mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#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:
@@ -65,7 +65,6 @@
|
||||
#include "RivReservoirViewPartMgr.h"
|
||||
#include "RivSingleCellPartGenerator.h"
|
||||
#include "RivTernarySaturationOverlayItem.h"
|
||||
#include "RivWellPathCollectionPartMgr.h"
|
||||
|
||||
#include "cafCadNavigation.h"
|
||||
#include "cafCeetronPlusNavigation.h"
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user