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:
@@ -948,16 +948,20 @@ void RimEclipseView::updateLegends()
|
||||
{
|
||||
if(cellEdgeResult()->singleVarEdgeResultColors()->resultType() != RimDefines::FORMATION_NAMES)
|
||||
{
|
||||
cellEdgeResult()->legendConfig()->setCategories(results->uniqueCellScalarValues(cellEdgeResult()->singleVarEdgeResultColors()->scalarResultIndex()),
|
||||
results->uniqueCellScalarValues(cellEdgeResult()->singleVarEdgeResultColors()->scalarResultIndex(), 0));
|
||||
cellEdgeResult()->legendConfig()->setCategories(results->uniqueCellScalarValues(cellEdgeResult()->singleVarEdgeResultColors()->scalarResultIndex()));
|
||||
}
|
||||
else
|
||||
{
|
||||
const std::vector<QString>& fnVector =
|
||||
eclipseCase->activeFormationNames()->formationNames();
|
||||
std::set<int> nameIndices;
|
||||
for(int i = 0; i < fnVector.size(); ++i) nameIndices.insert(i);
|
||||
cellEdgeResult()->legendConfig()->setCategories(nameIndices, nameIndices);
|
||||
const std::vector<QString>& fnVector = eclipseCase->activeFormationNames()->formationNames();
|
||||
std::vector<int> nameIndices;
|
||||
std::vector<cvf::String> names;
|
||||
for (int i = 0; i < fnVector.size(); ++i)
|
||||
{
|
||||
nameIndices.push_back(i);
|
||||
names.push_back(cvfqt::Utils::toString(fnVector[i]));
|
||||
}
|
||||
|
||||
cellEdgeResult()->legendConfig()->setCategoriesWithNames(nameIndices, names);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1006,21 +1010,22 @@ void RimEclipseView::updateMinMaxValuesAndAddLegendToView(QString legendLabel, R
|
||||
|
||||
if (resultColors->hasCategoryResult())
|
||||
{
|
||||
size_t adjustedTimeStep = m_currentTimeStep;
|
||||
if (resultColors->hasStaticResult()) adjustedTimeStep = 0;
|
||||
|
||||
if(resultColors->resultType() != RimDefines::FORMATION_NAMES)
|
||||
{
|
||||
resultColors->legendConfig()->setCategories(cellResultsData->uniqueCellScalarValues(resultColors->scalarResultIndex()),
|
||||
cellResultsData->uniqueCellScalarValues(resultColors->scalarResultIndex(), adjustedTimeStep));
|
||||
resultColors->legendConfig()->setCategories(cellResultsData->uniqueCellScalarValues(resultColors->scalarResultIndex()));
|
||||
}
|
||||
else
|
||||
{
|
||||
const std::vector<QString>& fnVector =
|
||||
eclipseCase()->reservoirData()->activeFormationNames()->formationNames();
|
||||
std::set<int> nameIndices;
|
||||
for(int i = 0; i < fnVector.size(); ++i) nameIndices.insert(i);
|
||||
resultColors->legendConfig()->setCategories(nameIndices, nameIndices);
|
||||
const std::vector<QString>& fnVector = eclipseCase()->reservoirData()->activeFormationNames()->formationNames();
|
||||
std::vector<int> nameIndices;
|
||||
std::vector<cvf::String> names;
|
||||
for (int i = 0; i < fnVector.size(); ++i)
|
||||
{
|
||||
nameIndices.push_back(i);
|
||||
names.push_back(cvfqt::Utils::toString(fnVector[i]));
|
||||
}
|
||||
|
||||
resultColors->legendConfig()->setCategoriesWithNames(nameIndices, names);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user