mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#552 Linked Views : Added const for clarity
This commit is contained in:
@@ -231,7 +231,7 @@ void RimViewController::fieldChangedByUi(const caf::PdmFieldHandle* changedField
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimEclipseView* RimViewController::managedEclipseView()
|
RimEclipseView* RimViewController::managedEclipseView() const
|
||||||
{
|
{
|
||||||
RimView* rimView = m_managedView;
|
RimView* rimView = m_managedView;
|
||||||
|
|
||||||
@@ -241,7 +241,7 @@ RimEclipseView* RimViewController::managedEclipseView()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimGeoMechView* RimViewController::managedGeoView()
|
RimGeoMechView* RimViewController::managedGeoView() const
|
||||||
{
|
{
|
||||||
RimView* rimView = m_managedView;
|
RimView* rimView = m_managedView;
|
||||||
|
|
||||||
@@ -442,7 +442,7 @@ void RimViewController::updateOptionSensitivity()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimView* RimViewController::managedView()
|
RimView* RimViewController::managedView() const
|
||||||
{
|
{
|
||||||
return m_managedView;
|
return m_managedView;
|
||||||
}
|
}
|
||||||
@@ -549,7 +549,7 @@ void RimViewController::updateLegendDefinitions()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimViewLinker* RimViewController::ownerViewLinker()
|
RimViewLinker* RimViewController::ownerViewLinker() const
|
||||||
{
|
{
|
||||||
RimViewLinker* viewLinker = NULL;
|
RimViewLinker* viewLinker = NULL;
|
||||||
this->firstAncestorOrThisOfType(viewLinker);
|
this->firstAncestorOrThisOfType(viewLinker);
|
||||||
@@ -628,7 +628,7 @@ const RigCaseToCaseCellMapper* RimViewController::cellMapper()
|
|||||||
}
|
}
|
||||||
else if (masterFemPart && dependEclGrid)
|
else if (masterFemPart && dependEclGrid)
|
||||||
{
|
{
|
||||||
m_caseToCaseCellMapper = new RigCaseToCaseCellMapper(masterFemPart, dependEclGrid);
|
m_caseToCaseCellMapper = new RigCaseToCaseCellMapper(masterFemPart, dependEclGrid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -638,7 +638,7 @@ const RigCaseToCaseCellMapper* RimViewController::cellMapper()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimView* RimViewController::masterView()
|
RimView* RimViewController::masterView() const
|
||||||
{
|
{
|
||||||
return ownerViewLinker()->masterView();
|
return ownerViewLinker()->masterView();
|
||||||
}
|
}
|
||||||
@@ -646,7 +646,7 @@ RimView* RimViewController::masterView()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimViewController::isMasterAndDepViewDifferentType()
|
bool RimViewController::isMasterAndDepViewDifferentType() const
|
||||||
{
|
{
|
||||||
RimEclipseView* eclipseMasterView = dynamic_cast<RimEclipseView*>(masterView());
|
RimEclipseView* eclipseMasterView = dynamic_cast<RimEclipseView*>(masterView());
|
||||||
RimGeoMechView* geoMasterView = dynamic_cast<RimGeoMechView*>(masterView());
|
RimGeoMechView* geoMasterView = dynamic_cast<RimGeoMechView*>(masterView());
|
||||||
@@ -667,7 +667,7 @@ bool RimViewController::isMasterAndDepViewDifferentType()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimViewController::scheduleCreateDisplayModelAndRedrawForDependentView()
|
void RimViewController::scheduleCreateDisplayModelAndRedrawForDependentView() const
|
||||||
{
|
{
|
||||||
if (!this->isActive()) return;
|
if (!this->isActive()) return;
|
||||||
|
|
||||||
@@ -687,7 +687,7 @@ void RimViewController::scheduleCreateDisplayModelAndRedrawForDependentView()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimViewController::scheduleGeometryRegenForDepViews(RivCellSetEnum geometryType)
|
void RimViewController::scheduleGeometryRegenForDepViews(RivCellSetEnum geometryType) const
|
||||||
{
|
{
|
||||||
if (!this->isActive()) return;
|
if (!this->isActive()) return;
|
||||||
|
|
||||||
@@ -712,7 +712,7 @@ void RimViewController::scheduleGeometryRegenForDepViews(RivCellSetEnum geometry
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimViewController::isActive()
|
bool RimViewController::isActive() const
|
||||||
{
|
{
|
||||||
return ownerViewLinker()->isActive() && this->m_isActive();
|
return ownerViewLinker()->isActive() && this->m_isActive();
|
||||||
}
|
}
|
||||||
@@ -720,7 +720,7 @@ bool RimViewController::isActive()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimViewController::isCameraLinked()
|
bool RimViewController::isCameraLinked() const
|
||||||
{
|
{
|
||||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||||
{
|
{
|
||||||
@@ -743,7 +743,7 @@ bool RimViewController::showCursor() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimViewController::isTimeStepLinked()
|
bool RimViewController::isTimeStepLinked() const
|
||||||
{
|
{
|
||||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||||
{
|
{
|
||||||
@@ -758,7 +758,7 @@ bool RimViewController::isTimeStepLinked()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimViewController::isResultColorControlled()
|
bool RimViewController::isResultColorControlled() const
|
||||||
{
|
{
|
||||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||||
{
|
{
|
||||||
@@ -773,7 +773,7 @@ bool RimViewController::isResultColorControlled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimViewController::isLegendDefinitionsControlled()
|
bool RimViewController::isLegendDefinitionsControlled() const
|
||||||
{
|
{
|
||||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||||
{
|
{
|
||||||
@@ -788,7 +788,7 @@ bool RimViewController::isLegendDefinitionsControlled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimViewController::isVisibleCellsOveridden()
|
bool RimViewController::isVisibleCellsOveridden() const
|
||||||
{
|
{
|
||||||
if (isMasterAndDepViewDifferentType())
|
if (isMasterAndDepViewDifferentType())
|
||||||
{
|
{
|
||||||
@@ -810,7 +810,7 @@ bool RimViewController::isVisibleCellsOveridden()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimViewController::isRangeFilterControlPossible()
|
bool RimViewController::isRangeFilterControlPossible() const
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
#if 0
|
#if 0
|
||||||
@@ -844,7 +844,7 @@ bool RimViewController::isRangeFilterControlPossible()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimViewController::isRangeFilterMappingApliccable()
|
bool RimViewController::isRangeFilterMappingApliccable() const
|
||||||
{
|
{
|
||||||
if (!isMasterAndDepViewDifferentType()) return false;
|
if (!isMasterAndDepViewDifferentType()) return false;
|
||||||
|
|
||||||
@@ -877,7 +877,7 @@ bool RimViewController::isRangeFilterMappingApliccable()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimViewController::isRangeFiltersControlled()
|
bool RimViewController::isRangeFiltersControlled() const
|
||||||
{
|
{
|
||||||
if (!isRangeFilterControlPossible()) return false;
|
if (!isRangeFilterControlPossible()) return false;
|
||||||
|
|
||||||
@@ -893,7 +893,7 @@ bool RimViewController::isRangeFiltersControlled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimViewController::isPropertyFilterControlPossible()
|
bool RimViewController::isPropertyFilterControlPossible() const
|
||||||
{
|
{
|
||||||
// The cases need to be the same
|
// The cases need to be the same
|
||||||
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>(masterView());
|
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>(masterView());
|
||||||
@@ -925,7 +925,7 @@ bool RimViewController::isPropertyFilterControlPossible()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimViewController::isPropertyFilterOveridden()
|
bool RimViewController::isPropertyFilterOveridden() const
|
||||||
{
|
{
|
||||||
if (!isPropertyFilterControlPossible()) return false;
|
if (!isPropertyFilterControlPossible()) return false;
|
||||||
|
|
||||||
|
|||||||
@@ -47,29 +47,29 @@ public:
|
|||||||
RimViewController(void);
|
RimViewController(void);
|
||||||
virtual ~RimViewController(void);
|
virtual ~RimViewController(void);
|
||||||
|
|
||||||
bool isActive();
|
bool isActive() const;
|
||||||
|
|
||||||
RimView* managedView();
|
RimView* managedView() const;
|
||||||
void setManagedView(RimView* view);
|
void setManagedView(RimView* view);
|
||||||
|
|
||||||
RimView* masterView();
|
RimView* masterView() const;
|
||||||
RimViewLinker* ownerViewLinker();
|
RimViewLinker* ownerViewLinker() const;
|
||||||
|
|
||||||
const RigCaseToCaseCellMapper* cellMapper();
|
const RigCaseToCaseCellMapper* cellMapper();
|
||||||
|
|
||||||
bool isCameraLinked();
|
bool isCameraLinked() const;
|
||||||
bool showCursor() const;
|
bool showCursor() const;
|
||||||
bool isTimeStepLinked();
|
bool isTimeStepLinked() const;
|
||||||
|
|
||||||
bool isResultColorControlled();
|
bool isResultColorControlled() const;
|
||||||
bool isLegendDefinitionsControlled();
|
bool isLegendDefinitionsControlled() const;
|
||||||
bool isRangeFiltersControlled();
|
bool isRangeFiltersControlled() const;
|
||||||
|
|
||||||
bool isVisibleCellsOveridden();
|
bool isVisibleCellsOveridden() const;
|
||||||
bool isPropertyFilterOveridden();
|
bool isPropertyFilterOveridden() const;
|
||||||
|
|
||||||
void scheduleCreateDisplayModelAndRedrawForDependentView();
|
void scheduleCreateDisplayModelAndRedrawForDependentView() const;
|
||||||
void scheduleGeometryRegenForDepViews(RivCellSetEnum geometryType);
|
void scheduleGeometryRegenForDepViews(RivCellSetEnum geometryType) const;
|
||||||
void updateOverrides();
|
void updateOverrides();
|
||||||
void updateOptionSensitivity();
|
void updateOptionSensitivity();
|
||||||
void removeOverrides();
|
void removeOverrides();
|
||||||
@@ -94,16 +94,17 @@ private:
|
|||||||
void updateResultColorsControl();
|
void updateResultColorsControl();
|
||||||
void updateLegendDefinitions();
|
void updateLegendDefinitions();
|
||||||
|
|
||||||
bool isMasterAndDepViewDifferentType();
|
bool isMasterAndDepViewDifferentType() const;
|
||||||
bool isRangeFilterControlPossible();
|
bool isRangeFilterControlPossible() const;
|
||||||
bool isPropertyFilterControlPossible();
|
bool isPropertyFilterControlPossible() const;
|
||||||
bool isRangeFilterMappingApliccable();
|
bool isRangeFilterMappingApliccable() const;
|
||||||
|
|
||||||
RimEclipseView* managedEclipseView();
|
RimEclipseView* managedEclipseView() const;
|
||||||
RimGeoMechView* managedGeoView();
|
RimGeoMechView* managedGeoView() const;
|
||||||
|
|
||||||
static void removeOverrides(RimView* view);
|
static void removeOverrides(RimView* view);
|
||||||
|
|
||||||
static bool askUserToRestoreOriginalRangeFilterCollection(const QString& viewName);
|
static bool askUserToRestoreOriginalRangeFilterCollection(const QString& viewName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<QString> m_name;
|
caf::PdmField<QString> m_name;
|
||||||
caf::PdmPtrField<RimView*> m_managedView;
|
caf::PdmPtrField<RimView*> m_managedView;
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ void RimViewLinker::removeOverrides()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimViewLinker::allViewsForCameraSync(const RimView* source, std::vector<RimView*>& views)
|
void RimViewLinker::allViewsForCameraSync(const RimView* source, std::vector<RimView*>& views) const
|
||||||
{
|
{
|
||||||
if (!isActive()) return;
|
if (!isActive()) return;
|
||||||
|
|
||||||
@@ -325,7 +325,7 @@ void RimViewLinker::setMasterView(RimView* view)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimView* RimViewLinker::masterView()
|
RimView* RimViewLinker::masterView() const
|
||||||
{
|
{
|
||||||
return m_masterView;
|
return m_masterView;
|
||||||
}
|
}
|
||||||
@@ -385,7 +385,7 @@ void RimViewLinker::updateScaleZ(RimView* sourceView, double scaleZ)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimViewLinker::isActive()
|
bool RimViewLinker::isActive() const
|
||||||
{
|
{
|
||||||
RimViewLinkerCollection* viewLinkerCollection = NULL;
|
RimViewLinkerCollection* viewLinkerCollection = NULL;
|
||||||
this->firstAncestorOrThisOfType(viewLinkerCollection);
|
this->firstAncestorOrThisOfType(viewLinkerCollection);
|
||||||
@@ -510,24 +510,6 @@ void RimViewLinker::updateCursorPosition(const RimView* sourceView, const cvf::V
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimViewLinker::disableCursor()
|
|
||||||
{
|
|
||||||
std::vector<RimView*> viewsToUpdate;
|
|
||||||
allViewsForCameraSync(m_masterView, viewsToUpdate);
|
|
||||||
|
|
||||||
for (RimView* destinationView : viewsToUpdate)
|
|
||||||
{
|
|
||||||
RiuViewer* destinationViewer = destinationView->viewer();
|
|
||||||
if (destinationViewer)
|
|
||||||
{
|
|
||||||
destinationViewer->setCursorPosition(cvf::Vec3d::UNDEFINED);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -677,11 +659,11 @@ void RimViewLinker::addDependentView(RimView* view)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimViewLinker::addViewControllers(caf::PdmUiTreeOrdering& uiTreeOrdering)
|
void RimViewLinker::addViewControllers(caf::PdmUiTreeOrdering& uiTreeOrdering) const
|
||||||
{
|
{
|
||||||
for (size_t j = 0; j < m_viewControllers.size(); j++)
|
for (size_t j = 0; j < m_viewControllers.size(); j++)
|
||||||
{
|
{
|
||||||
uiTreeOrdering.add(m_viewControllers()[j]);
|
uiTreeOrdering.add(m_viewControllers[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,10 +53,10 @@ public:
|
|||||||
RimViewLinker(void);
|
RimViewLinker(void);
|
||||||
virtual ~RimViewLinker(void);
|
virtual ~RimViewLinker(void);
|
||||||
|
|
||||||
bool isActive();
|
bool isActive() const;
|
||||||
|
|
||||||
void setMasterView(RimView* view);
|
void setMasterView(RimView* view);
|
||||||
RimView* masterView();
|
RimView* masterView() const;
|
||||||
|
|
||||||
void addDependentView(RimView* view);
|
void addDependentView(RimView* view);
|
||||||
void updateDependentViews();
|
void updateDependentViews();
|
||||||
@@ -80,13 +80,12 @@ public:
|
|||||||
|
|
||||||
void updateUiNameAndIcon();
|
void updateUiNameAndIcon();
|
||||||
|
|
||||||
void addViewControllers(caf::PdmUiTreeOrdering& uiTreeOrdering);
|
void addViewControllers(caf::PdmUiTreeOrdering& uiTreeOrdering) const;
|
||||||
|
|
||||||
static void applyIconEnabledState(caf::PdmObject* obj, const QIcon& icon, bool disable);
|
static void applyIconEnabledState(caf::PdmObject* obj, const QIcon& icon, bool disable);
|
||||||
static void findNameAndIconFromView(QString* name, QIcon* icon, RimView* view);
|
static void findNameAndIconFromView(QString* name, QIcon* icon, RimView* view);
|
||||||
|
|
||||||
void updateCursorPosition(const RimView* sourceView, const cvf::Vec3d& domainCoord);
|
void updateCursorPosition(const RimView* sourceView, const cvf::Vec3d& domainCoord);
|
||||||
void disableCursor();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QString displayNameForView(RimView* view);
|
static QString displayNameForView(RimView* view);
|
||||||
@@ -96,7 +95,7 @@ protected:
|
|||||||
virtual void initAfterRead();
|
virtual void initAfterRead();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void allViewsForCameraSync(const RimView* source, std::vector<RimView*>& views);
|
void allViewsForCameraSync(const RimView* source, std::vector<RimView*>& views) const;
|
||||||
|
|
||||||
void removeOverrides();
|
void removeOverrides();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user