mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3343 Holo Lens : Add colorFromCellCategory
This commit is contained in:
parent
782005bad9
commit
6eb5cb21c8
@ -888,6 +888,25 @@ void RimEclipseView::updateStaticCellColors()
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseView::updateStaticCellColors(RivCellSetEnum geometryType)
|
||||
{
|
||||
cvf::Color4f color = colorFromCellCategory(geometryType);
|
||||
|
||||
if (geometryType == PROPERTY_FILTERED || geometryType == PROPERTY_FILTERED_WELL_CELLS)
|
||||
{
|
||||
// Always use current time step when updating color of property geometry
|
||||
m_reservoirGridPartManager->updateCellColor(geometryType, m_currentTimeStep, color);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use static timestep (timestep 0) for geometry with no change between time steps
|
||||
m_reservoirGridPartManager->updateCellColor(geometryType, 0, color);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color4f RimEclipseView::colorFromCellCategory(RivCellSetEnum geometryType) const
|
||||
{
|
||||
float opacity = static_cast<float> (1 - cvf::Math::clamp(this->wellCollection()->wellCellTransparencyLevel(), 0.0, 1.0));
|
||||
cvf::Color4f color(cvf::Color3::ORANGE);
|
||||
@ -908,16 +927,7 @@ void RimEclipseView::updateStaticCellColors(RivCellSetEnum geometryType)
|
||||
case RANGE_FILTERED_INACTIVE: color = cvf::Color4f(RiaColorTables::undefinedCellColor()); break;
|
||||
}
|
||||
|
||||
if (geometryType == PROPERTY_FILTERED || geometryType == PROPERTY_FILTERED_WELL_CELLS)
|
||||
{
|
||||
// Always use current time step when updating color of property geometry
|
||||
m_reservoirGridPartManager->updateCellColor(geometryType, m_currentTimeStep, color);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use static timestep (timestep 0) for geometry with no change between time steps
|
||||
m_reservoirGridPartManager->updateCellColor(geometryType, 0, color);
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -140,6 +140,7 @@ public:
|
||||
virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility, int timeStep) override;
|
||||
|
||||
std::vector<RimLegendConfig*> legendConfigs() const override;
|
||||
cvf::Color4f colorFromCellCategory(RivCellSetEnum geometryType) const;
|
||||
|
||||
protected:
|
||||
virtual void initAfterRead() override;
|
||||
@ -161,6 +162,7 @@ private:
|
||||
|
||||
virtual void updateStaticCellColors() override;
|
||||
void updateStaticCellColors(RivCellSetEnum geometryType);
|
||||
|
||||
void updateLegends() override;
|
||||
void updateMinMaxValuesAndAddLegendToView(QString legendLabel, RimEclipseCellColors* resultColors, RigCaseCellResultsData* cellResultsData);
|
||||
virtual void resetLegendsInViewer() override;
|
||||
|
Loading…
Reference in New Issue
Block a user