From 1801e49105cc226f497e45049b9a43e0e8a73487 Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Tue, 6 Dec 2016 11:40:08 +0100 Subject: [PATCH] #1025 Establish base code structure --- .../ModelVisualization/CMakeLists_files.cmake | 2 + .../RivReservoirWellSpheresPartMgr.cpp | 109 ++++++++++++++++++ .../RivReservoirWellSpheresPartMgr.h | 50 ++++++++ .../RimEclipseWellCollection.cpp | 3 + .../RimEclipseWellCollection.h | 5 +- 5 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 ApplicationCode/ModelVisualization/RivReservoirWellSpheresPartMgr.cpp create mode 100644 ApplicationCode/ModelVisualization/RivReservoirWellSpheresPartMgr.h diff --git a/ApplicationCode/ModelVisualization/CMakeLists_files.cmake b/ApplicationCode/ModelVisualization/CMakeLists_files.cmake index 359b11b952..0baaa6a2ce 100644 --- a/ApplicationCode/ModelVisualization/CMakeLists_files.cmake +++ b/ApplicationCode/ModelVisualization/CMakeLists_files.cmake @@ -22,6 +22,7 @@ ${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.h ${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.h ${CEE_CURRENT_LIST_DIR}RivWellPathCollectionPartMgr.h ${CEE_CURRENT_LIST_DIR}RivWellPipesPartMgr.h +${CEE_CURRENT_LIST_DIR}RivReservoirWellSpheresPartMgr.h ${CEE_CURRENT_LIST_DIR}RivWellHeadPartMgr.h ${CEE_CURRENT_LIST_DIR}RivResultToTextureMapper.h ${CEE_CURRENT_LIST_DIR}RivTernaryResultToTextureMapper.h @@ -54,6 +55,7 @@ ${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.cpp ${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivWellPathCollectionPartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivWellPipesPartMgr.cpp +${CEE_CURRENT_LIST_DIR}RivReservoirWellSpheresPartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivWellHeadPartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivTextureCoordsCreator.cpp ${CEE_CURRENT_LIST_DIR}RivTernaryScalarMapper.cpp diff --git a/ApplicationCode/ModelVisualization/RivReservoirWellSpheresPartMgr.cpp b/ApplicationCode/ModelVisualization/RivReservoirWellSpheresPartMgr.cpp new file mode 100644 index 0000000000..cf6bb51d5f --- /dev/null +++ b/ApplicationCode/ModelVisualization/RivReservoirWellSpheresPartMgr.cpp @@ -0,0 +1,109 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// 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 "RivReservoirWellSpheresPartMgr.h" + +// #include "Rim3dOverlayInfoConfig.h" +// #include "RimCellEdgeColors.h" +// #include "RimCellRangeFilterCollection.h" +// #include "RimEclipseCellColors.h" +// #include "RimEclipsePropertyFilterCollection.h" +// #include "RimEclipseView.h" +// #include "RimEclipseWell.h" +// #include "RimEclipseWellCollection.h" + + +#include "cafPdmFieldCvfColor.h" +#include "cafPdmFieldCvfMat4d.h" + +#include "cvfTransform.h" + + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RivReservoirWellSpheresPartMgr::RivReservoirWellSpheresPartMgr(RimEclipseView* reservoirView) +{ +// m_reservoirView = reservoirView; +// +// m_scaleTransform = new cvf::Transform(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RivReservoirWellSpheresPartMgr::~RivReservoirWellSpheresPartMgr() +{ + +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivReservoirWellSpheresPartMgr::setScaleTransform(cvf::Transform * scaleTransform) +{ + m_scaleTransform = scaleTransform; + +// for (size_t wIdx = 0; wIdx != m_wellPipesPartMgrs.size(); ++ wIdx) +// { +// m_wellPipesPartMgrs[wIdx]->setScaleTransform(scaleTransform); +// } +// +// for (size_t wIdx = 0; wIdx != m_wellHeadPartMgrs.size(); ++ wIdx) +// { +// m_wellHeadPartMgrs[wIdx]->setScaleTransform(scaleTransform); +// } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivReservoirWellSpheresPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex) +{ +// if (!m_reservoirView->wellCollection()->isActive()) return; +// +// if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_FORCE_ALL_OFF) return; +// +// if (m_reservoirView->wellCollection()->wells.size() != m_wellPipesPartMgrs.size()) +// { +// clearGeometryCache(); +// +// for (size_t i = 0; i < m_reservoirView->wellCollection()->wells.size(); ++i) +// { +// RivWellPipesPartMgr * wppmgr = new RivWellPipesPartMgr(m_reservoirView, m_reservoirView->wellCollection()->wells[i]); +// m_wellPipesPartMgrs.push_back(wppmgr); +// wppmgr->setScaleTransform(m_scaleTransform.p()); +// +// RivWellHeadPartMgr* wellHeadMgr = new RivWellHeadPartMgr(m_reservoirView, m_reservoirView->wellCollection()->wells[i]); +// m_wellHeadPartMgrs.push_back(wellHeadMgr); +// wellHeadMgr->setScaleTransform(m_scaleTransform.p()); +// } +// } +// +// for (size_t wIdx = 0; wIdx != m_wellPipesPartMgrs.size(); ++ wIdx) +// { +// m_wellPipesPartMgrs[wIdx]->appendDynamicGeometryPartsToModel(model, frameIndex); +// m_wellHeadPartMgrs[wIdx]->appendDynamicGeometryPartsToModel(model, frameIndex); +// } +} + + + diff --git a/ApplicationCode/ModelVisualization/RivReservoirWellSpheresPartMgr.h b/ApplicationCode/ModelVisualization/RivReservoirWellSpheresPartMgr.h new file mode 100644 index 0000000000..a7f2368ed9 --- /dev/null +++ b/ApplicationCode/ModelVisualization/RivReservoirWellSpheresPartMgr.h @@ -0,0 +1,50 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2011-2012 Statoil ASA, 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 "RimEclipseWellCollection.h" + +#include "cvfCollection.h" +#include "cvfVector3.h" + +namespace cvf +{ + class Transform; + class ModelBasicList; +} + +class RimEclipseView; + +class RivReservoirWellSpheresPartMgr : public cvf::Object +{ +public: + RivReservoirWellSpheresPartMgr(RimEclipseView* reservoirView); + ~RivReservoirWellSpheresPartMgr(); + + + void setScaleTransform(cvf::Transform* scaleTransform); + + void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex); + +private: + caf::PdmPointer m_reservoirView; + cvf::ref m_scaleTransform; + + +}; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.cpp b/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.cpp index be76cd33c8..e9e4a38035 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.cpp @@ -108,6 +108,9 @@ RimEclipseWellCollection::RimEclipseWellCollection() CAF_PDM_InitField(&isAutoDetectingBranches, "IsAutoDetectingBranches", true, "Geometry based branch detection", "", "Toggle wether the well pipe visualization will try to detect when a part of the well \nis really a branch, and thus is starting from wellhead", ""); + CAF_PDM_InitField(&showCellCenterSpheres, "showCellCenterSpheres", false, "Show sphere in cell center", "", "", ""); + + CAF_PDM_InitFieldNoDefault(&wells, "Wells", "Wells", "", "", ""); wells.uiCapability()->setUiHidden(true); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.h b/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.h index 7aa4cf554b..d7c11b93e2 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.h @@ -102,7 +102,10 @@ public: caf::PdmField isAutoDetectingBranches; - caf::PdmChildArrayField wells; + caf::PdmField showCellCenterSpheres; + + + caf::PdmChildArrayField wells; RimEclipseWell* findWell(QString name); bool hasVisibleWellCells();