diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp index 6addd85669..cb869f1a26 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp @@ -64,7 +64,7 @@ void RicNewAzimuthDipIntersectionFeature::onActionTriggered(bool isChecked) RimGridView* activeView = RiaApplication::instance()->activeGridView(); if (!activeView) return; - RicNewAzimuthDipIntersectionFeatureCmd* cmd = new RicNewAzimuthDipIntersectionFeatureCmd(activeView->crossSectionCollection); + RicNewAzimuthDipIntersectionFeatureCmd* cmd = new RicNewAzimuthDipIntersectionFeatureCmd(activeView->crossSectionCollection()); caf::CmdExecCommandManager::instance()->processExecuteCommand(cmd); } diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp index 5ce3ae705b..7652bc9902 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp @@ -63,7 +63,7 @@ void RicNewPolylineIntersectionFeature::onActionTriggered(bool isChecked) RimGridView* activeView = RiaApplication::instance()->activeGridView(); if (!activeView) return; - RicNewPolylineIntersectionFeatureCmd* cmd = new RicNewPolylineIntersectionFeatureCmd(activeView->crossSectionCollection); + RicNewPolylineIntersectionFeatureCmd* cmd = new RicNewPolylineIntersectionFeatureCmd(activeView->crossSectionCollection()); caf::CmdExecCommandManager::instance()->processExecuteCommand(cmd); } diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp index 2d20fd4ba3..95caabd24f 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp @@ -56,7 +56,7 @@ void RicNewSimWellIntersectionFeature::onActionTriggered(bool isChecked) simWell->firstAncestorOrThisOfType(eclView); CVF_ASSERT(eclView); - RicNewSimWellIntersectionCmd* cmd = new RicNewSimWellIntersectionCmd(eclView->crossSectionCollection, simWell); + RicNewSimWellIntersectionCmd* cmd = new RicNewSimWellIntersectionCmd(eclView->crossSectionCollection(), simWell); caf::CmdExecCommandManager::instance()->processExecuteCommand(cmd); } diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp index 14386ba0d9..4b78ad8591 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp @@ -65,7 +65,7 @@ void RicNewWellPathIntersectionFeature::onActionTriggered(bool isChecked) RimWellPath* wellPath = collection[0]; - RicNewWellPathIntersectionFeatureCmd* cmd = new RicNewWellPathIntersectionFeatureCmd(activeView->crossSectionCollection, wellPath); + RicNewWellPathIntersectionFeatureCmd* cmd = new RicNewWellPathIntersectionFeatureCmd(activeView->crossSectionCollection(), wellPath); caf::CmdExecCommandManager::instance()->processExecuteCommand(cmd); } diff --git a/ApplicationCode/ProjectDataModel/Rim3dView.cpp b/ApplicationCode/ProjectDataModel/Rim3dView.cpp index e20475cc5e..c37abaa1be 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dView.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dView.cpp @@ -873,9 +873,9 @@ RimGridView::RimGridView() m_overrideRangeFilterCollection.xmlCapability()->setIOWritable(false); m_overrideRangeFilterCollection.xmlCapability()->setIOReadable(false); - CAF_PDM_InitFieldNoDefault(&crossSectionCollection, "CrossSections", "Intersections", "", "", ""); - crossSectionCollection.uiCapability()->setUiHidden(true); - crossSectionCollection = new RimIntersectionCollection(); + CAF_PDM_InitFieldNoDefault(&m_crossSectionCollection, "CrossSections", "Intersections", "", "", ""); + m_crossSectionCollection.uiCapability()->setUiHidden(true); + m_crossSectionCollection = new RimIntersectionCollection(); CAF_PDM_InitFieldNoDefault(&m_gridCollection, "GridCollection", "GridCollection", "", "", ""); m_gridCollection.uiCapability()->setUiHidden(true); @@ -918,7 +918,7 @@ RimGridView::~RimGridView(void) delete m_rangeFilterCollection; delete m_overrideRangeFilterCollection; - delete crossSectionCollection; + delete m_crossSectionCollection; delete m_gridCollection; } @@ -958,6 +958,14 @@ cvf::ref RimGridView::currentTotalCellVisibility() return m_currentReservoirCellVisibility; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimIntersectionCollection* RimGridView::crossSectionCollection() const +{ + return m_crossSectionCollection(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1114,7 +1122,7 @@ void RimGridView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons { if ( changedField == &scaleZ ) { - crossSectionCollection->updateIntersectionBoxGeometry(); + m_crossSectionCollection->updateIntersectionBoxGeometry(); } Rim3dView::fieldChangedByUi(changedField, oldValue, newValue); diff --git a/ApplicationCode/ProjectDataModel/Rim3dView.h b/ApplicationCode/ProjectDataModel/Rim3dView.h index 037bde6a37..154aeb53ae 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dView.h +++ b/ApplicationCode/ProjectDataModel/Rim3dView.h @@ -135,7 +135,6 @@ public: virtual RimCase* ownerCase() const = 0; protected: - void setDefaultView(); RimWellPathCollection* wellPathCollection(); @@ -167,14 +166,14 @@ protected: virtual void resetLegendsInViewer() = 0; protected: // Fields - caf::PdmField m_currentTimeStep; + caf::PdmField m_currentTimeStep; protected: - QPointer m_viewer; + QPointer m_viewer; - cvf::ref m_wellPathPipeVizModel; - cvf::ref m_crossSectionVizModel; - cvf::ref m_highlightVizModel; + cvf::ref m_wellPathPipeVizModel; + cvf::ref m_crossSectionVizModel; + cvf::ref m_highlightVizModel; private: // Overridden PdmObject methods: @@ -220,43 +219,40 @@ class RimGridView : public Rim3dView public: RimGridView(); virtual ~RimGridView(void); -#if 1 - caf::PdmChildField crossSectionCollection; + void showGridCells(bool enableGridCells); + + Rim3dOverlayInfoConfig* overlayInfoConfig() const; + + cvf::ref currentTotalCellVisibility(); - void showGridCells(bool enableGridCells); - - cvf::ref currentTotalCellVisibility(); - - virtual const RimPropertyFilterCollection* propertyFilterCollection() const = 0; - RimCellRangeFilterCollection* rangeFilterCollection(); - const RimCellRangeFilterCollection* rangeFilterCollection() const; - - bool hasOverridenRangeFilterCollection(); - void setOverrideRangeFilterCollection(RimCellRangeFilterCollection* rfc); - void replaceRangeFilterCollectionWithOverride(); - - RimViewController* viewController() const override; - RimViewLinker* assosiatedViewLinker() const override; - - Rim3dOverlayInfoConfig* overlayInfoConfig() const; -protected: - static void removeModelByName(cvf::Scene* scene, const cvf::String& modelName); - - virtual void onTimeStepChanged() override; - - virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility, int timeStep) = 0; - - virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; - - virtual void selectOverlayInfoConfig() override; + RimIntersectionCollection* crossSectionCollection() const; + + virtual const RimPropertyFilterCollection* propertyFilterCollection() const = 0; + RimCellRangeFilterCollection* rangeFilterCollection(); + const RimCellRangeFilterCollection* rangeFilterCollection() const; + + bool hasOverridenRangeFilterCollection(); + void setOverrideRangeFilterCollection(RimCellRangeFilterCollection* rfc); + void replaceRangeFilterCollectionWithOverride(); + + RimViewController* viewController() const override; + RimViewLinker* assosiatedViewLinker() const override; + +protected: + static void removeModelByName(cvf::Scene* scene, const cvf::String& modelName); + + virtual void onTimeStepChanged() override; + virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility, int timeStep) = 0; + virtual void selectOverlayInfoConfig() override; + + virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; protected: // Fields + caf::PdmChildField m_crossSectionCollection; caf::PdmChildField m_overlayInfoConfig; - caf::PdmChildField m_rangeFilterCollection; caf::PdmChildField m_overrideRangeFilterCollection; - caf::PdmChildField m_gridCollection; protected: @@ -265,6 +261,4 @@ protected: private: RimViewLinker* viewLinkerIfMasterView() const; bool m_previousGridModeMeshLinesWasFaults; - -#endif }; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index ee1a547c46..a11c0b488b 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -425,7 +425,7 @@ void RimEclipseView::createDisplayModel() // Cross sections m_crossSectionVizModel->removeAllParts(); - crossSectionCollection->appendPartsToModel(m_crossSectionVizModel.p(), m_reservoirGridPartManager->scaleTransform()); + m_crossSectionCollection->appendPartsToModel(m_crossSectionVizModel.p(), m_reservoirGridPartManager->scaleTransform()); m_viewer->addStaticModelOnce(m_crossSectionVizModel.p()); @@ -654,11 +654,11 @@ void RimEclipseView::updateCurrentTimeStep() if ((this->hasUserRequestedAnimation() && this->cellResult()->hasResult()) || this->cellResult()->isTernarySaturationSelected()) { - crossSectionCollection->updateCellResultColor(m_currentTimeStep); + m_crossSectionCollection->updateCellResultColor(m_currentTimeStep); } else { - crossSectionCollection->applySingleColorEffect(); + m_crossSectionCollection->applySingleColorEffect(); } if (m_viewer) @@ -1474,7 +1474,7 @@ void RimEclipseView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering uiTreeOrdering.add(wellCollection()); uiTreeOrdering.add(faultCollection()); - uiTreeOrdering.add(crossSectionCollection()); + uiTreeOrdering.add(m_crossSectionCollection()); uiTreeOrdering.add(m_rangeFilterCollection()); uiTreeOrdering.add(m_propertyFilterCollection()); diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp index c56cb95534..844ada1509 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp @@ -221,7 +221,7 @@ void RimGeoMechView::createDisplayModel() // Cross sections m_crossSectionVizModel->removeAllParts(); - crossSectionCollection->appendPartsToModel(m_crossSectionVizModel.p(), scaleTransform()); + m_crossSectionCollection->appendPartsToModel(m_crossSectionVizModel.p(), scaleTransform()); m_viewer->addStaticModelOnce(m_crossSectionVizModel.p()); // If the animation was active before recreating everything, make viewer view current frame @@ -234,7 +234,7 @@ void RimGeoMechView::createDisplayModel() { updateLegends(); m_vizLogic->updateStaticCellColors(-1); - crossSectionCollection->applySingleColorEffect(); + m_crossSectionCollection->applySingleColorEffect(); m_overlayInfoConfig()->update3DInfo(); } @@ -290,18 +290,18 @@ void RimGeoMechView::updateCurrentTimeStep() if (this->cellResult()->hasResult()) { - crossSectionCollection->updateCellResultColor(m_currentTimeStep); + m_crossSectionCollection->updateCellResultColor(m_currentTimeStep); } else { - crossSectionCollection->applySingleColorEffect(); + m_crossSectionCollection->applySingleColorEffect(); } } else { m_vizLogic->updateStaticCellColors(-1); - crossSectionCollection->applySingleColorEffect(); + m_crossSectionCollection->applySingleColorEffect(); m_viewer->animationControl()->slotPause(); // To avoid animation timer spinning in the background } @@ -650,7 +650,7 @@ void RimGeoMechView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering uiTreeOrdering.add(cellResult()); - uiTreeOrdering.add(crossSectionCollection()); + uiTreeOrdering.add(m_crossSectionCollection()); uiTreeOrdering.add(m_rangeFilterCollection()); uiTreeOrdering.add(m_propertyFilterCollection());