Blame view

src/ParamOutputImpl/Plot/ParameterAxes.hh 6.95 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
 * ParameterAxes.hh
 *
 *  Created on: 21 nov. 2013
 *      Author: guillaume
 */

#ifndef PARAMETERAXES_HH_
#define PARAMETERAXES_HH_

#include <iostream>
#include <iterator>
#include <string>
#include <vector>

#include "SeriesProperties.hh"
#include "XSeriesProperties.hh"
5953671a   Erdogan Furkan   For now
18
#include "Histogram2DSeriesProperties.hh"
4c693aae   Erdogan Furkan   For now
19
#include "Histogram1DSeriesProperties.hh"
fbe3c2bb   Benjamin Renard   First commit
20
21
#include "DrawingProperties.hh"
#include "SpectroProperties.hh"
793c4351   Hacene SI HADJ MOHAND   creation de class...
22
#include "SauvaudProperties.hh"
e257cfb9   Benjamin Renard   First implementat...
23
#include "IntervalsProperties.hh"
fbe3c2bb   Benjamin Renard   First commit
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "ColorSeriesProperties.hh"
#include "Parameter.hh"
#include "ParameterData.hh"

namespace plot {

/**
 * holds all properties related to a parameter.
 * series properties field is hidden in this class, because we have to check
 * for inclusion of the same serie (same index) twice.
 */
class ParameterAxes {
public:
	friend std::ostream& operator<<(std::ostream& out_,
			const ParameterAxes& prop_);
	/*
	 * Dumps properties for test.
	 */
	void dump(std::ostream& out_, std::string& prefix_);

	ParameterAxes() :
			_originalParamId(""),
			_defaultProperties(),
			_ySeriesProperties(),
5953671a   Erdogan Furkan   For now
48
			_histogram2DSeriesPropertiesPtr(nullptr),
4c693aae   Erdogan Furkan   For now
49
			_histogram1DSeriesPropertiesPtr(nullptr),
fbe3c2bb   Benjamin Renard   First commit
50
			_spectroPropertiesPtr(nullptr),
5953671a   Erdogan Furkan   For now
51
			_sauvaudPropertiesPtr(nullptr),
e257cfb9   Benjamin Renard   First implementat...
52
			_intervalsPropertiesPtr(nullptr),
fbe3c2bb   Benjamin Renard   First commit
53
54
55
56
57
58
59
60
61
			_colorSeriesProperties()
	{

	}

	ParameterAxes(const std::string& _originalParamId) :
			_originalParamId(_originalParamId),
			_defaultProperties(),
			_ySeriesProperties(),
5953671a   Erdogan Furkan   For now
62
			_histogram2DSeriesPropertiesPtr(nullptr),
4c693aae   Erdogan Furkan   For now
63
			_histogram1DSeriesPropertiesPtr(nullptr),
fbe3c2bb   Benjamin Renard   First commit
64
			_spectroPropertiesPtr(nullptr),
5953671a   Erdogan Furkan   For now
65
			_sauvaudPropertiesPtr(nullptr),
e257cfb9   Benjamin Renard   First implementat...
66
			_intervalsPropertiesPtr(nullptr),
fbe3c2bb   Benjamin Renard   First commit
67
68
69
70
71
72
73
74
75
			_colorSeriesProperties()
	{

	}

	ParameterAxes(const ParameterAxes& pParamAxes) :
			_originalParamId(pParamAxes._originalParamId),
			_defaultProperties(pParamAxes._defaultProperties),
			_ySeriesProperties(pParamAxes._ySeriesProperties),
5953671a   Erdogan Furkan   For now
76
			_histogram2DSeriesPropertiesPtr(pParamAxes._histogram2DSeriesPropertiesPtr),
4c693aae   Erdogan Furkan   For now
77
			_histogram1DSeriesPropertiesPtr(pParamAxes._histogram1DSeriesPropertiesPtr),
fbe3c2bb   Benjamin Renard   First commit
78
79
			_xSeriesProperties(pParamAxes._xSeriesProperties),
			_spectroPropertiesPtr(pParamAxes._spectroPropertiesPtr),
5953671a   Erdogan Furkan   For now
80
			_sauvaudPropertiesPtr(pParamAxes._sauvaudPropertiesPtr),
e257cfb9   Benjamin Renard   First implementat...
81
			_intervalsPropertiesPtr(pParamAxes._intervalsPropertiesPtr),
fbe3c2bb   Benjamin Renard   First commit
82
83
84
85
86
87
88
89
			_colorSeriesProperties(pParamAxes._colorSeriesProperties) {

	}

