From 562dfb01359aad0d9a6b87a79b45e460f85cbf63 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 8 Aug 2013 17:15:17 +0200 Subject: [PATCH] Do not show well cells when wells are turned off Renaming p4#: 22141 --- .../RivReservoirPipesPartMgr.cpp | 2 +- ApplicationCode/ProjectDataModel/RimWell.cpp | 2 +- .../ProjectDataModel/RimWellCollection.cpp | 14 ++++++++------ .../ProjectDataModel/RimWellCollection.h | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ApplicationCode/ModelVisualization/RivReservoirPipesPartMgr.cpp b/ApplicationCode/ModelVisualization/RivReservoirPipesPartMgr.cpp index 0da702d648..842990aed1 100644 --- a/ApplicationCode/ModelVisualization/RivReservoirPipesPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivReservoirPipesPartMgr.cpp @@ -98,7 +98,7 @@ void RivReservoirPipesPartMgr::setScaleTransform(cvf::Transform * scaleTransform //-------------------------------------------------------------------------------------------------- void RivReservoirPipesPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex) { - if (!m_reservoirView->wellCollection()->active() ) return; + if (!m_reservoirView->wellCollection()->isActive()) return; if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimWellCollection::PIPES_FORCE_ALL_OFF) return; diff --git a/ApplicationCode/ProjectDataModel/RimWell.cpp b/ApplicationCode/ProjectDataModel/RimWell.cpp index 8d7b53366b..4696461530 100644 --- a/ApplicationCode/ProjectDataModel/RimWell.cpp +++ b/ApplicationCode/ProjectDataModel/RimWell.cpp @@ -153,7 +153,7 @@ bool RimWell::calculateWellPipeVisibility(size_t frameIndex) || frameIndex >= this->wellResults()->m_wellCellsTimeSteps.size()) return false; - if (!m_reservoirView->wellCollection()->active()) + if (!m_reservoirView->wellCollection()->isActive()) return false; if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimWellCollection::PIPES_FORCE_ALL_ON) diff --git a/ApplicationCode/ProjectDataModel/RimWellCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellCollection.cpp index 711a04294e..c3a7009e20 100644 --- a/ApplicationCode/ProjectDataModel/RimWellCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellCollection.cpp @@ -76,8 +76,8 @@ RimWellCollection::RimWellCollection() { CAF_PDM_InitObject("Wells", ":/WellCollection.png", "", ""); - CAF_PDM_InitField(&active, "Active", true, "Active", "", "", ""); - active.setUiHidden(true); + CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", ""); + isActive.setUiHidden(true); CAF_PDM_InitField(&showWellHead, "ShowWellHead", true, "Show well heads", "", "", ""); CAF_PDM_InitField(&showWellLabel, "ShowWellLabel", true, "Show well labels", "", "", ""); @@ -130,6 +130,7 @@ RimWell* RimWellCollection::findWell(QString name) //-------------------------------------------------------------------------------------------------- bool RimWellCollection::hasVisibleWellCells() { + if (!this->isActive()) return false; if (this->wellCellsToRangeFilterMode() == RANGE_ADD_NONE) return false; if (this->wells().size() == 0 ) return false; @@ -164,7 +165,7 @@ bool RimWellCollection::hasVisibleWellCells() //-------------------------------------------------------------------------------------------------- bool RimWellCollection::hasVisibleWellPipes() { - if (!this->active()) return false; + if (!this->isActive()) return false; if (this->wellPipeVisibility() == PIPES_FORCE_ALL_OFF) return false; if (this->wells().size() == 0 ) return false; if (this->wellPipeVisibility() == PIPES_FORCE_ALL_ON) return true; @@ -178,12 +179,13 @@ bool RimWellCollection::hasVisibleWellPipes() //-------------------------------------------------------------------------------------------------- void RimWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) { - if (&showWellLabel == changedField || &active == changedField) + if (&showWellLabel == changedField || &isActive == changedField) { - this->updateUiIconFromState(active); + this->updateUiIconFromState(isActive); if (m_reservoirView) { + m_reservoirView->scheduleGeometryRegen(RivReservoirViewPartMgr::VISIBLE_WELL_CELLS); m_reservoirView->createDisplayModelAndRedraw(); } } @@ -276,7 +278,7 @@ void RimWellCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin //-------------------------------------------------------------------------------------------------- caf::PdmFieldHandle* RimWellCollection::objectToggleField() { - return &active; + return &isActive; } diff --git a/ApplicationCode/ProjectDataModel/RimWellCollection.h b/ApplicationCode/ProjectDataModel/RimWellCollection.h index 4ef7434171..15b061f867 100644 --- a/ApplicationCode/ProjectDataModel/RimWellCollection.h +++ b/ApplicationCode/ProjectDataModel/RimWellCollection.h @@ -68,7 +68,7 @@ public: typedef caf::AppEnum WellFenceEnum; caf::PdmField showWellLabel; - caf::PdmField active; + caf::PdmField isActive; caf::PdmField wellCellsToRangeFilterMode; caf::PdmField showWellCellFences;