From adee16e1f3b71b59c233342ec79480668dc8211c Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 5 Jun 2024 11:18:11 +0000 Subject: [PATCH] Fix bug with multi Histo1D in a panel + superpose mode --- src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc | 11 +++++------ src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh | 2 -- src/ParamOutputImpl/Plot/HistoPlot/HistogramSeriesProperties.hh | 20 +++++++++++++++++--- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc b/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc index 31ad57f..5faf61e 100644 --- a/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc +++ b/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.cc @@ -28,7 +28,6 @@ namespace plot { HistoPlot::HistoPlot(AMDA::Parameters::ParameterManager& manager, boost::shared_ptr panel) : PanelPlotOutput(manager, panel){ - _plotted=false; } @@ -337,7 +336,7 @@ void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pPa HistogramSeriesProperties &pHistogramProperties){ if(pHistogramProperties.getHistogramType() == "histogram1d"){ - if(_panel->_page->_superposeMode && _plotted) + if(_panel->_page->_superposeMode && pHistogramProperties.isPlotted()) return; std::vector> grid; @@ -350,11 +349,11 @@ void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pPa PanelPlotOutput::drawHistogram(startDate,stopDate,pParamId, pHistogramProperties); PanelPlotOutput::drawHistogramBoxes(grid,color,xBinSize, lYRange.getMin(), pHistogramProperties.getManualProperties().hasStairs()); - _plotted = true; + pHistogramProperties.setPlotted(true); } else { - if(_panel->_page->_superposeMode && _plotted) + if(_panel->_page->_superposeMode && pHistogramProperties.isPlotted()) return; if(_panel->_page->_superposeMode){ @@ -456,7 +455,7 @@ void HistoPlot::drawHistogram(double startDate, double stopDate, std::string pPa PanelPlotOutput::drawHistogram(startDate,stopDate,pParamId, pHistogramProperties); PanelPlotOutput::drawMatrix(matrixGrid, zMin, zMax, minValColor,maxValColor, lZAxis->_color._colorMapIndex, false); - _plotted = true; + pHistogramProperties.setPlotted(true); } } @@ -472,7 +471,7 @@ void HistoPlot::resetPlot() pHistogramProperties->getHistotypeProperties().getHisto1DFunction()->resetCache(); } - _plotted = false; + pHistogramProperties->setPlotted(false); } } } diff --git a/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh b/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh index 6cc1b5c..18ffabf 100644 --- a/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh +++ b/src/ParamOutputImpl/Plot/HistoPlot/HistoPlot.hh @@ -65,8 +65,6 @@ public: */ virtual void resetPlot(); - bool _plotted; - protected: void histo1DUtils(double startDate, double stopDate, HistogramSeriesProperties &pHistogramProperties, diff --git a/src/ParamOutputImpl/Plot/HistoPlot/HistogramSeriesProperties.hh b/src/ParamOutputImpl/Plot/HistoPlot/HistogramSeriesProperties.hh index eaa3f56..50916d6 100644 --- a/src/ParamOutputImpl/Plot/HistoPlot/HistogramSeriesProperties.hh +++ b/src/ParamOutputImpl/Plot/HistoPlot/HistogramSeriesProperties.hh @@ -37,7 +37,8 @@ public: _hasYAxis(true), _hasZAxis(false), _xId(-1), - _id(-1) + _id(-1), + _plotted(false) { } @@ -50,7 +51,8 @@ public: _hasYAxis(true), _hasZAxis(false), _xId(-1), - _id(-1) + _id(-1), + _plotted(false) { } @@ -64,7 +66,8 @@ public: _hasYAxis(pParamDrawingProperties_._hasYAxis), _hasZAxis(pParamDrawingProperties_._hasZAxis), _xId(pParamDrawingProperties_._xId), - _id(pParamDrawingProperties_._id) + _id(pParamDrawingProperties_._id), + _plotted(pParamDrawingProperties_._plotted) { } @@ -78,6 +81,7 @@ public: _hasZAxis = ref_._hasZAxis; _xId = ref_._xId; _id = ref_._id; + _plotted = ref_._plotted; return *this; } @@ -149,6 +153,14 @@ public: void setId(int id) { _id = id; } + + void setPlotted(bool plotted) { + _plotted = plotted; + } + + bool isPlotted() { + return _plotted; + } virtual ~HistogramSeriesProperties() { } @@ -171,6 +183,8 @@ public: bool _hasZAxis; int _xId; int _id; + bool _plotted; + ManualProperties _manualProperties; HistotypeProperties _histotypeProperties; -- libgit2 0.21.2