#5019 Update display model on separate intersection settings change

This commit is contained in:
Jacob Støren 2019-11-21 08:28:00 +01:00
parent a181e0c11d
commit 31a698243d
4 changed files with 41 additions and 2 deletions

View File

@ -553,6 +553,15 @@ void RimEclipseResultDefinition::loadDataAndUpdate()
}
}
RimIntersectionResultDefinition* sepIntersectionResDef = nullptr;
this->firstAncestorOrThisOfType( sepIntersectionResDef );
if (sepIntersectionResDef && sepIntersectionResDef->isInAction())
{
if ( view ) view->scheduleCreateDisplayModelAndRedraw();
RimGridView* eclView = dynamic_cast<RimGridView*>( view );
if ( eclView ) eclView->crossSectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
}
RimCellEdgeColors* cellEdgeColors = nullptr;
this->firstAncestorOrThisOfType( cellEdgeColors );
if ( cellEdgeColors )

View File

@ -23,6 +23,8 @@
#include "RimEclipseCellColors.h"
#include "RimGeoMechCase.h"
#include "RimGeoMechCellColors.h"
#include "RimGridView.h"
#include "RimIntersectionResultsDefinitionCollection.h"
#include "RimRegularLegendConfig.h"
#include "RimTernaryLegendConfig.h"
#include "RimTools.h"
@ -78,7 +80,7 @@ RimIntersectionResultDefinition::~RimIntersectionResultDefinition() {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimIntersectionResultDefinition::isActive()
bool RimIntersectionResultDefinition::isActive() const
{
return m_isActive();
}
@ -213,6 +215,17 @@ void RimIntersectionResultDefinition::fieldChangedByUi( const caf::PdmFieldHandl
}
this->updateConnectedEditors();
RimIntersectionResultsDefinitionCollection* interResDefColl = nullptr;
this->firstAncestorOrThisOfType( interResDefColl );
bool isInAction = isActive() && interResDefColl && interResDefColl->isActive();
if ( changedField == &m_isActive || ( changedField == &m_timeStep && isInAction ) )
{
RimGridView* gridView = nullptr;
this->firstAncestorOrThisOfType( gridView );
if ( gridView ) gridView->scheduleCreateDisplayModelAndRedraw();
}
}
//--------------------------------------------------------------------------------------------------
@ -310,3 +323,14 @@ void RimIntersectionResultDefinition::initAfterRead()
m_geomResultDefinition->setGeoMechCase( geomCase );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimIntersectionResultDefinition::isInAction() const
{
RimIntersectionResultsDefinitionCollection* interResDefColl = nullptr;
this->firstAncestorOrThisOfType( interResDefColl );
return isActive() && interResDefColl && interResDefColl->isActive();
}

View File

@ -38,7 +38,8 @@ public:
RimIntersectionResultDefinition();
~RimIntersectionResultDefinition() override;
bool isActive();
bool isActive() const;
bool isInAction() const;
QString autoName() const;
RimCase* activeCase() const;
bool isEclipseResultDefinition();

View File

@ -19,6 +19,7 @@
#include "RimIntersectionResultsDefinitionCollection.h"
#include "RimIntersectionResultDefinition.h"
#include "RimGridView.h"
CAF_PDM_SOURCE_INIT( RimIntersectionResultsDefinitionCollection, "RimIntersectionResultsDefinitionCollection" );
@ -78,6 +79,10 @@ void RimIntersectionResultsDefinitionCollection::fieldChangedByUi( const caf::Pd
const QVariant& newValue )
{
this->updateUiIconFromToggleField();
RimGridView* gridView = nullptr;
this->firstAncestorOrThisOfType(gridView);
if ( gridView ) gridView->scheduleCreateDisplayModelAndRedraw();
}
//--------------------------------------------------------------------------------------------------