Blame view

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

#ifndef AXISLEGENDMANAGER_HH_
#define AXISLEGENDMANAGER_HH_

#include "PanelPlotOutput.hh"
c2fa3b5d   Benjamin Renard   Rework of legend ...
12
#include "ParamMgr.hh"
07bf1e7c   Menouard AZIB   EveryThing works ...
13
#include "XYPlot.hh"
c2fa3b5d   Benjamin Renard   Rework of legend ...
14
15

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

07bf1e7c   Menouard AZIB   EveryThing works ...
17
18
namespace plot
{
fbe3c2bb   Benjamin Renard   First commit
19

07bf1e7c   Menouard AZIB   EveryThing works ...
20
21
	class ParameterIndexComponentColor
	{
8bb0f02b   Benjamin Renard   Set colors in axi...
22
	public:
07bf1e7c   Menouard AZIB   EveryThing works ...
23
24
		ParameterIndexComponentColor(int dim1Index, int dim2Index, Color &color) : _dim1Index(dim1Index), _dim2Index(dim2Index), _color(color)
		{
8bb0f02b   Benjamin Renard   Set colors in axi...
25
26
		}

07bf1e7c   Menouard AZIB   EveryThing works ...
27
28
		ParameterIndexComponentColor(AMDA::Common::ParameterIndexComponent index, Color &color) : _dim1Index(index.getDim1Index()), _dim2Index(index.getDim2Index()), _color(color)
		{
8bb0f02b   Benjamin Renard   Set colors in axi...
29
30
		}

07bf1e7c   Menouard AZIB   EveryThing works ...
31
32
		ParameterIndexComponentColor(const ParameterIndexComponentColor &index) : _dim1Index(index._dim1Index), _dim2Index(index._dim2Index), _color(index._color)
		{
8bb0f02b   Benjamin Renard   Set colors in axi...
33
34
		}

07bf1e7c   Menouard AZIB   EveryThing works ...
35
36
		const Color &getColor() const
		{
8bb0f02b   Benjamin Renard   Set colors in axi...
37
38
39
			return _color;
		}

07bf1e7c   Menouard AZIB   EveryThing works ...
40
41
		void setColor(Color &color)
		{
8bb0f02b   Benjamin Renard   Set colors in axi...
42
43
44
			_color = color;
		}

07bf1e7c   Menouard AZIB   EveryThing works ...
45
46
		int getDim1Index()
		{
8bb0f02b   Benjamin Renard   Set colors in axi...
47
48
49
			return _dim1Index;
		}

07bf1e7c   Menouard AZIB   EveryThing works ...
50
51
		int getDim2Index()
		{
8bb0f02b   Benjamin Renard   Set colors in axi...
52
53
54
55
56
57
58
59
60
			return _dim2Index;
		}

	private:
		int _dim1Index;

		int _dim2Index;

