#3261 Show 3d well log curves even if the grid result isn't dynamic.

* Have to be more precise on whether to attach the results as a static or dynamic property.
* Also rewrite some 3dWellLogPlanePartMgr code to only create one draw surface for each draw plane used for the curves.
This commit is contained in:
Gaute Lindkvist
2018-09-03 14:52:00 +02:00
parent 4c84bbb8a3
commit e3baaa4133
14 changed files with 157 additions and 42 deletions

View File

@@ -103,7 +103,7 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables(const caf::Display
}
std::vector<cvf::Vec3d> wellPathCurveNormals =
RigWellPathGeometryTools::calculateLineSegmentNormals(wellPathPoints, rim3dWellLogCurve->drawPlaneAngle());
RigWellPathGeometryTools::calculateLineSegmentNormals(wellPathPoints, rim3dWellLogCurve->drawPlaneAngle(rim3dWellLogCurve->drawPlane()));
std::vector<cvf::Vec3d> interpolatedWellPathPoints;
std::vector<cvf::Vec3d> interpolatedCurveNormals;

View File

@@ -52,7 +52,6 @@ Riv3dWellLogPlanePartMgr::Riv3dWellLogPlanePartMgr(RimWellPath* wellPath, RimGri
, m_gridView(gridView)
{
CVF_ASSERT(m_wellPath.notNull());
m_3dWellLogDrawSurfaceGeometryGenerator = new Riv3dWellLogDrawSurfaceGenerator(m_wellPath.p());
}
//--------------------------------------------------------------------------------------------------
@@ -60,7 +59,8 @@ Riv3dWellLogPlanePartMgr::Riv3dWellLogPlanePartMgr(RimWellPath* wellPath, RimGri
//--------------------------------------------------------------------------------------------------
void Riv3dWellLogPlanePartMgr::appendPlaneToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& wellPathClipBoundingBox)
const cvf::BoundingBox& wellPathClipBoundingBox,
bool isStaticResult)
{
if (m_wellPath.isNull()) return;
@@ -70,16 +70,32 @@ void Riv3dWellLogPlanePartMgr::appendPlaneToModel(cvf::ModelBasicList*
if (m_wellPath->rim3dWellLogCurveCollection()->vectorOf3dWellLogCurves().empty()) return;
if (isStaticResult)
{
std::set<Rim3dWellLogCurve::DrawPlane> drawPlanes;
for (Rim3dWellLogCurve* rim3dWellLogCurve : m_wellPath->rim3dWellLogCurveCollection()->vectorOf3dWellLogCurves())
{
if (rim3dWellLogCurve->showInView(m_gridView))
{
drawPlanes.insert(rim3dWellLogCurve->drawPlane());
}
}
for (Rim3dWellLogCurve::DrawPlane drawPlane : drawPlanes)
{
m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane] = new Riv3dWellLogDrawSurfaceGenerator(m_wellPath.p());
appendDrawSurfaceToModel(model, displayCoordTransform, wellPathClipBoundingBox, drawPlane, planeWidth());
}
}
for (Rim3dWellLogCurve* rim3dWellLogCurve : m_wellPath->rim3dWellLogCurveCollection()->vectorOf3dWellLogCurves())
{
if (rim3dWellLogCurve->isShowingCurve())
if (rim3dWellLogCurve->isShowingTimeDependentResultInView(m_gridView) != isStaticResult)
{
appendDrawSurfaceToModel(model, displayCoordTransform, wellPathClipBoundingBox, rim3dWellLogCurve, planeWidth());
append3dWellLogCurveToModel(model,
displayCoordTransform,
wellPathClipBoundingBox,
rim3dWellLogCurve,
m_3dWellLogDrawSurfaceGeometryGenerator->vertices());
m_3dWellLogDrawSurfaceGeometryGenerators[rim3dWellLogCurve->drawPlane()]->vertices());
}
}
}
@@ -105,7 +121,7 @@ void Riv3dWellLogPlanePartMgr::append3dWellLogCurveToModel(cvf::ModelBasicList*
generator->createCurveDrawables(displayCoordTransform,
wellPathClipBoundingBox,
rim3dWellLogCurve,
wellPathCenterToPlotStartOffset(rim3dWellLogCurve),
wellPathCenterToPlotStartOffset(rim3dWellLogCurve->drawPlane()),
planeWidth(),
drawSurfaceVertices,
m_gridView->currentTimeStep());
@@ -148,10 +164,10 @@ cvf::ref<cvf::Part> Riv3dWellLogPlanePartMgr::createPart(cvf::Drawable* drawable
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double Riv3dWellLogPlanePartMgr::wellPathCenterToPlotStartOffset(const Rim3dWellLogCurve* curve) const
double Riv3dWellLogPlanePartMgr::wellPathCenterToPlotStartOffset(Rim3dWellLogCurve::DrawPlane drawPlane) const
{
if (curve->drawPlane() == Rim3dWellLogCurve::HORIZONTAL_CENTER ||
curve->drawPlane() == Rim3dWellLogCurve::VERTICAL_CENTER)
if (drawPlane == Rim3dWellLogCurve::HORIZONTAL_CENTER ||
drawPlane == Rim3dWellLogCurve::VERTICAL_CENTER)
{
return -0.5*planeWidth();
}
@@ -179,16 +195,16 @@ double Riv3dWellLogPlanePartMgr::planeWidth() const
///
//--------------------------------------------------------------------------------------------------
void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& wellPathClipBoundingBox,
const Rim3dWellLogCurve* rim3dWellLogCurve,
double samplingInterval)
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& wellPathClipBoundingBox,
Rim3dWellLogCurve::DrawPlane drawPlane,
double samplingInterval)
{
Rim3dWellLogCurveCollection* curveCollection = m_wellPath->rim3dWellLogCurveCollection();
cvf::ref<RivObjectSourceInfo> sourceInfo = new RivObjectSourceInfo(curveCollection);
bool showCoordinateSystemMesh = curveCollection->isShowingGrid();
bool showBackground = curveCollection->isShowingBackground();
bool showCoordinateSystemMesh = curveCollection->isShowingGrid();
bool showBackground = curveCollection->isShowingBackground();
cvf::Color3f borderColor(0.4f, 0.4f, 0.4f);
caf::SurfaceEffectGenerator backgroundEffectGen(cvf::Color4f(1.0, 1.0, 1.0, 1.0), caf::PO_2);
@@ -204,10 +220,10 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel(cvf::ModelBasicList*
backgroundEffectGen.enableDepthWrite(false);
}
bool drawSurfaceCreated = m_3dWellLogDrawSurfaceGeometryGenerator->createDrawSurface(displayCoordTransform,
bool drawSurfaceCreated = m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane]->createDrawSurface(displayCoordTransform,
wellPathClipBoundingBox,
rim3dWellLogCurve->drawPlaneAngle(),
wellPathCenterToPlotStartOffset(rim3dWellLogCurve),
Rim3dWellLogCurve::drawPlaneAngle(drawPlane),
wellPathCenterToPlotStartOffset(drawPlane),
planeWidth(),
samplingInterval);
if (!drawSurfaceCreated) return;
@@ -216,7 +232,7 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel(cvf::ModelBasicList*
cvf::ref<cvf::Effect> borderEffect = borderEffectGen.generateCachedEffect();
cvf::ref<cvf::Effect> curveNormalsEffect = curveNormalsEffectGen.generateCachedEffect();
cvf::ref<cvf::DrawableGeo> background = m_3dWellLogDrawSurfaceGeometryGenerator->background();
cvf::ref<cvf::DrawableGeo> background = m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane]->background();
if (background.notNull())
{
@@ -230,7 +246,7 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel(cvf::ModelBasicList*
if (showCoordinateSystemMesh)
{
cvf::ref<cvf::DrawableGeo> border = m_3dWellLogDrawSurfaceGeometryGenerator->border();
cvf::ref<cvf::DrawableGeo> border = m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane]->border();
if (border.notNull())
{
cvf::ref<cvf::Part> part = createPart(border.p(), borderEffect.p());
@@ -240,7 +256,7 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel(cvf::ModelBasicList*
}
}
cvf::ref<cvf::DrawableVectors> normals = m_3dWellLogDrawSurfaceGeometryGenerator->curveNormalVectors();
cvf::ref<cvf::DrawableVectors> normals = m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane]->curveNormalVectors();
if (normals.notNull())
{
normals->setSingleColor(borderColor);

View File

@@ -54,7 +54,8 @@ public:
void appendPlaneToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& wellPathClipBoundingBox);
const cvf::BoundingBox& wellPathClipBoundingBox,
bool isStaticResult = false);
private:
void append3dWellLogCurveToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
@@ -65,16 +66,16 @@ private:
void appendDrawSurfaceToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& wellPathClipBoundingBox,
const Rim3dWellLogCurve* rim3dWellLogCurve,
Rim3dWellLogCurve::DrawPlane drawPlane,
double samplingInterval);
cvf::ref<cvf::Part> createPart(cvf::Drawable* drawable, cvf::Effect* effect);
double wellPathCenterToPlotStartOffset(const Rim3dWellLogCurve* curve) const;
double wellPathCenterToPlotStartOffset(Rim3dWellLogCurve::DrawPlane drawPlane) const;
double planeWidth() const;
private:
cvf::ref<Riv3dWellLogDrawSurfaceGenerator> m_3dWellLogDrawSurfaceGeometryGenerator;
std::map<Rim3dWellLogCurve::DrawPlane, cvf::ref<Riv3dWellLogDrawSurfaceGenerator>> m_3dWellLogDrawSurfaceGeometryGenerators;
caf::PdmPointer<RimWellPath> m_wellPath;
caf::PdmPointer<RimGridView> m_gridView;

View File

@@ -502,6 +502,12 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList*
appendFishboneSubsPartsToModel(model, displayCoordTransform, characteristicCellSize);
appendImportedFishbonesToModel(model, displayCoordTransform, characteristicCellSize);
RimGridView* gridView = dynamic_cast<RimGridView*>(m_rimView.p());
if (!gridView) return;
m_3dWellLogPlanePartMgr = new Riv3dWellLogPlanePartMgr(m_rimWellPath, gridView);
m_3dWellLogPlanePartMgr->appendPlaneToModel(model, displayCoordTransform, wellPathClipBoundingBox, true);
}
//--------------------------------------------------------------------------------------------------
@@ -564,8 +570,11 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList*
RimGridView* gridView = dynamic_cast<RimGridView*>(m_rimView.p());
if (!gridView) return;
m_3dWellLogPlanePartMgr = new Riv3dWellLogPlanePartMgr(m_rimWellPath, gridView);
m_3dWellLogPlanePartMgr->appendPlaneToModel(model, displayCoordTransform, wellPathClipBoundingBox);
if (m_3dWellLogPlanePartMgr.isNull())
{
m_3dWellLogPlanePartMgr = new Riv3dWellLogPlanePartMgr(m_rimWellPath, gridView);
}
m_3dWellLogPlanePartMgr->appendPlaneToModel(model, displayCoordTransform, wellPathClipBoundingBox, false);
}

