mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Linked Views: isActive() as access method. doSync methots renamed to update
and changed the meaning accordingly.
This commit is contained in:
parent
1933bbeb84
commit
03c788db6a
@ -331,7 +331,7 @@ void RimEclipseView::createDisplayModel()
|
||||
// For property filtered geometry : just set all the models as empty scenes
|
||||
// updateCurrentTimeStep requests the actual parts
|
||||
|
||||
if (this->viewController() && this->viewController()->isVisibleCellsOveridden()
|
||||
if ((this->viewController() && this->viewController()->isVisibleCellsOveridden())
|
||||
|| !this->propertyFilterCollection()->hasActiveFilters())
|
||||
{
|
||||
std::vector<RivCellSetEnum> geometryTypesToAdd;
|
||||
|
@ -53,8 +53,8 @@ RimViewController::RimViewController(void)
|
||||
{
|
||||
CAF_PDM_InitObject("View Link", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
|
||||
isActive.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitField(&m_isActive, "Active", true, "Active", "", "", "");
|
||||
m_isActive.uiCapability()->setUiHidden(true);
|
||||
|
||||
QString defaultName = "View Config: Empty view";
|
||||
CAF_PDM_InitField(&m_name, "Name", defaultName, "Managed View Name", "", "", "");
|
||||
@ -145,30 +145,25 @@ void RimViewController::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrder
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
if (changedField == &isActive)
|
||||
if (changedField == &m_isActive)
|
||||
{
|
||||
updateDisplayNameAndIcon();
|
||||
if (m_syncCamera()) doSyncCamera();
|
||||
if (m_syncTimeStep()) doSyncTimeStep();
|
||||
if (m_syncCellResult()) doSyncCellResult();
|
||||
updateCameraLink();
|
||||
updateTimeStepLink();
|
||||
updateResultColorsControl();
|
||||
updateOverrides();
|
||||
updateDisplayNameAndIcon();
|
||||
}
|
||||
else if (changedField == &m_syncCamera && m_syncCamera())
|
||||
else if (changedField == &m_syncCamera)
|
||||
{
|
||||
doSyncCamera();
|
||||
updateCameraLink();
|
||||
}
|
||||
else if (changedField == &m_syncTimeStep && m_syncTimeStep())
|
||||
else if (changedField == &m_syncTimeStep )
|
||||
{
|
||||
doSyncTimeStep();
|
||||
updateTimeStepLink();
|
||||
}
|
||||
else if (changedField == &m_syncCellResult)
|
||||
{
|
||||
if (m_syncCellResult())
|
||||
{
|
||||
doSyncCellResult();
|
||||
}
|
||||
else
|
||||
{
|
||||
updateResultColorsControl();
|
||||
if (managedEclipseView())
|
||||
{
|
||||
managedEclipseView()->cellResult()->updateIconState();
|
||||
@ -178,7 +173,6 @@ void RimViewController::fieldChangedByUi(const caf::PdmFieldHandle* changedField
|
||||
managedGeoView()->cellResult()->updateIconState();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (changedField == &m_syncRangeFilters)
|
||||
{
|
||||
updateOverrides();
|
||||
@ -275,7 +269,7 @@ void RimViewController::updateOverrides()
|
||||
{
|
||||
RimViewLinker* viewLinker = ownerViewLinker();
|
||||
|
||||
if (!viewLinker->isActive() || !isActive)
|
||||
if (!this->isActive() )
|
||||
{
|
||||
removeOverrides();
|
||||
return;
|
||||
@ -429,7 +423,7 @@ void RimViewController::setManagedView(RimView* view)
|
||||
{
|
||||
m_managedView = view;
|
||||
|
||||
this->initAfterReadRecursively();
|
||||
this->updateOverrides();
|
||||
this->updateOptionSensitivity();
|
||||
this->updateDisplayNameAndIcon();
|
||||
}
|
||||
@ -461,17 +455,15 @@ void RimViewController::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
|
||||
void RimViewController::updateDisplayNameAndIcon()
|
||||
{
|
||||
RimViewLinker::findNameAndIconFromView(&m_name.v(), &m_originalIcon, managedView());
|
||||
RimViewLinker::applyIconEnabledState(this, m_originalIcon, !isActive());
|
||||
RimViewLinker::applyIconEnabledState(this, m_originalIcon, !m_isActive());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::doSyncCamera()
|
||||
void RimViewController::updateCameraLink()
|
||||
{
|
||||
RimViewLinkerCollection* viewLinkerColl = NULL;
|
||||
this->firstAnchestorOrThisOfType(viewLinkerColl);
|
||||
if (!viewLinkerColl->isActive()) return;
|
||||
if (!this->isCameraLinked()) return;
|
||||
|
||||
RimViewLinker* viewLinker = NULL;
|
||||
this->firstAnchestorOrThisOfType(viewLinker);
|
||||
@ -482,11 +474,9 @@ void RimViewController::doSyncCamera()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::doSyncTimeStep()
|
||||
void RimViewController::updateTimeStepLink()
|
||||
{
|
||||
RimViewLinkerCollection* viewLinkerColl = NULL;
|
||||
this->firstAnchestorOrThisOfType(viewLinkerColl);
|
||||
if (!viewLinkerColl->isActive()) return;
|
||||
if (!this->isTimeStepLinked()) return;
|
||||
|
||||
if (m_managedView)
|
||||
{
|
||||
@ -499,8 +489,10 @@ void RimViewController::doSyncTimeStep()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::doSyncCellResult()
|
||||
void RimViewController::updateResultColorsControl()
|
||||
{
|
||||
if (!this->isResultColorControlled()) return;
|
||||
|
||||
RimViewLinker* viewLinker = ownerViewLinker();
|
||||
viewLinker->updateCellResult();
|
||||
}
|
||||
@ -628,11 +620,12 @@ bool RimViewController::isMasterAndDepViewDifferentType()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::scheduleCreateDisplayModelAndRedrawForDependentView()
|
||||
{
|
||||
if (!this->isActive) return;
|
||||
if (!this->isActive()) return;
|
||||
|
||||
if (this->isVisibleCellsOveridden()
|
||||
|| this->m_syncPropertyFilters()
|
||||
|| this->m_syncRangeFilters()
|
||||
|| this->isRangeFilterOveridden()
|
||||
|| this->isPropertyFilterOveridden()
|
||||
|| this->isResultColorControlled()
|
||||
)
|
||||
{
|
||||
if (this->managedView())
|
||||
@ -647,31 +640,40 @@ void RimViewController::scheduleCreateDisplayModelAndRedrawForDependentView()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::scheduleGeometryRegenForDepViews(RivCellSetEnum geometryType)
|
||||
{
|
||||
if (!this->isActive) return;
|
||||
if (!this->isActive()) return;
|
||||
|
||||
if ( this->isVisibleCellsOveridden()
|
||||
|| this->m_syncPropertyFilters()
|
||||
|| this->m_syncRangeFilters()
|
||||
|| this->isRangeFilterOveridden()
|
||||
|| this->isPropertyFilterOveridden()
|
||||
|| this->isResultColorControlled()
|
||||
)
|
||||
{
|
||||
if (this->managedView())
|
||||
{
|
||||
if (this->isVisibleCellsOveridden()) {
|
||||
if (this->isVisibleCellsOveridden())
|
||||
{
|
||||
this->managedView()->scheduleGeometryRegen(OVERRIDDEN_CELL_VISIBILITY);
|
||||
}
|
||||
else{
|
||||
|
||||
this->managedView()->scheduleGeometryRegen(geometryType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isActive()
|
||||
{
|
||||
return ownerViewLinker()->isActive() && this->m_isActive();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isCameraLinked()
|
||||
{
|
||||
if (ownerViewLinker()->isActive() && this->isActive())
|
||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||
{
|
||||
return m_syncCamera;
|
||||
}
|
||||
@ -686,7 +688,7 @@ bool RimViewController::isCameraLinked()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isTimeStepLinked()
|
||||
{
|
||||
if (ownerViewLinker()->isActive() && this->isActive())
|
||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||
{
|
||||
return m_syncTimeStep;
|
||||
}
|
||||
@ -701,7 +703,7 @@ bool RimViewController::isTimeStepLinked()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isResultColorControlled()
|
||||
{
|
||||
if (ownerViewLinker()->isActive() && this->isActive())
|
||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||
{
|
||||
return m_syncCellResult;
|
||||
}
|
||||
@ -718,7 +720,7 @@ bool RimViewController::isVisibleCellsOveridden()
|
||||
{
|
||||
if (isMasterAndDepViewDifferentType())
|
||||
{
|
||||
if (ownerViewLinker()->isActive() && this->isActive())
|
||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||
{
|
||||
return m_syncVisibleCells();
|
||||
}
|
||||
@ -739,7 +741,7 @@ bool RimViewController::isVisibleCellsOveridden()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isRangeFilterOveridden()
|
||||
{
|
||||
if (ownerViewLinker()->isActive() && this->isActive())
|
||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||
{
|
||||
return m_syncRangeFilters;
|
||||
}
|
||||
@ -754,7 +756,7 @@ bool RimViewController::isRangeFilterOveridden()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isPropertyFilterOveridden()
|
||||
{
|
||||
if (ownerViewLinker()->isActive() && this->isActive())
|
||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||
{
|
||||
return m_syncPropertyFilters;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
RimViewController(void);
|
||||
virtual ~RimViewController(void);
|
||||
|
||||
caf::PdmField<bool> isActive;
|
||||
bool isActive();
|
||||
|
||||
RimView* managedView();
|
||||
void setManagedView(RimView* view);
|
||||
@ -82,12 +82,12 @@ protected: // Pdm overridden methods
|
||||
virtual void initAfterRead();
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() { return &m_name; }
|
||||
virtual caf::PdmFieldHandle* objectToggleField() { return &isActive; }
|
||||
virtual caf::PdmFieldHandle* objectToggleField() { return &m_isActive; }
|
||||
|
||||
private:
|
||||
void doSyncCamera();
|
||||
void doSyncTimeStep();
|
||||
void doSyncCellResult();
|
||||
void updateCameraLink();
|
||||
void updateTimeStepLink();
|
||||
void updateResultColorsControl();
|
||||
|
||||
bool isMasterAndDepViewDifferentType();
|
||||
|
||||
@ -98,6 +98,7 @@ private:
|
||||
caf::PdmField<QString> m_name;
|
||||
caf::PdmPtrField<RimView*> m_managedView;
|
||||
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmField<bool> m_syncCamera;
|
||||
caf::PdmField<bool> m_syncTimeStep;
|
||||
|
||||
|
@ -93,7 +93,7 @@ void RimViewLinker::updateTimeStep(RimView* sourceView, int timeStep)
|
||||
RimViewController* sourceViewLink = sourceView->viewController();
|
||||
CVF_ASSERT(sourceViewLink);
|
||||
|
||||
if (!sourceViewLink->isActive() || !sourceViewLink->isTimeStepLinked())
|
||||
if (!sourceViewLink->isTimeStepLinked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -108,26 +108,24 @@ void RimViewLinker::updateTimeStep(RimView* sourceView, int timeStep)
|
||||
for (size_t i = 0; i < viewLinks.size(); i++)
|
||||
{
|
||||
RimViewController* viewLink = viewLinks[i];
|
||||
if (!viewLink->isActive) continue;
|
||||
|
||||
if (viewLink->managedView() && viewLink->managedView() != sourceView)
|
||||
{
|
||||
if (viewLink->isTimeStepLinked() && viewLink->managedView()->viewer())
|
||||
if (!viewLink->isTimeStepLinked()) continue;
|
||||
|
||||
if ( viewLink->managedView()
|
||||
&& viewLink->managedView() != sourceView
|
||||
&& viewLink->managedView()->viewer())
|
||||
{
|
||||
viewLink->managedView()->viewer()->setCurrentFrame(timeStep);
|
||||
viewLink->managedView()->viewer()->animationControl()->setCurrentFrameOnly(timeStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateCellResult()
|
||||
{
|
||||
if (!isActive()) return;
|
||||
|
||||
RimView* rimView = m_masterView;
|
||||
RimEclipseView* masterEclipseView = dynamic_cast<RimEclipseView*>(rimView);
|
||||
if (masterEclipseView && masterEclipseView->cellResult())
|
||||
@ -137,7 +135,6 @@ void RimViewLinker::updateCellResult()
|
||||
for (size_t i = 0; i < viewLinks.size(); i++)
|
||||
{
|
||||
RimViewController* viewLink = viewLinks[i];
|
||||
if (!viewLink->isActive) continue;
|
||||
|
||||
if (viewLink->managedView())
|
||||
{
|
||||
@ -167,7 +164,6 @@ void RimViewLinker::updateCellResult()
|
||||
for (size_t i = 0; i < viewLinks.size(); i++)
|
||||
{
|
||||
RimViewController* viewLink = viewLinks[i];
|
||||
if (!viewLink->isActive) continue;
|
||||
|
||||
if (viewLink->managedView())
|
||||
{
|
||||
@ -194,12 +190,11 @@ void RimViewLinker::updateCellResult()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateOverrides()
|
||||
{
|
||||
bool isViewlinkerActive = this->isActive();
|
||||
|
||||
for (size_t i = 0; i < viewLinks.size(); i++)
|
||||
{
|
||||
RimViewController* viewLink = viewLinks[i];
|
||||
if (isViewlinkerActive && viewLink->isActive)
|
||||
if (viewLink->isActive())
|
||||
{
|
||||
viewLink->updateOverrides();
|
||||
}
|
||||
@ -240,7 +235,7 @@ void RimViewLinker::allViewsForCameraSync(RimView* source, std::vector<RimView*>
|
||||
{
|
||||
if (viewLinks[i]->managedView() && source != viewLinks[i]->managedView())
|
||||
{
|
||||
if (viewLinks[i]->isActive() && viewLinks[i]->isCameraLinked())
|
||||
if (viewLinks[i]->isCameraLinked())
|
||||
{
|
||||
views.push_back(viewLinks[i]->managedView());
|
||||
}
|
||||
@ -345,7 +340,7 @@ void RimViewLinker::updateScaleZ(RimView* sourceView, double scaleZ)
|
||||
RimViewController* sourceViewLink = sourceView->viewController();
|
||||
CVF_ASSERT(sourceViewLink);
|
||||
|
||||
if (!sourceViewLink->isActive() || !sourceViewLink->isCameraLinked())
|
||||
if (!sourceViewLink->isCameraLinked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -468,7 +463,7 @@ void RimViewLinker::updateCamera(RimView* sourceView)
|
||||
RimViewController* viewLink = sourceView->viewController();
|
||||
if (viewLink)
|
||||
{
|
||||
if ((!viewLink->isActive() || !viewLink->isCameraLinked()))
|
||||
if (!viewLink->isCameraLinked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user