mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#829) Use std::vector instead of std::set for categories. Added categoryNames to RimLegendConfig
This commit is contained in:
@@ -258,21 +258,11 @@ const std::vector<size_t>& RigStatisticsDataCache::cellScalarValuesHistogram(siz
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::set<int>& RigStatisticsDataCache::uniqueCellScalarValues()
|
||||
const std::vector<int>& RigStatisticsDataCache::uniqueCellScalarValues()
|
||||
{
|
||||
computeUniqueValuesIfNeeded();
|
||||
|
||||
return m_statsAllTimesteps.m_uniqueValues;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::set<int>& RigStatisticsDataCache::uniqueCellScalarValues(size_t timeStepIndex)
|
||||
{
|
||||
computeUniqueValuesIfNeeded(timeStepIndex);
|
||||
|
||||
return m_statsPrTs[timeStepIndex].m_uniqueValues;
|
||||
return m_uniqueValues;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -339,34 +329,19 @@ void RigStatisticsDataCache::computeHistogramStatisticsIfNeeded(size_t timeStepI
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStatisticsDataCache::computeUniqueValuesIfNeeded(size_t timeStepIndex)
|
||||
{
|
||||
if (timeStepIndex >= m_statsPrTs.size())
|
||||
{
|
||||
m_statsPrTs.resize(timeStepIndex + 1);
|
||||
}
|
||||
|
||||
if (m_statsPrTs[timeStepIndex].m_uniqueValues.size() == 0)
|
||||
{
|
||||
m_statisticsCalculator->uniqueValues(timeStepIndex, m_statsPrTs[timeStepIndex].m_uniqueValues);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStatisticsDataCache::computeUniqueValuesIfNeeded()
|
||||
{
|
||||
if (m_statsAllTimesteps.m_uniqueValues.size() == 0)
|
||||
if (m_uniqueValues.size() == 0)
|
||||
{
|
||||
for (size_t tIdx = 0; tIdx < m_statisticsCalculator->timeStepCount(); tIdx++)
|
||||
{
|
||||
computeUniqueValuesIfNeeded(tIdx);
|
||||
std::set<int> setValues;
|
||||
m_statisticsCalculator->uniqueValues(0, setValues);
|
||||
|
||||
m_statsAllTimesteps.m_uniqueValues.insert(m_statsPrTs[tIdx].m_uniqueValues.begin(), m_statsPrTs[tIdx].m_uniqueValues.end());
|
||||
for (auto val : setValues)
|
||||
{
|
||||
m_uniqueValues.push_back(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user