mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath). RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection. RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes). Added features: - Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format. - Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path). - Possible to turn on / off visibility, set thickness, set color for individual well paths. - List of well paths including specified parameters/settings will be stored in project file. - Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc. Known problems: - Well paths are not shown in some types of reservoir views, for instance reservoir views showing well pipes. Will look into this later. p4#: 21658
This commit is contained in:
@@ -26,6 +26,8 @@ ${CEE_CURRENT_LIST_DIR}RimResultSlot.h
|
||||
${CEE_CURRENT_LIST_DIR}RimCellEdgeResultSlot.h
|
||||
${CEE_CURRENT_LIST_DIR}RimWell.h
|
||||
${CEE_CURRENT_LIST_DIR}RimWellCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimWellPath.h
|
||||
${CEE_CURRENT_LIST_DIR}RimWellPathCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimScriptCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimStatisticsCase.h
|
||||
${CEE_CURRENT_LIST_DIR}RimStatisticsCaseCollection.h
|
||||
@@ -62,6 +64,8 @@ ${CEE_CURRENT_LIST_DIR}RimResultSlot.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimCellEdgeResultSlot.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimWell.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimWellCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimWellPath.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimWellPathCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimScriptCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimStatisticsCase.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimStatisticsCaseCollection.cpp
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "RigGridManager.h"
|
||||
#include "RigCaseData.h"
|
||||
#include "RimResultCase.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
@@ -65,7 +66,6 @@ RimProject::RimProject(void)
|
||||
CAF_PDM_InitFieldNoDefault(&caseGroups, "CaseGroups", "", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&scriptCollection, "ScriptCollection", "Scripts", ":/Default.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&treeViewState, "TreeViewState", "", "", "", "");
|
||||
treeViewState.setUiHidden(true);
|
||||
|
||||
@@ -75,9 +75,11 @@ RimProject::RimProject(void)
|
||||
scriptCollection = new RimScriptCollection();
|
||||
scriptCollection->directory.setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&wellPathCollection, "WellPathCollection", "Well Paths", ":/WellCollection.png", "", "");
|
||||
|
||||
m_gridCollection = new RigGridManager;
|
||||
|
||||
initAfterRead();
|
||||
initScriptDirectories();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -88,6 +90,7 @@ RimProject::~RimProject(void)
|
||||
close();
|
||||
|
||||
if (scriptCollection()) delete scriptCollection();
|
||||
if (wellPathCollection()) delete wellPathCollection();
|
||||
|
||||
reservoirs.deleteAllChildObjects();
|
||||
}
|
||||
@@ -101,6 +104,7 @@ void RimProject::close()
|
||||
|
||||
reservoirs.deleteAllChildObjects();
|
||||
caseGroups.deleteAllChildObjects();
|
||||
if (wellPathCollection != NULL) delete wellPathCollection;
|
||||
|
||||
fileName = "";
|
||||
|
||||
@@ -108,10 +112,11 @@ void RimProject::close()
|
||||
nextValidCaseGroupId = 0;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimProject::initAfterRead()
|
||||
void RimProject::initScriptDirectories()
|
||||
{
|
||||
//
|
||||
// TODO : Must store content of scripts in project file and notify user if stored content is different from disk on execute and edit
|
||||
@@ -185,6 +190,17 @@ void RimProject::initAfterRead()
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimProject::initAfterRead()
|
||||
{
|
||||
initScriptDirectories();
|
||||
|
||||
if (wellPathCollection) wellPathCollection->setProject(this);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -434,3 +450,20 @@ void RimProject::allCases(std::vector<RimCase*>& cases)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimProject::createDisplayModelAndRedrawAllViews()
|
||||
{
|
||||
for (size_t caseIdx = 0; caseIdx < reservoirs.size(); caseIdx++)
|
||||
{
|
||||
RimCase* rimCase = reservoirs[caseIdx];
|
||||
for (size_t viewIdx = 0; viewIdx < rimCase->reservoirViews.size(); viewIdx++)
|
||||
{
|
||||
RimReservoirView* reservoirView = rimCase->reservoirViews[viewIdx];
|
||||
reservoirView->createDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmDocument.h"
|
||||
//#include "RimScriptCollection.h"
|
||||
//#include "RimIdenticalGridCaseGroup.h"
|
||||
|
||||
class RimCase;
|
||||
class RigGridManager;
|
||||
@@ -28,6 +26,7 @@ class RimScriptCollection;
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RigMainGrid;
|
||||
class RigCaseData;
|
||||
class RimWellPathCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -48,6 +47,7 @@ public:
|
||||
caf::PdmField<QString> currentModelIndexPath;
|
||||
caf::PdmField<int> nextValidCaseId; // Unique case ID within a project, used to identify a case from Octave scripts
|
||||
caf::PdmField<int> nextValidCaseGroupId; // Unique case group ID within a project, used to identify a case group from Octave scripts
|
||||
caf::PdmField<RimWellPathCollection*> wellPathCollection;
|
||||
|
||||
void setScriptDirectories(const QString& scriptDirectories);
|
||||
QString projectFileVersionString() const;
|
||||
@@ -65,12 +65,14 @@ public:
|
||||
void assignIdToCaseGroup(RimIdenticalGridCaseGroup* caseGroup);
|
||||
|
||||
void allCases(std::vector<RimCase*>& cases);
|
||||
|
||||
void createDisplayModelAndRedrawAllViews();
|
||||
|
||||
private:
|
||||
RigMainGrid* registerCaseInGridCollection(RigCaseData* rigEclipseCase);
|
||||
|
||||
protected:
|
||||
// Overridden methods
|
||||
void initScriptDirectories();
|
||||
virtual void initAfterRead();
|
||||
virtual void setupBeforeSave();
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimResultSlot.h"
|
||||
#include "RimCellEdgeResultSlot.h"
|
||||
@@ -38,6 +39,10 @@
|
||||
#include "RimCellPropertyFilter.h"
|
||||
#include "RimCellPropertyFilterCollection.h"
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
#include "RimScriptCollection.h"
|
||||
#include "RimCaseCollection.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RigGridBase.h"
|
||||
@@ -61,6 +66,7 @@
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RigGridScalarDataAccess.h"
|
||||
#include "RimReservoirCellResultsCacher.h"
|
||||
#include "RivWellPathCollectionPartMgr.h"
|
||||
#include "cvfOverlayScalarMapperLegend.h"
|
||||
|
||||
#include <limits.h>
|
||||
@@ -189,6 +195,7 @@ RimReservoirView::~RimReservoirView()
|
||||
delete rangeFilterCollection();
|
||||
delete propertyFilterCollection();
|
||||
delete wellCollection();
|
||||
// delete wellPathCollection();
|
||||
|
||||
if (m_viewer)
|
||||
{
|
||||
@@ -346,6 +353,10 @@ void RimReservoirView::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
{
|
||||
if (scaleZ < 1) scaleZ = 1;
|
||||
|
||||
// Regenerate well paths
|
||||
RimWellPathCollection* wellPathCollection = (RiaApplication::instance() && RiaApplication::instance()->project()) ? RiaApplication::instance()->project()->wellPathCollection() : NULL;
|
||||
if (wellPathCollection) wellPathCollection->wellPathCollectionPartMgr()->scheduleGeometryRegen();
|
||||
|
||||
if (m_viewer)
|
||||
{
|
||||
cvf::Vec3d poi = m_viewer->pointOfInterest();
|
||||
@@ -564,7 +575,6 @@ void RimReservoirView::createDisplayModel()
|
||||
geometryTypesToAdd.push_back(RivReservoirViewPartMgr::INACTIVE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
size_t frameIdx;
|
||||
for (frameIdx = 0; frameIdx < frameModels.size(); ++frameIdx)
|
||||
@@ -573,6 +583,19 @@ void RimReservoirView::createDisplayModel()
|
||||
{
|
||||
m_reservoirGridPartManager->appendStaticGeometryPartsToModel(frameModels[frameIdx].p(), geometryTypesToAdd[gtIdx], gridIndices);
|
||||
}
|
||||
|
||||
// Append static Well Paths to model
|
||||
cvf::Vec3d displayModelOffset = eclipseCase()->reservoirData()->mainGrid()->displayModelOffset();
|
||||
double characteristicCellSize = eclipseCase()->reservoirData()->mainGrid()->characteristicIJCellSize();
|
||||
cvf::BoundingBox boundingBox = currentActiveCellInfo()->geometryBoundingBox();
|
||||
RimProject* rimProject = RiaApplication::instance() ? RiaApplication::instance()->project() : NULL;
|
||||
RivWellPathCollectionPartMgr* wellPathCollectionPartMgr = (rimProject && rimProject->wellPathCollection()) ? rimProject->wellPathCollection()->wellPathCollectionPartMgr() : NULL;
|
||||
if (wellPathCollectionPartMgr)
|
||||
{
|
||||
printf("Append well paths for frame %i: ", frameIdx);
|
||||
wellPathCollectionPartMgr->appendStaticGeometryPartsToModel(frameModels[frameIdx].p(), displayModelOffset, m_reservoirGridPartManager->scaleTransform(), characteristicCellSize, boundingBox);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Set static colors
|
||||
@@ -581,7 +604,6 @@ void RimReservoirView::createDisplayModel()
|
||||
m_visibleGridParts = geometryTypesToAdd;
|
||||
}
|
||||
|
||||
|
||||
// Compute triangle count, Debug only
|
||||
|
||||
if (false)
|
||||
|
||||
@@ -48,7 +48,7 @@ class RivReservoirPipesPartMgr;
|
||||
class RiuViewer;
|
||||
class RigGridBase;
|
||||
class RigGridCellFaceVisibilityFilter;
|
||||
|
||||
class RimReservoirCellResultsStorage;
|
||||
namespace cvf
|
||||
{
|
||||
class Transform;
|
||||
|
||||
Reference in New Issue
Block a user