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
                    }
                    Color compLegendColor = lXAxis->_color;
ddddc350   Erdogan Furkan   #11675 - Done.
53
                    if(param.getHistogramSeriesPropertiesList().size() > 1)
05089f4a   Erdogan Furkan   #11376 - Done.
54
55
                        compLegendColor = pHistogramProperties->getColor();
                    ParameterIndexComponentColor xIndex = ParameterIndexComponentColor(xIndexComp, compLegendColor);
920804c3   Benjamin Renard   Fix
56
                    pushComponentInList(xParamId, xIndex, axesParamsComponents[xAxisId], insertionOrder);
7c94ae0d   Erdogan Furkan   For now, histo1d ...
57
                }
7c94ae0d   Erdogan Furkan   For now, histo1d ...
58
59
            }

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

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

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

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

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

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

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

                ParameterIndexComponentColor xIndex = ParameterIndexComponentColor(xSerie.getIndex(), compLegendColor);
920804c3   Benjamin Renard   Fix
86
                pushComponentInList(xSerie.getParamId(), xIndex, axesParamsComponents[xAxisId], insertionOrder);
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
87
88
89
            }
        }

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

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

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

            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 ...
129
130
        PanelPlotOutput *plot)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
131
        SeriesProperties lSeriesProperties;
4bced76d   Furkan   #11372 - Adding n...
132
        std::string yAxisTextLegend;
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
133
134
135
136
137
        // 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...
138
        std::map<std::string, AxisParamsComponents> axesHistoParamsComponents;
e701a1b4   Erdogan Furkan   Minor fix on hist...
139
        std::map<std::string,std::string> yAxisTextLegendHisto;
dd42b8f4   Erdogan Furkan   #7857 - Done
140
141
142

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

05089f4a   Erdogan Furkan   #11376 - Done.
155
156
157
158
159
160
                    std::string yAxisId = pHistogramProperties->getYAxisId();
                    boost::shared_ptr<Axis> lYAxis = plot->_panel->getAxis(yAxisId);
                    if (lYAxis.get() == nullptr)
                    {
                        continue;
                    }
650942c4   Erdogan Furkan   #11372 - Done.
161
162
                    std::string yParamId ;
                    AMDA::Common::ParameterIndexComponent yIndexComp;
05089f4a   Erdogan Furkan   #11376 - Done.
163
                    if(pHistogramProperties->getHistogramType() == "histogram1d"){
650942c4   Erdogan Furkan   #11372 - Done.
164
165
                        yParamId =  pHistogramProperties->getHistotypeProperties().getParamId();
                        yIndexComp = AMDA::Common::ParameterIndexComponent(pHistogramProperties->getHistotypeProperties().getIndex(), -1);
bec89e22   Erdogan Furkan   Fixes + refactori...
166
                        yAxisTextLegend = pHistogramProperties->getHistotypeProperties().getHisto1DFunction()->getTextLegend();
e701a1b4   Erdogan Furkan   Minor fix on hist...
167
                        yAxisTextLegendHisto[yAxisId] = yAxisTextLegend;
4bced76d   Furkan   #11372 - Adding n...
168
169
170
171
172
173
                        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.
174
                        }                  
05089f4a   Erdogan Furkan   #11376 - Done.
175
                    }
650942c4   Erdogan Furkan   #11372 - Done.
176
177
178
179
180
181
182
183
184
                    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);
920804c3   Benjamin Renard   Fix
185
                    pushComponentInList(yParamId, yIndex, axesHistoParamsComponents[yAxisId], insertionOrder);
1248af2b   Erdogan Furkan   Refactored, all w...
186
                }
7c94ae0d   Erdogan Furkan   For now, histo1d ...
187
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
188
189
            for (auto lSeriesProperties : param.getYSeriePropertiesList())
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
190
191
192
193
194
195
196
                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 ...
197
198
                if (lYAxis.get() == nullptr)
                {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
199
200
201
                    continue;
                }

07bf1e7c   Menouard AZIB   EveryThing works ...
202
203
                for (auto index : lSeriesProperties.getIndexList(plot->_pParameterValues))
                {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
204
                    Color compLegendColor = lYAxis->_color;
07bf1e7c   Menouard AZIB   EveryThing works ...
205
206
                    if (moreThanOneSerieForAxis && (lSeriesProperties.getColorSerieId() == -1) && (!plot->_panel->_page->_superposeMode))
                    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
207
208
209
                        compLegendColor = plot->getSerieLineColor(lSeriesProperties, moreThanOneSerieForAxis);
                    }
                    ParameterIndexComponentColor yIndex = ParameterIndexComponentColor(index, compLegendColor);
