#3343 Holo Lens : Add colorFromCellCategory

This commit is contained in:
Magne Sjaastad 2018-09-19 14:28:27 +02:00
parent 782005bad9
commit 6eb5cb21c8
2 changed files with 30 additions and 18 deletions

View File

@ -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;
}
//--------------------------------------------------------------------------------------------------

View File

@ -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;