mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Managed views can use range filters from master view
RangeFilterCollection is now a private field in RimView
This commit is contained in:
parent
dc7735a67d
commit
e5f0bdfaab
@ -31,6 +31,7 @@
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimManagedViewCollection.h"
|
||||
|
||||
#include "cafPdmUiEditorHandle.h"
|
||||
|
||||
@ -59,14 +60,6 @@ RimCellRangeFilterCollection::~RimCellRangeFilterCollection()
|
||||
rangeFilters.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCellRangeFilterCollection::setReservoirView(RimView* reservoirView)
|
||||
{
|
||||
m_reservoirView = reservoirView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// RimCellRangeFilter is using Eclipse 1-based indexing, adjust filter values before
|
||||
// populating cvf::CellRangeFilter (which is 0-based)
|
||||
@ -131,7 +124,7 @@ RigMainGrid* RimCellRangeFilterCollection::mainGrid() const
|
||||
RigActiveCellInfo* RimCellRangeFilterCollection::activeCellInfo() const
|
||||
{
|
||||
RimEclipseView* eclipseView = this->eclipseView();
|
||||
if (eclipseView )
|
||||
if (eclipseView)
|
||||
{
|
||||
return eclipseView->currentActiveCellInfo();
|
||||
}
|
||||
@ -154,18 +147,16 @@ void RimCellRangeFilterCollection::updateUiUpdateDisplayModel()
|
||||
{
|
||||
this->updateUiIconFromToggleField();
|
||||
|
||||
m_reservoirView->scheduleGeometryRegen(RANGE_FILTERED);
|
||||
m_reservoirView->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
||||
RimView* rimView = NULL;
|
||||
firstAnchestorOrThisOfType(rimView);
|
||||
|
||||
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
rimView->scheduleGeometryRegen(RANGE_FILTERED);
|
||||
rimView->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimView* RimCellRangeFilterCollection::reservoirView()
|
||||
{
|
||||
return m_reservoirView;
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
|
||||
// Notify managed views of range filter change in master view
|
||||
rimView->managedViewCollection()->updateRangeFilters();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -173,7 +164,7 @@ RimView* RimCellRangeFilterCollection::reservoirView()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseView* RimCellRangeFilterCollection::eclipseView() const
|
||||
{
|
||||
return dynamic_cast<RimEclipseView*>(m_reservoirView);
|
||||
return dynamic_cast<RimEclipseView*>(baseView());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -226,7 +217,6 @@ bool RimCellRangeFilterCollection::hasActiveIncludeFilters() const
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -303,16 +293,25 @@ QString RimCellRangeFilterCollection::gridName(int gridIndex) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemPartCollection* RimCellRangeFilterCollection::femPartColl() const
|
||||
{
|
||||
RimGeoMechView* eclipseView = dynamic_cast<RimGeoMechView*>(m_reservoirView);
|
||||
|
||||
if (eclipseView &&
|
||||
eclipseView->geoMechCase() &&
|
||||
eclipseView->geoMechCase()->geoMechData() )
|
||||
RimGeoMechView* geoView = dynamic_cast<RimGeoMechView*>(baseView());
|
||||
if (geoView &&
|
||||
geoView->geoMechCase() &&
|
||||
geoView->geoMechCase()->geoMechData() )
|
||||
{
|
||||
|
||||
return eclipseView->geoMechCase()->geoMechData()->femParts();
|
||||
return geoView->geoMechCase()->geoMechData()->femParts();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimView* RimCellRangeFilterCollection::baseView() const
|
||||
{
|
||||
RimView* rimView = NULL;
|
||||
firstAnchestorOrThisOfType(rimView);
|
||||
|
||||
return rimView;
|
||||
}
|
||||
|
||||
|
@ -47,9 +47,6 @@ public:
|
||||
bool hasActiveFilters() const;
|
||||
bool hasActiveIncludeFilters() const;
|
||||
|
||||
void setReservoirView(RimView* reservoirView);
|
||||
|
||||
RimView* reservoirView();
|
||||
const cvf::StructGridInterface* gridByIndex(int gridIndex) const;
|
||||
int gridCount() const;
|
||||
QString gridName(int gridIndex) const;
|
||||
@ -66,11 +63,11 @@ protected:
|
||||
// Overridden methods
|
||||
virtual void initAfterRead();
|
||||
|
||||
private:
|
||||
RimView* baseView() const;
|
||||
|
||||
private:
|
||||
RimEclipseView* eclipseView() const;
|
||||
RigMainGrid* mainGrid() const;
|
||||
RigFemPartCollection* femPartColl() const;
|
||||
|
||||
RimView* m_reservoirView;
|
||||
};
|
||||
|
@ -97,10 +97,9 @@ RimEclipseView::RimEclipseView()
|
||||
faultCollection = new RimFaultCollection;
|
||||
faultCollection.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&rangeFilterCollection, "RangeFilters", "Range Filters", "", "", "");
|
||||
rangeFilterCollection = new RimCellRangeFilterCollection();
|
||||
rangeFilterCollection.uiCapability()->setUiHidden(true);
|
||||
rangeFilterCollection->setReservoirView(this);
|
||||
CAF_PDM_InitFieldNoDefault(&m_rangeFilterCollection, "RangeFilters", "Range Filters", "", "", "");
|
||||
m_rangeFilterCollection = new RimCellRangeFilterCollection();
|
||||
m_rangeFilterCollection.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&propertyFilterCollection, "PropertyFilters", "Property Filters", "", "", "");
|
||||
propertyFilterCollection = new RimEclipsePropertyFilterCollection();
|
||||
@ -135,7 +134,7 @@ RimEclipseView::~RimEclipseView()
|
||||
delete this->cellResult();
|
||||
delete this->cellEdgeResult();
|
||||
|
||||
delete rangeFilterCollection();
|
||||
delete m_rangeFilterCollection;
|
||||
delete propertyFilterCollection();
|
||||
delete wellCollection();
|
||||
delete faultCollection();
|
||||
@ -232,7 +231,7 @@ void RimEclipseView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
{
|
||||
createDisplayModelAndRedraw();
|
||||
}
|
||||
else if (changedField == &rangeFilterCollection)
|
||||
else if (changedField == &m_rangeFilterCollection)
|
||||
{
|
||||
m_reservoirGridPartManager->scheduleGeometryRegen(RANGE_FILTERED);
|
||||
m_reservoirGridPartManager->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
||||
@ -467,7 +466,7 @@ void RimEclipseView::createDisplayModel()
|
||||
}
|
||||
else
|
||||
{
|
||||
overlayInfoConfig()->update3DInfo();
|
||||
m_overlayInfoConfig()->update3DInfo();
|
||||
updateLegends();
|
||||
}
|
||||
}
|
||||
@ -647,7 +646,7 @@ void RimEclipseView::updateCurrentTimeStep()
|
||||
}
|
||||
}
|
||||
|
||||
overlayInfoConfig()->update3DInfo();
|
||||
m_overlayInfoConfig()->update3DInfo();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -707,7 +706,6 @@ void RimEclipseView::initAfterRead()
|
||||
this->faultResultSettings()->setReservoirView(this);
|
||||
this->cellResult()->setReservoirView(this);
|
||||
this->cellEdgeResult()->setReservoirView(this);
|
||||
this->rangeFilterCollection()->setReservoirView(this);
|
||||
this->propertyFilterCollection()->setReservoirView(this);
|
||||
|
||||
this->updateUiIconFromToggleField();
|
||||
|
@ -70,10 +70,9 @@ RimGeoMechView::RimGeoMechView(void)
|
||||
cellResult = new RimGeoMechCellColors();
|
||||
cellResult.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&rangeFilterCollection, "RangeFilters", "Range Filters", "", "", "");
|
||||
rangeFilterCollection = new RimCellRangeFilterCollection();
|
||||
rangeFilterCollection->setReservoirView(this);
|
||||
rangeFilterCollection.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_rangeFilterCollection, "RangeFilters", "Range Filters", "", "", "");
|
||||
m_rangeFilterCollection = new RimCellRangeFilterCollection();
|
||||
m_rangeFilterCollection.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&propertyFilterCollection, "PropertyFilters", "Property Filters", "", "", "");
|
||||
propertyFilterCollection = new RimGeoMechPropertyFilterCollection();
|
||||
@ -252,7 +251,7 @@ void RimGeoMechView::createDisplayModel()
|
||||
{
|
||||
updateLegends();
|
||||
m_vizLogic->updateStaticCellColors(-1);
|
||||
overlayInfoConfig()->update3DInfo();
|
||||
m_overlayInfoConfig()->update3DInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@ -303,7 +302,7 @@ void RimGeoMechView::updateCurrentTimeStep()
|
||||
m_viewer->animationControl()->slotPause(); // To avoid animation timer spinning in the background
|
||||
}
|
||||
|
||||
overlayInfoConfig()->update3DInfo();
|
||||
m_overlayInfoConfig()->update3DInfo();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -116,3 +116,29 @@ void RimManagedViewCollection::updateResult(RimEclipseResultDefinition* resultDe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimManagedViewCollection::updateRangeFilters()
|
||||
{
|
||||
for (size_t i = 0; i < managedViews.size(); i++)
|
||||
{
|
||||
RimManagedViewConfig* managedViewConfig = managedViews[i];
|
||||
if (managedViewConfig->managedView())
|
||||
{
|
||||
if (managedViewConfig->syncRangeFilters())
|
||||
{
|
||||
RimView* rimView = managedViewConfig->managedView();
|
||||
RimEclipseView* eclipeView = dynamic_cast<RimEclipseView*>(rimView);
|
||||
if (eclipeView)
|
||||
{
|
||||
eclipeView->scheduleGeometryRegen(RANGE_FILTERED);
|
||||
eclipeView->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
||||
|
||||
eclipeView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,4 +46,6 @@ public:
|
||||
void updateViewers(RiuViewer* masterViewer);
|
||||
void updateTimeStep(int timeStep);
|
||||
void updateResult(RimEclipseResultDefinition* resultDefinition);
|
||||
|
||||
void updateRangeFilters();
|
||||
};
|
||||
|
@ -22,9 +22,12 @@
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimView.h"
|
||||
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
|
||||
@ -39,9 +42,10 @@ RimManagedViewConfig::RimManagedViewConfig(void)
|
||||
CAF_PDM_InitFieldNoDefault(&managedView, "ManagedView", "Managed View", "", "", "");
|
||||
managedView.uiCapability()->setUiChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&syncCamera, "SyncCamera", true, "Sync Camera", "", "", "");
|
||||
CAF_PDM_InitField(&syncCellResult, "SyncCellResult", true, "Sync Cell Result", "", "", "");
|
||||
CAF_PDM_InitField(&syncTimeStep, "SyncTimeStep", true, "Sync Time Step", "", "", "");
|
||||
CAF_PDM_InitField(&syncCamera, "SyncCamera", true, "Sync Camera", "", "", "");
|
||||
CAF_PDM_InitField(&syncCellResult, "SyncCellResult", true, "Sync Cell Result", "", "", "");
|
||||
CAF_PDM_InitField(&syncTimeStep, "SyncTimeStep", true, "Sync Time Step", "", "", "");
|
||||
CAF_PDM_InitField(&syncRangeFilters,"SyncRangeFilters", true, "Sync Range Filters", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -115,3 +119,72 @@ void RimManagedViewConfig::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOr
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimManagedViewConfig::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
if (changedField == &syncCamera || changedField == &syncTimeStep)
|
||||
{
|
||||
RimView* masterView = NULL;
|
||||
firstAnchestorOrThisOfType(masterView);
|
||||
|
||||
masterView->viewer()->update();
|
||||
}
|
||||
else if (changedField == &syncRangeFilters)
|
||||
{
|
||||
configureOverrides();
|
||||
|
||||
if (managedView)
|
||||
{
|
||||
managedView->rangeFilterCollection()->updateUiUpdateDisplayModel();
|
||||
}
|
||||
}
|
||||
else if (changedField == &managedView)
|
||||
{
|
||||
configureOverrides();
|
||||
|
||||
if (managedView)
|
||||
{
|
||||
managedView->rangeFilterCollection()->updateUiUpdateDisplayModel();
|
||||
}
|
||||
|
||||
PdmObjectHandle* prevValue = oldValue.value<caf::PdmPointer<PdmObjectHandle> >().rawPtr();
|
||||
if (prevValue)
|
||||
{
|
||||
RimView* rimView = dynamic_cast<RimView*>(prevValue);
|
||||
rimView->setOverrideRangeFilterCollection(NULL);
|
||||
rimView->rangeFilterCollection()->updateUiUpdateDisplayModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimManagedViewConfig::configureOverrides()
|
||||
{
|
||||
RimView* masterView = NULL;
|
||||
firstAnchestorOrThisOfType(masterView);
|
||||
|
||||
if (managedView)
|
||||
{
|
||||
if (syncRangeFilters)
|
||||
{
|
||||
managedView->setOverrideRangeFilterCollection(masterView->rangeFilterCollection());
|
||||
}
|
||||
else
|
||||
{
|
||||
managedView->setOverrideRangeFilterCollection(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimManagedViewConfig::initAfterRead()
|
||||
{
|
||||
configureOverrides();
|
||||
}
|
||||
|
||||
|
@ -42,11 +42,15 @@ public:
|
||||
caf::PdmField<bool> syncCamera;
|
||||
caf::PdmField<bool> syncCellResult;
|
||||
caf::PdmField<bool> syncTimeStep;
|
||||
caf::PdmField<bool> syncRangeFilters;
|
||||
|
||||
protected:
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "");
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "");
|
||||
virtual void initAfterRead();
|
||||
|
||||
private:
|
||||
void allVisibleViews(std::vector<RimView*>& views);
|
||||
void configureOverrides();
|
||||
};
|
||||
|
@ -4,9 +4,10 @@
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
#include "RimManagedViewCollection.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimManagedViewCollection.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
@ -89,10 +90,10 @@ RimView::RimView(void)
|
||||
managedViewCollection = new RimManagedViewCollection;
|
||||
managedViewCollection.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&overlayInfoConfig, "OverlayInfoConfig", "Info Box", "", "", "");
|
||||
overlayInfoConfig = new Rim3dOverlayInfoConfig();
|
||||
overlayInfoConfig->setReservoirView(this);
|
||||
overlayInfoConfig.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_overlayInfoConfig, "OverlayInfoConfig", "Info Box", "", "", "");
|
||||
m_overlayInfoConfig = new Rim3dOverlayInfoConfig();
|
||||
m_overlayInfoConfig->setReservoirView(this);
|
||||
m_overlayInfoConfig.uiCapability()->setUiHidden(true);
|
||||
|
||||
caf::AppEnum<RimView::MeshModeType> defaultMeshType = NO_MESH;
|
||||
if (preferences->defaultGridLines) defaultMeshType = FULL_MESH;
|
||||
@ -109,7 +110,7 @@ RimView::RimView(void)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimView::~RimView(void)
|
||||
{
|
||||
delete this->overlayInfoConfig();
|
||||
delete this->m_overlayInfoConfig();
|
||||
|
||||
if (m_viewer)
|
||||
{
|
||||
@ -498,3 +499,41 @@ void RimView::addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
|
||||
|
||||
wellPathModelBasicList->updateBoundingBoxesRecursive();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimCellRangeFilterCollection* RimView::rangeFilterCollection()
|
||||
{
|
||||
if (m_overrideRangeFilterCollection)
|
||||
{
|
||||
return m_overrideRangeFilterCollection;
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_rangeFilterCollection;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimCellRangeFilterCollection* RimView::rangeFilterCollection() const
|
||||
{
|
||||
if (m_overrideRangeFilterCollection)
|
||||
{
|
||||
return m_overrideRangeFilterCollection;
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_rangeFilterCollection;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimView::setOverrideRangeFilterCollection(RimCellRangeFilterCollection* rfc)
|
||||
{
|
||||
m_overrideRangeFilterCollection = rfc;
|
||||
}
|
||||
|
@ -69,10 +69,13 @@ public:
|
||||
caf::PdmField<int> maximumFrameRate;
|
||||
caf::PdmField<bool> hasUserRequestedAnimation;
|
||||
|
||||
caf::PdmChildField<RimCellRangeFilterCollection*> rangeFilterCollection;
|
||||
|
||||
caf::PdmChildField<RimManagedViewCollection*> managedViewCollection;
|
||||
|
||||
RimCellRangeFilterCollection* rangeFilterCollection();
|
||||
const RimCellRangeFilterCollection* rangeFilterCollection() const;
|
||||
void setOverrideRangeFilterCollection(RimCellRangeFilterCollection* rfc);
|
||||
|
||||
|
||||
// Draw style
|
||||
|
||||
enum MeshModeType
|
||||
@ -147,8 +150,11 @@ protected:
|
||||
|
||||
QPointer<RiuViewer> m_viewer;
|
||||
|
||||
caf::PdmField<int> m_currentTimeStep;
|
||||
caf::PdmChildField<Rim3dOverlayInfoConfig*> overlayInfoConfig;
|
||||
caf::PdmField<int> m_currentTimeStep;
|
||||
caf::PdmChildField<Rim3dOverlayInfoConfig*> m_overlayInfoConfig;
|
||||
|
||||
caf::PdmChildField<RimCellRangeFilterCollection*> m_rangeFilterCollection;
|
||||
caf::PdmPointer<RimCellRangeFilterCollection> m_overrideRangeFilterCollection;
|
||||
|
||||
// Overridden PDM methods:
|
||||
virtual void setupBeforeSave();
|
||||
|
Loading…
Reference in New Issue
Block a user