920804c3   Benjamin Renard   Fix
210
                    pushComponentInList(lSeriesProperties.getParamId(), yIndex, axesParamsComponents[yAxisId], insertionOrder);
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
211
212
213
                }
            }
        }
07bf1e7c   Menouard AZIB   EveryThing works ...
214
215
        if (!plot->_panel->_page->_superposeMode)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
216
217
218
219
            plot->resetAutomaticSerieColorCursor();
        }

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

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

07bf1e7c   Menouard AZIB   EveryThing works ...
241
242
        if (lZAxis.get() == nullptr)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
243
244
245
246
247
            return;
        }

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

05089f4a   Erdogan Furkan   #11376 - Done.
257
                    if(pHistogramProperties->getHistogramType() == "histogram1d" )
650942c4   Erdogan Furkan   #11372 - Done.
258
                        continue;
05089f4a   Erdogan Furkan   #11376 - Done.
259
260
261
262
263
264
                    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...
265
                        lZAxis->_legend.setLabel(zLabel);
05089f4a   Erdogan Furkan   #11376 - Done.
266
267
                        continue;
                    }
97f9b74e   Erdogan Furkan   #10776 - Density ...
268

05089f4a   Erdogan Furkan   #11376 - Done.
269
270
271
                    ParameterIndexComponentColor colorSerieIndex = ParameterIndexComponentColor(-1, -1, lZAxis->_color);
                    if (pHistogramProperties->getHistotypeProperties().getIndex() > -1)
                        colorSerieIndex = ParameterIndexComponentColor(pHistogramProperties->getHistotypeProperties().getIndex(), -1, lZAxis->_color);
920804c3   Benjamin Renard   Fix
272
                    pushComponentInList(pHistogramProperties->getHistotypeProperties().getParamId(), colorSerieIndex, axisParamsComponents, insertionOrder);
05089f4a   Erdogan Furkan   #11376 - Done.
273
                }
97f9b74e   Erdogan Furkan   #10776 - Density ...
274
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
275
276
            for (auto lSeriesProperties : param.getYSeriePropertiesList())
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
277
278
279
280
281
                if (!lSeriesProperties.hasYAxis())
                    continue;

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

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

07bf1e7c   Menouard AZIB   EveryThing works ...
286
                ParameterAxes *colorSerieParameterAxes = plot->getParameterAxesByColorSerieId(lSeriesProperties.getColorSerieId());
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
287
288
289
290
291
292
293
294
295

                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);
920804c3   Benjamin Renard   Fix
296
                pushComponentInList(lColorSerieProperties.getColorParamIds()[yParamId], colorSerieIndex, axisParamsComponents, insertionOrder);
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
297
298
299
            }
        }

dd42b8f4   Erdogan Furkan   #7857 - Done
300
        setAxisLegendForSeries(plot, lZAxis, axisParamsComponents, insertionOrder,zAxisTextLegend);
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
301
302
303
    }

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

07bf1e7c   Menouard AZIB   EveryThing works ...
308
309
        if (lZAxis.get() == nullptr)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
310
311
            return;
        }
5ee90a58   Benjamin Renard   Use AxisLegendMan...
312

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

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

5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
322
323
324
            setAxisLegendForSpectro(plot, lZAxis, param._originalParamId);
            break;
        }
