Statistics dialog. Fix crash when values equals INF

This commit is contained in:
Bjørn Erik Jensen 2017-11-16 14:52:06 +01:00
parent af1ffcb71c
commit c4385c1c1c
2 changed files with 16 additions and 7 deletions

View File

@ -192,14 +192,23 @@ void RicGridStatisticsDialog::setMarkers(const Rim3dOverlayInfoConfig::Histogram
QwtPlotMarker* marker;
marker = createVerticalPlotMarker(Qt::red, histData.p10);
marker->attach(plot);
if (histData.p10 != HUGE_VAL)
{
marker = createVerticalPlotMarker(Qt::red, histData.p10);
marker->attach(plot);
}
marker = createVerticalPlotMarker(Qt::red, histData.p90);
marker->attach(plot);
if (histData.p90 != HUGE_VAL)
{
marker = createVerticalPlotMarker(Qt::red, histData.p90);
marker->attach(plot);
}
marker = createVerticalPlotMarker(Qt::blue, histData.mean);
marker->attach(plot);
if (histData.mean != HUGE_VAL)
{
marker = createVerticalPlotMarker(Qt::blue, histData.mean);
marker->attach(plot);
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -58,7 +58,7 @@ class Rim3dOverlayInfoConfig : public caf::PdmObject
double weightedMean;
const std::vector<size_t>* histogram;
bool isValid() { return histogram && histogram->size() > 0; }
bool isValid() { return histogram && histogram->size() > 0 && min != HUGE_VAL && max != HUGE_VAL; }
};
public: