diff --git a/ApplicationCode/ModelVisualization/CMakeLists_files.cmake b/ApplicationCode/ModelVisualization/CMakeLists_files.cmake index 03c8d21e92..6f3dffcf80 100644 --- a/ApplicationCode/ModelVisualization/CMakeLists_files.cmake +++ b/ApplicationCode/ModelVisualization/CMakeLists_files.cmake @@ -19,7 +19,6 @@ ${CEE_CURRENT_LIST_DIR}RivReservoirSimWellsPartMgr.h ${CEE_CURRENT_LIST_DIR}RivSourceInfo.h ${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.h ${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.h -${CEE_CURRENT_LIST_DIR}RivWellPathCollectionPartMgr.h ${CEE_CURRENT_LIST_DIR}RivSimWellPipesPartMgr.h ${CEE_CURRENT_LIST_DIR}RivWellHeadPartMgr.h ${CEE_CURRENT_LIST_DIR}RivResultToTextureMapper.h @@ -59,7 +58,6 @@ ${CEE_CURRENT_LIST_DIR}RivReservoirSimWellsPartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivSourceInfo.cpp ${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.cpp ${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.cpp -${CEE_CURRENT_LIST_DIR}RivWellPathCollectionPartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivSimWellPipesPartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivWellHeadPartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivTextureCoordsCreator.cpp diff --git a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.cpp deleted file mode 100644 index 007ea0cede..0000000000 --- a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.cpp +++ /dev/null @@ -1,94 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2011- Statoil ASA -// Copyright (C) 2013- Ceetron Solutions AS -// Copyright (C) 2011-2012 Ceetron 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 -// for more details. -// -///////////////////////////////////////////////////////////////////////////////// - -#include "RivWellPathCollectionPartMgr.h" - -#include "RimWellPath.h" -#include "RimWellPathCollection.h" -#include "RivWellPathPartMgr.h" -#include "RigMainGrid.h" -#include "RimView.h" - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RivWellPathCollectionPartMgr::RivWellPathCollectionPartMgr(RimWellPathCollection* wellPathCollection) -{ - m_wellPathCollection = wellPathCollection; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RivWellPathCollectionPartMgr::~RivWellPathCollectionPartMgr() -{ - -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RivWellPathCollectionPartMgr::scheduleGeometryRegen() -{ - for (size_t wIdx = 0; wIdx < m_wellPathCollection->wellPaths.size(); wIdx++) - { - m_wellPathCollection->wellPaths[wIdx]->partMgr()->scheduleGeometryRegen(); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RivWellPathCollectionPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, - double characteristicCellSize, - const cvf::BoundingBox& wellPathClipBoundingBox, - const caf::DisplayCoordTransform* displayCoordTransform) -{ - if (!m_wellPathCollection->isActive()) return; - if (m_wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return; - - for (size_t wIdx = 0; wIdx < m_wellPathCollection->wellPaths.size(); wIdx++) - { - RivWellPathPartMgr* partMgr = m_wellPathCollection->wellPaths[wIdx]->partMgr(); - partMgr->appendStaticGeometryPartsToModel(model, characteristicCellSize, wellPathClipBoundingBox, displayCoordTransform); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RivWellPathCollectionPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, - const QDateTime& timeStamp, - double characteristicCellSize, - const cvf::BoundingBox& wellPathClipBoundingBox, - const caf::DisplayCoordTransform* displayCoordTransform) - -{ - if (!m_wellPathCollection->isActive()) return; - if (m_wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return; - - for (size_t wIdx = 0; wIdx < m_wellPathCollection->wellPaths.size(); wIdx++) - { - RivWellPathPartMgr* partMgr = m_wellPathCollection->wellPaths[wIdx]->partMgr(); - partMgr->appendDynamicGeometryPartsToModel(model, timeStamp, characteristicCellSize, wellPathClipBoundingBox, displayCoordTransform); - } -} - diff --git a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h b/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h deleted file mode 100644 index 7dfc6aaa11..0000000000 --- a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h +++ /dev/null @@ -1,71 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2011- Statoil ASA -// Copyright (C) 2013- Ceetron Solutions AS -// Copyright (C) 2011-2012 Ceetron 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 -// for more details. -// -///////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "cvfBase.h" -#include "cvfCollection.h" -#include "cafPdmPointer.h" -#include "cvfVector3.h" -#include "cvfBoundingBox.h" -#include "cvfTransform.h" - -#include "cafPdmPointer.h" - -class RimWellPathCollection; -class RimProject; -class RivWellPathPartMgr; -class RimView; - -class QDateTime; - -namespace cvf -{ - class ModelBasicList; -} - -namespace caf -{ - class DisplayCoordTransform; -} - - -class RivWellPathCollectionPartMgr : public cvf::Object -{ -public: - explicit RivWellPathCollectionPartMgr(RimWellPathCollection* wellPathCollection); - ~RivWellPathCollectionPartMgr(); - - void scheduleGeometryRegen(); - - void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, - double characteristicCellSize, - const cvf::BoundingBox& wellPathClipBoundingBox, - const caf::DisplayCoordTransform* displayCoordTransform); - - void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, - const QDateTime& timeStamp, - double characteristicCellSize, - const cvf::BoundingBox& wellPathClipBoundingBox, - const caf::DisplayCoordTransform* displayCoordTransform); - -private: - caf::PdmPointer m_wellPathCollection; -}; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index 2cb8ee7c55..84e0ef44cd 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -65,7 +65,6 @@ #include "RivReservoirViewPartMgr.h" #include "RivSingleCellPartGenerator.h" #include "RivTernarySaturationOverlayItem.h" -#include "RivWellPathCollectionPartMgr.h" #include "cafCadNavigation.h" #include "cafCeetronPlusNavigation.h" diff --git a/ApplicationCode/ProjectDataModel/RimView.cpp b/ApplicationCode/ProjectDataModel/RimView.cpp index 78a54a75c2..d9865d140a 100644 --- a/ApplicationCode/ProjectDataModel/RimView.cpp +++ b/ApplicationCode/ProjectDataModel/RimView.cpp @@ -40,8 +40,6 @@ #include "RiuMainWindow.h" #include "RiuViewer.h" -#include "RivWellPathCollectionPartMgr.h" - #include "cafDisplayCoordTransform.h" #include "cafFrameAnimationControl.h" #include "cafPdmObjectFactory.h" @@ -54,6 +52,7 @@ #include "cvfViewport.h" #include +#include "cvfTransform.h" namespace caf { @@ -426,28 +425,13 @@ void RimView::endAnimation() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RivWellPathCollectionPartMgr* RimView::wellPathsPartManager() +RimWellPathCollection* RimView::wellPathsPartManager() { - ensureWellPathManagerIsCreated(); + RimProject* proj = nullptr; + this->firstAncestorOrThisOfTypeAsserted(proj); + CVF_ASSERT(proj && proj->activeOilField() && proj->activeOilField()->wellPathCollection()); - CVF_ASSERT(m_wellPathsPartManager.notNull()); - - return m_wellPathsPartManager.p(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimView::ensureWellPathManagerIsCreated() -{ - if (m_wellPathsPartManager.isNull()) - { - RimProject* proj = nullptr; - this->firstAncestorOrThisOfTypeAsserted(proj); - CVF_ASSERT(proj && proj->activeOilField() && proj->activeOilField()->wellPathCollection()); - - m_wellPathsPartManager = new RivWellPathCollectionPartMgr(proj->activeOilField()->wellPathCollection()); - } + return proj->activeOilField()->wellPathCollection(); } //-------------------------------------------------------------------------------------------------- @@ -627,7 +611,6 @@ void RimView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QV // Regenerate well paths RimOilField* oilFields = RiaApplication::instance()->project() ? RiaApplication::instance()->project()->activeOilField() : NULL; RimWellPathCollection* wellPathCollection = (oilFields) ? oilFields->wellPathCollection() : NULL; - if (wellPathCollection) wellPathCollection->wellPathCollectionPartMgr()->scheduleGeometryRegen(); wellPathsPartManager()->scheduleGeometryRegen(); diff --git a/ApplicationCode/ProjectDataModel/RimView.h b/ApplicationCode/ProjectDataModel/RimView.h index c29103ad57..045547dab5 100644 --- a/ApplicationCode/ProjectDataModel/RimView.h +++ b/ApplicationCode/ProjectDataModel/RimView.h @@ -50,7 +50,7 @@ class RimPropertyFilterCollection; class RimViewController; class RimViewLinker; class RiuViewer; -class RivWellPathCollectionPartMgr; +class RimWellPathCollection; namespace cvf { @@ -204,7 +204,7 @@ protected: virtual void resetLegendsInViewer() = 0; virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility) = 0; - RivWellPathCollectionPartMgr* wellPathsPartManager(); + RimWellPathCollection* wellPathsPartManager(); QPointer m_viewer; @@ -240,13 +240,9 @@ private: void setCurrentTimeStepAndUpdate(int frameIdx); void endAnimation(); - void ensureWellPathManagerIsCreated(); - private: bool m_previousGridModeMeshLinesWasFaults; caf::PdmField m_disableLighting; - - cvf::ref m_wellPathsPartManager; }; diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp index 1e0b23881b..1bad2a8f52 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp @@ -37,8 +37,6 @@ #include "RiuMainWindow.h" -#include "RivWellPathCollectionPartMgr.h" - #include "RifWellPathImporter.h" #include "cafPdmUiEditorHandle.h" @@ -50,6 +48,7 @@ #include #include +#include "RivWellPathPartMgr.h" namespace caf { @@ -93,8 +92,6 @@ RimWellPathCollection::RimWellPathCollection() CAF_PDM_InitFieldNoDefault(&wellPaths, "WellPaths", "Well Paths", "", "", ""); wellPaths.uiCapability()->setUiHidden(true); - m_wellPathCollectionPartManager = new RivWellPathCollectionPartMgr(this); - m_wellPathImporter = new RifWellPathImporter; } @@ -328,12 +325,61 @@ caf::PdmFieldHandle* RimWellPathCollection::objectToggleField() //-------------------------------------------------------------------------------------------------- void RimWellPathCollection::scheduleGeometryRegenAndRedrawViews() { - m_wellPathCollectionPartManager->scheduleGeometryRegen(); + this->scheduleGeometryRegen(); RimProject* proj; this->firstAncestorOrThisOfType(proj); if (proj) proj->createDisplayModelAndRedrawAllViews(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathCollection::scheduleGeometryRegen() +{ + for (size_t wIdx = 0; wIdx < this->wellPaths.size(); wIdx++) + { + this->wellPaths[wIdx]->partMgr()->scheduleGeometryRegen(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathCollection::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, + double characteristicCellSize, + const cvf::BoundingBox& wellPathClipBoundingBox, + const caf::DisplayCoordTransform* displayCoordTransform) +{ + if (!this->isActive()) return; + if (this->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return; + + for (size_t wIdx = 0; wIdx < this->wellPaths.size(); wIdx++) + { + RivWellPathPartMgr* partMgr = this->wellPaths[wIdx]->partMgr(); + partMgr->appendStaticGeometryPartsToModel(model, characteristicCellSize, wellPathClipBoundingBox, displayCoordTransform); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathCollection::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, + const QDateTime& timeStamp, + double characteristicCellSize, + const cvf::BoundingBox& wellPathClipBoundingBox, + const caf::DisplayCoordTransform* displayCoordTransform) + +{ + if (!this->isActive()) return; + if (this->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return; + + for (size_t wIdx = 0; wIdx < this->wellPaths.size(); wIdx++) + { + RivWellPathPartMgr* partMgr = this->wellPaths[wIdx]->partMgr(); + partMgr->appendDynamicGeometryPartsToModel(model, timeStamp, characteristicCellSize, wellPathClipBoundingBox, displayCoordTransform); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.h b/ApplicationCode/ProjectDataModel/RimWellPathCollection.h index 7f309c7442..68a013a924 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.h +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.h @@ -35,12 +35,19 @@ #include -class RivWellPathCollectionPartMgr; class RifWellPathImporter; class RimWellPath; class RimProject; class RigWellPath; +namespace cvf { +class ModelBasicList; +class BoundingBox; +} + +namespace caf { +class DisplayCoordTransform; +} //================================================================================================== /// @@ -76,10 +83,7 @@ public: caf::PdmField wellPathClipZDistance; caf::PdmChildArrayField wellPaths; - - RivWellPathCollectionPartMgr* wellPathCollectionPartMgr() { return m_wellPathCollectionPartManager.p(); } - void readWellPathFiles(); void addWellPaths(QStringList filePaths); @@ -89,8 +93,19 @@ public: RimWellPath* wellPathByName(const QString& wellPathName) const; void addWellLogs(const QStringList& filePaths); - void scheduleGeometryRegenAndRedrawViews(); + void scheduleGeometryRegen(); + + void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, + double characteristicCellSize, + const cvf::BoundingBox& wellPathClipBoundingBox, + const caf::DisplayCoordTransform* displayCoordTransform); + + void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, + const QDateTime& timeStamp, + double characteristicCellSize, + const cvf::BoundingBox& wellPathClipBoundingBox, + const caf::DisplayCoordTransform* displayCoordTransform); void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath); protected: virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ); @@ -104,7 +119,5 @@ private: RiaEclipseUnitTools::UnitSystemType findUnitSystemForWellPath(const RimWellPath* wellPath); - cvf::ref m_wellPathCollectionPartManager; - RifWellPathImporter* m_wellPathImporter; }; diff --git a/doc/well_path_part_manager.plantuml b/doc/well_path_part_manager.plantuml index 7c5e7509b3..983cd2d6c7 100644 --- a/doc/well_path_part_manager.plantuml +++ b/doc/well_path_part_manager.plantuml @@ -1,23 +1,52 @@ @startuml +/' +package Viz{ +class RivWellPathPartMgr +class RivFishbonesSubsPartMgr +class RivWellFracturePartMgr +} +'/ - - -RimView --> RivWellPathCollectionPartMgr - -RivWellPathCollectionPartMgr -* "N" RivWellPathPartMgr - -class RivWellPathPartMgr { -RimWellPath* m_wellPath +package Pdm{ +class RimView +class RimOilField +class RimEclipseCaseCollection +class RimCase +class RimWellPath +class RimWellPathCollection +class RimFishbonesMultipleSubs +class RimWellPathCompletions +class RimFishboneWellPathCollection +class RimPerforationCollection +class RimWellPathFractureCollection +class RimFishbonesCollection +class RimFracture } -class RimWellPath { -RimWellPathFractureCollection m_fractureCollection; -} +RivWellPathPartMgr ..> RimWellPath +RimWellPath *--> RivWellPathPartMgr -class RimWellPathFractureCollection { -caf::PdmChildArrayField fractures; -} +RivWellPathPartMgr *--> "n" RivFishbonesSubsPartMgr +RivFishbonesSubsPartMgr ..> RimFishbonesMultipleSubs +RivWellFracturePartMgr ...> RimFracture + +RimOilField *--> RimWellPathCollection +RimOilField *--> RimEclipseCaseCollection +RimEclipseCaseCollection *--> "n" RimCase + +RimCase *--> "n" RimView +RimWellPathCollection *--> "n" RimWellPath +RimWellPath *--> RimWellPathCompletions +RimFishbonesCollection *--> RimFishbonesMultipleSubs +RimFishbonesCollection *--> RimFishboneWellPathCollection +RimWellPathCompletions *--> RimFishbonesCollection +RimWellPathCompletions *--> RimPerforationCollection +RimWellPathCompletions *--> RimWellPathFractureCollection + +RimWellPathFractureCollection *--> "n" RimFracture + +RimFracture *--> RivWellFracturePartMgr @enduml