View File

@@ -410,6 +410,23 @@ RimWellPathCollection* Rim3dView::wellPathCollection() const
return RimTools::wellPathCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool Rim3dView::hasVisibleTimeStepDependent3dWellLogCurves() const
{
std::vector<Rim3dWellLogCurve*> wellLogCurves;
wellPathCollection()->descendantsIncludingThisOfType(wellLogCurves);
for (const Rim3dWellLogCurve* curve : wellLogCurves)
{
if (curve->isShowingTimeDependentResultInView(this))
{
return true;
}
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -152,7 +152,8 @@ protected:
RimWellPathCollection* wellPathCollection() const;
void addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
bool hasVisibleTimeStepDependent3dWellLogCurves() const;
void addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
const cvf::BoundingBox& wellPathClipBoundingBox);
void addDynamicWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,

View File

@@ -100,9 +100,9 @@ Rim3dWellLogCurve::DrawPlane Rim3dWellLogCurve::drawPlane() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double Rim3dWellLogCurve::drawPlaneAngle() const
double Rim3dWellLogCurve::drawPlaneAngle(Rim3dWellLogCurve::DrawPlane drawPlane)
{
switch (drawPlane())
switch (drawPlane)
{
case HORIZONTAL_LEFT:
case HORIZONTAL_CENTER:

View File

@@ -30,6 +30,7 @@
#include "RimNameConfig.h"
class Riv3dWellLogCurveGeometryGenerator;
class Rim3dView;
//==================================================================================================
///
@@ -61,11 +62,12 @@ public:
virtual QString resultPropertyString() const = 0;
DrawPlane drawPlane() const;
double drawPlaneAngle() const;
static double drawPlaneAngle(DrawPlane drawPlane);
cvf::Color3f color() const;
bool isShowingCurve() const;
virtual bool isShowingTimeDependentResultInView(const Rim3dView* gridView) const { return showInView(gridView); }
virtual bool showInView(const Rim3dView* gridView) const { return isShowingCurve(); }
virtual bool followAnimationTimeStep() const { return false; }
virtual void curveValuesAndMds(std::vector<double>* values, std::vector<double>* measuredDepthValues) const = 0;
virtual void curveValuesAndMdsAtTimeStep(std::vector<double>* values, std::vector<double>* measuredDepthValues, int timeStep) const;

View File

@@ -375,6 +375,44 @@ double Rim3dWellLogExtractionCurve::rkbDiff() const
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool Rim3dWellLogExtractionCurve::isShowingTimeDependentResultInView(const Rim3dView* gridView) const
{
if (showInView(gridView))
{
if (dynamic_cast<const RimEclipseCase*>(m_case()))
{
return m_eclipseResultDefinition->hasDynamicResult();
}
else if (dynamic_cast<const RimGeoMechCase*>(m_case()))
{
return m_geomResultDefinition->hasResult();
}
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool Rim3dWellLogExtractionCurve::showInView(const Rim3dView* gridView) const
{
if (isShowingCurve())
{
if (dynamic_cast<const RimEclipseCase*>(m_case()))
{
return dynamic_cast<const RimEclipseView*>(gridView) != nullptr;
}
else if (dynamic_cast<const RimGeoMechCase*>(m_case()))
{
return dynamic_cast<const RimGeoMechView*>(gridView) != nullptr;
}
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -388,7 +426,22 @@ caf::PdmFieldHandle* Rim3dWellLogExtractionCurve::userDescriptionField()
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogExtractionCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
if (changedField == &m_case || changedField == &m_timeStep)
if (changedField == &m_case)
{
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case());
RimGeoMechCase* geoMechCase = dynamic_cast<RimGeoMechCase*>(m_case());
if (eclipseCase)
{
m_eclipseResultDefinition->setEclipseCase(eclipseCase);
}
else if (geoMechCase)
{
m_geomResultDefinition->setGeoMechCase(geoMechCase);
}
this->resetMinMaxValuesAndUpdateUI();
}
else if (changedField == &m_timeStep)
{
this->resetMinMaxValuesAndUpdateUI();
}

View File

@@ -53,6 +53,11 @@ public:
virtual QString name() const override;
virtual QString createAutoName() const override;
double rkbDiff() const;
virtual bool isShowingTimeDependentResultInView(const Rim3dView* gridView) const override;
virtual bool showInView(const Rim3dView* gridView) const override;
protected:
virtual caf::PdmFieldHandle* userDescriptionField() override;
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;

View File

@@ -1563,6 +1563,8 @@ bool RimEclipseView::isTimeStepDependentDataVisible() const
if (this->wellPathCollection()->anyWellsContainingPerforationIntervals()) return true;
if (this->hasVisibleTimeStepDependent3dWellLogCurves()) return true;
return false;
}

View File

@@ -129,7 +129,7 @@ QString RimGeoMechCase::caseFileName() const
//--------------------------------------------------------------------------------------------------
RigGeoMechCaseData* RimGeoMechCase::geoMechData()
{
return m_geoMechCaseData.p();
return m_geoMechCaseData.p();
}
//--------------------------------------------------------------------------------------------------
@@ -137,7 +137,7 @@ RigGeoMechCaseData* RimGeoMechCase::geoMechData()
//--------------------------------------------------------------------------------------------------
const RigGeoMechCaseData* RimGeoMechCase::geoMechData() const
{
return m_geoMechCaseData.p();
return m_geoMechCaseData.p();
}
//--------------------------------------------------------------------------------------------------

View File

@@ -646,7 +646,16 @@ void RimGeoMechView::clampCurrentTimestep()
//--------------------------------------------------------------------------------------------------
bool RimGeoMechView::isTimeStepDependentDataVisible() const
{
return this->hasUserRequestedAnimation() && (this->cellResult()->hasResult() || this->geoMechPropertyFilterCollection()->hasActiveFilters());
if (this->hasUserRequestedAnimation() &&
(this->cellResult()->hasResult() || this->geoMechPropertyFilterCollection()->hasActiveFilters()))
{
return true;
}
if (this->hasVisibleTimeStepDependent3dWellLogCurves())
{
return true;
}
return false;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -33,11 +33,11 @@ RimWellLogExtractionCurveNameConfig::RimWellLogExtractionCurveNameConfig(const R
{
CAF_PDM_InitObject("Well Log Extraction Curve Name Generator", "", "", "");
CAF_PDM_InitField(&m_addCaseName, "AddCaseName", false, "Add Case Name", "", "", "");
CAF_PDM_InitField(&m_addProperty, "AddProperty", false, "Add Property Type", "", "", "");
CAF_PDM_InitField(&m_addWellName, "AddWellName", false, "Add Well Name", "", "", "");
CAF_PDM_InitField(&m_addTimestep, "AddTimeStep", false, "Add Time Step", "", "", "");
CAF_PDM_InitField(&m_addDate, "AddDate", false, "Add Date", "", "", "");
CAF_PDM_InitField(&m_addCaseName, "AddCaseName", true, "Add Case Name", "", "", "");
CAF_PDM_InitField(&m_addProperty, "AddProperty", true, "Add Property Type", "", "", "");
CAF_PDM_InitField(&m_addWellName, "AddWellName", true, "Add Well Name", "", "", "");
CAF_PDM_InitField(&m_addTimestep, "AddTimeStep", true, "Add Time Step", "", "", "");
CAF_PDM_InitField(&m_addDate, "AddDate", true, "Add Date", "", "", "");
m_customName = "Log Extraction";
}