(#689) Do not try to update colors if no intersection geometry is present

This commit is contained in:
Magne Sjaastad 2015-12-03 12:54:13 +01:00
parent de41755320
commit 71cb7115eb
3 changed files with 19 additions and 2 deletions

View File

@ -1280,6 +1280,21 @@ const RimCrossSection* RivCrossSectionGeometryGenerator::crossSection() const
return m_crossSection; return m_crossSection;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RivCrossSectionGeometryGenerator::isAnyGeometryPresent() const
{
if (m_triangleVxes->size() == 0)
{
return false;
}
else
{
return true;
}
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -138,6 +138,8 @@ public:
~RivCrossSectionGeometryGenerator(); ~RivCrossSectionGeometryGenerator();
bool isAnyGeometryPresent() const;
// Generate geometry // Generate geometry
cvf::ref<cvf::DrawableGeo> generateSurface(); cvf::ref<cvf::DrawableGeo> generateSurface();
cvf::ref<cvf::DrawableGeo> createMeshDrawable(); cvf::ref<cvf::DrawableGeo> createMeshDrawable();

View File

@ -83,14 +83,14 @@ void RivCrossSectionPartMgr::updateCellResultColor(size_t timeStepIndex)
{ {
if (m_crossSectionGenerator.isNull()) return; if (m_crossSectionGenerator.isNull()) return;
if (!m_crossSectionGenerator->isAnyGeometryPresent()) return;
RimEclipseView* eclipseView; RimEclipseView* eclipseView;
m_rimCrossSection->firstAnchestorOrThisOfType(eclipseView); m_rimCrossSection->firstAnchestorOrThisOfType(eclipseView);
if (eclipseView) if (eclipseView)
{ {
RimEclipseCellColors* cellResultColors = eclipseView->cellResult(); RimEclipseCellColors* cellResultColors = eclipseView->cellResult();
CVF_ASSERT(cellResultColors); CVF_ASSERT(cellResultColors);
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel()); RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel());