#1440 Remove RivWellPathCollectionPartMgr as it did not manage any parts

This is a step to make it easier to make the interface from the views to get the well path related geometry parts more "static".
This commit is contained in:
Jacob Støren 2017-06-21 15:39:59 +02:00
parent 0826db99f8
commit 3193127e32
9 changed files with 122 additions and 223 deletions

View File

@ -19,7 +19,6 @@ ${CEE_CURRENT_LIST_DIR}RivReservoirSimWellsPartMgr.h
${CEE_CURRENT_LIST_DIR}RivSourceInfo.h ${CEE_CURRENT_LIST_DIR}RivSourceInfo.h
${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.h ${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.h
${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.h ${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.h
${CEE_CURRENT_LIST_DIR}RivWellPathCollectionPartMgr.h
${CEE_CURRENT_LIST_DIR}RivSimWellPipesPartMgr.h ${CEE_CURRENT_LIST_DIR}RivSimWellPipesPartMgr.h
${CEE_CURRENT_LIST_DIR}RivWellHeadPartMgr.h ${CEE_CURRENT_LIST_DIR}RivWellHeadPartMgr.h
${CEE_CURRENT_LIST_DIR}RivResultToTextureMapper.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}RivSourceInfo.cpp
${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.cpp ${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.cpp
${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivWellPathCollectionPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivSimWellPipesPartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivSimWellPipesPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivWellHeadPartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivWellHeadPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivTextureCoordsCreator.cpp ${CEE_CURRENT_LIST_DIR}RivTextureCoordsCreator.cpp

View File

@ -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 <http://www.gnu.org/licenses/gpl.html>
// 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);
}
}

View File

@ -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 <http://www.gnu.org/licenses/gpl.html>
// 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<RimWellPathCollection> m_wellPathCollection;
};

View File

@ -65,7 +65,6 @@
#include "RivReservoirViewPartMgr.h" #include "RivReservoirViewPartMgr.h"
#include "RivSingleCellPartGenerator.h" #include "RivSingleCellPartGenerator.h"
#include "RivTernarySaturationOverlayItem.h" #include "RivTernarySaturationOverlayItem.h"
#include "RivWellPathCollectionPartMgr.h"
#include "cafCadNavigation.h" #include "cafCadNavigation.h"
#include "cafCeetronPlusNavigation.h" #include "cafCeetronPlusNavigation.h"

View File

@ -40,8 +40,6 @@
#include "RiuMainWindow.h" #include "RiuMainWindow.h"
#include "RiuViewer.h" #include "RiuViewer.h"
#include "RivWellPathCollectionPartMgr.h"
#include "cafDisplayCoordTransform.h" #include "cafDisplayCoordTransform.h"
#include "cafFrameAnimationControl.h" #include "cafFrameAnimationControl.h"
#include "cafPdmObjectFactory.h" #include "cafPdmObjectFactory.h"
@ -54,6 +52,7 @@
#include "cvfViewport.h" #include "cvfViewport.h"
#include <limits.h> #include <limits.h>
#include "cvfTransform.h"
namespace caf { namespace caf {
@ -426,28 +425,13 @@ void RimView::endAnimation()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RivWellPathCollectionPartMgr* RimView::wellPathsPartManager() RimWellPathCollection* RimView::wellPathsPartManager()
{ {
ensureWellPathManagerIsCreated();
CVF_ASSERT(m_wellPathsPartManager.notNull());
return m_wellPathsPartManager.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimView::ensureWellPathManagerIsCreated()
{
if (m_wellPathsPartManager.isNull())
{
RimProject* proj = nullptr; RimProject* proj = nullptr;
this->firstAncestorOrThisOfTypeAsserted(proj); this->firstAncestorOrThisOfTypeAsserted(proj);
CVF_ASSERT(proj && proj->activeOilField() && proj->activeOilField()->wellPathCollection()); 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 // Regenerate well paths
RimOilField* oilFields = RiaApplication::instance()->project() ? RiaApplication::instance()->project()->activeOilField() : NULL; RimOilField* oilFields = RiaApplication::instance()->project() ? RiaApplication::instance()->project()->activeOilField() : NULL;
RimWellPathCollection* wellPathCollection = (oilFields) ? oilFields->wellPathCollection() : NULL; RimWellPathCollection* wellPathCollection = (oilFields) ? oilFields->wellPathCollection() : NULL;
if (wellPathCollection) wellPathCollection->wellPathCollectionPartMgr()->scheduleGeometryRegen();
wellPathsPartManager()->scheduleGeometryRegen(); wellPathsPartManager()->scheduleGeometryRegen();

View File

@ -50,7 +50,7 @@ class RimPropertyFilterCollection;
class RimViewController; class RimViewController;
class RimViewLinker; class RimViewLinker;
class RiuViewer; class RiuViewer;
class RivWellPathCollectionPartMgr; class RimWellPathCollection;
namespace cvf namespace cvf
{ {
@ -204,7 +204,7 @@ protected:
virtual void resetLegendsInViewer() = 0; virtual void resetLegendsInViewer() = 0;
virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility) = 0; virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility) = 0;
RivWellPathCollectionPartMgr* wellPathsPartManager(); RimWellPathCollection* wellPathsPartManager();
QPointer<RiuViewer> m_viewer; QPointer<RiuViewer> m_viewer;
@ -240,13 +240,9 @@ private:
void setCurrentTimeStepAndUpdate(int frameIdx); void setCurrentTimeStepAndUpdate(int frameIdx);
void endAnimation(); void endAnimation();
void ensureWellPathManagerIsCreated();
private: private:
bool m_previousGridModeMeshLinesWasFaults; bool m_previousGridModeMeshLinesWasFaults;
caf::PdmField<bool> m_disableLighting; caf::PdmField<bool> m_disableLighting;
cvf::ref<RivWellPathCollectionPartMgr> m_wellPathsPartManager;
}; };

View File

@ -37,8 +37,6 @@
#include "RiuMainWindow.h" #include "RiuMainWindow.h"
#include "RivWellPathCollectionPartMgr.h"
#include "RifWellPathImporter.h" #include "RifWellPathImporter.h"
#include "cafPdmUiEditorHandle.h" #include "cafPdmUiEditorHandle.h"
@ -50,6 +48,7 @@
#include <fstream> #include <fstream>
#include <cmath> #include <cmath>
#include "RivWellPathPartMgr.h"
namespace caf namespace caf
{ {
@ -93,8 +92,6 @@ RimWellPathCollection::RimWellPathCollection()
CAF_PDM_InitFieldNoDefault(&wellPaths, "WellPaths", "Well Paths", "", "", ""); CAF_PDM_InitFieldNoDefault(&wellPaths, "WellPaths", "Well Paths", "", "", "");
wellPaths.uiCapability()->setUiHidden(true); wellPaths.uiCapability()->setUiHidden(true);
m_wellPathCollectionPartManager = new RivWellPathCollectionPartMgr(this);
m_wellPathImporter = new RifWellPathImporter; m_wellPathImporter = new RifWellPathImporter;
} }
@ -328,12 +325,61 @@ caf::PdmFieldHandle* RimWellPathCollection::objectToggleField()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellPathCollection::scheduleGeometryRegenAndRedrawViews() void RimWellPathCollection::scheduleGeometryRegenAndRedrawViews()
{ {
m_wellPathCollectionPartManager->scheduleGeometryRegen(); this->scheduleGeometryRegen();
RimProject* proj; RimProject* proj;
this->firstAncestorOrThisOfType(proj); this->firstAncestorOrThisOfType(proj);
if (proj) proj->createDisplayModelAndRedrawAllViews(); 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);
}
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -35,12 +35,19 @@
#include <QString> #include <QString>
class RivWellPathCollectionPartMgr;
class RifWellPathImporter; class RifWellPathImporter;
class RimWellPath; class RimWellPath;
class RimProject; class RimProject;
class RigWellPath; class RigWellPath;
namespace cvf {
class ModelBasicList;
class BoundingBox;
}
namespace caf {
class DisplayCoordTransform;
}
//================================================================================================== //==================================================================================================
/// ///
@ -77,9 +84,6 @@ public:
caf::PdmChildArrayField<RimWellPath*> wellPaths; caf::PdmChildArrayField<RimWellPath*> wellPaths;
RivWellPathCollectionPartMgr* wellPathCollectionPartMgr() { return m_wellPathCollectionPartManager.p(); }
void readWellPathFiles(); void readWellPathFiles();
void addWellPaths(QStringList filePaths); void addWellPaths(QStringList filePaths);
@ -89,8 +93,19 @@ public:
RimWellPath* wellPathByName(const QString& wellPathName) const; RimWellPath* wellPathByName(const QString& wellPathName) const;
void addWellLogs(const QStringList& filePaths); void addWellLogs(const QStringList& filePaths);
void scheduleGeometryRegenAndRedrawViews(); 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); void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
protected: protected:
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ); virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
@ -104,7 +119,5 @@ private:
RiaEclipseUnitTools::UnitSystemType findUnitSystemForWellPath(const RimWellPath* wellPath); RiaEclipseUnitTools::UnitSystemType findUnitSystemForWellPath(const RimWellPath* wellPath);
cvf::ref<RivWellPathCollectionPartMgr> m_wellPathCollectionPartManager;
RifWellPathImporter* m_wellPathImporter; RifWellPathImporter* m_wellPathImporter;
}; };

View File

@ -1,23 +1,52 @@
@startuml @startuml
/'
package Viz{
class RivWellPathPartMgr
class RivFishbonesSubsPartMgr
class RivWellFracturePartMgr
}
'/
package Pdm{
class RimView
RimView --> RivWellPathCollectionPartMgr class RimOilField
class RimEclipseCaseCollection
RivWellPathCollectionPartMgr -* "N" RivWellPathPartMgr class RimCase
class RimWellPath
class RivWellPathPartMgr { class RimWellPathCollection
RimWellPath* m_wellPath class RimFishbonesMultipleSubs
class RimWellPathCompletions
class RimFishboneWellPathCollection
class RimPerforationCollection
class RimWellPathFractureCollection
class RimFishbonesCollection
class RimFracture
} }
class RimWellPath { RivWellPathPartMgr ..> RimWellPath
RimWellPathFractureCollection m_fractureCollection; RimWellPath *--> RivWellPathPartMgr
}
class RimWellPathFractureCollection { RivWellPathPartMgr *--> "n" RivFishbonesSubsPartMgr
caf::PdmChildArrayField<RimWellPathFracture*> fractures;
}
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 @enduml