mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-11 07:56:08 -06:00
Whitespace
This commit is contained in:
parent
67b9561c04
commit
20facfd583
@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil ASA
|
||||
//
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@ -25,15 +25,17 @@
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigReservoirGridTools.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
#include "RimTools.h"
|
||||
#include "Rim3dView.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
// clang-format off
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
@ -75,17 +77,18 @@ RimMultiSnapshotDefinition::RimMultiSnapshotDefinition()
|
||||
CAF_PDM_InitFieldNoDefault(&additionalCases, "AdditionalCases", "Cases", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMultiSnapshotDefinition::~RimMultiSnapshotDefinition()
|
||||
{
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimMultiSnapshotDefinition::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
||||
RimMultiSnapshotDefinition::~RimMultiSnapshotDefinition() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimMultiSnapshotDefinition::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
@ -93,9 +96,9 @@ QList<caf::PdmOptionItemInfo> RimMultiSnapshotDefinition::calculateValueOptions(
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo("None", nullptr));
|
||||
|
||||
std::vector<Rim3dView*> views;
|
||||
std::vector<Rim3dView*> views;
|
||||
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
std::vector<RimCase*> cases;
|
||||
proj->allCases(cases);
|
||||
|
||||
@ -114,8 +117,10 @@ QList<caf::PdmOptionItemInfo> RimMultiSnapshotDefinition::calculateValueOptions(
|
||||
}
|
||||
else if (fieldNeedingOptions == &eclipseResultType)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum<RiaDefines::ResultCatType>(RiaDefines::DYNAMIC_NATIVE).uiText(), RiaDefines::DYNAMIC_NATIVE));
|
||||
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum<RiaDefines::ResultCatType>(RiaDefines::STATIC_NATIVE).uiText(), RiaDefines::STATIC_NATIVE));
|
||||
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum<RiaDefines::ResultCatType>(RiaDefines::DYNAMIC_NATIVE).uiText(),
|
||||
RiaDefines::DYNAMIC_NATIVE));
|
||||
options.push_back(caf::PdmOptionItemInfo(caf::AppEnum<RiaDefines::ResultCatType>(RiaDefines::STATIC_NATIVE).uiText(),
|
||||
RiaDefines::STATIC_NATIVE));
|
||||
}
|
||||
else if (fieldNeedingOptions == &selectedEclipseResults)
|
||||
{
|
||||
@ -147,9 +152,9 @@ QList<caf::PdmOptionItemInfo> RimMultiSnapshotDefinition::calculateValueOptions(
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMultiSnapshotDefinition::getTimeStepStrings(QList<caf::PdmOptionItemInfo> &options)
|
||||
void RimMultiSnapshotDefinition::getTimeStepStrings(QList<caf::PdmOptionItemInfo>& options)
|
||||
{
|
||||
if (!view()) return;
|
||||
|
||||
@ -164,9 +169,11 @@ void RimMultiSnapshotDefinition::getTimeStepStrings(QList<caf::PdmOptionItemInfo
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMultiSnapshotDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
void RimMultiSnapshotDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue)
|
||||
{
|
||||
if (changedField == &eclipseResultType)
|
||||
{
|
||||
@ -174,16 +181,16 @@ void RimMultiSnapshotDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
}
|
||||
else if (changedField == &sliceDirection)
|
||||
{
|
||||
const cvf::StructGridInterface* mainGrid = nullptr;
|
||||
const RigActiveCellInfo* actCellInfo = nullptr;
|
||||
|
||||
const cvf::StructGridInterface* mainGrid = nullptr;
|
||||
const RigActiveCellInfo* actCellInfo = nullptr;
|
||||
|
||||
if (view())
|
||||
{
|
||||
actCellInfo = RigReservoirGridTools::activeCellInfo(view());
|
||||
|
||||
RimCase* rimCase = nullptr;
|
||||
view()->firstAncestorOrThisOfTypeAsserted(rimCase);
|
||||
|
||||
|
||||
mainGrid = RigReservoirGridTools::mainGrid(rimCase);
|
||||
}
|
||||
|
||||
@ -219,23 +226,22 @@ void RimMultiSnapshotDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
maxInt = static_cast<int>(max.z());
|
||||
minInt = static_cast<int>(min.z());
|
||||
}
|
||||
|
||||
startSliceIndex = minInt;
|
||||
endSliceIndex = maxInt;
|
||||
|
||||
startSliceIndex = minInt;
|
||||
endSliceIndex = maxInt;
|
||||
}
|
||||
|
||||
|
||||
startSliceIndex.uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimMultiSnapshotDefinition::toOptionList(const QStringList& varList)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> optionList;
|
||||
int i;
|
||||
int i;
|
||||
for (i = 0; i < varList.size(); ++i)
|
||||
{
|
||||
optionList.push_back(caf::PdmOptionItemInfo(varList[i], varList[i]));
|
||||
@ -244,7 +250,7 @@ QList<caf::PdmOptionItemInfo> RimMultiSnapshotDefinition::toOptionList(const QSt
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMultiSnapshotDefinition::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,15 +44,15 @@ class RimViewController : public caf::PdmObject
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimViewController(void);
|
||||
virtual ~RimViewController(void);
|
||||
RimViewController();
|
||||
virtual ~RimViewController();
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
RimGridView* managedView() const;
|
||||
RimGridView* managedView() const;
|
||||
void setManagedView(RimGridView* view);
|
||||
|
||||
RimGridView* masterView() const;
|
||||
RimGridView* masterView() const;
|
||||
RimViewLinker* ownerViewLinker() const;
|
||||
|
||||
const RigCaseToCaseCellMapper* cellMapper();
|
||||
@ -80,13 +80,13 @@ public:
|
||||
|
||||
|
||||
protected: // Pdm overridden methods
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "");
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() { return &m_name; }
|
||||
virtual caf::PdmFieldHandle* objectToggleField() { return &m_isActive; }
|
||||
caf::PdmFieldHandle* userDescriptionField() override { return &m_name; }
|
||||
caf::PdmFieldHandle* objectToggleField() override { return &m_isActive; }
|
||||
|
||||
private:
|
||||
void updateCameraLink();
|
||||
@ -107,7 +107,7 @@ private:
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_name;
|
||||
caf::PdmPtrField<RimGridView*> m_managedView;
|
||||
caf::PdmPtrField<RimGridView*> m_managedView;
|
||||
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmField<bool> m_syncCamera;
|
||||
|
@ -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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@ -23,6 +23,7 @@
|
||||
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseInputCase.h"
|
||||
@ -34,29 +35,27 @@
|
||||
#include "RimGeoMechResultDefinition.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
#include "RimTernaryLegendConfig.h"
|
||||
#include "Rim3dView.h"
|
||||
#include "RimViewController.h"
|
||||
#include "RimViewLinkerCollection.h"
|
||||
#include "RimViewManipulator.h"
|
||||
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "cvfCamera.h"
|
||||
#include "cvfScene.h"
|
||||
#include "cvfMatrix4.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
|
||||
#include "cvfCamera.h"
|
||||
#include "cvfMatrix4.h"
|
||||
#include "cvfScene.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimViewLinker, "ViewLinker");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewLinker::RimViewLinker(void)
|
||||
RimViewLinker::RimViewLinker()
|
||||
{
|
||||
// clang-format off
|
||||
CAF_PDM_InitObject("Linked Views", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_name, "Name", QString("View Group Name"), "View Group Name", "", "", "");
|
||||
@ -69,12 +68,13 @@ RimViewLinker::RimViewLinker(void)
|
||||
CAF_PDM_InitFieldNoDefault(&m_viewControllers, "ManagedViews", "Managed Views", "", "", "");
|
||||
m_viewControllers.uiCapability()->setUiHidden(true);
|
||||
m_viewControllers.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewLinker::~RimViewLinker(void)
|
||||
RimViewLinker::~RimViewLinker()
|
||||
{
|
||||
removeOverrides();
|
||||
|
||||
@ -82,7 +82,7 @@ RimViewLinker::~RimViewLinker(void)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateTimeStep(RimGridView* sourceView, int timeStep)
|
||||
{
|
||||
@ -112,9 +112,7 @@ void RimViewLinker::updateTimeStep(RimGridView* sourceView, int timeStep)
|
||||
|
||||
if (!viewLink->isTimeStepLinked()) continue;
|
||||
|
||||
if ( viewLink->managedView()
|
||||
&& viewLink->managedView() != sourceView
|
||||
&& viewLink->managedView()->viewer())
|
||||
if (viewLink->managedView() && viewLink->managedView() != sourceView && viewLink->managedView()->viewer())
|
||||
{
|
||||
viewLink->managedView()->viewer()->setCurrentFrame(timeStep);
|
||||
}
|
||||
@ -122,11 +120,11 @@ void RimViewLinker::updateTimeStep(RimGridView* sourceView, int timeStep)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateCellResult()
|
||||
{
|
||||
Rim3dView* rimView = m_masterView;
|
||||
Rim3dView* rimView = m_masterView;
|
||||
RimEclipseView* masterEclipseView = dynamic_cast<RimEclipseView*>(rimView);
|
||||
if (masterEclipseView && masterEclipseView->cellResult())
|
||||
{
|
||||
@ -138,7 +136,7 @@ void RimViewLinker::updateCellResult()
|
||||
|
||||
if (viewLink->managedView())
|
||||
{
|
||||
Rim3dView* rimView = viewLink->managedView();
|
||||
Rim3dView* rimView = viewLink->managedView();
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(rimView);
|
||||
if (eclipseView)
|
||||
{
|
||||
@ -149,16 +147,18 @@ void RimViewLinker::updateCellResult()
|
||||
|
||||
if (viewLink->isLegendDefinitionsControlled())
|
||||
{
|
||||
eclipseView->cellResult()->legendConfig()->setUiValuesFromLegendConfig(masterEclipseView->cellResult()->legendConfig());
|
||||
eclipseView->cellResult()->legendConfig()->setUiValuesFromLegendConfig(
|
||||
masterEclipseView->cellResult()->legendConfig());
|
||||
eclipseView->cellResult()->legendConfig()->updateLegend();
|
||||
|
||||
eclipseView->cellResult()->ternaryLegendConfig()->setUiValuesFromLegendConfig(masterEclipseView->cellResult()->ternaryLegendConfig());
|
||||
eclipseView->cellResult()->ternaryLegendConfig()->setUiValuesFromLegendConfig(
|
||||
masterEclipseView->cellResult()->ternaryLegendConfig());
|
||||
}
|
||||
|
||||
eclipseView->scheduleCreateDisplayModelAndRedraw();
|
||||
eclipseView->crossSectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
||||
}
|
||||
|
||||
|
||||
eclipseView->cellResult()->updateIconState();
|
||||
}
|
||||
}
|
||||
@ -176,7 +176,7 @@ void RimViewLinker::updateCellResult()
|
||||
|
||||
if (viewLink->managedView())
|
||||
{
|
||||
Rim3dView* rimView = viewLink->managedView();
|
||||
Rim3dView* rimView = viewLink->managedView();
|
||||
RimGeoMechView* geoView = dynamic_cast<RimGeoMechView*>(rimView);
|
||||
if (geoView)
|
||||
{
|
||||
@ -186,7 +186,8 @@ void RimViewLinker::updateCellResult()
|
||||
|
||||
if (viewLink->isLegendDefinitionsControlled())
|
||||
{
|
||||
geoView->cellResult()->legendConfig()->setUiValuesFromLegendConfig(masterGeoView->cellResult()->legendConfig());
|
||||
geoView->cellResult()->legendConfig()->setUiValuesFromLegendConfig(
|
||||
masterGeoView->cellResult()->legendConfig());
|
||||
geoView->cellResult()->legendConfig()->updateLegend();
|
||||
}
|
||||
|
||||
@ -202,7 +203,7 @@ void RimViewLinker::updateCellResult()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateRangeFilters(RimCellRangeFilter* changedRangeFilter)
|
||||
{
|
||||
@ -214,7 +215,7 @@ void RimViewLinker::updateRangeFilters(RimCellRangeFilter* changedRangeFilter)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateOverrides()
|
||||
{
|
||||
@ -233,7 +234,7 @@ void RimViewLinker::updateOverrides()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::removeOverrides()
|
||||
{
|
||||
@ -247,7 +248,7 @@ void RimViewLinker::removeOverrides()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::allViewsForCameraSync(const RimGridView* source, std::vector<RimGridView*>& views) const
|
||||
{
|
||||
@ -271,7 +272,7 @@ void RimViewLinker::allViewsForCameraSync(const RimGridView* source, std::vector
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateDependentViews()
|
||||
{
|
||||
@ -283,7 +284,7 @@ void RimViewLinker::updateDependentViews()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimViewLinker::displayNameForView(RimGridView* view)
|
||||
{
|
||||
@ -303,7 +304,7 @@ QString RimViewLinker::displayNameForView(RimGridView* view)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::setMasterView(RimGridView* view)
|
||||
{
|
||||
@ -324,7 +325,7 @@ void RimViewLinker::setMasterView(RimGridView* view)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGridView* RimViewLinker::masterView() const
|
||||
{
|
||||
@ -332,7 +333,7 @@ RimGridView* RimViewLinker::masterView() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::allViews(std::vector<RimGridView*>& views) const
|
||||
{
|
||||
@ -348,7 +349,7 @@ void RimViewLinker::allViews(std::vector<RimGridView*>& views) const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::initAfterRead()
|
||||
{
|
||||
@ -356,7 +357,7 @@ void RimViewLinker::initAfterRead()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateScaleZ(RimGridView* sourceView, double scaleZ)
|
||||
{
|
||||
@ -384,13 +385,13 @@ void RimViewLinker::updateScaleZ(RimGridView* sourceView, double scaleZ)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewLinker::isActive() const
|
||||
{
|
||||
RimViewLinkerCollection* viewLinkerCollection = nullptr;
|
||||
this->firstAncestorOrThisOfType(viewLinkerCollection);
|
||||
|
||||
|
||||
if (!viewLinkerCollection)
|
||||
{
|
||||
// This will happen when the all linked views are about to be deleted
|
||||
@ -420,9 +421,8 @@ void RimViewLinker::applyIconEnabledState(caf::PdmObject* obj, const QIcon& icon
|
||||
obj->setUiIcon(newIcon);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateUiNameAndIcon()
|
||||
{
|
||||
@ -431,7 +431,7 @@ void RimViewLinker::updateUiNameAndIcon()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::scheduleGeometryRegenForDepViews(RivCellSetEnum geometryType)
|
||||
{
|
||||
@ -442,7 +442,7 @@ void RimViewLinker::scheduleGeometryRegenForDepViews(RivCellSetEnum geometryType
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::scheduleCreateDisplayModelAndRedrawForDependentViews()
|
||||
{
|
||||
@ -452,9 +452,8 @@ void RimViewLinker::scheduleCreateDisplayModelAndRedrawForDependentViews()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::findNameAndIconFromView(QString* name, QIcon* icon, RimGridView* view)
|
||||
{
|
||||
@ -487,7 +486,7 @@ void RimViewLinker::findNameAndIconFromView(QString* name, QIcon* icon, RimGridV
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateCursorPosition(const RimGridView* sourceView, const cvf::Vec3d& domainCoord)
|
||||
{
|
||||
@ -521,12 +520,12 @@ void RimViewLinker::updateCursorPosition(const RimGridView* sourceView, const cv
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateCamera(RimGridView* sourceView)
|
||||
{
|
||||
if (!sourceView->viewer()) return;
|
||||
|
||||
|
||||
if (!isActive()) return;
|
||||
|
||||
RimViewController* viewLink = sourceView->viewController();
|
||||
@ -545,12 +544,12 @@ void RimViewLinker::updateCamera(RimGridView* sourceView)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::addDependentView(RimGridView* view)
|
||||
{
|
||||
CVF_ASSERT(view && view != m_masterView);
|
||||
|
||||
|
||||
RimViewController* viewContr = new RimViewController;
|
||||
this->m_viewControllers.push_back(viewContr);
|
||||
|
||||
@ -558,7 +557,7 @@ void RimViewLinker::addDependentView(RimGridView* view)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::addViewControllers(caf::PdmUiTreeOrdering& uiTreeOrdering) const
|
||||
{
|
||||
@ -569,7 +568,7 @@ void RimViewLinker::addViewControllers(caf::PdmUiTreeOrdering& uiTreeOrdering) c
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::applyRangeFilterCollectionByUserChoice()
|
||||
{
|
||||
@ -580,10 +579,9 @@ void RimViewLinker::applyRangeFilterCollectionByUserChoice()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::removeViewController(RimViewController* viewController)
|
||||
{
|
||||
m_viewControllers.removeChildObject(viewController);
|
||||
}
|
||||
|
||||
|
@ -48,13 +48,13 @@ class RimViewLinker : public caf::PdmObject
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimViewLinker(void);
|
||||
virtual ~RimViewLinker(void);
|
||||
RimViewLinker();
|
||||
virtual ~RimViewLinker();
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
void setMasterView(RimGridView* view);
|
||||
RimGridView* masterView() const;
|
||||
RimGridView* masterView() const;
|
||||
|
||||
void addDependentView(RimGridView* view);
|
||||
void updateDependentViews();
|
||||
@ -85,20 +85,20 @@ public:
|
||||
|
||||
void updateCursorPosition(const RimGridView* sourceView, const cvf::Vec3d& domainCoord);
|
||||
|
||||
|
||||
protected:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() { return &m_name; }
|
||||
virtual void initAfterRead();
|
||||
static QString displayNameForView(RimGridView* view);
|
||||
caf::PdmFieldHandle* userDescriptionField() override { return &m_name; }
|
||||
void initAfterRead() override;
|
||||
|
||||
private:
|
||||
static QString displayNameForView(RimGridView* view);
|
||||
|
||||
void allViewsForCameraSync(const RimGridView* source, std::vector<RimGridView*>& views) const;
|
||||
|
||||
void removeOverrides();
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimViewController*> m_viewControllers;
|
||||
caf::PdmPtrField<RimGridView*> m_masterView;
|
||||
caf::PdmPtrField<RimGridView*> m_masterView;
|
||||
caf::PdmField<QString> m_name;
|
||||
QIcon m_originalIcon;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user