mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Whitespace
This commit is contained in:
@@ -2,17 +2,17 @@
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "RigGeoMechCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimCellRangeFilter.h"
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
@@ -39,11 +40,10 @@
|
||||
#include "RimGeoMechCellColors.h"
|
||||
#include "RimGeoMechPropertyFilterCollection.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "Rim3dView.h"
|
||||
#include "RimViewLinker.h"
|
||||
#include "RimViewLinkerCollection.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
|
||||
#include "RiuViewer.h"
|
||||
|
||||
@@ -53,10 +53,12 @@
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimViewController, "ViewController");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewController::RimViewController(void)
|
||||
RimViewController::RimViewController()
|
||||
{
|
||||
// clang-format off
|
||||
|
||||
CAF_PDM_InitObject("View Link", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_isActive, "Active", true, "Active", "", "", "");
|
||||
@@ -83,26 +85,29 @@ RimViewController::RimViewController(void)
|
||||
|
||||
CAF_PDM_InitField(&m_syncRangeFilters, "SyncRangeFilters", false, "Range Filters", "", "", "");
|
||||
CAF_PDM_InitField(&m_syncPropertyFilters, "SyncPropertyFilters", false,"Property Filters", "", "", "");
|
||||
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewController::~RimViewController(void)
|
||||
RimViewController::~RimViewController()
|
||||
{
|
||||
this->removeOverrides();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimViewController::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
||||
QList<caf::PdmOptionItemInfo> RimViewController::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if (fieldNeedingOptions == &m_managedView)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
std::vector<RimGridView*> views;
|
||||
proj->allNotLinkedViews(views);
|
||||
|
||||
@@ -124,7 +129,7 @@ QList<caf::PdmOptionItemInfo> RimViewController::calculateValueOptions(const caf
|
||||
}
|
||||
}
|
||||
|
||||
if (options.size() > 0)
|
||||
if (!options.empty())
|
||||
{
|
||||
options.push_front(caf::PdmOptionItemInfo("None", nullptr));
|
||||
}
|
||||
@@ -134,7 +139,7 @@ QList<caf::PdmOptionItemInfo> RimViewController::calculateValueOptions(const caf
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||
{
|
||||
@@ -143,9 +148,11 @@ void RimViewController::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrder
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
void RimViewController::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue)
|
||||
{
|
||||
if (changedField == &m_isActive)
|
||||
{
|
||||
@@ -164,7 +171,7 @@ void RimViewController::fieldChangedByUi(const caf::PdmFieldHandle* changedField
|
||||
{
|
||||
updateCameraLink();
|
||||
}
|
||||
else if (changedField == &m_syncTimeStep )
|
||||
else if (changedField == &m_syncTimeStep)
|
||||
{
|
||||
updateTimeStepLink();
|
||||
}
|
||||
@@ -205,8 +212,8 @@ void RimViewController::fieldChangedByUi(const caf::PdmFieldHandle* changedField
|
||||
}
|
||||
else if (changedField == &m_managedView)
|
||||
{
|
||||
PdmObjectHandle* prevValue = oldValue.value<caf::PdmPointer<PdmObjectHandle> >().rawPtr();
|
||||
RimGridView* previousManagedView = dynamic_cast<RimGridView*>(prevValue);
|
||||
PdmObjectHandle* prevValue = oldValue.value<caf::PdmPointer<PdmObjectHandle>>().rawPtr();
|
||||
RimGridView* previousManagedView = dynamic_cast<RimGridView*>(prevValue);
|
||||
RimViewController::removeOverrides(previousManagedView);
|
||||
|
||||
setManagedView(m_managedView());
|
||||
@@ -220,9 +227,8 @@ void RimViewController::fieldChangedByUi(const caf::PdmFieldHandle* changedField
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseView* RimViewController::managedEclipseView() const
|
||||
{
|
||||
@@ -232,7 +238,7 @@ RimEclipseView* RimViewController::managedEclipseView() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGeoMechView* RimViewController::managedGeoView() const
|
||||
{
|
||||
@@ -242,16 +248,16 @@ RimGeoMechView* RimViewController::managedGeoView() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::updateOverrides()
|
||||
{
|
||||
RimViewLinker* viewLinker = ownerViewLinker();
|
||||
|
||||
|
||||
RimGridView* masterView = viewLinker->masterView();
|
||||
|
||||
CVF_ASSERT(masterView);
|
||||
|
||||
|
||||
if (m_managedView)
|
||||
{
|
||||
RimEclipseView* manEclView = managedEclipseView();
|
||||
@@ -269,7 +275,6 @@ void RimViewController::updateOverrides()
|
||||
RimEclipseView* masterEclipseView = dynamic_cast<RimEclipseView*>(masterView);
|
||||
if (masterEclipseView)
|
||||
{
|
||||
|
||||
if (manEclView)
|
||||
{
|
||||
if (isPropertyFilterOveridden())
|
||||
@@ -301,7 +306,7 @@ void RimViewController::updateOverrides()
|
||||
}
|
||||
|
||||
this->updateRangeFilterOverrides(nullptr);
|
||||
|
||||
|
||||
if (manGeoView)
|
||||
{
|
||||
manGeoView->updateIconStateForFilterCollections();
|
||||
@@ -315,7 +320,7 @@ void RimViewController::updateOverrides()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::removeOverrides()
|
||||
{
|
||||
@@ -335,7 +340,7 @@ void RimViewController::removeOverrides()
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::removeOverrides(RimGridView* view)
|
||||
{
|
||||
@@ -346,18 +351,18 @@ void RimViewController::removeOverrides(RimGridView* view)
|
||||
|
||||
if (manEclView) manEclView->setOverridePropertyFilterCollection(nullptr);
|
||||
if (manGeoView) manGeoView->setOverridePropertyFilterCollection(nullptr);
|
||||
|
||||
|
||||
view->setOverrideRangeFilterCollection(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::updateOptionSensitivity()
|
||||
{
|
||||
RimGridView* mainView = nullptr;
|
||||
|
||||
|
||||
{
|
||||
RimViewLinker* linkedViews = nullptr;
|
||||
firstAncestorOrThisOfType(linkedViews);
|
||||
@@ -371,7 +376,7 @@ void RimViewController::updateOptionSensitivity()
|
||||
}
|
||||
|
||||
RimEclipseView* eclipseMasterView = dynamic_cast<RimEclipseView*>(mainView);
|
||||
RimGeoMechView* geoMasterView = dynamic_cast<RimGeoMechView*>(mainView);
|
||||
RimGeoMechView* geoMasterView = dynamic_cast<RimGeoMechView*>(mainView);
|
||||
|
||||
bool isMasterAndDependentViewDifferentType = false;
|
||||
if (eclipseMasterView && !managedEclipseView())
|
||||
@@ -440,7 +445,7 @@ void RimViewController::updateOptionSensitivity()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGridView* RimViewController::managedView() const
|
||||
{
|
||||
@@ -448,7 +453,7 @@ RimGridView* RimViewController::managedView() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::setManagedView(RimGridView* view)
|
||||
{
|
||||
@@ -463,7 +468,7 @@ void RimViewController::setManagedView(RimGridView* view)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
@@ -484,9 +489,8 @@ void RimViewController::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
|
||||
visibleCells->add(&m_syncPropertyFilters);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::updateDisplayNameAndIcon()
|
||||
{
|
||||
@@ -495,7 +499,7 @@ void RimViewController::updateDisplayNameAndIcon()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::updateCameraLink()
|
||||
{
|
||||
@@ -510,22 +514,22 @@ void RimViewController::updateCameraLink()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::updateTimeStepLink()
|
||||
{
|
||||
if (!this->isTimeStepLinked()) return;
|
||||
if (!this->isTimeStepLinked()) return;
|
||||
|
||||
if (m_managedView)
|
||||
{
|
||||
RimViewLinker* viewLinker = this->ownerViewLinker();
|
||||
RimViewLinker* viewLinker = this->ownerViewLinker();
|
||||
|
||||
viewLinker->updateTimeStep(viewLinker->masterView(), viewLinker->masterView()->currentTimeStep());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::updateResultColorsControl()
|
||||
{
|
||||
@@ -536,7 +540,7 @@ void RimViewController::updateResultColorsControl()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::updateLegendDefinitions()
|
||||
{
|
||||
@@ -547,7 +551,7 @@ void RimViewController::updateLegendDefinitions()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewLinker* RimViewController::ownerViewLinker() const
|
||||
{
|
||||
@@ -558,7 +562,7 @@ RimViewLinker* RimViewController::ownerViewLinker() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigCaseToCaseCellMapper* RimViewController::cellMapper()
|
||||
{
|
||||
@@ -582,14 +586,12 @@ const RigCaseToCaseCellMapper* RimViewController::cellMapper()
|
||||
dependEclGrid = dependEclipseView->mainGrid();
|
||||
}
|
||||
|
||||
if (masterGeomechView && masterGeomechView->geoMechCase()->geoMechData()
|
||||
&& masterGeomechView->femParts()->partCount())
|
||||
if (masterGeomechView && masterGeomechView->geoMechCase()->geoMechData() && masterGeomechView->femParts()->partCount())
|
||||
{
|
||||
masterFemPart = masterGeomechView->femParts()->part(0);
|
||||
}
|
||||
|
||||
if (dependGeomechView && dependGeomechView->geoMechCase()->geoMechData()
|
||||
&& dependGeomechView->femParts()->partCount())
|
||||
if (dependGeomechView && dependGeomechView->geoMechCase()->geoMechData() && dependGeomechView->femParts()->partCount())
|
||||
{
|
||||
dependFemPart = dependGeomechView->femParts()->part(0);
|
||||
}
|
||||
@@ -597,17 +599,16 @@ const RigCaseToCaseCellMapper* RimViewController::cellMapper()
|
||||
// If we have the correct mapping already, return it.
|
||||
if (m_caseToCaseCellMapper.notNull())
|
||||
{
|
||||
if ( masterEclGrid == m_caseToCaseCellMapper->masterGrid()
|
||||
&& dependEclGrid == m_caseToCaseCellMapper->dependentGrid()
|
||||
&& masterFemPart == m_caseToCaseCellMapper->masterFemPart()
|
||||
&& dependFemPart == m_caseToCaseCellMapper->dependentFemPart())
|
||||
{
|
||||
return m_caseToCaseCellMapper.p();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_caseToCaseCellMapper = nullptr;
|
||||
}
|
||||
if (masterEclGrid == m_caseToCaseCellMapper->masterGrid() && dependEclGrid == m_caseToCaseCellMapper->dependentGrid() &&
|
||||
masterFemPart == m_caseToCaseCellMapper->masterFemPart() &&
|
||||
dependFemPart == m_caseToCaseCellMapper->dependentFemPart())
|
||||
{
|
||||
return m_caseToCaseCellMapper.p();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_caseToCaseCellMapper = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Create the mapping if needed
|
||||
@@ -626,7 +627,7 @@ const RigCaseToCaseCellMapper* RimViewController::cellMapper()
|
||||
{
|
||||
m_caseToCaseCellMapper = new RigCaseToCaseCellMapper(masterFemPart, dependFemPart);
|
||||
}
|
||||
else if (masterFemPart && dependEclGrid)
|
||||
else if (masterFemPart && dependEclGrid)
|
||||
{
|
||||
m_caseToCaseCellMapper = new RigCaseToCaseCellMapper(masterFemPart, dependEclGrid);
|
||||
}
|
||||
@@ -636,7 +637,7 @@ const RigCaseToCaseCellMapper* RimViewController::cellMapper()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGridView* RimViewController::masterView() const
|
||||
{
|
||||
@@ -644,12 +645,12 @@ RimGridView* RimViewController::masterView() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isMasterAndDepViewDifferentType() const
|
||||
{
|
||||
RimEclipseView* eclipseMasterView = dynamic_cast<RimEclipseView*>(masterView());
|
||||
RimGeoMechView* geoMasterView = dynamic_cast<RimGeoMechView*>(masterView());
|
||||
RimGeoMechView* geoMasterView = dynamic_cast<RimGeoMechView*>(masterView());
|
||||
|
||||
bool isMasterAndDependentViewDifferentType = false;
|
||||
if (eclipseMasterView && !managedEclipseView())
|
||||
@@ -659,23 +660,20 @@ bool RimViewController::isMasterAndDepViewDifferentType() const
|
||||
if (geoMasterView && !managedGeoView())
|
||||
{
|
||||
isMasterAndDependentViewDifferentType = true;
|
||||
}
|
||||
}
|
||||
|
||||
return isMasterAndDependentViewDifferentType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::scheduleCreateDisplayModelAndRedrawForDependentView() const
|
||||
{
|
||||
if (!this->isActive()) return;
|
||||
|
||||
if (this->isVisibleCellsOveridden()
|
||||
|| this->isRangeFiltersControlled()
|
||||
|| this->isPropertyFilterOveridden()
|
||||
|| this->isResultColorControlled()
|
||||
)
|
||||
if (this->isVisibleCellsOveridden() || this->isRangeFiltersControlled() || this->isPropertyFilterOveridden() ||
|
||||
this->isResultColorControlled())
|
||||
{
|
||||
if (this->managedView())
|
||||
{
|
||||
@@ -683,28 +681,25 @@ void RimViewController::scheduleCreateDisplayModelAndRedrawForDependentView() co
|
||||
}
|
||||
}
|
||||
|
||||
if (this->isResultColorControlled() && this->managedView() )
|
||||
if (this->isResultColorControlled() && this->managedView())
|
||||
{
|
||||
this->managedView()->crossSectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::scheduleGeometryRegenForDepViews(RivCellSetEnum geometryType) const
|
||||
{
|
||||
if (!this->isActive()) return;
|
||||
|
||||
if ( this->isVisibleCellsOveridden()
|
||||
|| this->isRangeFiltersControlled()
|
||||
|| this->isPropertyFilterOveridden()
|
||||
|| this->isResultColorControlled()
|
||||
)
|
||||
if (this->isVisibleCellsOveridden() || this->isRangeFiltersControlled() || this->isPropertyFilterOveridden() ||
|
||||
this->isResultColorControlled())
|
||||
{
|
||||
if (this->managedView())
|
||||
{
|
||||
if (this->isVisibleCellsOveridden())
|
||||
if (this->isVisibleCellsOveridden())
|
||||
{
|
||||
this->managedView()->scheduleGeometryRegen(OVERRIDDEN_CELL_VISIBILITY);
|
||||
}
|
||||
@@ -715,7 +710,7 @@ void RimViewController::scheduleGeometryRegenForDepViews(RivCellSetEnum geometry
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isActive() const
|
||||
{
|
||||
@@ -723,7 +718,7 @@ bool RimViewController::isActive() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isCameraLinked() const
|
||||
{
|
||||
@@ -738,7 +733,7 @@ bool RimViewController::isCameraLinked() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::showCursor() const
|
||||
{
|
||||
@@ -746,7 +741,7 @@ bool RimViewController::showCursor() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isTimeStepLinked() const
|
||||
{
|
||||
@@ -761,11 +756,11 @@ bool RimViewController::isTimeStepLinked() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isResultColorControlled() const
|
||||
{
|
||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||
{
|
||||
return m_syncCellResult;
|
||||
}
|
||||
@@ -776,7 +771,7 @@ bool RimViewController::isResultColorControlled() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isLegendDefinitionsControlled() const
|
||||
{
|
||||
@@ -791,7 +786,7 @@ bool RimViewController::isLegendDefinitionsControlled() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isVisibleCellsOveridden() const
|
||||
{
|
||||
@@ -813,12 +808,12 @@ bool RimViewController::isVisibleCellsOveridden() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isRangeFilterControlPossible() const
|
||||
{
|
||||
return true;
|
||||
#if 0
|
||||
#if 0
|
||||
if (!isMasterAndDepViewDifferentType()) return true;
|
||||
|
||||
// Make sure the cases are in the same domain
|
||||
@@ -843,11 +838,11 @@ bool RimViewController::isRangeFilterControlPossible() const
|
||||
}
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isRangeFilterMappingApliccable() const
|
||||
{
|
||||
@@ -855,7 +850,7 @@ bool RimViewController::isRangeFilterMappingApliccable() const
|
||||
|
||||
// Make sure the cases are in the same domain
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(masterView());
|
||||
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>(masterView());
|
||||
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>(masterView());
|
||||
if (!geomView) geomView = managedGeoView();
|
||||
if (!eclipseView) eclipseView = managedEclipseView();
|
||||
|
||||
@@ -864,7 +859,7 @@ bool RimViewController::isRangeFilterMappingApliccable() const
|
||||
if (eclipseView->eclipseCase()->eclipseCaseData() && geomView->geoMechCase() && geomView->geoMechCase()->geoMechData())
|
||||
{
|
||||
RigMainGrid* eclGrid = eclipseView->mainGrid();
|
||||
RigFemPart* femPart = geomView->femParts()->part(0);
|
||||
RigFemPart* femPart = geomView->femParts()->part(0);
|
||||
|
||||
if (eclGrid && femPart)
|
||||
{
|
||||
@@ -878,9 +873,8 @@ bool RimViewController::isRangeFilterMappingApliccable() const
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isRangeFiltersControlled() const
|
||||
{
|
||||
@@ -896,16 +890,16 @@ bool RimViewController::isRangeFiltersControlled() const
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isPropertyFilterControlPossible() const
|
||||
{
|
||||
// The cases need to be the same
|
||||
// The cases need to be the same
|
||||
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>(masterView());
|
||||
|
||||
if (geomView)
|
||||
{
|
||||
RimGeoMechView* depGeomView = managedGeoView();
|
||||
RimGeoMechView* depGeomView = managedGeoView();
|
||||
if (depGeomView && geomView->geoMechCase() == depGeomView->geoMechCase())
|
||||
{
|
||||
return true;
|
||||
@@ -918,23 +912,22 @@ bool RimViewController::isPropertyFilterControlPossible() const
|
||||
{
|
||||
RimEclipseView* depEclipseView = managedEclipseView();
|
||||
if (depEclipseView && eclipseView->eclipseCase() == depEclipseView->eclipseCase())
|
||||
{
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isPropertyFilterOveridden() const
|
||||
{
|
||||
if (!isPropertyFilterControlPossible()) return false;
|
||||
if (!isPropertyFilterControlPossible()) return false;
|
||||
|
||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||
{
|
||||
return m_syncPropertyFilters;
|
||||
}
|
||||
@@ -945,7 +938,7 @@ bool RimViewController::isPropertyFilterOveridden() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::updateRangeFilterOverrides(RimCellRangeFilter* changedRangeFilter)
|
||||
{
|
||||
@@ -964,30 +957,31 @@ void RimViewController::updateRangeFilterOverrides(RimCellRangeFilter* changedRa
|
||||
// Copy the rangeFilterCollection
|
||||
|
||||
RimCellRangeFilterCollection* sourceFilterCollection = masterView()->rangeFilterCollection();
|
||||
QString xmlRangeFilterCollCopy = sourceFilterCollection->writeObjectToXmlString();
|
||||
PdmObjectHandle* objectCopy = PdmXmlObjectHandle::readUnknownObjectFromXmlString(xmlRangeFilterCollCopy, caf::PdmDefaultObjectFactory::instance());
|
||||
QString xmlRangeFilterCollCopy = sourceFilterCollection->writeObjectToXmlString();
|
||||
PdmObjectHandle* objectCopy =
|
||||
PdmXmlObjectHandle::readUnknownObjectFromXmlString(xmlRangeFilterCollCopy, caf::PdmDefaultObjectFactory::instance());
|
||||
RimCellRangeFilterCollection* overrideRangeFilterColl = dynamic_cast<RimCellRangeFilterCollection*>(objectCopy);
|
||||
|
||||
// Convert the range filter to fit in the managed view if needed
|
||||
if (isRangeFilterMappingApliccable())
|
||||
{
|
||||
RimEclipseView* eclipseMasterView = dynamic_cast<RimEclipseView*>(masterView());
|
||||
RimGeoMechView* geoMasterView = dynamic_cast<RimGeoMechView*>(masterView());
|
||||
RimEclipseView* depEclView = managedEclipseView();
|
||||
RimGeoMechView* depGeomView = managedGeoView();
|
||||
RimGeoMechView* geoMasterView = dynamic_cast<RimGeoMechView*>(masterView());
|
||||
RimEclipseView* depEclView = managedEclipseView();
|
||||
RimGeoMechView* depGeomView = managedGeoView();
|
||||
|
||||
if (eclipseMasterView && depGeomView)
|
||||
{
|
||||
if (eclipseMasterView->mainGrid())
|
||||
{
|
||||
RigMainGrid* srcEclGrid = eclipseMasterView->mainGrid();
|
||||
RigFemPart* dstFemPart = depGeomView->femParts()->part(0);
|
||||
RigFemPart* dstFemPart = depGeomView->femParts()->part(0);
|
||||
for (size_t rfIdx = 0; rfIdx < sourceFilterCollection->rangeFilters().size(); ++rfIdx)
|
||||
{
|
||||
RimCellRangeFilter* srcRFilter = sourceFilterCollection->rangeFilters[rfIdx];
|
||||
RimCellRangeFilter* dstRFilter = overrideRangeFilterColl->rangeFilters[rfIdx];
|
||||
RigCaseToCaseRangeFilterMapper::convertRangeFilterEclToFem(srcRFilter, srcEclGrid,
|
||||
dstRFilter, dstFemPart);
|
||||
RigCaseToCaseRangeFilterMapper::convertRangeFilterEclToFem(
|
||||
srcRFilter, srcEclGrid, dstRFilter, dstFemPart);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -995,14 +989,14 @@ void RimViewController::updateRangeFilterOverrides(RimCellRangeFilter* changedRa
|
||||
{
|
||||
if (depEclView->mainGrid())
|
||||
{
|
||||
RigFemPart* srcFemPart = geoMasterView->femParts()->part(0);
|
||||
RigFemPart* srcFemPart = geoMasterView->femParts()->part(0);
|
||||
RigMainGrid* dstEclGrid = depEclView->mainGrid();
|
||||
for (size_t rfIdx = 0; rfIdx < sourceFilterCollection->rangeFilters().size(); ++rfIdx)
|
||||
{
|
||||
RimCellRangeFilter* srcRFilter = sourceFilterCollection->rangeFilters[rfIdx];
|
||||
RimCellRangeFilter* dstRFilter = overrideRangeFilterColl->rangeFilters[rfIdx];
|
||||
RigCaseToCaseRangeFilterMapper::convertRangeFilterFemToEcl(srcRFilter, srcFemPart,
|
||||
dstRFilter, dstEclGrid);
|
||||
RigCaseToCaseRangeFilterMapper::convertRangeFilterFemToEcl(
|
||||
srcRFilter, srcFemPart, dstRFilter, dstEclGrid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1013,7 +1007,7 @@ void RimViewController::updateRangeFilterOverrides(RimCellRangeFilter* changedRa
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::applyRangeFilterCollectionByUserChoice()
|
||||
{
|
||||
@@ -1036,7 +1030,7 @@ void RimViewController::applyRangeFilterCollectionByUserChoice()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::askUserToRestoreOriginalRangeFilterCollection(const QString& viewName)
|
||||
{
|
||||
@@ -1062,4 +1056,3 @@ bool RimViewController::askUserToRestoreOriginalRangeFilterCollection(const QStr
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user