		Color _color;
07bf1e7c   Menouard AZIB   EveryThing works ...
61
	};
8bb0f02b   Benjamin Renard   Set colors in axi...
62

07bf1e7c   Menouard AZIB   EveryThing works ...
63
64
	class AxisLegendManager
	{
fbe3c2bb   Benjamin Renard   First commit
65
	public:
07bf1e7c   Menouard AZIB   EveryThing works ...
66
		typedef std::map<std::string, std::list<ParameterIndexComponentColor>> AxisParamsComponents;
5ee90a58   Benjamin Renard   Use AxisLegendMan...
67

07bf1e7c   Menouard AZIB   EveryThing works ...
68
		static void configureYAxisLegendForSpectro(PanelPlotOutput *plot);
c2fa3b5d   Benjamin Renard   Rework of legend ...
69

07bf1e7c   Menouard AZIB   EveryThing works ...
70
		static void configureYAxisLegendForSeries(PanelPlotOutput *plot);
fbe3c2bb   Benjamin Renard   First commit
71

07bf1e7c   Menouard AZIB   EveryThing works ...
72
		static void configureColorAxisLegendForSpectro(PanelPlotOutput *plot);
c2fa3b5d   Benjamin Renard   Rework of legend ...
73

07bf1e7c   Menouard AZIB   EveryThing works ...
74
		static void configureColorAxisLegendForSeries(PanelPlotOutput *plot);
fbe3c2bb   Benjamin Renard   First commit
75

7c94ae0d   Erdogan Furkan   For now, histo1d ...
76
		static void configureXAxisLegendForSeries(PanelPlotOutput *plot);
c2fa3b5d   Benjamin Renard   Rework of legend ...
77

dd42b8f4   Erdogan Furkan   #7857 - Done
78
		static void setAxisLegendForSeries(PanelPlotOutput *plot, boost::shared_ptr<Axis> &pAxis, AxisParamsComponents &axisParamsComponents, std::vector<std::string> insertionOrder, std::string legendPrefix="");
c2fa3b5d   Benjamin Renard   Rework of legend ...
79

07bf1e7c   Menouard AZIB   EveryThing works ...
80
		static void setAxisLegendForSpectro(PanelPlotOutput *plot, boost::shared_ptr<Axis> &pAxis, std::string originalParamId);
5ee90a58   Benjamin Renard   Use AxisLegendMan...
81

07bf1e7c   Menouard AZIB   EveryThing works ...
82
83
		static void setAxisLegendForTable(PanelPlotOutput *plot, boost::shared_ptr<Axis> &pAxis, std::string originalParamId, std::string paramId, AMDA::Common::ParameterIndexComponentList &indexes, int relatedDim);
		static std::string getTransformedUnits(const std::string &rawUnit);
5ee90a58   Benjamin Renard   Use AxisLegendMan...
84
85

	private:
07bf1e7c   Menouard AZIB   EveryThing works ...
86
		static void addInfoPart(std::string &legend, std::string info);
c2fa3b5d   Benjamin Renard   Rework of legend ...
87

07bf1e7c   Menouard AZIB   EveryThing works ...
88
		static void addIndexPart(std::string &legend, ParameterIndexComponentColor &index);
c2fa3b5d   Benjamin Renard   Rework of legend ...
89

07bf1e7c   Menouard AZIB   EveryThing works ...
90
		static void addIndexPart(std::string &legend, int index);
c2fa3b5d   Benjamin Renard   Rework of legend ...
91

07bf1e7c   Menouard AZIB   EveryThing works ...
92
		static void addBoundsPart(std::string &legend, PLFLT min, PLFLT max);
c2fa3b5d   Benjamin Renard   Rework of legend ...
93

07bf1e7c   Menouard AZIB   EveryThing works ...
94
		static void addBreakLine(std::string &legend);
c2fa3b5d   Benjamin Renard   Rework of legend ...
95

920804c3   Benjamin Renard   Fix
96
		static void pushComponentInList(std::string paramId, ParameterIndexComponentColor &index, AxisParamsComponents &axisParamsComponents, std::vector<std::string> &insertionOrder);
c2fa3b5d   Benjamin Renard   Rework of legend ...
97

07bf1e7c   Menouard AZIB   EveryThing works ...
98
		static std::string getParamLegend(AMDA::Info::ParamInfoSPtr paramInfo, ParameterIndexComponentColor &index);
c2fa3b5d   Benjamin Renard   Rework of legend ...
99

07bf1e7c   Menouard AZIB   EveryThing works ...
100
		// static std::string getParamLegend(AMDA::Info::ParamInfoSPtr paramInfo, int index);
8c8ac7bf   Benjamin Renard   Write mission/ins...
101
102

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

		static std::string getMissionInfo(AMDA::Info::ParamInfoSPtr paramInfo);
07bf1e7c   Menouard AZIB   EveryThing works ...
105
106
107

		static std::string transformPower(std::string &unit, std::string pattern);
	};
fbe3c2bb   Benjamin Renard   First commit
108
109
110
111

}

#endif