Do not show well cells when wells are turned off

Renaming
p4#: 22141
This commit is contained in:
Magne Sjaastad
2013-08-08 17:15:17 +02:00
parent e747804ef4
commit 562dfb0135
4 changed files with 11 additions and 9 deletions

View File

@@ -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;

View File

@@ -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)

View File

@@ -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;
}

View File

@@ -68,7 +68,7 @@ public:
typedef caf::AppEnum<RimWellCollection::WellFenceType> WellFenceEnum;
caf::PdmField<bool> showWellLabel;
caf::PdmField<bool> active;
caf::PdmField<bool> isActive;
caf::PdmField<WellCellsRangeFilterEnum> wellCellsToRangeFilterMode;
caf::PdmField<bool> showWellCellFences;