07bf1e7c   Menouard AZIB   EveryThing works ...
325
326
327

        for (auto param : plot->_parameterAxesList)
        {
b0205fd9   Hacene SI HADJ MOHAND   plot ok reste que...
328
329
            std::shared_ptr<SauvaudProperties> sauvaudPropertiesPtr = param.getSauvaudProperties();
            if (sauvaudPropertiesPtr == nullptr)
07bf1e7c   Menouard AZIB   EveryThing works ...
330
                continue; // no sauvaud defined
b0205fd9   Hacene SI HADJ MOHAND   plot ok reste que...
331
332
333
334
335
336
337

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

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

920804c3   Benjamin Renard   Fix
340
341
    void AxisLegendManager::pushComponentInList(std::string paramId, ParameterIndexComponentColor &index, AxisParamsComponents &axisParamsComponents,
                                                std::vector<std::string> &insertionOrder)
07bf1e7c   Menouard AZIB   EveryThing works ...
342
343
344
345
    {
        if (index.getDim1Index() == -1 && index.getDim2Index() == -1)
        {
            // All indexes of this parameter are used
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
346
347
            axisParamsComponents[paramId].clear();
            axisParamsComponents[paramId].push_back(index);
920804c3   Benjamin Renard   Fix
348
349
            if (std::find(insertionOrder.begin(), insertionOrder.end(), paramId) == insertionOrder.end())
                insertionOrder.push_back(paramId);
07bf1e7c   Menouard AZIB   EveryThing works ...
350
351
352
353
354
355
356
357
        }
        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
358
359
360
                    return;
                }
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
361
362
363
364
365
            for (auto crtIndex : axisParamsComponents[paramId])
            {
                if ((crtIndex.getDim1Index() == index.getDim1Index()) && (crtIndex.getDim2Index() == index.getDim2Index()))
                {
                    // Component already exists
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
366
367
368
                    return;
                }
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
369
            // Add this components for this axis
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
370
            axisParamsComponents[paramId].push_back(index);
920804c3   Benjamin Renard   Fix
371
372
            if (std::find(insertionOrder.begin(), insertionOrder.end(), paramId) == insertionOrder.end())
                insertionOrder.push_back(paramId);
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
373
        }
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
374
375
    }

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

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

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

07bf1e7c   Menouard AZIB   EveryThing works ...
434
435
436
437
    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
438
439
440
441
            return;
        }

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

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

5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
449
450
451
452
453
454
        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 ...
455
456
457
458
    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
459
            return;
5ee90a58   Benjamin Renard   Use AxisLegendMan...
460
        }
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
461
462

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

        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 ...
473
474
        if (!info.empty())
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
475
476
477
478
479
480
            addInfoPart(label._text, info);
            addBreakLine(label._text);
        }

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

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

07bf1e7c   Menouard AZIB   EveryThing works ...
504
505
        if (tableSPtr == nullptr)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
506
507
508
509
510
511
512
513
514
            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 ...
515
516
517
            ((*plot->_pParameterValues)[paramId].getDim2Size() > 0) &&
            !indexes.empty())
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
518
519
            boost::shared_ptr<AMDA::Info::ParamTable> otherTableSPtr;
            int otherDimIndex;
07bf1e7c   Menouard AZIB   EveryThing works ...
520
521
            if (relatedDim == 0)
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
522
523
                otherTableSPtr = paramInfo->getTable(1);
                otherDimIndex = indexes.front().getDim2Index();
07bf1e7c   Menouard AZIB   EveryThing works ...
524
525
526
            }
            else
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
527
528
529
                otherTableSPtr = paramInfo->getTable(0);
                otherDimIndex = indexes.front().getDim1Index();
            }
07bf1e7c   Menouard AZIB   EveryThing works ...
530
531
            if ((otherTableSPtr != nullptr) && !otherTableSPtr->isVariable(&plot->_parameterManager))
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
532
533
534
535
536
537
538
539
540
                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 ...
541
542
543
            }
            else
            {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
544
545
546
547
548
549
550
551
552
553
554
555
                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 ...
556
557
558
559
560
561
562
563
564
565
    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
566
567
                        legend += ", ";
                    }
07bf1e7c   Menouard AZIB   EveryThing works ...
568
569
570
                }
                else
                {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
571
572
573
574
575
576
577
                    legend += ", ";
                }
            }
            legend += info;
        }
    }

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

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

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

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

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

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

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

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

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

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

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

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

    /*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 ...
665
666
    std::string AxisLegendManager::getMissionInstrumentInfo(AMDA::Info::ParamInfoSPtr paramInfo)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
667
668
669
670
671
672
673
674
        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 ...
675
676
    std::string AxisLegendManager::getMissionInfo(AMDA::Info::ParamInfoSPtr paramInfo)
    {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
677
678
679
        std::string info = paramInfo->getInstrumentId();
        if (info.empty())
            return info;
07bf1e7c   Menouard AZIB   EveryThing works ...
680
681
        if (info.find('_') != std::string::npos)
        {
5e31eec0   Hacene SI HADJ MOHAND   resolu puissance
682
683
684
685
686
687
            info = info.substr(0, info.find('_'));
        }
        std::transform(info.begin(), info.end(), info.begin(), ::toupper);
        return info;
    }

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

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

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