#2621 Improve interface of part managers to prepare for use in 2D intersection views

This commit is contained in:
Magne Sjaastad 2018-03-16 11:21:57 +01:00
parent 08a978d0d7
commit 471d625051
6 changed files with 101 additions and 90 deletions

View File

@ -54,6 +54,7 @@ public:
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
size_t frameIndex,
const caf::DisplayCoordTransform* displayXf);
void appendFlattenedDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
size_t frameIndex,
const caf::DisplayCoordTransform* displayXf,

View File

@ -160,6 +160,7 @@ void RivWellPathPartMgr::appendImportedFishbonesToModel(cvf::ModelBasicList* mod
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::appendPerforationsToModel(cvf::ModelBasicList* model,
size_t timeStepIndex,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize)
{
@ -172,16 +173,20 @@ void RivWellPathPartMgr::appendPerforationsToModel(cvf::ModelBasicList* model,
if (!wellPathGeometry) return;
QDateTime currentTimeStamp;
RimEclipseCase* eclipseCase = nullptr;
m_rimView->firstAncestorOrThisOfTypeAsserted(eclipseCase);
if (m_rimView)
{
RimCase* rimCase = nullptr;
m_rimView->firstAncestorOrThisOfType(rimCase);
size_t timeStepIndex = m_rimView->currentTimeStep();
std::vector<QDateTime> timeStamps = eclipseCase->timeStepDates();
if (rimCase)
{
std::vector<QDateTime> timeStamps = rimCase->timeStepDates();
if (timeStepIndex < timeStamps.size())
{
currentTimeStamp = timeStamps[timeStepIndex];
}
}
}
// Since we're using the index of measured depths to find the index of a point, ensure they're equal
CVF_ASSERT(wellPathGeometry->m_measuredDepths.size() == wellPathGeometry->m_wellPathPoints.size());
@ -197,7 +202,7 @@ void RivWellPathPartMgr::appendPerforationsToModel(cvf::ModelBasicList* model,
if (!perforation->isChecked()) continue;
if (perforation->startMD() > perforation->endMD()) continue;
if (currentTimeStamp.isValid() && !perforation->isActiveOnDate(currentTimeStamp)) continue;
if (!perforation->isActiveOnDate(currentTimeStamp)) continue;
using namespace std;
pair<vector<cvf::Vec3d>, vector<double> > displayCoordsAndMD = wellPathGeometry->clippedPointSubset(perforation->startMD(),
@ -223,6 +228,7 @@ void RivWellPathPartMgr::appendPerforationsToModel(cvf::ModelBasicList* model,
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::appendVirtualTransmissibilitiesToModel(cvf::ModelBasicList* model,
size_t timeStepIndex,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize)
{
@ -240,8 +246,6 @@ void RivWellPathPartMgr::appendVirtualTransmissibilitiesToModel(cvf::ModelBasicL
{
m_wellConnectionFactorPartMgr = new RivWellConnectionFactorPartMgr(m_rimWellPath, eclView->virtualPerforationResult());
size_t timeStepIndex = m_rimView->currentTimeStep();
m_wellConnectionFactorPartMgr->appendDynamicGeometryPartsToModel(model, timeStepIndex);
}
}
@ -402,9 +406,9 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform)
const cvf::BoundingBox& wellPathClipBoundingBox)
{
RimWellPathCollection* wellPathCollection = this->wellPathCollection();
if (!wellPathCollection) return;
@ -441,9 +445,10 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
size_t timeStepIndex,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform)
const cvf::BoundingBox& wellPathClipBoundingBox)
{
CVF_ASSERT(model);
@ -458,8 +463,8 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList*
if (wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_ON && m_rimWellPath->showWellPath() == false)
return;
appendPerforationsToModel(model, displayCoordTransform, characteristicCellSize);
appendVirtualTransmissibilitiesToModel(model, displayCoordTransform, characteristicCellSize);
appendPerforationsToModel(model, timeStepIndex, displayCoordTransform, characteristicCellSize);
appendVirtualTransmissibilitiesToModel(model, timeStepIndex, displayCoordTransform, characteristicCellSize);
m_3dWellLogCurvePartMgr = new Riv3dWellLogPlanePartMgr(m_rimWellPath->wellPathGeometry());
m_3dWellLogCurvePartMgr->append3dWellLogCurvesToModel(model, displayCoordTransform, m_rimWellPath->vectorOf3dWellLogCurves());

View File

@ -60,16 +60,18 @@ public:
~RivWellPathPartMgr();
void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform);
const cvf::BoundingBox& wellPathClipBoundingBox);
void appendStaticFracturePartsToModel(cvf::ModelBasicList* model);
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
size_t timeStepIndex,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform);
const cvf::BoundingBox& wellPathClipBoundingBox);
void appendStaticFracturePartsToModel(cvf::ModelBasicList* model);
size_t segmentIndexFromTriangleIndex(size_t triangleIndex);
@ -83,18 +85,20 @@ private:
double characteristicCellSize);
void appendPerforationsToModel(cvf::ModelBasicList* model,
size_t timeStepIndex,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize);
void appendVirtualTransmissibilitiesToModel(cvf::ModelBasicList* model,
size_t timeStepIndex,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize);
void buildWellPathParts(const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox);
void clearAllBranchData();
inline RimWellPathCollection* wellPathCollection();
inline double wellPathRadius(double characteristicCellSize, RimWellPathCollection* wellPathCollection);

