#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);
}