#2703 An initial implementation of filled drawing style with problems remaining.

* New vertices are successfully created in the intersections between the
  curve and draw surface triangles
* New vertices are also inserted along the bottom edge of the filled curve.
* However, new vertices will still need to be inserted in the lines connecting the
  top of the curve and the bottom where they intersect with the triangles.
* The option for filled curves remain hidden in the GUI. See #2860.

# Please enter the commit message for your changes. Lines starting
This commit is contained in:
Gaute Lindkvist
2018-05-04 13:20:49 +02:00
parent fba437f595
commit 78326bb19c
6 changed files with 298 additions and 113 deletions

View File

@@ -109,24 +109,46 @@ void Riv3dWellLogPlanePartMgr::append3dWellLogCurveToModel(cvf::ModelBasicList*
planeWidth(),
drawSurfaceVertices);
cvf::ref<cvf::DrawableGeo> curveDrawable = generator->curveDrawable();
if (curveDrawable.isNull() || !curveDrawable->boundingBox().isValid())
if (curveDrawable.notNull() && curveDrawable->boundingBox().isValid())
{
return;
caf::MeshEffectGenerator meshEffectGen(rim3dWellLogCurve->color());
meshEffectGen.setLineWidth(2.0f);
cvf::ref<cvf::Effect> effect = meshEffectGen.generateCachedEffect();
cvf::ref<cvf::Part> part = new cvf::Part;
part->setDrawable(curveDrawable.p());
part->setEffect(effect.p());
if (part.notNull())
{
model->addPart(part.p());
}
}
caf::MeshEffectGenerator meshEffectGen(rim3dWellLogCurve->color());
meshEffectGen.setLineWidth(2.0f);
cvf::ref<cvf::Effect> effect = meshEffectGen.generateCachedEffect();
cvf::ref<cvf::Part> part = new cvf::Part;
part->setDrawable(curveDrawable.p());
part->setEffect(effect.p());
if (part.notNull())
if (rim3dWellLogCurve->drawStyle() == Rim3dWellLogCurve::FILLED)
{
model->addPart(part.p());
Rim3dWellLogCurveCollection* curveCollection = m_wellPath->rim3dWellLogCurveCollection();
cvf::ref<RivObjectSourceInfo> sourceInfo = new RivObjectSourceInfo(curveCollection);
cvf::ref<cvf::DrawableGeo> curveFilledDrawable = generator->curveFilledDrawable();
if (curveFilledDrawable.notNull() && curveFilledDrawable->boundingBox().isValid())
{
caf::SurfaceEffectGenerator filledEffectGen(rim3dWellLogCurve->color(), caf::PO_NONE);
filledEffectGen.enableLighting(false);
cvf::ref<cvf::Effect> filledEffect = filledEffectGen.generateCachedEffect();
cvf::ref<cvf::Part> part = new cvf::Part;
part->setDrawable(curveFilledDrawable.p());
part->setEffect(filledEffect.p());
if (part.notNull())
{
model->addPart(part.p());
part->setSourceInfo(sourceInfo.p());
}
}
}
}
@@ -186,6 +208,8 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel(cvf::ModelBasicList*
double samplingInterval)
{
Rim3dWellLogCurveCollection* curveCollection = m_wellPath->rim3dWellLogCurveCollection();
cvf::ref<RivObjectSourceInfo> sourceInfo = new RivObjectSourceInfo(curveCollection);
bool showCoordinateSystemMesh = curveCollection->isShowingGrid();
bool showBackground = curveCollection->isShowingBackground();
@@ -216,7 +240,7 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel(cvf::ModelBasicList*
cvf::ref<cvf::Effect> curveNormalsEffect = curveNormalsEffectGen.generateCachedEffect();
cvf::ref<cvf::DrawableGeo> background = m_3dWellLogDrawSurfaceGeometryGenerator->background();
cvf::ref<RivObjectSourceInfo> sourceInfo = new RivObjectSourceInfo(curveCollection);
if (background.notNull())
{
cvf::ref<cvf::Part> part = createPart(background.p(), backgroundEffect.p());