From 487ee0321259b20c234a1e33e73924c6939cb914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Tue, 5 Feb 2013 16:35:04 +0100 Subject: [PATCH] Rearranged members a bit in preparations to split out active info p4#: 20381 --- .../ProjectDataModel/RimReservoirView.cpp | 8 ++++++-- .../ProjectDataModel/RimReservoirView.h | 3 ++- ApplicationCode/ReservoirDataModel/RigCell.h | 16 +++++++++------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp index 53a3c4bcda..7deb2b0bcc 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp @@ -137,7 +137,7 @@ RimReservoirView::RimReservoirView() CAF_PDM_InitField(&showInactiveCells, "ShowInactiveCells", false, "Show Inactive Cells", "", "", ""); CAF_PDM_InitField(&showInvalidCells, "ShowInvalidCells", false, "Show Invalid Cells", "", "", ""); - //CAF_PDM_InitFieldNoDefault(&cameraPosition, "CameraPosition", "", "", "", ""); + CAF_PDM_InitField(&cameraPosition, "CameraPosition", cvf::Mat4d::IDENTITY, "", "", "", ""); this->cellResult()->setReservoirView(this); @@ -714,7 +714,10 @@ void RimReservoirView::loadDataAndUpdate() createDisplayModel(); updateDisplayModelVisibility(); - setDefaultView(); + if (cameraPosition().isIdentity()) + { + setDefaultView(); + } overlayInfoConfig()->update3DInfo(); if (animationMode && m_viewer) @@ -933,6 +936,7 @@ void RimReservoirView::setupBeforeSave() if (m_viewer) { animationMode = m_viewer->isAnimationActive(); + cameraPosition = m_viewer->mainCamera()->viewMatrix(); } } diff --git a/ApplicationCode/ProjectDataModel/RimReservoirView.h b/ApplicationCode/ProjectDataModel/RimReservoirView.h index 5446d15d30..8e68ab20b0 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirView.h +++ b/ApplicationCode/ProjectDataModel/RimReservoirView.h @@ -34,6 +34,7 @@ #include "cvfMatrix4.h" #include "cvfStructGridGeometryGenerator.h" +#include "cafPdmFieldCvfMat4d.h" #include "RivReservoirViewPartMgr.h" #include "RivReservoirPipesPartMgr.h" @@ -118,7 +119,7 @@ public: // 3D Viewer // Cam pos should be a field, but is not yet supported bu caf::Pdm - cvf::Mat4d cameraPosition; + caf::PdmField cameraPosition; void setDefaultView(); RIViewer* viewer(); diff --git a/ApplicationCode/ReservoirDataModel/RigCell.h b/ApplicationCode/ReservoirDataModel/RigCell.h index fc84b23f63..8e60ac1850 100644 --- a/ApplicationCode/ReservoirDataModel/RigCell.h +++ b/ApplicationCode/ReservoirDataModel/RigCell.h @@ -78,20 +78,22 @@ public: bool isLongPyramidCell(double maxHeightFactor = 5, double nodeNearTolerance = 1e-3 ) const; private: caf::SizeTArray8 m_cornerIndices; - - bool m_isInvalid; - bool m_isWellCell; + size_t m_cellIndex; ///< This cells index in the grid it belongs to. + RigGridBase* m_hostGrid; RigLocalGrid* m_subGrid; - bool m_cellFaceFaults[6]; - - RigGridBase* m_hostGrid; size_t m_parentCellIndex; ///< Grid cell index of the cell in the parent grid containing this cell size_t m_mainGridCellIndex; bool m_isInCoarseCell; + + bool m_cellFaceFaults[6]; + + // Result case specific data + bool m_isInvalid; + bool m_isWellCell; + size_t m_activeIndexInMatrixModel; ///< This cell's running index of all the active calls (matrix) in the reservoir size_t m_activeIndexInFractureModel; ///< This cell's running index of all the active calls (fracture) in the reservoir - size_t m_cellIndex; ///< This cells index in the grid it belongs to. };