mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2625 Completion Type Legend : Only show categories present in the model
This commit is contained in:
@@ -400,10 +400,27 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
caf::AppEnum<RiaDefines::CompletionType> perforationInterval(RiaDefines::PERFORATION_INTERVAL);
|
||||
caf::AppEnum<RiaDefines::CompletionType> fracture(RiaDefines::FRACTURE);
|
||||
|
||||
categories.push_back(std::make_tuple(wellPath.uiText(), static_cast<int>(wellPath.index()), cvf::Color3::RED));
|
||||
categories.push_back(std::make_tuple(fishbone.uiText(), static_cast<int>(fishbone.index()), cvf::Color3::DARK_GREEN));
|
||||
categories.push_back(std::make_tuple(perforationInterval.uiText(), static_cast<int>(perforationInterval.index()), cvf::Color3::GREEN));
|
||||
categories.push_back(std::make_tuple(fracture.uiText(), static_cast<int>(fracture.index()), cvf::Color3::YELLOW_GREEN));
|
||||
const std::vector<int>& visibleCatetories = cellResultsData->uniqueCellScalarValues(this->scalarResultIndex());
|
||||
|
||||
if (std::find(visibleCatetories.begin(), visibleCatetories.end(), wellPath.index()) != visibleCatetories.end())
|
||||
{
|
||||
categories.push_back(std::make_tuple(wellPath.uiText(), static_cast<int>(wellPath.index()), cvf::Color3::RED));
|
||||
}
|
||||
|
||||
if (std::find(visibleCatetories.begin(), visibleCatetories.end(), fishbone.index()) != visibleCatetories.end())
|
||||
{
|
||||
categories.push_back(std::make_tuple(fishbone.uiText(), static_cast<int>(fishbone.index()), cvf::Color3::DARK_GREEN));
|
||||
}
|
||||
|
||||
if (std::find(visibleCatetories.begin(), visibleCatetories.end(), perforationInterval.index()) != visibleCatetories.end())
|
||||
{
|
||||
categories.push_back(std::make_tuple(perforationInterval.uiText(), static_cast<int>(perforationInterval.index()), cvf::Color3::GREEN));
|
||||
}
|
||||
|
||||
if (std::find(visibleCatetories.begin(), visibleCatetories.end(), fracture.index()) != visibleCatetories.end())
|
||||
{
|
||||
categories.push_back(std::make_tuple(fracture.uiText(), static_cast<int>(fracture.index()), cvf::Color3::YELLOW_GREEN));
|
||||
}
|
||||
|
||||
legendConfig->setCategoryItems(categories);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user