ConstantLine.hh
2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
* ConstantLine.hh
*
* Created on: Jun 26, 2014
* Author: AKKA
*/
#ifndef CONSTANTLINE_HH_
#define CONSTANTLINE_HH_
#include <iostream>
#include <string>
#include "LineProperties.hh"
namespace plot {
/**
* ConstantLine. Defines style, width, color and position of each constant line drawn
* on a panel for an axis.
*/
class ConstantLine {
public:
friend std::ostream& operator<<(std::ostream& out_, const ConstantLine& lprop_);
/*
* Dumps properties for test.
*/
void dump(std::ostream& out_, std::string& prefix_);
ConstantLine() :
_width(1), _color(), _style(LineStyle::PLAIN), _value(), _id(-1), _drawn(false) {
}
ConstantLine(const ConstantLine& pConstantLine_) :
_width(pConstantLine_._width),
_color(pConstantLine_._color),
_style(pConstantLine_._style),
_value(pConstantLine_._value),
_id(pConstantLine_._id),
_drawn(pConstantLine_._drawn){
}
ConstantLine& operator=(const ConstantLine& pConstantLine_) {
_width = pConstantLine_._width;
_color = pConstantLine_._color;
_style = pConstantLine_._style;
_value = pConstantLine_._value;
_id = pConstantLine_._id;
_drawn = pConstantLine_._drawn;
return *this;
}
virtual ~ConstantLine() {
}
void reset()
{
_drawn = false;
}
const Color& getColor() const{
return _color;
}
Color& getColor() {
return _color;
}
void setColor(const Color& color) {
_color = color;
}
LineStyle getStyle() const {
return _style;
}
void setStyle(const LineStyle& style) {
_style = style;
}
int getWidth() const {
return _width;
}
void setWidth(int width) {
_width = width;
}
std::string getValue() const {
return _value;
}
void setValue(const std::string &value) {
_value = value;
}
int getId() const {
return _id;
}
void setId(int id) {
_id = id;
}
bool isDrawn(void)
{
return _drawn;
}
void setDrawn(bool drawn)
{
_drawn = drawn;
}
private:
int _width;
Color _color;
LineStyle _style;
std::string _value;
int _id;
bool _drawn;
};
} /* namespace plot */
#endif /* CONSTANTLINE_HH_ */