mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
ResInsight: Added mean value to 3D info text
p4#: 19268
This commit is contained in:
@@ -481,9 +481,10 @@ void RIViewer::setHistogram(double min, double max, const std::vector<size_t>& h
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RIViewer::setHistogramPercentiles(double pmin, double pmax)
|
||||
void RIViewer::setHistogramPercentiles(double pmin, double pmax, double mean)
|
||||
{
|
||||
m_histogramWidget->setPercentiles(pmin, pmax);
|
||||
m_histogramWidget->setMean(mean);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
void setInfoText(QString text);
|
||||
void showHistogram(bool enable);
|
||||
void setHistogram(double min, double max, const std::vector<size_t>& histogram);
|
||||
void setHistogramPercentiles(double pmin, double pmax);
|
||||
void setHistogramPercentiles(double pmin, double pmax, double mean);
|
||||
|
||||
void showAnimationProgress(bool enable);
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ QWidget(parent, f)
|
||||
{
|
||||
m_minPercentile = HUGE_VAL;
|
||||
m_maxPercentile = HUGE_VAL;
|
||||
m_mean = HUGE_VAL;
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -78,6 +80,14 @@ void RiuSimpleHistogramWidget::draw(QPainter *painter,int x, int y, int width, i
|
||||
painter->setPen(QColor(255, 0, 0, 200));
|
||||
painter->drawLine(xpos, y+1, xpos, y + height -1);
|
||||
}
|
||||
|
||||
// Vertical lines for percentiles
|
||||
if (m_mean != HUGE_VAL)
|
||||
{
|
||||
int xpos = xPosFromDomainValue(m_mean);
|
||||
painter->setPen(QColor(0, 0, 255, 200));
|
||||
painter->drawLine(xpos, y+1, xpos, y + height -1);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -11,6 +11,7 @@ public:
|
||||
|
||||
void setHistogramData(double min, double max, const std::vector<size_t>& histogram);
|
||||
void setPercentiles(double pmin, double pmax) {m_minPercentile = pmin; m_maxPercentile = pmax;}
|
||||
void setMean(double mean) {m_mean = mean;}
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent* event);
|
||||
@@ -28,6 +29,7 @@ private:
|
||||
double m_min;
|
||||
double m_minPercentile;
|
||||
double m_maxPercentile;
|
||||
double m_mean;
|
||||
size_t m_maxHistogramCount;
|
||||
|
||||
double m_width;
|
||||
|
||||
Reference in New Issue
Block a user