mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added ManagedViews and sync of camera, time step and cell result
This commit is contained in:
parent
792793b6ed
commit
f6ac177ff2
@ -38,6 +38,7 @@ bool RicToggleItemsFeatureImpl::isToggleCommandsAvailable()
|
|||||||
caf::PdmUiObjectHandle* uiObjectHandle = dynamic_cast<caf::PdmUiObjectHandle*>(selectedItems[0]);
|
caf::PdmUiObjectHandle* uiObjectHandle = dynamic_cast<caf::PdmUiObjectHandle*>(selectedItems[0]);
|
||||||
QModelIndex modIndex = RiuMainWindow::instance()->projectTreeView()->findModelIndex(selectedItems[0]);
|
QModelIndex modIndex = RiuMainWindow::instance()->projectTreeView()->findModelIndex(selectedItems[0]);
|
||||||
caf::PdmUiTreeOrdering* treeItem = static_cast<caf::PdmUiTreeOrdering*>(modIndex.internalPointer());
|
caf::PdmUiTreeOrdering* treeItem = static_cast<caf::PdmUiTreeOrdering*>(modIndex.internalPointer());
|
||||||
|
if (!treeItem) return false;
|
||||||
|
|
||||||
for (int cIdx = 0; cIdx < treeItem->childCount(); ++ cIdx)
|
for (int cIdx = 0; cIdx < treeItem->childCount(); ++ cIdx)
|
||||||
{
|
{
|
||||||
|
@ -59,6 +59,8 @@ ${CEE_CURRENT_LIST_DIR}RimGeoMechCellColors.h
|
|||||||
${CEE_CURRENT_LIST_DIR}RimView.h
|
${CEE_CURRENT_LIST_DIR}RimView.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimCase.h
|
${CEE_CURRENT_LIST_DIR}RimCase.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimTreeViewStateSerializer.h
|
${CEE_CURRENT_LIST_DIR}RimTreeViewStateSerializer.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}RimManagedViewConfig.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}RimManagedViewCollection.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
@ -116,6 +118,8 @@ ${CEE_CURRENT_LIST_DIR}RimGeoMechCellColors.cpp
|
|||||||
${CEE_CURRENT_LIST_DIR}RimView.cpp
|
${CEE_CURRENT_LIST_DIR}RimView.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimCase.cpp
|
${CEE_CURRENT_LIST_DIR}RimCase.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimTreeViewStateSerializer.cpp
|
${CEE_CURRENT_LIST_DIR}RimTreeViewStateSerializer.cpp
|
||||||
|
${CEE_CURRENT_LIST_DIR}RimManagedViewConfig.cpp
|
||||||
|
${CEE_CURRENT_LIST_DIR}RimManagedViewCollection.cpp
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
95
ApplicationCode/ProjectDataModel/RimConnectedViews.cpp
Normal file
95
ApplicationCode/ProjectDataModel/RimConnectedViews.cpp
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RimConnectedViews.h"
|
||||||
|
|
||||||
|
#include "RimView.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldHandle.h"
|
||||||
|
#include "RimProject.h"
|
||||||
|
#include "RiaApplication.h"
|
||||||
|
#include "RimCase.h"
|
||||||
|
|
||||||
|
CAF_PDM_SOURCE_INIT(RimConnectedViews, "RimConnectedViews");
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimConnectedViews::RimConnectedViews(void)
|
||||||
|
{
|
||||||
|
CAF_PDM_InitObject("Connected Views", "", "", "");
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault(&masterView, "MasterView", "Master View", "", "", "");
|
||||||
|
CAF_PDM_InitFieldNoDefault(&slaveView, "SlaveView", "Slave View", "", "", "");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimConnectedViews::~RimConnectedViews(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QList<caf::PdmOptionItemInfo> RimConnectedViews::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
||||||
|
{
|
||||||
|
QList<caf::PdmOptionItemInfo> optionList;
|
||||||
|
|
||||||
|
std::vector<RimView*> views;
|
||||||
|
allViews(views);
|
||||||
|
|
||||||
|
for (size_t i = 0; i< views.size(); i++)
|
||||||
|
{
|
||||||
|
optionList.push_back(caf::PdmOptionItemInfo(views[i]->name(), QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(views[i]))));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (optionList.size() > 0)
|
||||||
|
{
|
||||||
|
optionList.push_front(caf::PdmOptionItemInfo("None", QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(NULL))));
|
||||||
|
}
|
||||||
|
|
||||||
|
return optionList;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimConnectedViews::allViews(std::vector<RimView*>& views)
|
||||||
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
|
||||||
|
if (proj)
|
||||||
|
{
|
||||||
|
std::vector<RimCase*> cases;
|
||||||
|
proj->allCases(cases);
|
||||||
|
for (size_t caseIdx = 0; caseIdx < cases.size(); caseIdx++)
|
||||||
|
{
|
||||||
|
RimCase* rimCase = cases[caseIdx];
|
||||||
|
|
||||||
|
std::vector<RimView*> caseViews = rimCase->views();
|
||||||
|
for (size_t viewIdx = 0; viewIdx < caseViews.size(); viewIdx++)
|
||||||
|
{
|
||||||
|
views.push_back(caseViews[viewIdx]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
48
ApplicationCode/ProjectDataModel/RimConnectedViews.h
Normal file
48
ApplicationCode/ProjectDataModel/RimConnectedViews.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "cafPdmObject.h"
|
||||||
|
#include "cafPdmPtrField.h"
|
||||||
|
|
||||||
|
class RimView;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RimConnectedViews : public caf::PdmObject
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
RimConnectedViews(void);
|
||||||
|
virtual ~RimConnectedViews(void);
|
||||||
|
|
||||||
|
caf::PdmPtrField<RimView*> masterView;
|
||||||
|
caf::PdmPtrField<RimView*> slaveView;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void allViews(std::vector<RimView*>& views);
|
||||||
|
|
||||||
|
};
|
@ -22,13 +22,17 @@
|
|||||||
|
|
||||||
#include "RigCaseCellResultsData.h"
|
#include "RigCaseCellResultsData.h"
|
||||||
#include "RigCaseData.h"
|
#include "RigCaseData.h"
|
||||||
|
|
||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
#include "RimReservoirCellResultsStorage.h"
|
#include "RimEclipseCellColors.h"
|
||||||
|
#include "RimEclipseFaultColors.h"
|
||||||
|
#include "RimEclipsePropertyFilter.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
|
#include "RimManagedViewCollection.h"
|
||||||
|
#include "RimReservoirCellResultsStorage.h"
|
||||||
|
#include "RimView.h"
|
||||||
|
|
||||||
#include "cafPdmUiListEditor.h"
|
#include "cafPdmUiListEditor.h"
|
||||||
#include "RimEclipsePropertyFilter.h"
|
|
||||||
#include "RimEclipseFaultColors.h"
|
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimEclipseResultDefinition, "ResultDefinition");
|
CAF_PDM_SOURCE_INIT(RimEclipseResultDefinition, "ResultDefinition");
|
||||||
|
|
||||||
@ -139,6 +143,16 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
|||||||
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dynamic_cast<RimEclipseCellColors*>(this))
|
||||||
|
{
|
||||||
|
RimView* view = NULL;
|
||||||
|
this->firstAnchestorOrThisOfType(view);
|
||||||
|
if (view)
|
||||||
|
{
|
||||||
|
view->managedViewCollection->updateResult(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RimEclipsePropertyFilter* propFilter = dynamic_cast<RimEclipsePropertyFilter*>(this->parentField()->ownerObject());
|
RimEclipsePropertyFilter* propFilter = dynamic_cast<RimEclipsePropertyFilter*>(this->parentField()->ownerObject());
|
||||||
|
118
ApplicationCode/ProjectDataModel/RimManagedViewCollection.cpp
Normal file
118
ApplicationCode/ProjectDataModel/RimManagedViewCollection.cpp
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RimManagedViewCollection.h"
|
||||||
|
|
||||||
|
#include "RimEclipseCellColors.h"
|
||||||
|
#include "RimEclipseResultDefinition.h"
|
||||||
|
#include "RimEclipseView.h"
|
||||||
|
#include "RimManagedViewConfig.h"
|
||||||
|
#include "RimView.h"
|
||||||
|
|
||||||
|
#include "RiuViewer.h"
|
||||||
|
|
||||||
|
#include "cvfCamera.h"
|
||||||
|
#include "cvfMatrix4.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CAF_PDM_SOURCE_INIT(RimManagedViewCollection, "RimManagedViewCollection");
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimManagedViewCollection::RimManagedViewCollection(void)
|
||||||
|
{
|
||||||
|
CAF_PDM_InitObject("Managed Views", ":/chain.png", "", "");
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault(&managedViews, "ManagedViews", "Managed Views", "", "", "");
|
||||||
|
managedViews.push_back(new RimManagedViewConfig);
|
||||||
|
managedViews.uiCapability()->setUiHidden(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimManagedViewCollection::~RimManagedViewCollection(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimManagedViewCollection::updateViewers(RiuViewer* masterViewer)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < managedViews.size(); i++)
|
||||||
|
{
|
||||||
|
RimManagedViewConfig* managedViewConfig = managedViews[i];
|
||||||
|
if (managedViewConfig->managedView())
|
||||||
|
{
|
||||||
|
if (managedViewConfig->syncCamera() && managedViewConfig->managedView()->viewer())
|
||||||
|
{
|
||||||
|
const cvf::Mat4d mat = masterViewer->mainCamera()->viewMatrix();
|
||||||
|
|
||||||
|
managedViewConfig->managedView()->viewer()->mainCamera()->setViewMatrix(mat);
|
||||||
|
managedViewConfig->managedView()->viewer()->update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimManagedViewCollection::updateTimeStep(int timeStep)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < managedViews.size(); i++)
|
||||||
|
{
|
||||||
|
RimManagedViewConfig* managedViewConfig = managedViews[i];
|
||||||
|
if (managedViewConfig->managedView())
|
||||||
|
{
|
||||||
|
if (managedViewConfig->syncTimeStep() && managedViewConfig->managedView()->viewer())
|
||||||
|
{
|
||||||
|
managedViewConfig->managedView()->viewer()->slotSetCurrentFrame(timeStep);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimManagedViewCollection::updateResult(RimEclipseResultDefinition* resultDefinition)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < managedViews.size(); i++)
|
||||||
|
{
|
||||||
|
RimManagedViewConfig* managedViewConfig = managedViews[i];
|
||||||
|
if (managedViewConfig->managedView())
|
||||||
|
{
|
||||||
|
if (managedViewConfig->syncCellResult())
|
||||||
|
{
|
||||||
|
RimView* rimView = managedViewConfig->managedView();
|
||||||
|
RimEclipseView* eclipeView = dynamic_cast<RimEclipseView*>(rimView);
|
||||||
|
if (eclipeView)
|
||||||
|
{
|
||||||
|
eclipeView->cellResult()->setPorosityModel(resultDefinition->porosityModel());
|
||||||
|
eclipeView->cellResult()->setResultType(resultDefinition->resultType());
|
||||||
|
eclipeView->cellResult()->setResultVariable(resultDefinition->resultVariable());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
49
ApplicationCode/ProjectDataModel/RimManagedViewCollection.h
Normal file
49
ApplicationCode/ProjectDataModel/RimManagedViewCollection.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "RimDefines.h"
|
||||||
|
|
||||||
|
#include "cafPdmChildArrayField.h"
|
||||||
|
#include "cafPdmField.h"
|
||||||
|
#include "cafPdmObject.h"
|
||||||
|
|
||||||
|
class RimEclipseResultDefinition;
|
||||||
|
class RimManagedViewConfig;
|
||||||
|
class RiuViewer;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RimManagedViewCollection : public caf::PdmObject
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
RimManagedViewCollection(void);
|
||||||
|
virtual ~RimManagedViewCollection(void);
|
||||||
|
|
||||||
|
caf::PdmChildArrayField<RimManagedViewConfig*> managedViews;
|
||||||
|
|
||||||
|
void updateViewers(RiuViewer* masterViewer);
|
||||||
|
void updateTimeStep(int timeStep);
|
||||||
|
void updateResult(RimEclipseResultDefinition* resultDefinition);
|
||||||
|
};
|
117
ApplicationCode/ProjectDataModel/RimManagedViewConfig.cpp
Normal file
117
ApplicationCode/ProjectDataModel/RimManagedViewConfig.cpp
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RimManagedViewConfig.h"
|
||||||
|
|
||||||
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
|
#include "RimCase.h"
|
||||||
|
#include "RimProject.h"
|
||||||
|
#include "RimView.h"
|
||||||
|
|
||||||
|
#include "cafPdmUiTreeOrdering.h"
|
||||||
|
|
||||||
|
|
||||||
|
CAF_PDM_SOURCE_INIT(RimManagedViewConfig, "RimManagedViewConfig");
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimManagedViewConfig::RimManagedViewConfig(void)
|
||||||
|
{
|
||||||
|
CAF_PDM_InitObject("View Config", ":/chain.png", "", "");
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault(&managedView, "ManagedView", "Managed View", "", "", "");
|
||||||
|
managedView.uiCapability()->setUiChildrenHidden(true);
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&syncCamera, "SyncCamera", true, "Sync Camera", "", "", "");
|
||||||
|
CAF_PDM_InitField(&syncCellResult, "SyncCellResult", true, "Sync Cell Result", "", "", "");
|
||||||
|
CAF_PDM_InitField(&syncTimeStep, "SyncTimeStep", true, "Sync Time Step", "", "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimManagedViewConfig::~RimManagedViewConfig(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QList<caf::PdmOptionItemInfo> RimManagedViewConfig::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
||||||
|
{
|
||||||
|
QList<caf::PdmOptionItemInfo> optionList;
|
||||||
|
|
||||||
|
if (fieldNeedingOptions == &managedView)
|
||||||
|
{
|
||||||
|
std::vector<RimView*> views;
|
||||||
|
allVisibleViews(views);
|
||||||
|
|
||||||
|
for (size_t i = 0; i< views.size(); i++)
|
||||||
|
{
|
||||||
|
optionList.push_back(caf::PdmOptionItemInfo(views[i]->name(), QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(views[i]))));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (optionList.size() > 0)
|
||||||
|
{
|
||||||
|
optionList.push_front(caf::PdmOptionItemInfo("None", QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(NULL))));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return optionList;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimManagedViewConfig::allVisibleViews(std::vector<RimView*>& views)
|
||||||
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
|
||||||
|
RimView* masterView = NULL;
|
||||||
|
firstAnchestorOrThisOfType(masterView);
|
||||||
|
|
||||||
|
if (proj)
|
||||||
|
{
|
||||||
|
std::vector<RimCase*> cases;
|
||||||
|
proj->allCases(cases);
|
||||||
|
for (size_t caseIdx = 0; caseIdx < cases.size(); caseIdx++)
|
||||||
|
{
|
||||||
|
RimCase* rimCase = cases[caseIdx];
|
||||||
|
|
||||||
|
std::vector<RimView*> caseViews = rimCase->views();
|
||||||
|
for (size_t viewIdx = 0; viewIdx < caseViews.size(); viewIdx++)
|
||||||
|
{
|
||||||
|
if (caseViews[viewIdx]->viewer() && caseViews[viewIdx] != masterView)
|
||||||
|
{
|
||||||
|
views.push_back(caseViews[viewIdx]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimManagedViewConfig::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||||
|
{
|
||||||
|
uiTreeOrdering.setForgetRemainingFields(true);
|
||||||
|
}
|
||||||
|
|
52
ApplicationCode/ProjectDataModel/RimManagedViewConfig.h
Normal file
52
ApplicationCode/ProjectDataModel/RimManagedViewConfig.h
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "cafPdmField.h"
|
||||||
|
#include "cafPdmObject.h"
|
||||||
|
#include "cafPdmPtrField.h"
|
||||||
|
|
||||||
|
class RimView;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RimManagedViewConfig : public caf::PdmObject
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
RimManagedViewConfig(void);
|
||||||
|
virtual ~RimManagedViewConfig(void);
|
||||||
|
|
||||||
|
caf::PdmPtrField<RimView*> managedView;
|
||||||
|
|
||||||
|
caf::PdmField<bool> syncCamera;
|
||||||
|
caf::PdmField<bool> syncCellResult;
|
||||||
|
caf::PdmField<bool> syncTimeStep;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||||
|
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "");
|
||||||
|
|
||||||
|
private:
|
||||||
|
void allVisibleViews(std::vector<RimView*>& views);
|
||||||
|
};
|
@ -26,34 +26,37 @@
|
|||||||
|
|
||||||
#include "RigCaseData.h"
|
#include "RigCaseData.h"
|
||||||
|
|
||||||
|
#include "RiaApplication.h"
|
||||||
|
#include "RimCalcScript.h"
|
||||||
#include "RimCaseCollection.h"
|
#include "RimCaseCollection.h"
|
||||||
#include "RimCommandObject.h"
|
#include "RimCommandObject.h"
|
||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
#include "RimEclipseCaseCollection.h"
|
#include "RimEclipseCaseCollection.h"
|
||||||
|
#include "RimEclipseInputProperty.h"
|
||||||
|
#include "RimEclipseInputPropertyCollection.h"
|
||||||
|
#include "RimEclipseStatisticsCase.h"
|
||||||
|
#include "RimEclipseStatisticsCaseCollection.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimGeoMechCase.h"
|
#include "RimGeoMechCase.h"
|
||||||
#include "RimGeoMechModels.h"
|
#include "RimGeoMechModels.h"
|
||||||
#include "RimIdenticalGridCaseGroup.h"
|
#include "RimIdenticalGridCaseGroup.h"
|
||||||
|
#include "RimManagedViewCollection.h"
|
||||||
|
#include "RimManagedViewConfig.h"
|
||||||
#include "RimOilField.h"
|
#include "RimOilField.h"
|
||||||
#include "RimScriptCollection.h"
|
#include "RimScriptCollection.h"
|
||||||
#include "RimWellPath.h"
|
#include "RimWellPath.h"
|
||||||
#include "RimWellPathCollection.h"
|
#include "RimWellPathCollection.h"
|
||||||
#include "RimWellPathImport.h"
|
#include "RimWellPathImport.h"
|
||||||
#include "RimCalcScript.h"
|
|
||||||
|
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
#include "RiaApplication.h"
|
|
||||||
|
|
||||||
|
#include "ToggleCommands/RicToggleItemsFeatureImpl.h"
|
||||||
|
#include "OctaveScriptCommands/RicExecuteScriptForCasesFeature.h"
|
||||||
|
|
||||||
|
#include "cafCmdFeature.h"
|
||||||
#include "cafPdmUiTreeOrdering.h"
|
#include "cafPdmUiTreeOrdering.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include "cafCmdFeature.h"
|
|
||||||
#include "ToggleCommands/RicToggleItemsFeatureImpl.h"
|
|
||||||
#include "OctaveScriptCommands/RicExecuteScriptForCasesFeature.h"
|
|
||||||
#include "RimEclipseStatisticsCaseCollection.h"
|
|
||||||
#include "RimEclipseStatisticsCase.h"
|
|
||||||
#include "RimEclipseInputProperty.h"
|
|
||||||
#include "RimEclipseInputPropertyCollection.h"
|
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimProject, "ResInsightProject");
|
CAF_PDM_SOURCE_INIT(RimProject, "ResInsightProject");
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -704,6 +707,22 @@ void RimProject::actionsBasedOnSelection(QMenu& contextMenu)
|
|||||||
commandIds << "RicAddScriptPathFeature";
|
commandIds << "RicAddScriptPathFeature";
|
||||||
commandIds << "RicDeleteScriptPathFeature";
|
commandIds << "RicDeleteScriptPathFeature";
|
||||||
}
|
}
|
||||||
|
else if (dynamic_cast<RimManagedViewConfig*>(uiItem))
|
||||||
|
{
|
||||||
|
commandIds << "RicDeleteItemFeature";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dynamic_cast<RimManagedViewCollection*>(uiItem))
|
||||||
|
{
|
||||||
|
RimManagedViewCollection* viewCollection = dynamic_cast<RimManagedViewCollection*>(uiItem);
|
||||||
|
caf::SelectionManager::instance()->setActiveChildArrayFieldHandle(&viewCollection->managedViews);
|
||||||
|
|
||||||
|
commandIds << "PdmListField_AddItem";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
caf::SelectionManager::instance()->setActiveChildArrayFieldHandle(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RicToggleItemsFeatureImpl::isToggleCommandsAvailable())
|
if (RicToggleItemsFeatureImpl::isToggleCommandsAvailable())
|
||||||
|
@ -65,6 +65,7 @@ public:
|
|||||||
caf::PdmField<QString> treeViewState;
|
caf::PdmField<QString> treeViewState;
|
||||||
caf::PdmField<QString> currentModelIndexPath;
|
caf::PdmField<QString> currentModelIndexPath;
|
||||||
|
|
||||||
|
|
||||||
void setScriptDirectories(const QString& scriptDirectories);
|
void setScriptDirectories(const QString& scriptDirectories);
|
||||||
QString projectFileVersionString() const;
|
QString projectFileVersionString() const;
|
||||||
void close();
|
void close();
|
||||||
|
@ -1,24 +1,29 @@
|
|||||||
#include "RimView.h"
|
#include "RimView.h"
|
||||||
#include "cafPdmObjectFactory.h"
|
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "RiaPreferences.h"
|
#include "RiaPreferences.h"
|
||||||
|
|
||||||
#include "Rim3dOverlayInfoConfig.h"
|
#include "Rim3dOverlayInfoConfig.h"
|
||||||
#include "RiuViewer.h"
|
#include "RimOilField.h"
|
||||||
|
#include "RimProject.h"
|
||||||
|
#include "RimManagedViewCollection.h"
|
||||||
|
#include "RimWellPathCollection.h"
|
||||||
|
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
|
#include "RiuViewer.h"
|
||||||
|
|
||||||
|
#include "RivWellPathCollectionPartMgr.h"
|
||||||
|
|
||||||
|
#include "cafFrameAnimationControl.h"
|
||||||
|
#include "cafPdmObjectFactory.h"
|
||||||
#include "cvfCamera.h"
|
#include "cvfCamera.h"
|
||||||
#include "cvfModel.h"
|
#include "cvfModel.h"
|
||||||
#include "cvfModelBasicList.h"
|
#include "cvfModelBasicList.h"
|
||||||
#include "cvfPart.h"
|
#include "cvfPart.h"
|
||||||
#include "cvfScene.h"
|
#include "cvfScene.h"
|
||||||
#include "cvfViewport.h"
|
#include "cvfViewport.h"
|
||||||
#include "cafFrameAnimationControl.h"
|
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include "RimOilField.h"
|
|
||||||
#include "RimWellPathCollection.h"
|
|
||||||
#include "RimProject.h"
|
|
||||||
#include "RivWellPathCollectionPartMgr.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace caf {
|
namespace caf {
|
||||||
@ -80,6 +85,10 @@ RimView::RimView(void)
|
|||||||
CAF_PDM_InitField(&m_currentTimeStep, "CurrentTimeStep", 0, "Current Time Step", "", "", "");
|
CAF_PDM_InitField(&m_currentTimeStep, "CurrentTimeStep", 0, "Current Time Step", "", "", "");
|
||||||
m_currentTimeStep.uiCapability()->setUiHidden(true);
|
m_currentTimeStep.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault(&managedViewCollection, "ManagedViewCollection", "Managed View Collection", "", "", "");
|
||||||
|
managedViewCollection = new RimManagedViewCollection;
|
||||||
|
managedViewCollection.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&overlayInfoConfig, "OverlayInfoConfig", "Info Box", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&overlayInfoConfig, "OverlayInfoConfig", "Info Box", "", "", "");
|
||||||
overlayInfoConfig = new Rim3dOverlayInfoConfig();
|
overlayInfoConfig = new Rim3dOverlayInfoConfig();
|
||||||
overlayInfoConfig->setReservoirView(this);
|
overlayInfoConfig->setReservoirView(this);
|
||||||
@ -443,6 +452,8 @@ void RimView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QV
|
|||||||
if (m_viewer)
|
if (m_viewer)
|
||||||
{
|
{
|
||||||
m_viewer->update();
|
m_viewer->update();
|
||||||
|
|
||||||
|
managedViewCollection->updateTimeStep(m_currentTimeStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (changedField == &backgroundColor)
|
else if (changedField == &backgroundColor)
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "cafAppEnum.h"
|
#include "cafAppEnum.h"
|
||||||
|
#include "cafPdmChildArrayField.h"
|
||||||
#include "cafPdmChildField.h"
|
#include "cafPdmChildField.h"
|
||||||
#include "cafPdmField.h"
|
#include "cafPdmField.h"
|
||||||
#include "cafPdmFieldCvfColor.h"
|
#include "cafPdmFieldCvfColor.h"
|
||||||
@ -30,16 +31,17 @@
|
|||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
class RiuViewer;
|
|
||||||
class Rim3dOverlayInfoConfig;
|
class Rim3dOverlayInfoConfig;
|
||||||
class RimCase;
|
class RimCase;
|
||||||
class RimCellRangeFilterCollection;
|
class RimCellRangeFilterCollection;
|
||||||
|
class RimManagedViewCollection;
|
||||||
|
class RiuViewer;
|
||||||
|
|
||||||
namespace cvf
|
namespace cvf
|
||||||
{
|
{
|
||||||
class BoundingBox;
|
class BoundingBox;
|
||||||
class Scene;
|
|
||||||
class ModelBasicList;
|
class ModelBasicList;
|
||||||
|
class Scene;
|
||||||
class Transform;
|
class Transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +69,9 @@ public:
|
|||||||
caf::PdmField<int> maximumFrameRate;
|
caf::PdmField<int> maximumFrameRate;
|
||||||
caf::PdmField<bool> hasUserRequestedAnimation;
|
caf::PdmField<bool> hasUserRequestedAnimation;
|
||||||
|
|
||||||
caf::PdmChildField<RimCellRangeFilterCollection*> rangeFilterCollection;
|
caf::PdmChildField<RimCellRangeFilterCollection*> rangeFilterCollection;
|
||||||
|
|
||||||
|
caf::PdmChildField<RimManagedViewCollection*> managedViewCollection;
|
||||||
|
|
||||||
// Draw style
|
// Draw style
|
||||||
|
|
||||||
|
@ -46,7 +46,8 @@
|
|||||||
<file>draw_style_surface_w_fault_mesh_24x24.png</file>
|
<file>draw_style_surface_w_fault_mesh_24x24.png</file>
|
||||||
<file>InfoBox16x16.png</file>
|
<file>InfoBox16x16.png</file>
|
||||||
<file>GeoMechCase48x48.png</file>
|
<file>GeoMechCase48x48.png</file>
|
||||||
<file>GeoMechCases48x48.png</file>
|
<file>GeoMechCases48x48.png</file>
|
||||||
|
<file>chain.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/Shader/">
|
<qresource prefix="/Shader/">
|
||||||
<file>fs_CellFace.glsl</file>
|
<file>fs_CellFace.glsl</file>
|
||||||
|
BIN
ApplicationCode/Resources/chain.png
Normal file
BIN
ApplicationCode/Resources/chain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
@ -64,6 +64,8 @@
|
|||||||
#include "RigFemPartCollection.h"
|
#include "RigFemPartCollection.h"
|
||||||
#include "RigFemPart.h"
|
#include "RigFemPart.h"
|
||||||
#include "RigFemPartGrid.h"
|
#include "RigFemPartGrid.h"
|
||||||
|
#include "RimProject.h"
|
||||||
|
#include "RimManagedViewCollection.h"
|
||||||
|
|
||||||
using cvf::ManipulatorTrackball;
|
using cvf::ManipulatorTrackball;
|
||||||
|
|
||||||
@ -278,6 +280,12 @@ void RiuViewer::slotSetCurrentFrame(int frameIndex)
|
|||||||
if (m_reservoirView) m_reservoirView->setCurrentTimeStep(frameIndex);
|
if (m_reservoirView) m_reservoirView->setCurrentTimeStep(frameIndex);
|
||||||
|
|
||||||
caf::Viewer::slotSetCurrentFrame(frameIndex);
|
caf::Viewer::slotSetCurrentFrame(frameIndex);
|
||||||
|
|
||||||
|
if (m_reservoirView)
|
||||||
|
{
|
||||||
|
m_reservoirView->managedViewCollection()->updateTimeStep(frameIndex);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -489,3 +497,16 @@ void RiuViewer::updateNavigationPolicy()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuViewer::paintEvent(QPaintEvent* event)
|
||||||
|
{
|
||||||
|
caf::Viewer::paintEvent(event);
|
||||||
|
|
||||||
|
if (m_reservoirView)
|
||||||
|
{
|
||||||
|
m_reservoirView->managedViewCollection()->updateViewers(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -83,6 +83,8 @@ private:
|
|||||||
void mouseReleaseEvent(QMouseEvent* event);
|
void mouseReleaseEvent(QMouseEvent* event);
|
||||||
void mousePressEvent(QMouseEvent* event);
|
void mousePressEvent(QMouseEvent* event);
|
||||||
|
|
||||||
|
virtual void paintEvent(QPaintEvent* event);
|
||||||
|
|
||||||
QLabel* m_InfoLabel;
|
QLabel* m_InfoLabel;
|
||||||
QLabel* m_versionInfoLabel;
|
QLabel* m_versionInfoLabel;
|
||||||
bool m_showInfoText;;
|
bool m_showInfoText;;
|
||||||
|
Loading…
Reference in New Issue
Block a user