mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2591 3D well log curves: Option to turn grid on/off
This commit is contained in:
@@ -61,7 +61,7 @@ cvf::ref<cvf::DrawableGeo>
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo> Riv3dWellLogCurveGeometryGenerator::createGrid(const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
const Rim3dWellLogCurve* rim3dWellLogCurve,
|
||||
const Rim3dWellLogCurve::DrawPlane drawPlane,
|
||||
double gridIntervalSize) const
|
||||
{
|
||||
CVF_ASSERT(gridIntervalSize > 0);
|
||||
@@ -89,7 +89,7 @@ cvf::ref<cvf::DrawableGeo> Riv3dWellLogCurveGeometryGenerator::createGrid(const
|
||||
md += gridIntervalSize;
|
||||
}
|
||||
|
||||
pointNormals = calculatePointNormals(rim3dWellLogCurve->drawPlane(), gridPoints);
|
||||
pointNormals = calculatePointNormals(drawPlane, gridPoints);
|
||||
if (pointNormals.size() != gridPoints.size()) return nullptr;
|
||||
|
||||
std::vector<cvf::Vec3f> vertices;
|
||||
|
||||
@@ -44,9 +44,10 @@ public:
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> createCurveLine(const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
const Rim3dWellLogCurve* rim3dWellLogCurve) const;
|
||||
cvf::ref<cvf::DrawableGeo> createGrid(const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
const Rim3dWellLogCurve* rim3dWellLogCurve,
|
||||
double gridIntervalSize) const;
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> createGrid(const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
const Rim3dWellLogCurve::DrawPlane drawPlane,
|
||||
double gridIntervalSize) const;
|
||||
|
||||
private:
|
||||
void createCurveVerticesAndIndices(const Rim3dWellLogCurve* rim3dWellLogCurve,
|
||||
|
||||
@@ -61,8 +61,8 @@ void Riv3dWellLogPlanePartMgr::append3dWellLogCurvesToModel(cvf::ModelBasicList*
|
||||
continue;
|
||||
}
|
||||
|
||||
caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(255, 0, 0, 0.5), caf::PO_1);
|
||||
cvf::ref<cvf::Effect> effect = surfaceGen.generateCachedEffect();
|
||||
caf::MeshEffectGenerator meshEffectGen(cvf::Color3f(0.9f, 0.0f, 0.0f));
|
||||
cvf::ref<cvf::Effect> effect = meshEffectGen.generateCachedEffect();
|
||||
|
||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
part->setDrawable(curveDrawable.p());
|
||||
@@ -73,24 +73,48 @@ void Riv3dWellLogPlanePartMgr::append3dWellLogCurvesToModel(cvf::ModelBasicList*
|
||||
model->addPart(part.p());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Atm, only the grid for the first curve is drawn.
|
||||
cvf::ref<cvf::Drawable> gridDrawable = m_3dWellLogCurveGeometryGenerator->createGrid(displayCoordTransform, rim3dWellLogCurves[0], 200);
|
||||
cvf::ref<cvf::Part> Riv3dWellLogPlanePartMgr::createPart(cvf::Drawable* drawable, cvf::Effect* effect)
|
||||
{
|
||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
|
||||
if (gridDrawable.isNull() || !gridDrawable->boundingBox().isValid())
|
||||
if (drawable && drawable->boundingBox().isValid())
|
||||
{
|
||||
return;
|
||||
part->setDrawable(drawable);
|
||||
part->setEffect(effect);
|
||||
}
|
||||
|
||||
caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(255, 255, 0, 1), caf::PO_1);
|
||||
cvf::ref<cvf::Effect> effect = surfaceGen.generateCachedEffect();
|
||||
return part;
|
||||
}
|
||||
|
||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
part->setDrawable(gridDrawable.p());
|
||||
part->setEffect(effect.p());
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Riv3dWellLogPlanePartMgr::appendGridToModel(cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform, double gridIntervalSize)
|
||||
{
|
||||
caf::MeshEffectGenerator meshEffectGen(cvf::Color3f(0.4f, 0.4f, 0.4f));
|
||||
|
||||
if (part.notNull())
|
||||
{
|
||||
model->addPart(part.p());
|
||||
cvf::ref<cvf::Drawable> gridHorizontalDrawable = m_3dWellLogCurveGeometryGenerator->createGrid(displayCoordTransform, Rim3dWellLogCurve::HORIZONTAL_LEFT, gridIntervalSize);
|
||||
|
||||
cvf::ref<cvf::Effect> effect = meshEffectGen.generateCachedEffect();
|
||||
cvf::ref<cvf::Part> part = createPart(gridHorizontalDrawable.p(), effect.p());
|
||||
|
||||
if (part.notNull())
|
||||
{
|
||||
model->addPart(part.p());
|
||||
}
|
||||
}
|
||||
{
|
||||
cvf::ref<cvf::Drawable> gridHorizontalDrawable = m_3dWellLogCurveGeometryGenerator->createGrid(displayCoordTransform, Rim3dWellLogCurve::HORIZONTAL_RIGHT, gridIntervalSize);
|
||||
|
||||
cvf::ref<cvf::Effect> effect = meshEffectGen.generateCachedEffect();
|
||||
cvf::ref<cvf::Part> part = createPart(gridHorizontalDrawable.p(), effect.p());
|
||||
|
||||
if (part.notNull())
|
||||
{
|
||||
model->addPart(part.p());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
namespace cvf
|
||||
{
|
||||
class ModelBasicList;
|
||||
class Drawable;
|
||||
class Effect;
|
||||
class Part;
|
||||
}
|
||||
|
||||
namespace caf
|
||||
@@ -49,6 +52,11 @@ public:
|
||||
const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
std::vector<Rim3dWellLogCurve*> rim3dWellLogCurves);
|
||||
|
||||
void appendGridToModel(cvf::ModelBasicList* model,
|
||||
const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
double gridIntervalSize);
|
||||
private:
|
||||
cvf::ref<cvf::Part> createPart(cvf::Drawable* drawable, cvf::Effect* effect);
|
||||
private:
|
||||
cvf::ref<Riv3dWellLogCurveGeometryGenerator> m_3dWellLogCurveGeometryGenerator;
|
||||
cvf::ref<RigWellPath> m_wellPathGeometry;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "RigVirtualPerforationTransmissibilities.h"
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "Rim3dWellLogCurveCollection.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFishboneWellPath.h"
|
||||
@@ -457,17 +458,26 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList*
|
||||
|
||||
if (m_rimWellPath.isNull()) return;
|
||||
|
||||
if (wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF)
|
||||
return;
|
||||
if (wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return;
|
||||
|
||||
if (wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_ON && m_rimWellPath->showWellPath() == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
appendPerforationsToModel(model, timeStepIndex, displayCoordTransform, characteristicCellSize);
|
||||
appendVirtualTransmissibilitiesToModel(model, timeStepIndex, displayCoordTransform, characteristicCellSize);
|
||||
|
||||
if (!m_rimWellPath->rim3dWellLogCurveCollection()) return;
|
||||
if (!m_rimWellPath->rim3dWellLogCurveCollection()->showPlot()) return;
|
||||
|
||||
m_3dWellLogCurvePartMgr = new Riv3dWellLogPlanePartMgr(m_rimWellPath->wellPathGeometry());
|
||||
m_3dWellLogCurvePartMgr->append3dWellLogCurvesToModel(model, displayCoordTransform, m_rimWellPath->vectorOf3dWellLogCurves());
|
||||
|
||||
if (m_rimWellPath->rim3dWellLogCurveCollection()->showGrid())
|
||||
{
|
||||
m_3dWellLogCurvePartMgr->appendGridToModel(model, displayCoordTransform, 200);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user