mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2823 Switching curve plane does not work
* The previous drawable and geometry was kept if switching to a result type without valid points. * The drawable is then stuck in position until switching back to a result type that has valid points. * This commit fixes this by clearing the geometry every time you draw. * TODO: cache values when it is possible to do so.
This commit is contained in:
parent
04f793c19d
commit
7307b97466
@ -57,6 +57,10 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables(const caf::Display
|
||||
{
|
||||
m_planeWidth = planeWidth;
|
||||
|
||||
// Make sure all drawables are cleared in case we return early to avoid a
|
||||
// previous drawable being "stuck" when changing result type.
|
||||
clearCurvePointsAndGeometry();
|
||||
|
||||
if (!wellPathGeometry()) return;
|
||||
if (wellPathGeometry()->m_wellPathPoints.empty()) return;
|
||||
if (!wellPathClipBoundingBox.isValid()) return;
|
||||
@ -172,6 +176,17 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables(const caf::Display
|
||||
m_curveDrawable->setVertexArray(vertexArray.p());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Riv3dWellLogCurveGeometryGenerator::clearCurvePointsAndGeometry()
|
||||
{
|
||||
m_curveDrawable = nullptr;
|
||||
m_curveVertices.clear();
|
||||
m_curveMeasuredDepths.clear();
|
||||
m_curveValues.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -55,6 +55,8 @@ public:
|
||||
double planeWidth,
|
||||
double minResultValue,
|
||||
double maxResultValue);
|
||||
|
||||
void clearCurvePointsAndGeometry();
|
||||
|
||||
const RigWellPath* wellPathGeometry() const;
|
||||
|
||||
@ -67,9 +69,10 @@ public:
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimWellPath> m_wellPath;
|
||||
double m_planeWidth;
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> m_curveDrawable;
|
||||
std::vector<cvf::Vec3f> m_curveVertices;
|
||||
std::vector<double> m_curveMeasuredDepths;
|
||||
std::vector<double> m_curveValues;
|
||||
double m_planeWidth;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user