#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}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

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 "RivSingleCellPartGenerator.h"
#include "RivTernarySaturationOverlayItem.h"
#include "RivWellPathCollectionPartMgr.h"
#include "cafCadNavigation.h"
#include "cafCeetronPlusNavigation.h"

View File

@ -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 <limits.h>
#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();

View File

@ -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<RiuViewer> m_viewer;
@ -240,13 +240,9 @@ private:
void setCurrentTimeStepAndUpdate(int frameIdx);
void endAnimation();
void ensureWellPathManagerIsCreated();
private:
bool m_previousGridModeMeshLinesWasFaults;
caf::PdmField<bool> m_disableLighting;
cvf::ref<RivWellPathCollectionPartMgr> m_wellPathsPartManager;
};

View File

@ -37,8 +37,6 @@
#include "RiuMainWindow.h"
#include "RivWellPathCollectionPartMgr.h"
#include "RifWellPathImporter.h"
#include "cafPdmUiEditorHandle.h"
@ -50,6 +48,7 @@
#include <fstream>
#include <cmath>
#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);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -35,12 +35,19 @@
#include <QString>
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<int> wellPathClipZDistance;
caf::PdmChildArrayField<RimWellPath*> 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<RivWellPathCollectionPartMgr> m_wellPathCollectionPartManager;
RifWellPathImporter* m_wellPathImporter;
};

View File

@ -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<RimWellPathFracture*> 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