	ParameterAxes& operator=(const ParameterAxes& pParamAxes_) {
		_originalParamId = pParamAxes_._originalParamId;
		_defaultProperties = pParamAxes_._defaultProperties;
		_ySeriesProperties = pParamAxes_._ySeriesProperties;
5953671a   Erdogan Furkan   For now
90
		_histogram2DSeriesPropertiesPtr = pParamAxes_._histogram2DSeriesPropertiesPtr;
4c693aae   Erdogan Furkan   For now
91
		_histogram1DSeriesPropertiesPtr = pParamAxes_._histogram1DSeriesPropertiesPtr;
fbe3c2bb   Benjamin Renard   First commit
92
93
		_xSeriesProperties = pParamAxes_._xSeriesProperties;
		_spectroPropertiesPtr = pParamAxes_._spectroPropertiesPtr;
5953671a   Erdogan Furkan   For now
94
		_sauvaudPropertiesPtr = pParamAxes_._sauvaudPropertiesPtr;
e257cfb9   Benjamin Renard   First implementat...
95
		_intervalsPropertiesPtr = pParamAxes_._intervalsPropertiesPtr;
fbe3c2bb   Benjamin Renard   First commit
96
97
98
99
100
101
102
103
104
105
106
107
108
109
		_colorSeriesProperties = pParamAxes_._colorSeriesProperties;
		return *this;
	}

	virtual ~ParameterAxes() {
	}

	/**
	 * add a new series properties. If a series with the same index
	 * already exist, it will be overridden.
	 * _index field of SerieProperties must have been properly set
	 * before calling this method.
	 * @param series properties to add.
	 */
2fc1f2f8   Benjamin Renard   Full rework for s...
110
	SeriesProperties* addYSerieProperties(const SeriesProperties&);
fbe3c2bb   Benjamin Renard   First commit
111
112

	/**
c46af5a8   Benjamin Renard   Implements multi ...
113
	 * adds a new X series.
fbe3c2bb   Benjamin Renard   First commit
114
115
116
117
118
119
120
121
	 * already exist, it will be overridden.
	 * _index field of SerieProperties must have been properly set
	 * before calling this method.
	 * @param series properties to add, with no drawing settings, just index and xAxis
	 */
	void addXSerieProperties(const XSeriesProperties&);

	/**
5953671a   Erdogan Furkan   For now
122
123
124
125
126
127
	 * adds a new histo series.
	 * @param series properties to add, with no drawing settings, just index and xAxis
	 */
	void addHistogram2DSeriesProperties(std::shared_ptr<Histogram2DSeriesProperties> pHistogram2DProperties);

	/**
4c693aae   Erdogan Furkan   For now
128
129
130
131
132
133
	 * adds a new histo series.
	 * @param series properties to add, with no drawing settings, just index and xAxis
	 */
	void addHistogram1DSeriesProperties(std::shared_ptr<Histogram1DSeriesProperties> pHistogram1DProperties);

	/**
fbe3c2bb   Benjamin Renard   First commit
134
135
136
	 * add a new spectro
	 */
	void addSpectroProperties(std::shared_ptr<SpectroProperties> pSPectroProperties);
793c4351   Hacene SI HADJ MOHAND   creation de class...
137
138
139
140
141
        
                    /**
	 * add a new SauvaudPlot
	 */
	void addSauvaudProperties(std::shared_ptr<SauvaudProperties> pSauvaudProperties);
fbe3c2bb   Benjamin Renard   First commit
142
143

	/**
e257cfb9   Benjamin Renard   First implementat...
144
145
146
147
148
	 * add a new intervals
	 */
	void addIntervalsProperties(std::shared_ptr<IntervalsProperties> pIntervalsProperties);

	/**
fbe3c2bb   Benjamin Renard   First commit
149
150
151
152
	 * add a new color serie
	 */
	void addColorSerieProperties(const ColorSeriesProperties&);

2fc1f2f8   Benjamin Renard   Full rework for s...
153
	std::vector<SeriesProperties>& getYSeriePropertiesList() {
fbe3c2bb   Benjamin Renard   First commit
154
155
156
		return _ySeriesProperties;
	}

c46af5a8   Benjamin Renard   Implements multi ...
157
158
159
160
161
162
	/**
	 * Get x serie properties by id
	 */
	XSeriesProperties& getXSeriePropertiesById(int id_);

	std::vector<XSeriesProperties>& getXSeriePropertiesList() {
fbe3c2bb   Benjamin Renard   First commit
163
164
165
166
167
168
		return _xSeriesProperties;
	}

	std::shared_ptr<SpectroProperties> getSpectroProperties() {
		return _spectroPropertiesPtr;
	}
793c4351   Hacene SI HADJ MOHAND   creation de class...
169
170
171
172
        
                    std::shared_ptr<SauvaudProperties> getSauvaudProperties() {
		return _sauvaudPropertiesPtr;
	}
fbe3c2bb   Benjamin Renard   First commit
173

7c94ae0d   Erdogan Furkan   For now, histo1d ...
174
175
176
177
	std::shared_ptr<Histogram1DSeriesProperties> getHistogram1DSeriesProperties() {
		return _histogram1DSeriesPropertiesPtr;
	}

5953671a   Erdogan Furkan   For now
178
179
180
181
	std::shared_ptr<Histogram2DSeriesProperties> getHistogram2DSeriesProperties() {
		return _histogram2DSeriesPropertiesPtr;
	}

e257cfb9   Benjamin Renard   First implementat...
182
183
184
185
	std::shared_ptr<IntervalsProperties> getIntervalsProperties() {
		return _intervalsPropertiesPtr;
	}

fbe3c2bb   Benjamin Renard   First commit
186
187
188
189
190
191
192
193
194
195
	std::vector<ColorSeriesProperties>& getColorSeriePropertiesList() {
		return _colorSeriesProperties;
	}

	/**
	 * Get the list of indexes used for a parameter
	 */
	std::vector<AMDA::Common::ParameterIndexComponent> getParamUsedIndexes(std::string paramId_);

	/**
fbe3c2bb   Benjamin Renard   First commit
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
     * Get color serie properties by id
     */
    ColorSeriesProperties& getColorSeriePropertiesById(int id_);

	DrawingProperties& getDefaultProperties() {
		return _defaultProperties;
	}

	void setDefaultProperties(const DrawingProperties& default_) {
		_defaultProperties = default_;
	}

	/**
	 * Original parameter Id
	 */
	std::string _originalParamId;

private:

	/**
	 * Common drawing properties
	 */
	DrawingProperties _defaultProperties;

	/**
	 * Y Series
	 */
2fc1f2f8   Benjamin Renard   Full rework for s...
223
	std::vector<SeriesProperties> _ySeriesProperties;
fbe3c2bb   Benjamin Renard   First commit
224
225

	/**
5953671a   Erdogan Furkan   For now
226
227
228
	 * Histo Series
	 */
	std::shared_ptr<Histogram2DSeriesProperties> _histogram2DSeriesPropertiesPtr;
4c693aae   Erdogan Furkan   For now
229
230
231
232
233

	/**
	 * Histo Series
	 */
	std::shared_ptr<Histogram1DSeriesProperties> _histogram1DSeriesPropertiesPtr;
5953671a   Erdogan Furkan   For now
234
	/**
fbe3c2bb   Benjamin Renard   First commit
235
236
	 * X Series
	 */
c46af5a8   Benjamin Renard   Implements multi ...
237
	std::vector<XSeriesProperties> _xSeriesProperties;
fbe3c2bb   Benjamin Renard   First commit
238
239
240
241
242

	/**
	 * Spectro
	 */
	std::shared_ptr<SpectroProperties> _spectroPropertiesPtr;
793c4351   Hacene SI HADJ MOHAND   creation de class...
243
244
245
246
247
        
                    /**
	 * Sauvaud
	 */
	std::shared_ptr<SauvaudProperties> _sauvaudPropertiesPtr;
fbe3c2bb   Benjamin Renard   First commit
248
249

	/**
e257cfb9   Benjamin Renard   First implementat...
250
251
252
253
254
	 * Intervals
	 */
	std::shared_ptr<IntervalsProperties> _intervalsPropertiesPtr;

	/**
fbe3c2bb   Benjamin Renard   First commit
255
256
257
258
259
260
261
262
263
	 * Color Series
	 */
	std::vector<ColorSeriesProperties> _colorSeriesProperties;
};

typedef std::vector<ParameterAxes> ParameterAxesList;

} /* namespace plot */
#endif /* PARAMETERAXES_HH_ */