mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve Grid Statistics Plot UI (#9831)
- Set default frequency enum to relative frequency [%] - Set current view selected in filter by 3D view visibility by default - Add labels for statistics data - Add UI to change number of bins in histogram - Add control of font size of axis values and axis titles
This commit is contained in:
committed by
Magne Sjaastad
parent
2f6b2e57f5
commit
07d1a3c669
@@ -29,6 +29,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigStatisticsDataCache::RigStatisticsDataCache( RigStatisticsCalculator* statisticsCalculator )
|
||||
: m_statisticsCalculator( statisticsCalculator )
|
||||
, m_numBins( RigStatisticsDataCache::defaultNumBins() )
|
||||
{
|
||||
CVF_ASSERT( m_statisticsCalculator.notNull() );
|
||||
|
||||
@@ -44,6 +45,22 @@ void RigStatisticsDataCache::clearAllStatistics()
|
||||
m_statsPrTs.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigStatisticsDataCache::defaultNumBins()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStatisticsDataCache::setNumBins( size_t numBins )
|
||||
{
|
||||
m_numBins = numBins;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -369,14 +386,13 @@ void RigStatisticsDataCache::p10p90CellScalarValues( size_t timeStepIndex, doubl
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStatisticsDataCache::computeHistogramStatisticsIfNeeded()
|
||||
{
|
||||
if ( m_statsAllTimesteps.m_histogram.size() == 0 )
|
||||
if ( m_statsAllTimesteps.m_histogram.size() != m_numBins )
|
||||
{
|
||||
double min;
|
||||
double max;
|
||||
size_t nBins = 100;
|
||||
this->minMaxCellScalarValues( min, max );
|
||||
|
||||
RigHistogramCalculator histCalc( min, max, nBins, &m_statsAllTimesteps.m_histogram );
|
||||
RigHistogramCalculator histCalc( min, max, m_numBins, &m_statsAllTimesteps.m_histogram );
|
||||
|
||||
m_statisticsCalculator->addDataToHistogramCalculator( histCalc );
|
||||
|
||||
@@ -390,14 +406,13 @@ void RigStatisticsDataCache::computeHistogramStatisticsIfNeeded()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStatisticsDataCache::computeHistogramStatisticsIfNeeded( size_t timeStepIndex )
|
||||
{
|
||||
if ( m_statsPrTs[timeStepIndex].m_histogram.size() == 0 )
|
||||
if ( m_statsPrTs[timeStepIndex].m_histogram.size() != m_numBins )
|
||||
{
|
||||
double min;
|
||||
double max;
|
||||
size_t nBins = 100;
|
||||
this->minMaxCellScalarValues( timeStepIndex, min, max );
|
||||
|
||||
RigHistogramCalculator histCalc( min, max, nBins, &m_statsPrTs[timeStepIndex].m_histogram );
|
||||
RigHistogramCalculator histCalc( min, max, m_numBins, &m_statsPrTs[timeStepIndex].m_histogram );
|
||||
|
||||
m_statisticsCalculator->addDataToHistogramCalculator( timeStepIndex, histCalc );
|
||||
|
||||
|
||||
@@ -36,6 +36,9 @@ public:
|
||||
|
||||
void clearAllStatistics();
|
||||
|
||||
static size_t defaultNumBins();
|
||||
void setNumBins( size_t numBins );
|
||||
|
||||
void minMaxCellScalarValues( double& min, double& max );
|
||||
void minMaxCellScalarValues( size_t timeStepIndex, double& min, double& max );
|
||||
|
||||
@@ -114,8 +117,8 @@ private:
|
||||
std::vector<int> m_uniqueValues;
|
||||
};
|
||||
|
||||
StatisticsValues m_statsAllTimesteps;
|
||||
std::vector<StatisticsValues> m_statsPrTs;
|
||||
|
||||
StatisticsValues m_statsAllTimesteps;
|
||||
std::vector<StatisticsValues> m_statsPrTs;
|
||||
cvf::ref<RigStatisticsCalculator> m_statisticsCalculator;
|
||||
size_t m_numBins;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user