Blame view

src/ParamOutputImpl/Plot/AxisLegendManager.cc 30.2 KB
fbe3c2bb   Benjamin Renard   First commit
1
#include "AxisLegendManager.hh"
07bf1e7c   Menouard AZIB   EveryThing works ...
2
3
#include <iostream> // std::cout
#include <string>
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
4
#include <vector>
fbe3c2bb   Benjamin Renard   First commit
5

fbe3c2bb   Benjamin Renard   First commit
6
7
using namespace AMDA::Info;

07bf1e7c   Menouard AZIB   EveryThing works ...
8
9
namespace plot
{
fbe3c2bb   Benjamin Renard   First commit
10

5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
11
    void AxisLegendManager::configureXAxisLegendForSeries(
7c94ae0d   Erdogan Furkan   For now, histo1d ...
12
        PanelPlotOutput *plot)
07bf1e7c   Menouard AZIB   EveryThing works ...
13
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
14
15
        // Build list of all indexes used by each parameters for each x axes
        std::map<std::string, AxisParamsComponents> axesParamsComponents;
dd42b8f4   Erdogan Furkan   #7857 - Done
16
17
        // Keep an order of the legends
        std::vector<std::string> insertionOrder;
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
18
19
        // Compute nb series to draw by y axis
        std::map<std::string, int> nbSeriesByYAxisMap = plot->getNbSeriesByYAxis();
21ddb9f2   Benjamin Renard   Set legend color ...
20

5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
21
        SeriesProperties lSeriesProperties;
07bf1e7c   Menouard AZIB   EveryThing works ...
22
23
        for (auto param : plot->_parameterAxesList)
        {
05089f4a   Erdogan Furkan   #11376 - Done.
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
            for (auto pHistogramProperties : param.getHistogramSeriesPropertiesList())
            {
                if(pHistogramProperties != nullptr){
                    std::string xParamId = "";
                    AMDA::Common::ParameterIndexComponent xIndexComp;

                    if(pHistogramProperties->getHistogramType() == "histogram1d"){
                        if (!pHistogramProperties->hasXAxis())
                            continue;
                        xIndexComp = pHistogramProperties->getIndex();
                        xParamId = pHistogramProperties->getParamId();
                        
                    }
                    if(pHistogramProperties->getHistogramType() == "histogram2d"){
                        if (!pHistogramProperties->hasYAxis() || !pHistogramProperties->hasXAxis())
                            continue;
                        ParameterAxes *xParameter = plot->getParameterAxesByXSerieId(pHistogramProperties->getXId());
                        XSeriesProperties xSerie = xParameter->getXSeriePropertiesById(pHistogramProperties->getXId());
                        xIndexComp = xSerie.getIndex();
                        xParamId = xSerie.getParamId();
                    }
1248af2b   Erdogan Furkan   Refactored, all w...
45
                    
05089f4a   Erdogan Furkan   #11376 - Done.
46
47
48
49
                    std::string xAxisId = pHistogramProperties->getXAxisId();
                    boost::shared_ptr<Axis> lXAxis = plot->_panel->getAxis(xAxisId);
                    if (lXAxis.get() == nullptr)
                    {
1248af2b   Erdogan Furkan   Refactored, all w...
50
                        continue;
05089f4a   Erdogan Furkan   #11376 - Done.
51
52
53
54
55
56
                    }
                    Color compLegendColor = lXAxis->_color;
                    if(param.getHistogramSeriesPropertiesList().size() > 0)
                        compLegendColor = pHistogramProperties->getColor();
                    ParameterIndexComponentColor xIndex = ParameterIndexComponentColor(xIndexComp, compLegendColor);
                    pushComponentInList(xParamId, xIndex, axesParamsComponents[xAxisId]);
dd42b8f4   Erdogan Furkan   #7857 - Done
57
                    insertionOrder.push_back(xParamId);
7c94ae0d   Erdogan Furkan   For now, histo1d ...
58
                }
7c94ae0d   Erdogan Furkan   For now, histo1d ...
59
60
            }

07bf1e7c   Menouard AZIB   EveryThing works ...
61
62
            for (auto lSeriesProperties : param.getYSeriePropertiesList())
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
63
64
                if (!lSeriesProperties.hasYAxis() || !lSeriesProperties.hasXAxis())
                    continue;
5ee90a58   Benjamin Renard   Use AxisLegendMan...
65

5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
66
                bool moreThanOneSerieForAxis = (nbSeriesByYAxisMap[lSeriesProperties.getYAxisId()] > 1);
21ddb9f2   Benjamin Renard   Set legend color ...
67

07bf1e7c   Menouard AZIB   EveryThing works ...
68
                ParameterAxes *xParameter = plot->getParameterAxesByXSerieId(lSeriesProperties.getXId());
5ee90a58   Benjamin Renard   Use AxisLegendMan...
69

5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
70
                XSeriesProperties xSerie = xParameter->getXSeriePropertiesById(lSeriesProperties.getXId());
5ee90a58   Benjamin Renard   Use AxisLegendMan...
71

5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
72
                std::string xAxisId = lSeriesProperties.getXAxisId();
5ee90a58   Benjamin Renard   Use AxisLegendMan...
73

5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
74
                boost::shared_ptr<Axis> lXAxis = plot->_panel->getAxis(xAxisId);
07bf1e7c   Menouard AZIB   EveryThing works ...
75
76
                if (lXAxis.get() == nullptr)
                {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
77
78
79
80
                    continue;
                }

                Color compLegendColor = lXAxis->_color;
07bf1e7c   Menouard AZIB   EveryThing works ...
81
82
                if (moreThanOneSerieForAxis && (lSeriesProperties.getColorSerieId() == -1) && (!plot->_panel->_page->_superposeMode))
                {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
83
84
85
86
87
                    compLegendColor = plot->getSerieLineColor(lSeriesProperties, moreThanOneSerieForAxis);
                }

                ParameterIndexComponentColor xIndex = ParameterIndexComponentColor(xSerie.getIndex(), compLegendColor);
                pushComponentInList(xSerie.getParamId(), xIndex, axesParamsComponents[xAxisId]);
dd42b8f4   Erdogan Furkan   #7857 - Done
88
                insertionOrder.push_back(xSerie.getParamId());
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
89
90
91
            }
        }

07bf1e7c   Menouard AZIB   EveryThing works ...
92
93
        if (!plot->_panel->_page->_superposeMode)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
94
95
96
97
            plot->resetAutomaticSerieColorCursor();
        }

        std::list<std::string> legendLines;
07bf1e7c   Menouard AZIB   EveryThing works ...
98
99
        for (auto axisParamsComponents : axesParamsComponents)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
100
            boost::shared_ptr<Axis> lXAxis = plot->_panel->getAxis(axisParamsComponents.first);
dd42b8f4   Erdogan Furkan   #7857 - Done
101
            setAxisLegendForSeries(plot, lXAxis, axisParamsComponents.second, insertionOrder);
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
102
103
104
105
        }
    }

    void AxisLegendManager::configureYAxisLegendForSpectro(
07bf1e7c   Menouard AZIB   EveryThing works ...
106
107
108
109
        PanelPlotOutput *plot)
    {
        for (auto param : plot->_parameterAxesList)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
110
111
            std::shared_ptr<SpectroProperties> spectroPropertiesPtr = param.getSpectroProperties();
            if (spectroPropertiesPtr == nullptr)
07bf1e7c   Menouard AZIB   EveryThing works ...
112
                continue; // no spectro defined
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130

            if (!spectroPropertiesPtr->hasYAxis())
                continue;

            std::string yAxisId = spectroPropertiesPtr->getYAxisId();
            boost::shared_ptr<Axis> lYAxis = plot->_panel->getAxis(yAxisId);
            if (lYAxis.get() == nullptr)
                continue;

            if (!lYAxis->_legend.isEmpty())
                continue;

            setAxisLegendForTable(plot, lYAxis, param._originalParamId, spectroPropertiesPtr->getParamId(), spectroPropertiesPtr->getIndexes(), spectroPropertiesPtr->getRelatedDim());
            return;
        }
    }

    void AxisLegendManager::configureYAxisLegendForSeries(
07bf1e7c   Menouard AZIB   EveryThing works ...
131
132
        PanelPlotOutput *plot)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
133
        SeriesProperties lSeriesProperties;
4bced76d   Furkan   #11372 - Adding n...
134
        std::string yAxisTextLegend;
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
135
136
137
138
139
        // Compute nb series to draw by y axis
        std::map<std::string, int> nbSeriesByYAxisMap = plot->getNbSeriesByYAxis();

        // Build list of all indexes used by each parameters for each y axes
        std::map<std::string, AxisParamsComponents> axesParamsComponents;
bec89e22   Erdogan Furkan   Fixes + refactori...
140
        std::map<std::string, AxisParamsComponents> axesHistoParamsComponents;
e701a1b4   Erdogan Furkan   Minor fix on hist...
141
        std::map<std::string,std::string> yAxisTextLegendHisto;
dd42b8f4   Erdogan Furkan   #7857 - Done
142
143
144

        // Keeping the order of the legends
        std::vector<std::string> insertionOrder;
07bf1e7c   Menouard AZIB   EveryThing works ...
145
146
        if (!plot->_panel->_page->_superposeMode)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
147
148
            plot->resetAutomaticSerieColorCursor();
        }
07bf1e7c   Menouard AZIB   EveryThing works ...
149
150
        for (auto param : plot->_parameterAxesList)
        {
05089f4a   Erdogan Furkan   #11376 - Done.
151
152
153
154
155
            for (auto pHistogramProperties : param.getHistogramSeriesPropertiesList())
            {
                if(pHistogramProperties != nullptr){
                    if (!pHistogramProperties->hasYAxis())
                        continue;
1248af2b   Erdogan Furkan   Refactored, all w...
156

05089f4a   Erdogan Furkan   #11376 - Done.
157
158
159
160
161
162
                    std::string yAxisId = pHistogramProperties->getYAxisId();
                    boost::shared_ptr<Axis> lYAxis = plot->_panel->getAxis(yAxisId);
                    if (lYAxis.get() == nullptr)
                    {
                        continue;
                    }
650942c4   Erdogan Furkan   #11372 - Done.
163
164
                    std::string yParamId ;
                    AMDA::Common::ParameterIndexComponent yIndexComp;
05089f4a   Erdogan Furkan   #11376 - Done.
165
                    if(pHistogramProperties->getHistogramType() == "histogram1d"){
650942c4   Erdogan Furkan   #11372 - Done.
166
167
                        yParamId =  pHistogramProperties->getHistotypeProperties().getParamId();
                        yIndexComp = AMDA::Common::ParameterIndexComponent(pHistogramProperties->getHistotypeProperties().getIndex(), -1);
bec89e22   Erdogan Furkan   Fixes + refactori...
168
                        yAxisTextLegend = pHistogramProperties->getHistotypeProperties().getHisto1DFunction()->getTextLegend();
e701a1b4   Erdogan Furkan   Minor fix on hist...
169
                        yAxisTextLegendHisto[yAxisId] = yAxisTextLegend;
4bced76d   Furkan   #11372 - Adding n...
170
171
172
173
174
175
                        if(pHistogramProperties->getHistotypeProperties().getParamId().empty())
                        {
                            Label yLabel(lYAxis->_legend.getFont(),lYAxis->_color);
                            yLabel._text = yAxisTextLegend;
                            lYAxis->_legend.setLabel(yLabel);
                            continue;
650942c4   Erdogan Furkan   #11372 - Done.
176
                        }                  
05089f4a   Erdogan Furkan   #11376 - Done.
177
                    }
650942c4   Erdogan Furkan   #11372 - Done.
178
179
180
181
182
183
184
185
186
187
                    else if (pHistogramProperties->getHistogramType() == "histogram2d"){
                        yParamId = pHistogramProperties->getParamId();
                        yIndexComp = pHistogramProperties->getIndex();
                    }

                    Color compLegendColor = lYAxis->_color;
                    if(param.getHistogramSeriesPropertiesList().size() > 0)
                        compLegendColor = pHistogramProperties->getColor();
                    ParameterIndexComponentColor yIndex = ParameterIndexComponentColor(yIndexComp, compLegendColor);
                    pushComponentInList(yParamId, yIndex, axesHistoParamsComponents[yAxisId]);
dd42b8f4   Erdogan Furkan   #7857 - Done
188
                    insertionOrder.push_back(yParamId);
1248af2b   Erdogan Furkan   Refactored, all w...
189
                }
7c94ae0d   Erdogan Furkan   For now, histo1d ...
190
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
191
192
            for (auto lSeriesProperties : param.getYSeriePropertiesList())
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
193
194
195
196
197
198
199
                if (!lSeriesProperties.hasYAxis())
                    continue;

                bool moreThanOneSerieForAxis = (nbSeriesByYAxisMap[lSeriesProperties.getYAxisId()] > 1);

                std::string yAxisId = lSeriesProperties.getYAxisId();
                boost::shared_ptr<Axis> lYAxis = plot->_panel->getAxis(yAxisId);
07bf1e7c   Menouard AZIB   EveryThing works ...
200
201
                if (lYAxis.get() == nullptr)
                {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
202
203
204
                    continue;
                }

07bf1e7c   Menouard AZIB   EveryThing works ...
205
206
                for (auto index : lSeriesProperties.getIndexList(plot->_pParameterValues))
                {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
207
                    Color compLegendColor = lYAxis->_color;
07bf1e7c   Menouard AZIB   EveryThing works ...
208
209
                    if (moreThanOneSerieForAxis && (lSeriesProperties.getColorSerieId() == -1) && (!plot->_panel->_page->_superposeMode))
                    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
210
211
212
                        compLegendColor = plot->getSerieLineColor(lSeriesProperties, moreThanOneSerieForAxis);
                    }
                    ParameterIndexComponentColor yIndex = ParameterIndexComponentColor(index, compLegendColor);
dd42b8f4   Erdogan Furkan   #7857 - Done
213
                    std::cout << " --- " <<lSeriesProperties.getParamId() << std::endl;
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
214
                    pushComponentInList(lSeriesProperties.getParamId(), yIndex, axesParamsComponents[yAxisId]);
dd42b8f4   Erdogan Furkan   #7857 - Done
215
                    insertionOrder.push_back(lSeriesProperties.getParamId());
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
216
217
218
                }
            }
        }
07bf1e7c   Menouard AZIB   EveryThing works ...
219
220
        if (!plot->_panel->_page->_superposeMode)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
221
222
223
224
            plot->resetAutomaticSerieColorCursor();
        }

        std::list<std::string> legendLines;
07bf1e7c   Menouard AZIB   EveryThing works ...
225
226
        for (auto axisParamsComponents : axesParamsComponents)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
227
            boost::shared_ptr<Axis> lYAxis = plot->_panel->getAxis(axisParamsComponents.first);
dd42b8f4   Erdogan Furkan   #7857 - Done
228
            setAxisLegendForSeries(plot, lYAxis, axisParamsComponents.second,insertionOrder, yAxisTextLegend);
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
229
        }
bec89e22   Erdogan Furkan   Fixes + refactori...
230
231
232
        for (auto axisHistoParamsComponents : axesHistoParamsComponents)
        {
            boost::shared_ptr<Axis> lYAxis = plot->_panel->getAxis(axisHistoParamsComponents.first);
dd42b8f4   Erdogan Furkan   #7857 - Done
233
            setAxisLegendForSeries(plot, lYAxis, axisHistoParamsComponents.second, insertionOrder, yAxisTextLegendHisto[axisHistoParamsComponents.first] );
bec89e22   Erdogan Furkan   Fixes + refactori...
234
235
            
        }
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
236
237
238
    }

    void AxisLegendManager::configureColorAxisLegendForSeries(
07bf1e7c   Menouard AZIB   EveryThing works ...
239
240
        PanelPlotOutput *plot)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
241
242
243
        SeriesProperties lSeriesProperties;
        ColorSeriesProperties lColorSerieProperties;
        boost::shared_ptr<Axis> lZAxis = plot->_panel->getColorAxis();
97f9b74e   Erdogan Furkan   #10776 - Density ...
244
        std::string zAxisTextLegend = "";
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
245

07bf1e7c   Menouard AZIB   EveryThing works ...
246
247
        if (lZAxis.get() == nullptr)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
248
249
250
251
252
            return;
        }

        // Build list of all indexes used by each parameters for each y axes
        AxisParamsComponents axisParamsComponents;
dd42b8f4   Erdogan Furkan   #7857 - Done
253
        std::vector<std::string> insertionOrder;
07bf1e7c   Menouard AZIB   EveryThing works ...
254
255
        for (auto param : plot->_parameterAxesList)
        {
05089f4a   Erdogan Furkan   #11376 - Done.
256
257
258
259
260
            for (auto pHistogramProperties : param.getHistogramSeriesPropertiesList())
            {
                if(pHistogramProperties != nullptr){
                    if (!pHistogramProperties->hasYAxis())
                        continue;
97f9b74e   Erdogan Furkan   #10776 - Density ...
261

05089f4a   Erdogan Furkan   #11376 - Done.
262
                    if(pHistogramProperties->getHistogramType() == "histogram1d" )
650942c4   Erdogan Furkan   #11372 - Done.
263
                        continue;
05089f4a   Erdogan Furkan   #11376 - Done.
264
265
266
267
268
269
                    if(pHistogramProperties->getHistogramType() == "histogram2d" )
                        zAxisTextLegend = pHistogramProperties->getHistotypeProperties().getHisto2DFunction()->getTextLegend();
                    // check if a colored param is defined for this serie
                    if (pHistogramProperties->getHistotypeProperties().getParamId().empty()){
                        Label zLabel(lZAxis->_legend.getFont(),lZAxis->_color);
                        zLabel._text = zAxisTextLegend;
5a5d916f   Erdogan Furkan   Histograms : fixi...
270
                        lZAxis->_legend.setLabel(zLabel);
05089f4a   Erdogan Furkan   #11376 - Done.
271
272
                        continue;
                    }
97f9b74e   Erdogan Furkan   #10776 - Density ...
273

05089f4a   Erdogan Furkan   #11376 - Done.
274
275
276
277
                    ParameterIndexComponentColor colorSerieIndex = ParameterIndexComponentColor(-1, -1, lZAxis->_color);
                    if (pHistogramProperties->getHistotypeProperties().getIndex() > -1)
                        colorSerieIndex = ParameterIndexComponentColor(pHistogramProperties->getHistotypeProperties().getIndex(), -1, lZAxis->_color);
                    pushComponentInList(pHistogramProperties->getHistotypeProperties().getParamId(), colorSerieIndex, axisParamsComponents);
dd42b8f4   Erdogan Furkan   #7857 - Done
278
                    insertionOrder.push_back(pHistogramProperties->getHistotypeProperties().getParamId());
05089f4a   Erdogan Furkan   #11376 - Done.
279
                }
97f9b74e   Erdogan Furkan   #10776 - Density ...
280
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
281
282
            for (auto lSeriesProperties : param.getYSeriePropertiesList())
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
283
284
285
286
287
                if (!lSeriesProperties.hasYAxis())
                    continue;

                std::string yParamId = lSeriesProperties.getParamId();

07bf1e7c   Menouard AZIB   EveryThing works ...
288
                // check if a colored param is defined for this serie
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
289
290
291
                if (lSeriesProperties.getColorParamId().empty())
                    continue;

07bf1e7c   Menouard AZIB   EveryThing works ...
292
                ParameterAxes *colorSerieParameterAxes = plot->getParameterAxesByColorSerieId(lSeriesProperties.getColorSerieId());
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
293
294
295
296
297
298
299
300
301
302

                if (colorSerieParameterAxes == NULL)
                    continue;

                lColorSerieProperties = colorSerieParameterAxes->getColorSeriePropertiesById(lSeriesProperties.getColorSerieId());

                ParameterIndexComponentColor colorSerieIndex = ParameterIndexComponentColor(-1, -1, lZAxis->_color);
                if (lColorSerieProperties.getIndex() > -1)
                    colorSerieIndex = ParameterIndexComponentColor(lColorSerieProperties.getIndex(), -1, lZAxis->_color);
                pushComponentInList(lColorSerieProperties.getColorParamIds()[yParamId], colorSerieIndex, axisParamsComponents);
dd42b8f4   Erdogan Furkan   #7857 - Done
303
                insertionOrder.push_back(lColorSerieProperties.getColorParamIds()[yParamId]);
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
304
305
306
            }
        }

dd42b8f4   Erdogan Furkan   #7857 - Done
307
        setAxisLegendForSeries(plot, lZAxis, axisParamsComponents, insertionOrder,zAxisTextLegend);
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
308
309
310
    }

    void AxisLegendManager::configureColorAxisLegendForSpectro(
07bf1e7c   Menouard AZIB   EveryThing works ...
311
312
        PanelPlotOutput *plot)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
313
314
        boost::shared_ptr<Axis> lZAxis = plot->_panel->getColorAxis();

07bf1e7c   Menouard AZIB   EveryThing works ...
315
316
        if (lZAxis.get() == nullptr)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
317
318
            return;
        }
5ee90a58   Benjamin Renard   Use AxisLegendMan...
319

07bf1e7c   Menouard AZIB   EveryThing works ...
320
321
        for (auto param : plot->_parameterAxesList)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
322
323
            std::shared_ptr<SpectroProperties> spectroPropertiesPtr = param.getSpectroProperties();
            if (spectroPropertiesPtr == nullptr)
07bf1e7c   Menouard AZIB   EveryThing works ...
324
                continue; // no spectro defined
21ddb9f2   Benjamin Renard   Set legend color ...
325

5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
326
327
            if (!spectroPropertiesPtr->hasZAxis())
                continue;
5ee90a58   Benjamin Renard   Use AxisLegendMan...
328

5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
329
330
331
            setAxisLegendForSpectro(plot, lZAxis, param._originalParamId);
            break;
        }
07bf1e7c   Menouard AZIB   EveryThing works ...
332
333
334

        for (auto param : plot->_parameterAxesList)
        {
b0205fd9   Hacene SI HADJ MOHAND   plot ok reste que...
335
336
            std::shared_ptr<SauvaudProperties> sauvaudPropertiesPtr = param.getSauvaudProperties();
            if (sauvaudPropertiesPtr == nullptr)
07bf1e7c   Menouard AZIB   EveryThing works ...
337
                continue; // no sauvaud defined
b0205fd9   Hacene SI HADJ MOHAND   plot ok reste que...
338
339
340
341
342
343
344

            if (!sauvaudPropertiesPtr->hasZAxis())
                continue;

            setAxisLegendForSpectro(plot, lZAxis, param._originalParamId);
            break;
        }
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
345
346
    }

07bf1e7c   Menouard AZIB   EveryThing works ...
347
348
349
350
351
    void AxisLegendManager::pushComponentInList(std::string paramId, ParameterIndexComponentColor &index, AxisParamsComponents &axisParamsComponents)
    {
        if (index.getDim1Index() == -1 && index.getDim2Index() == -1)
        {
            // All indexes of this parameter are used
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
352
353
            axisParamsComponents[paramId].clear();
            axisParamsComponents[paramId].push_back(index);
07bf1e7c   Menouard AZIB   EveryThing works ...
354
355
356
357
358
359
360
361
        }
        else
        {
            if (axisParamsComponents[paramId].size() > 0)
            {
                if (axisParamsComponents[paramId].front().getDim1Index() == -1 && axisParamsComponents[paramId].front().getDim2Index() == -1)
                {
                    // Skip. All components already defined for this paramter on this axis
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
362
363
364
                    return;
                }
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
365
366
367
368
369
            for (auto crtIndex : axisParamsComponents[paramId])
            {
                if ((crtIndex.getDim1Index() == index.getDim1Index()) && (crtIndex.getDim2Index() == index.getDim2Index()))
                {
                    // Component already exists
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
370
371
372
                    return;
                }
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
373
            // Add this components for this axis
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
374
375
            axisParamsComponents[paramId].push_back(index);
        }
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
376
377
    }

97f9b74e   Erdogan Furkan   #10776 - Density ...
378
    void AxisLegendManager::setAxisLegendForSeries(PanelPlotOutput *plot, boost::shared_ptr<Axis> &pAxis, AxisParamsComponents &axisParamsComponents, 
dd42b8f4   Erdogan Furkan   #7857 - Done
379
                                                    std::vector<std::string> insertionOrder, std::string legendPrefix)
07bf1e7c   Menouard AZIB   EveryThing works ...
380
381
382
    {
        if (pAxis == nullptr || !pAxis->_legend.isEmpty())
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
383
384
385
386
            return;
        }

        // Retrieve ParamInfo Manager
07bf1e7c   Menouard AZIB   EveryThing works ...
387
        ParamMgr *piMgr = ParamMgr::getInstance();
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
388

dd42b8f4   Erdogan Furkan   #7857 - Done
389
        for (auto paramsComponents : insertionOrder)
07bf1e7c   Menouard AZIB   EveryThing works ...
390
        {
dd42b8f4   Erdogan Furkan   #7857 - Done
391
            ParameterSPtr p = plot->_parameterManager.getParameter(paramsComponents);
7c94ae0d   Erdogan Furkan   For now, histo1d ...
392
393
            if (p == nullptr)
                continue;
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
394
            ParamInfoSPtr paramInfo = piMgr->getParamInfoFromId(p->getInfoId());
dd42b8f4   Erdogan Furkan   #7857 - Done
395
            if (axisParamsComponents[paramsComponents].size() == p->getDataWriterTemplate()->getParamData()->getDim1() * p->getDataWriterTemplate()->getParamData()->getDim2())
07bf1e7c   Menouard AZIB   EveryThing works ...
396
397
            {
                // All components of this parameter are used by this axis => merge
dd42b8f4   Erdogan Furkan   #7857 - Done
398
399
400
                Color color = axisParamsComponents[paramsComponents].front().getColor();
                axisParamsComponents[paramsComponents].clear();
                axisParamsComponents[paramsComponents].push_back(ParameterIndexComponentColor(-1, -1, color));
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
401
402
            }
            bool isFirstComponent = true;
dd42b8f4   Erdogan Furkan   #7857 - Done
403
            for (auto components : axisParamsComponents[paramsComponents])
07bf1e7c   Menouard AZIB   EveryThing works ...
404
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
405
406
407
                if (paramInfo == nullptr)
                    continue;
                Label label(pAxis->_legend.getFont(), components.getColor());
07bf1e7c   Menouard AZIB   EveryThing works ...
408
409
410
411
                if (axisParamsComponents.size() == 1)
                {
                    if (isFirstComponent)
                    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
412
                        std::string info = getMissionInstrumentInfo(paramInfo);
07bf1e7c   Menouard AZIB   EveryThing works ...
413
414
                        if (!info.empty())
                        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
415
416
417
418
                            label._text = info;
                            addBreakLine(label._text);
                        }
                    }
07bf1e7c   Menouard AZIB   EveryThing works ...
419
420
421
                }
                else
                {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
422
                    std::string info = getMissionInfo(paramInfo);
07bf1e7c   Menouard AZIB   EveryThing works ...
423
424
                    if (!info.empty())
                    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
425
426
427
                        label._text = info + ", ";
                    }
                }
