Blame view

src/ParamOutputImpl/Plot/IntervalTickProperties.hh 2.37 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
 * IntervalTickProperties.hh
 *
 *  Created on: Jan 26, 2015
 *      Author: AKKA
 */

#ifndef INTERVALTICKPROPERTIES_HH_
#define INTERVALTICKPROPERTIES_HH_

#include <iostream>
#include <map>
#include <string>

f6eaec4e   Benjamin Renard   Optimize plot ele...
15
#include "Label.hh"
fbe3c2bb   Benjamin Renard   First commit
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
#include "Font.hh"
#include "SymbolProperties.hh"

namespace plot {

/* Enumerate to define the drawing mode of the interval tick */
enum class IntervalTickMode {
	NONE            = 0,
	SYMBOL_ONLY     = 1,
	INTERVAL_INDEX  = 2,
	START_TIME      = 3,
	START_STOP_TIME = 4
};

/**
 * IntervalTick properties.
 */
class IntervalTickProperties {
public:
	friend std::ostream& operator<<(std::ostream& out_, const IntervalTickProperties& prop_);
	/*
	 * Dumps properties for test.
	 */
	void dump(std::ostream& out_, std::string& prefix_);

	IntervalTickProperties() :
bb68eaab   Benjamin Renard   Fix + Also give t...
42
		_mode(IntervalTickMode::NONE), _symbol(), _lastSymbol(), _color(), _font("sans-serif", 11)
fbe3c2bb   Benjamin Renard   First commit
43
44
45
46
47
48
			{
	}

	IntervalTickProperties(const IntervalTickProperties& pIntervalTickProperties_) :
		_mode(pIntervalTickProperties_._mode),
		_symbol(pIntervalTickProperties_._symbol),
bb68eaab   Benjamin Renard   Fix + Also give t...
49
        _lastSymbol(pIntervalTickProperties_._lastSymbol),
fbe3c2bb   Benjamin Renard   First commit
50
		_color(pIntervalTickProperties_._color),
f6eaec4e   Benjamin Renard   Optimize plot ele...
51
		_font(pIntervalTickProperties_.getFont())
fbe3c2bb   Benjamin Renard   First commit
52
53
54
55
56
57
		{
	}

	IntervalTickProperties& operator=(const IntervalTickProperties& pIntervalTickProperties_) {
		_mode = pIntervalTickProperties_._mode;
		_symbol = pIntervalTickProperties_._symbol;
bb68eaab   Benjamin Renard   Fix + Also give t...
58
        _lastSymbol = pIntervalTickProperties_._lastSymbol;
fbe3c2bb   Benjamin Renard   First commit
59
		_color = pIntervalTickProperties_._color;
f6eaec4e   Benjamin Renard   Optimize plot ele...
60
		_font = pIntervalTickProperties_.getFont();
fbe3c2bb   Benjamin Renard   First commit
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
		return *this;
	}

	virtual ~IntervalTickProperties() {
	}

	IntervalTickMode& getMode()
	{
		return _mode;
	}

	void setMode(const IntervalTickMode& mode) {
		_mode = mode;
	}

	const Font& getFont() const {
		return _font;
	}

	void setFont(const Font& font) {
		_font = font;
	}

f6eaec4e   Benjamin Renard   Optimize plot ele...
84

fbe3c2bb   Benjamin Renard   First commit
85
86
87
88
89
90
91
92
	SymbolProperties& getSymbol() {
		return _symbol;
	}

	void setSymbol(const SymbolProperties& symbol) {
		_symbol = symbol;
	}

bb68eaab   Benjamin Renard   Fix + Also give t...
93
94
95
96
97
98
99
100
    SymbolProperties& getLastSymbol() {
		return _lastSymbol;
	}

	void setLastSymbol(const SymbolProperties& lastSymbol) {
		_lastSymbol = lastSymbol;
	}

fbe3c2bb   Benjamin Renard   First commit
101
102
103
104
105
106
107
108
109
110
111
112
	Color& getColor() {
		return _color;
	}

	void setColor(const Color& color) {
		_color = color;
	}

private:
	IntervalTickMode _mode;

	SymbolProperties _symbol;
bb68eaab   Benjamin Renard   Fix + Also give t...
113
    SymbolProperties _lastSymbol;
fbe3c2bb   Benjamin Renard   First commit
114
115
	Color			 _color;

fbe3c2bb   Benjamin Renard   First commit
116
117
118
119
120
121
122
123
124
	Font			_font;
};




} /* namespace plot */

#endif /* INTERVALTICKPROPERTIES_HH_ */