View File

@ -30,7 +30,10 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivWellPathsPartMgr::RivWellPathsPartMgr(Rim3dView* view) : m_rimView(view) {}
RivWellPathsPartMgr::RivWellPathsPartMgr(Rim3dView* view)
: m_rimView(view)
{
}
//--------------------------------------------------------------------------------------------------
///
@ -41,9 +44,9 @@ RivWellPathsPartMgr::~RivWellPathsPartMgr() {}
///
//--------------------------------------------------------------------------------------------------
void RivWellPathsPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform)
const cvf::BoundingBox& wellPathClipBoundingBox)
{
if (!isWellPathVisible()) return;
@ -51,7 +54,7 @@ void RivWellPathsPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList*
for (auto& partMgr : m_wellPatshsPartMgrs)
{
partMgr->appendStaticGeometryPartsToModel(model, characteristicCellSize, wellPathClipBoundingBox, displayCoordTransform);
partMgr->appendStaticGeometryPartsToModel(model, displayCoordTransform, characteristicCellSize, wellPathClipBoundingBox);
}
}
@ -74,9 +77,10 @@ void RivWellPathsPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList*
///
//--------------------------------------------------------------------------------------------------
void RivWellPathsPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
size_t timeStepIndex,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform)
const cvf::BoundingBox& wellPathClipBoundingBox)
{
if (!isWellPathVisible()) return;
@ -84,10 +88,8 @@ void RivWellPathsPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList*
for (auto& partMgr : m_wellPatshsPartMgrs)
{
partMgr->appendDynamicGeometryPartsToModel(model,
characteristicCellSize,
wellPathClipBoundingBox,
displayCoordTransform);
partMgr->appendDynamicGeometryPartsToModel(
model, timeStepIndex, displayCoordTransform, characteristicCellSize, wellPathClipBoundingBox);
}
}

View File

@ -18,7 +18,6 @@
#pragma once
#include "cvfBase.h"
#include "cvfCollection.h"
#include "cvfObject.h"
@ -29,13 +28,12 @@
#include <map>
namespace cvf
{
class BoundingBox;
class Transform;
class ModelBasicList;
}
} // namespace cvf
namespace caf
{
@ -57,22 +55,21 @@ public:
~RivWellPathsPartMgr();
void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform);
const cvf::BoundingBox& wellPathClipBoundingBox);
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
size_t timeStepIndex,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox);
void appendStaticFracturePartsToModel(cvf::ModelBasicList* model);
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform);
size_t segmentIndexFromTriangleIndex(size_t triangleIndex, RimWellPath* wellPath) const;
private:
void clearGeometryCache();
void scheduleGeometryRegen();

View File

@ -665,9 +665,9 @@ void Rim3dView::addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
m_wellPathsPartManager->appendStaticGeometryPartsToModel(wellPathModelBasicList,
transForm.p(),
this->ownerCase()->characteristicCellSize(),
wellPathClipBoundingBox,
transForm.p());
wellPathClipBoundingBox);
wellPathModelBasicList->updateBoundingBoxesRecursive();
}
@ -681,10 +681,12 @@ void Rim3dView::addDynamicWellPathsToModel(cvf::ModelBasicList* wellPathModelBas
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
size_t timeStepIndex = currentTimeStep();
m_wellPathsPartManager->appendDynamicGeometryPartsToModel(wellPathModelBasicList,
timeStepIndex,
transForm.p(),
this->ownerCase()->characteristicCellSize(),
wellPathClipBoundingBox,
transForm.p());
wellPathClipBoundingBox);
wellPathModelBasicList->updateBoundingBoxesRecursive();
}