97f9b74e   Erdogan Furkan   #10776 - Density ...
428
                label._text += legendPrefix;
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
429
430
431
432
433
434
435
                label._text += getParamLegend(paramInfo, components);
                pAxis->_legend.pushLabel(label);
                isFirstComponent = false;
            }
        }
    }

07bf1e7c   Menouard AZIB   EveryThing works ...
436
437
438
439
    void AxisLegendManager::setAxisLegendForSpectro(PanelPlotOutput *plot, boost::shared_ptr<Axis> &pAxis, std::string originalParamId)
    {
        if (pAxis == nullptr || !pAxis->_legend.isEmpty())
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
440
441
442
443
            return;
        }

        // Retrieve ParamInfo Manager
07bf1e7c   Menouard AZIB   EveryThing works ...
444
        ParamMgr *piMgr = ParamMgr::getInstance();
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
445
446
447
448
449

        ParameterSPtr p = plot->_parameterManager.getParameter(originalParamId);
        AMDA::Info::ParamInfoSPtr paramInfo = piMgr->getParamInfoFromId(p->getInfoId());
        if (paramInfo == nullptr)
            return;
21ddb9f2   Benjamin Renard   Set legend color ...
450

5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
451
452
453
454
455
456
        Label label(pAxis->_legend.getFont(), pAxis->_legend.getColor());
        addInfoPart(label._text, paramInfo->getShortName());
        addInfoPart(label._text, getTransformedUnits(paramInfo->getUnits()));
        pAxis->_legend.setLabel(label);
    }

07bf1e7c   Menouard AZIB   EveryThing works ...
457
458
459
460
    void AxisLegendManager::setAxisLegendForTable(PanelPlotOutput *plot, boost::shared_ptr<Axis> &pAxis, std::string originalParamId, std::string paramId, AMDA::Common::ParameterIndexComponentList &indexes, int relatedDim)
    {
        if (pAxis == nullptr || !pAxis->_legend.isEmpty())
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
461
            return;
5ee90a58   Benjamin Renard   Use AxisLegendMan...
462
        }
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
463
464

        // Retrieve ParamInfo Manager
07bf1e7c   Menouard AZIB   EveryThing works ...
465
        ParamMgr *piMgr = ParamMgr::getInstance();
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
466
467
468
469
470
471
472
473
474

        ParameterSPtr p = plot->_parameterManager.getParameter(originalParamId);
        AMDA::Info::ParamInfoSPtr paramInfo = piMgr->getParamInfoFromId(p->getInfoId());

        if (paramInfo == nullptr)
            return;

        Label label(pAxis->_legend.getFont(), pAxis->_legend.getColor());
        std::string info = getMissionInstrumentInfo(paramInfo);
07bf1e7c   Menouard AZIB   EveryThing works ...
475
476
        if (!info.empty())
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
477
478
479
480
481
482
            addInfoPart(label._text, info);
            addBreakLine(label._text);
        }

        boost::shared_ptr<AMDA::Info::ParamTable> tableSPtr;
        tableSPtr = paramInfo->getTable(relatedDim);
07bf1e7c   Menouard AZIB   EveryThing works ...
483
484
485

        if (tableSPtr == nullptr)
        {
0831b2cf   Hacene SI HADJ MOHAND   axis legend
486
487
488
            // look for unique embedded table
            boost::shared_ptr<AMDA::Info::ParamTable> linkedTableSPtr;
            int counter = 0;
07bf1e7c   Menouard AZIB   EveryThing works ...
489
490
            for (auto pInfo : paramInfo->getLinkedParamList())
            {
0831b2cf   Hacene SI HADJ MOHAND   axis legend
491
492
493
                linkedTableSPtr = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(pInfo)->getTable(relatedDim);
                if (linkedTableSPtr == nullptr)
                    continue;
07bf1e7c   Menouard AZIB   EveryThing works ...
494
                counter++;
0831b2cf   Hacene SI HADJ MOHAND   axis legend
495
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
496
497
            if (linkedTableSPtr == nullptr || counter != 1)
            {
0831b2cf   Hacene SI HADJ MOHAND   axis legend
498
                LOG4CXX_DEBUG(gLogger, "table cannot be defined from linked info params");
07bf1e7c   Menouard AZIB   EveryThing works ...
499
500
501
            }
            else
            {
0831b2cf   Hacene SI HADJ MOHAND   axis legend
502
503
                tableSPtr = linkedTableSPtr;
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
504
        }
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
505

07bf1e7c   Menouard AZIB   EveryThing works ...
506
507
        if (tableSPtr == nullptr)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
508
509
510
511
512
513
514
515
516
            std::string tableInfo = "Table ";
            tableInfo += std::to_string(relatedDim);
            tableInfo += " indexes";
            addInfoPart(label._text, tableInfo);
            pAxis->_legend.pushLabel(label);
            return;
        }

        if (((*plot->_pParameterValues)[paramId].getDim1Size() > 0) &&
07bf1e7c   Menouard AZIB   EveryThing works ...
517
518
519
            ((*plot->_pParameterValues)[paramId].getDim2Size() > 0) &&
            !indexes.empty())
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
520
521
            boost::shared_ptr<AMDA::Info::ParamTable> otherTableSPtr;
            int otherDimIndex;
07bf1e7c   Menouard AZIB   EveryThing works ...
522
523
            if (relatedDim == 0)
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
524
525
                otherTableSPtr = paramInfo->getTable(1);
                otherDimIndex = indexes.front().getDim2Index();
07bf1e7c   Menouard AZIB   EveryThing works ...
526
527
528
            }
            else
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
529
530
531
                otherTableSPtr = paramInfo->getTable(0);
                otherDimIndex = indexes.front().getDim1Index();
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
532
533
            if ((otherTableSPtr != nullptr) && !otherTableSPtr->isVariable(&plot->_parameterManager))
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
534
535
536
537
538
539
540
541
542
                if (otherTableSPtr->getName(&plot->_parameterManager).empty())
                    addInfoPart(label._text, "Table bounds");
                else
                    addInfoPart(label._text, otherTableSPtr->getName(&plot->_parameterManager));

                AMDA::Info::t_TableBound crtBound = otherTableSPtr->getBound(&plot->_parameterManager, otherDimIndex);
                addBoundsPart(label._text, crtBound.min, crtBound.max);
                std::string rawUnit = otherTableSPtr->getUnits(&plot->_parameterManager);
                addInfoPart(label._text, getTransformedUnits(rawUnit));
07bf1e7c   Menouard AZIB   EveryThing works ...
543
544
545
            }
            else
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
546
547
548
549
550
551
552
553
554
555
556
557
                std::string part = "Table Index: ";
                part += std::to_string(otherDimIndex);
                addInfoPart(label._text, part);
            }
            addBreakLine(label._text);
        }
        addInfoPart(label._text, tableSPtr->getName(&plot->_parameterManager));
        std::string rawUnit = tableSPtr->getUnits(&plot->_parameterManager);
        addInfoPart(label._text, getTransformedUnits(rawUnit));
        pAxis->_legend.pushLabel(label);
    }

07bf1e7c   Menouard AZIB   EveryThing works ...
558
559
560
561
562
563
564
565
566
567
    void AxisLegendManager::addInfoPart(std::string &legend, std::string info)
    {
        if (!info.empty())
        {
            if (!legend.empty())
            {
                if (legend.length() >= Label::DELIMITER.length())
                {
                    if (legend.compare(legend.length() - Label::DELIMITER.length(), Label::DELIMITER.length(), Label::DELIMITER) != 0)
                    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
568
569
                        legend += ", ";
                    }
07bf1e7c   Menouard AZIB   EveryThing works ...
570
571
572
                }
                else
                {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
573
574
575
576
577
578
579
                    legend += ", ";
                }
            }
            legend += info;
        }
    }

07bf1e7c   Menouard AZIB   EveryThing works ...
580
581
    void AxisLegendManager::addIndexPart(std::string &legend, ParameterIndexComponentColor &index)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
582
583
        legend += "[";
        legend += std::to_string(index.getDim1Index());
07bf1e7c   Menouard AZIB   EveryThing works ...
584
585
        if (index.getDim2Index() != -1)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
586
587
588
589
590
591
            legend += ",";
            legend += std::to_string(index.getDim2Index());
        }
        legend += "]";
    }

07bf1e7c   Menouard AZIB   EveryThing works ...
592
593
    void AxisLegendManager::addIndexPart(std::string &legend, int index)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
594
595
596
597
598
        legend += "[";
        legend += std::to_string(index);
        legend += "]";
    }

07bf1e7c   Menouard AZIB   EveryThing works ...
599
600
    void AxisLegendManager::addBoundsPart(std::string &legend, PLFLT min, PLFLT max)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
601
602
603
604
605
        legend += " ";

        char minCount[1024];
        char maxCount[1024];

b358ee7d   Benjamin Renard   Adapt axes labels...
606
        int precision = computeScientificFormatPrecision(min, max);
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
607

3371b1c8   Erdogan Furkan   #11199 - done
608
609
        getDigitalLabel(min, precision, minCount, 1024, min, max);
        getDigitalLabel(max, precision, maxCount, 1024, min, max);
fbe3c2bb   Benjamin Renard   First commit
610

5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
611
612
613
614
615
        legend += std::string(minCount);
        legend += ", ";
        legend += std::string(maxCount);
    }

07bf1e7c   Menouard AZIB   EveryThing works ...
616
617
618
619
    void AxisLegendManager::addBreakLine(std::string &legend)
    {
        if (!legend.empty())
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
620
621
622
623
            legend += Label::DELIMITER;
        }
    }

07bf1e7c   Menouard AZIB   EveryThing works ...
624
625
    std::string AxisLegendManager::getParamLegend(AMDA::Info::ParamInfoSPtr paramInfo, ParameterIndexComponentColor &index)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
626
627
628
        std::string legend;
        addInfoPart(legend, paramInfo->getShortName());

