#2601 Well CF Visualization: Support regeneration of viz on time step changes

This commit is contained in:
Magne Sjaastad 2018-03-15 07:52:54 +01:00
parent ab67dcfd1f
commit c8b92a0c89
5 changed files with 20 additions and 21 deletions

View File

@ -159,8 +159,7 @@ void RivWellPathPartMgr::appendImportedFishbonesToModel(cvf::ModelBasicList* mod
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::appendPerforationsToModel(const QDateTime& currentViewDate,
cvf::ModelBasicList* model,
void RivWellPathPartMgr::appendPerforationsToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize)
{
@ -172,6 +171,18 @@ void RivWellPathPartMgr::appendPerforationsToModel(const QDateTime& currentViewD
RigWellPath* wellPathGeometry = m_rimWellPath->wellPathGeometry();
if (!wellPathGeometry) return;
QDateTime currentTimeStamp;
RimEclipseCase* eclipseCase = nullptr;
m_rimView->firstAncestorOrThisOfTypeAsserted(eclipseCase);
size_t timeStepIndex = m_rimView->currentTimeStep();
std::vector<QDateTime> timeStamps = eclipseCase->timeStepDates();
if (timeStepIndex < static_cast<int>(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());
@ -186,7 +197,7 @@ void RivWellPathPartMgr::appendPerforationsToModel(const QDateTime& currentViewD
if (!perforation->isChecked()) continue;
if (perforation->startMD() > perforation->endMD()) continue;
if (currentViewDate.isValid() && !perforation->isActiveOnDate(currentViewDate)) continue;
if (currentTimeStamp.isValid() && !perforation->isActiveOnDate(currentTimeStamp)) continue;
using namespace std;
pair<vector<cvf::Vec3d>, vector<double> > displayCoordsAndMD = wellPathGeometry->clippedPointSubset(perforation->startMD(),
@ -229,7 +240,9 @@ void RivWellPathPartMgr::appendVirtualTransmissibilitiesToModel(cvf::ModelBasicL
{
m_virtualConnectionFactorPartMgr = new RivVirtualConnFactorPartMgr(m_rimWellPath, eclView->virtualPerforationResult());
m_virtualConnectionFactorPartMgr->appendDynamicGeometryPartsToModel(model, 0);
size_t timeStepIndex = m_rimView->currentTimeStep();
m_virtualConnectionFactorPartMgr->appendDynamicGeometryPartsToModel(model, timeStepIndex);
}
}
@ -422,14 +435,12 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m
appendFishboneSubsPartsToModel(model, displayCoordTransform, characteristicCellSize);
appendImportedFishbonesToModel(model, displayCoordTransform, characteristicCellSize);
appendVirtualTransmissibilitiesToModel(model, displayCoordTransform, characteristicCellSize);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
const QDateTime& timeStamp,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform)
@ -447,7 +458,8 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList*
if (wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_ON && m_rimWellPath->showWellPath() == false)
return;
appendPerforationsToModel(timeStamp, model, displayCoordTransform, characteristicCellSize);
appendPerforationsToModel(model, displayCoordTransform, characteristicCellSize);
appendVirtualTransmissibilitiesToModel(model, displayCoordTransform, characteristicCellSize);
m_3dWellLogCurvePartMgr = new Riv3dWellLogPlanePartMgr(m_rimWellPath->wellPathGeometry());
m_3dWellLogCurvePartMgr->append3dWellLogCurvesToModel(model, displayCoordTransform, m_rimWellPath->vectorOf3dWellLogCurves());

View File

@ -67,7 +67,6 @@ public:
void appendStaticFracturePartsToModel(cvf::ModelBasicList* model);
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
const QDateTime& timeStamp,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform);
@ -83,8 +82,7 @@ private:
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize);
void appendPerforationsToModel(const QDateTime& currentViewDate,
cvf::ModelBasicList* model,
void appendPerforationsToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize);

View File

@ -74,7 +74,6 @@ void RivWellPathsPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList*
///
//--------------------------------------------------------------------------------------------------
void RivWellPathsPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
const QDateTime& timeStamp,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform)
@ -86,7 +85,6 @@ void RivWellPathsPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList*
for (auto& partMgr : m_wellPatshsPartMgrs)
{
partMgr->appendDynamicGeometryPartsToModel(model,
timeStamp,
characteristicCellSize,
wellPathClipBoundingBox,
displayCoordTransform);

View File

@ -64,7 +64,6 @@ public:
void appendStaticFracturePartsToModel(cvf::ModelBasicList* model);
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
const QDateTime& timeStamp,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform);

View File

@ -681,15 +681,7 @@ void Rim3dView::addDynamicWellPathsToModel(cvf::ModelBasicList* wellPathModelBas
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
QDateTime currentTimeStamp;
std::vector<QDateTime> timeStamps = ownerCase()->timeStepDates();
if (currentTimeStep() < static_cast<int>(timeStamps.size()))
{
currentTimeStamp = timeStamps[currentTimeStep()];
}
m_wellPathsPartManager->appendDynamicGeometryPartsToModel(wellPathModelBasicList,
currentTimeStamp,
this->ownerCase()->characteristicCellSize(),
wellPathClipBoundingBox,
transForm.p());