mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Propagate changes to managed views of children
This commit is contained in:
@@ -124,6 +124,9 @@ void RimManagedViewCollection::updateCellResult()
|
||||
eclipeView->cellResult()->setResultVariable(eclipseCellResultDefinition->resultVariable());
|
||||
}
|
||||
}
|
||||
|
||||
// Notify recursively
|
||||
managedViewConfig->managedView()->managedViewCollection()->updateCellResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,6 +151,9 @@ void RimManagedViewCollection::updateCellResult()
|
||||
geoView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
// Notify recursively
|
||||
managedViewConfig->managedView()->managedViewCollection()->updateCellResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,6 +190,9 @@ void RimManagedViewCollection::updateRangeFilters()
|
||||
geoView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
// Notify recursively
|
||||
managedViewConfig->managedView()->managedViewCollection()->updateRangeFilters();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -204,21 +213,35 @@ void RimManagedViewCollection::updatePropertyFilters()
|
||||
RimEclipseView* eclipeView = dynamic_cast<RimEclipseView*>(rimView);
|
||||
if (eclipeView)
|
||||
{
|
||||
eclipeView->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
eclipeView->scheduleGeometryRegen(RANGE_FILTERED);
|
||||
eclipeView->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
||||
|
||||
eclipeView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
/*
|
||||
RimGeoMechView* geoView = dynamic_cast<RimGeoMechView*>(rimView);
|
||||
if (geoView)
|
||||
{
|
||||
geoView->scheduleGeometryRegen(RANGE_FILTERED);
|
||||
geoView->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
||||
geoView->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
|
||||
geoView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// Notify recursively
|
||||
managedViewConfig->managedView()->managedViewCollection()->updatePropertyFilters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimManagedViewCollection::configureOverrides()
|
||||
{
|
||||
for (size_t i = 0; i < managedViews.size(); i++)
|
||||
{
|
||||
RimManagedViewConfig* managedViewConfig = managedViews[i];
|
||||
managedViewConfig->configureOverridesUpdateDisplayModel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,4 +48,6 @@ public:
|
||||
|
||||
void updateRangeFilters();
|
||||
void updatePropertyFilters();
|
||||
|
||||
void configureOverrides();
|
||||
};
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
#include "RimEclipsePropertyFilterCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimGeoMechPropertyFilterCollection.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimManagedViewCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimView.h"
|
||||
@@ -32,8 +34,6 @@
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimGeoMechPropertyFilterCollection.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimManagedViewConfig, "RimManagedViewConfig");
|
||||
@@ -152,38 +152,18 @@ void RimManagedViewConfig::fieldChangedByUi(const caf::PdmFieldHandle* changedFi
|
||||
}
|
||||
else if (changedField == &syncRangeFilters)
|
||||
{
|
||||
configureOverrides();
|
||||
|
||||
if (managedView)
|
||||
{
|
||||
managedView->rangeFilterCollection()->updateDisplayModeNotifyManagedViews();
|
||||
}
|
||||
configureOverridesUpdateDisplayModel();
|
||||
}
|
||||
else if (changedField == &syncPropertyFilters)
|
||||
{
|
||||
configureOverrides();
|
||||
|
||||
RimEclipseView* eclipseView = managedEclipseView();
|
||||
if (eclipseView)
|
||||
{
|
||||
eclipseView->propertyFilterCollection()->updateDisplayModelNotifyManagedViews();
|
||||
}
|
||||
|
||||
RimGeoMechView* geoView = managedGeoView();
|
||||
if (geoView)
|
||||
{
|
||||
geoView->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
geoView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
configureOverridesUpdateDisplayModel();
|
||||
}
|
||||
else if (changedField == &managedView)
|
||||
{
|
||||
configureOverrides();
|
||||
configureOverridesUpdateDisplayModel();
|
||||
|
||||
if (managedView)
|
||||
{
|
||||
managedView->rangeFilterCollection()->updateDisplayModeNotifyManagedViews();
|
||||
|
||||
if (syncCellResult())
|
||||
{
|
||||
RimView* masterView = NULL;
|
||||
@@ -218,7 +198,35 @@ void RimManagedViewConfig::fieldChangedByUi(const caf::PdmFieldHandle* changedFi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimManagedViewConfig::configureOverrides()
|
||||
void RimManagedViewConfig::initAfterRead()
|
||||
{
|
||||
configureOverridesUpdateDisplayModel();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseView* RimManagedViewConfig::managedEclipseView()
|
||||
{
|
||||
RimView* rimView = managedView;
|
||||
|
||||
return dynamic_cast<RimEclipseView*>(rimView);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGeoMechView* RimManagedViewConfig::managedGeoView()
|
||||
{
|
||||
RimView* rimView = managedView;
|
||||
|
||||
return dynamic_cast<RimGeoMechView*>(rimView);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimManagedViewConfig::configureOverridesUpdateDisplayModel()
|
||||
{
|
||||
RimView* masterView = NULL;
|
||||
firstAnchestorOrThisOfType(masterView);
|
||||
@@ -267,34 +275,26 @@ void RimManagedViewConfig::configureOverrides()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Propagate overrides in current view to managed views
|
||||
managedView->managedViewCollection()->configureOverrides();
|
||||
}
|
||||
|
||||
if (managedView)
|
||||
{
|
||||
managedView->rangeFilterCollection()->updateDisplayModeNotifyManagedViews();
|
||||
}
|
||||
|
||||
RimEclipseView* eclipseView = managedEclipseView();
|
||||
if (eclipseView)
|
||||
{
|
||||
eclipseView->propertyFilterCollection()->updateDisplayModelNotifyManagedViews();
|
||||
}
|
||||
|
||||
RimGeoMechView* geoView = managedGeoView();
|
||||
if (geoView)
|
||||
{
|
||||
geoView->propertyFilterCollection()->updateDisplayModelNotifyManagedViews();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimManagedViewConfig::initAfterRead()
|
||||
{
|
||||
configureOverrides();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseView* RimManagedViewConfig::managedEclipseView()
|
||||
{
|
||||
RimView* rimView = managedView;
|
||||
|
||||
return dynamic_cast<RimEclipseView*>(rimView);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGeoMechView* RimManagedViewConfig::managedGeoView()
|
||||
{
|
||||
RimView* rimView = managedView;
|
||||
|
||||
return dynamic_cast<RimGeoMechView*>(rimView);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ public:
|
||||
caf::PdmField<bool> syncRangeFilters;
|
||||
caf::PdmField<bool> syncPropertyFilters;
|
||||
|
||||
void configureOverridesUpdateDisplayModel();
|
||||
|
||||
protected:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||
@@ -55,7 +57,6 @@ protected:
|
||||
|
||||
private:
|
||||
void allVisibleViews(std::vector<RimView*>& views);
|
||||
void configureOverrides();
|
||||
|
||||
RimEclipseView* managedEclipseView();
|
||||
RimGeoMechView* managedGeoView();
|
||||
|
||||
Reference in New Issue
Block a user