07bf1e7c   Menouard AZIB   EveryThing works ...
629
630
        if ((index.getDim1Index() != -1) || (index.getDim2Index() != -1))
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
631
632
633
            AMDA::Common::ParameterIndexComponent paramIndex(index.getDim1Index(), index.getDim2Index());
            if (paramInfo->getComponents(paramIndex).empty() == false)
                addInfoPart(legend, paramInfo->getComponents(paramIndex));
07bf1e7c   Menouard AZIB   EveryThing works ...
634
635
            else
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
636
637
638
                addInfoPart(legend, paramInfo->getShortName());
                addIndexPart(legend, index);
            }
c2fa3b5d   Benjamin Renard   Rework of legend ...
639
640
        }

5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
641
        addInfoPart(legend, getTransformedUnits(paramInfo->getUnits()));
c2fa3b5d   Benjamin Renard   Rework of legend ...
642
        addInfoPart(legend, paramInfo->getCoordinatesSystem());
5ee90a58   Benjamin Renard   Use AxisLegendMan...
643

c2fa3b5d   Benjamin Renard   Rework of legend ...
644
        return legend;
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
    }

    /*std::string AxisLegendManager::getParamLegend(AMDA::Info::ParamInfoSPtr paramInfo, int index) {
            std::string legend;
            addInfoPart(legend, paramInfo->getShortName());

            if ((index.getDim1Index() != -1) || (index.getDim2Index() != -1)) {
                    if (paramInfo->getComponents(index).empty() == false)
                            addInfoPart(legend, paramInfo->getComponents(index));
                    else
                    {
                            addInfoPart(legend, paramInfo->getShortName());
                            addIndexPart(legend, index);
                    }
            }

            addInfoPart(legend, paramInfo->getUnits());
            addInfoPart(legend, paramInfo->getCoordinatesSystem());

            return legend;
    }*/

07bf1e7c   Menouard AZIB   EveryThing works ...
667
668
    std::string AxisLegendManager::getMissionInstrumentInfo(AMDA::Info::ParamInfoSPtr paramInfo)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
669
670
671
672
673
674
675
676
        std::string info = paramInfo->getInstrumentId();
        if (info.empty())
            return info;
        std::replace(info.begin(), info.end(), '_', ' ');
        std::transform(info.begin(), info.end(), info.begin(), ::toupper);
        return info;
    }

07bf1e7c   Menouard AZIB   EveryThing works ...
677
678
    std::string AxisLegendManager::getMissionInfo(AMDA::Info::ParamInfoSPtr paramInfo)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
679
680
681
        std::string info = paramInfo->getInstrumentId();
        if (info.empty())
            return info;
07bf1e7c   Menouard AZIB   EveryThing works ...
682
683
        if (info.find('_') != std::string::npos)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
684
685
686
687
688
689
            info = info.substr(0, info.find('_'));
        }
        std::transform(info.begin(), info.end(), info.begin(), ::toupper);
        return info;
    }

07bf1e7c   Menouard AZIB   EveryThing works ...
690
691
    std::string AxisLegendManager::getTransformedUnits(const std::string &rawUnit)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
692
693
694
695
696
697
698
699
        std::string unit = rawUnit;
        if (unit.find("^"))
            unit = transformPower(unit, "^");
        if (unit.find("**"))
            unit = transformPower(unit, "**");
        return unit;
    }

07bf1e7c   Menouard AZIB   EveryThing works ...
700
701
    std::string AxisLegendManager::transformPower(std::string &unit, std::string pattern)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
702
703
704
        std::map<size_t, size_t> positions; // holds all the positions that pattern occurs within unit
        size_t pos_first = unit.find(pattern, 0);
        size_t pos_last;
07bf1e7c   Menouard AZIB   EveryThing works ...
705
706
        while (pos_first != std::string::npos)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
707
708
            char afterPattern = unit[pos_first + pattern.length()];
            pos_last = pos_first + pattern.length();
07bf1e7c   Menouard AZIB   EveryThing works ...
709
710
711
712
713
714
715
716
            if (afterPattern == '+' || afterPattern == '-')
            {
                afterPattern = unit[pos_first + pattern.length() + 1];
                pos_last++;
            }
            if (afterPattern == '(')
            {
                pos_last = unit.find(")", pos_first + pattern.length()) + 1;
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
717
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
718
719
720
            else if (afterPattern == '|')
            {
                pos_last = unit.find("|", pos_first + pattern.length() + 2) + 1;
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
721
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
722
723
724
725
726
727
            else if (isdigit(afterPattern) || afterPattern == '.')
            {
                pos_last++;
                while (isdigit(unit[pos_last]) || unit[pos_last] == '.')
                {
                    pos_last++;
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
728
                }
07bf1e7c   Menouard AZIB   EveryThing works ...
729
730
731
732
            }
            else
            {
                pos_last++;
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
733
734
735
736
737
            }
            positions.insert(std::pair<size_t, size_t>(pos_first, pos_last));
            pos_first = unit.find(pattern, pos_first + pattern.length());
        }
        std::map<size_t, size_t>::reverse_iterator it;
07bf1e7c   Menouard AZIB   EveryThing works ...
738
739
        for (it = positions.rbegin(); it != positions.rend(); ++it)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
740
741
742
743
744
745
746
            unit.insert(it->second, "#d");
            unit.erase(it->first, pattern.length());
            unit.insert(it->first, "#u");
        }
        return unit;
    }

fbe3c2bb   Benjamin Renard   First commit
747
} /* namespace plot */