Blame view

src/ParamOutputImpl/Plot/AxisLegendManager.hh 3.1 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
/*
 * AxisLegendManager.hh
 *
 *  Created on: 23 jan. 2015
 *      Author: AKKA
 */

#ifndef AXISLEGENDMANAGER_HH_
#define AXISLEGENDMANAGER_HH_

#include "PanelPlotOutput.hh"
#include "XYPlot.hh"
c2fa3b5d   Benjamin Renard   Rework of legend ...
13
14
15
#include "ParamMgr.hh"

using namespace AMDA::Info;
fbe3c2bb   Benjamin Renard   First commit
16
17
18

namespace plot {

8bb0f02b   Benjamin Renard   Set colors in axi...
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
class ParameterIndexComponentColor {
	public:
		ParameterIndexComponentColor(int dim1Index, int dim2Index, Color& color) : _dim1Index(dim1Index) , _dim2Index(dim2Index),  _color(color){
		}

		ParameterIndexComponentColor(AMDA::Common::ParameterIndexComponent index, Color& color) : _dim1Index(index.getDim1Index()), _dim2Index(index.getDim2Index()), _color(color) {
		}

		ParameterIndexComponentColor(const ParameterIndexComponentColor& index) : _dim1Index(index._dim1Index), _dim2Index(index._dim2Index), _color(index._color) {
		}

		const Color& getColor() const {
			return _color;
		}

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

		int getDim1Index() {
			return _dim1Index;
		}

		int getDim2Index() {
			return _dim2Index;
		}

	private:
		int _dim1Index;

		int _dim2Index;

		Color _color;
};

fbe3c2bb   Benjamin Renard   First commit
54
55
class AxisLegendManager {
	public:
8bb0f02b   Benjamin Renard   Set colors in axi...
56
		typedef std::map<std::string, std::list< ParameterIndexComponentColor > > AxisParamsComponents;
5ee90a58   Benjamin Renard   Use AxisLegendMan...
57

c2fa3b5d   Benjamin Renard   Rework of legend ...
58
59
		static void configureYAxisLegendForSpectro(PanelPlotOutput* plot);

fbe3c2bb   Benjamin Renard   First commit
60
61
		static void configureYAxisLegendForSeries(PanelPlotOutput* plot);

c2fa3b5d   Benjamin Renard   Rework of legend ...
62
63
		static void configureColorAxisLegendForSpectro(PanelPlotOutput* plot);

fbe3c2bb   Benjamin Renard   First commit
64
65
66
		static void configureColorAxisLegendForSeries(PanelPlotOutput* plot);

		static void configureXAxisLegendForSeries(XYPlot* plot);
c2fa3b5d   Benjamin Renard   Rework of legend ...
67

5ee90a58   Benjamin Renard   Use AxisLegendMan...
68
		static void setAxisLegendForSeries(PanelPlotOutput* plot, boost::shared_ptr<Axis>& pAxis, AxisParamsComponents& axisParamsComponents);
c2fa3b5d   Benjamin Renard   Rework of legend ...
69

5ee90a58   Benjamin Renard   Use AxisLegendMan...
70
71
72
73
74
		static void setAxisLegendForSpectro(PanelPlotOutput* plot, boost::shared_ptr<Axis>& pAxis, std::string originalParamId);

		static void setAxisLegendForTable(PanelPlotOutput* plot, boost::shared_ptr<Axis>& pAxis, std::string originalParamId, std::string paramId, AMDA::Common::ParameterIndexComponentList& indexes, int relatedDim);

	private:
c2fa3b5d   Benjamin Renard   Rework of legend ...
75
76
		static void addInfoPart(std::string& legend, std::string info);

8bb0f02b   Benjamin Renard   Set colors in axi...
77
		static void addIndexPart(std::string& legend, ParameterIndexComponentColor& index);
c2fa3b5d   Benjamin Renard   Rework of legend ...
78
79
80
81
82
83
84

		static void addIndexPart(std::string& legend, int index);

		static void addBoundsPart(std::string& legend, PLFLT min, PLFLT max);

		static void addBreakLine(std::string& legend);

8bb0f02b   Benjamin Renard   Set colors in axi...
85
		static void pushComponentInList(std::string paramId, ParameterIndexComponentColor& index, AxisParamsComponents& axisParamsComponents);
c2fa3b5d   Benjamin Renard   Rework of legend ...
86

8bb0f02b   Benjamin Renard   Set colors in axi...
87
		static std::string getParamLegend(AMDA::Info::ParamInfoSPtr paramInfo, ParameterIndexComponentColor& index);
c2fa3b5d   Benjamin Renard   Rework of legend ...
88

5ee90a58   Benjamin Renard   Use AxisLegendMan...
89
		//static std::string getParamLegend(AMDA::Info::ParamInfoSPtr paramInfo, int index);
8c8ac7bf   Benjamin Renard   Write mission/ins...
90
91

		static std::string getMissionInstrumentInfo(AMDA::Info::ParamInfoSPtr paramInfo);
8bb0f02b   Benjamin Renard   Set colors in axi...
92
93

		static std::string getMissionInfo(AMDA::Info::ParamInfoSPtr paramInfo);
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
94
95
96
97
                
                                        static std::string getTransformedUnits(const std::string& rawUnit);
                                        
                                        static std::string transformPower(std::string& unit, std::string pattern);
fbe3c2bb   Benjamin Renard   First commit
98
99
100
101
102
};

}

#endif