Add infrastructure for dynamic parts to well path part managers

This commit is contained in:
Magne Sjaastad
2017-06-15 14:07:04 +02:00
parent 5739e7e09e
commit e50f876cf0
5 changed files with 96 additions and 13 deletions

View File

@@ -23,6 +23,8 @@
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RivWellPathPartMgr.h"
#include "RigMainGrid.h"
#include "RimView.h"
//--------------------------------------------------------------------------------------------------
@@ -83,3 +85,27 @@ void RivWellPathCollectionPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBa
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathCollectionPartMgr::appendDynamicGeometryPartsToModel(size_t timeStep,
cvf::ModelBasicList* model,
cvf::Vec3d displayModelOffset,
cvf::Transform* scaleTransform,
double characteristicCellSize,
cvf::BoundingBox wellPathClipBoundingBox,
caf::DisplayCoordTransform* displayCoordTransform)
{
setScaleTransform(scaleTransform);
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->setScaleTransform(scaleTransform);
partMgr->appendDynamicGeometryPartsToModel(timeStep, model, displayModelOffset, characteristicCellSize, wellPathClipBoundingBox, displayCoordTransform);
}
}

View File

@@ -32,6 +32,7 @@
class RimWellPathCollection;
class RimProject;
class RivWellPathPartMgr;
class RimView;
namespace cvf
{
@@ -55,11 +56,20 @@ public:
void setScaleTransform(cvf::Transform * scaleTransform);
void appendStaticGeometryPartsToModel(
cvf::ModelBasicList* model,
cvf::Vec3d displayModelOffset,
cvf::Transform* scaleTransform,
double characteristicCellSize,
cvf::BoundingBox wellPathClipBoundingBox,
cvf::ModelBasicList* model,
cvf::Vec3d displayModelOffset,
cvf::Transform* scaleTransform,
double characteristicCellSize,
cvf::BoundingBox wellPathClipBoundingBox,
caf::DisplayCoordTransform* displayCoordTransform);
void appendDynamicGeometryPartsToModel(
size_t timeStep,
cvf::ModelBasicList* model,
cvf::Vec3d displayModelOffset,
cvf::Transform* scaleTransform,
double characteristicCellSize,
cvf::BoundingBox wellPathClipBoundingBox,
caf::DisplayCoordTransform* displayCoordTransform);
private:

View File

@@ -391,6 +391,19 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m
appendPerforationsToModel(model, displayCoordTransform, characteristicCellSize);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(size_t frameIndex,
cvf::ModelBasicList* model,
cvf::Vec3d displayModelOffset,
double characteristicCellSize,
cvf::BoundingBox wellPathClipBoundingBox,
caf::DisplayCoordTransform* displayCoordTransform)
{
// TODO add perforation intervals
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -58,6 +58,10 @@ public:
double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox,
caf::DisplayCoordTransform* displayCoordTransform);
void appendDynamicGeometryPartsToModel(size_t frameIndex, cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset,
double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox,
caf::DisplayCoordTransform* displayCoordTransform);
size_t segmentIndexFromTriangleIndex(size_t triangleIndex);
private:

View File

@@ -69,6 +69,7 @@
#include "cafCadNavigation.h"
#include "cafCeetronPlusNavigation.h"
#include "cafDisplayCoordTransform.h"
#include "cafFrameAnimationControl.h"
#include "cafPdmUiTreeOrdering.h"
@@ -617,23 +618,52 @@ void RimEclipseView::updateCurrentTimeStep()
crossSectionCollection->applySingleColorEffect();
}
// Simulation Wells
if (m_viewer)
{
cvf::Scene* frameScene = m_viewer->frame(m_currentTimeStep);
if (frameScene)
{
cvf::ref<cvf::ModelBasicList> simWellModelBasicList = new cvf::ModelBasicList;
simWellModelBasicList->setName("SimWellPipeMod");
// Simulation Wells
{
cvf::String name = "SimWellPipeMod";
this->removeModelByName(frameScene, name);
m_simWellsPartManager->appendDynamicGeometryPartsToModel(simWellModelBasicList.p(), m_currentTimeStep);
cvf::ref<cvf::ModelBasicList> simWellModelBasicList = new cvf::ModelBasicList;
simWellModelBasicList->setName(name);
simWellModelBasicList->updateBoundingBoxesRecursive();
m_simWellsPartManager->appendDynamicGeometryPartsToModel(simWellModelBasicList.p(), m_currentTimeStep);
this->removeModelByName(frameScene, simWellModelBasicList->name());
frameScene->addModel(simWellModelBasicList.p());
simWellModelBasicList->updateBoundingBoxesRecursive();
m_simWellsPartManager->updatePipeResultColor(m_currentTimeStep);
frameScene->addModel(simWellModelBasicList.p());
m_simWellsPartManager->updatePipeResultColor(m_currentTimeStep);
}
// Well Paths
{
cvf::String name = "WellPathMod";
this->removeModelByName(frameScene, name);
cvf::ref<cvf::ModelBasicList> wellPathModelBasicList = new cvf::ModelBasicList;
wellPathModelBasicList->setName(name);
RigMainGrid* mainGrid = this->mainGrid();
if (mainGrid)
{
wellPathsPartManager()->appendDynamicGeometryPartsToModel(m_currentTimeStep,
wellPathModelBasicList.p(),
mainGrid->displayModelOffset(),
m_reservoirGridPartManager->scaleTransform(),
mainGrid->characteristicIJCellSize(),
currentActiveCellInfo()->geometryBoundingBox(),
this->displayCoordTransform().p());
wellPathModelBasicList->updateBoundingBoxesRecursive();
frameScene->addModel(wellPathModelBasicList.p());
}
}
}
}