diff --git a/ApplicationCode/ModelVisualization/Riv3dWellLogCurveGeometryGenerator.cpp b/ApplicationCode/ModelVisualization/Riv3dWellLogCurveGeometryGenerator.cpp index 3ce784da74..26385a699e 100644 --- a/ApplicationCode/ModelVisualization/Riv3dWellLogCurveGeometryGenerator.cpp +++ b/ApplicationCode/ModelVisualization/Riv3dWellLogCurveGeometryGenerator.cpp @@ -167,17 +167,6 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables(const caf::Display } m_curveVertices = projectVerticesOntoTriangles(m_curveVertices, drawSurfaceVertices); - m_bottomVertices.reserve(m_curveVertices.size() + 2); - for (size_t i = 0; i < m_curveVertices.size(); ++i) - { - double md = m_curveMeasuredDepths[i]; - cvf::Vec3d point = wellPathGeometry()->interpolatedVectorAlongWellPath(wellPathPoints, md); - cvf::Vec3d normal = wellPathGeometry()->interpolatedVectorAlongWellPath(wellPathCurveNormals, md); - point += planeOffsetFromWellPathCenter * normal; - m_bottomVertices.push_back(point); - } - m_bottomVertices = projectVerticesOntoTriangles(m_bottomVertices, drawSurfaceVertices); - createNewVerticesAlongTriangleEdges(drawSurfaceVertices); { @@ -212,34 +201,6 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables(const caf::Display } m_curveDrawable->setVertexArray(vertexArray.p()); } - - // Disable filled draw style in the GUI because of triangle stitching issue #2860. -#if 0 - { - CVF_ASSERT(m_bottomVertices.size() == m_curveVertices.size()); - cvf::ref vertexArray = new cvf::Vec3fArray(m_bottomVertices.size() + m_curveVertices.size()); - for (size_t i = 0; i < m_bottomVertices.size(); ++i) - { - (*vertexArray)[2 * i] = cvf::Vec3f(m_bottomVertices[i]); - (*vertexArray)[2 * i + 1] = cvf::Vec3f(m_curveVertices[i]); - } - - std::vector indices; - indices.reserve(vertexArray->size()); - for (size_t i = 0; i < vertexArray->size(); ++i) - { - indices.push_back(cvf::uint(i)); - } - - cvf::ref indexedUInt = new cvf::PrimitiveSetIndexedUInt(cvf::PrimitiveType::PT_TRIANGLE_STRIP); - cvf::ref indexArray = new cvf::UIntArray(indices); - - m_curveFilledDrawable = new cvf::DrawableGeo(); - indexedUInt->setIndices(indexArray.p()); - m_curveFilledDrawable->addPrimitiveSet(indexedUInt.p()); - m_curveFilledDrawable->setVertexArray(vertexArray.p()); - } -#endif } //-------------------------------------------------------------------------------------------------- @@ -248,9 +209,7 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables(const caf::Display void Riv3dWellLogCurveGeometryGenerator::clearCurvePointsAndGeometry() { m_curveDrawable = nullptr; - m_curveFilledDrawable = nullptr; m_curveVertices.clear(); - m_bottomVertices.clear(); m_curveMeasuredDepths.clear(); m_curveValues.clear(); } @@ -263,14 +222,6 @@ cvf::ref Riv3dWellLogCurveGeometryGenerator::curveDrawable() return m_curveDrawable; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -cvf::ref Riv3dWellLogCurveGeometryGenerator::curveFilledDrawable() -{ - return m_curveFilledDrawable; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -330,12 +281,10 @@ bool Riv3dWellLogCurveGeometryGenerator::findClosestPointOnCurve(const cvf::Vec3 void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongTriangleEdges(const std::vector& drawSurfaceVertices) { std::vector expandedCurveVertices; - std::vector expandedBottomVertices; std::vector expandedMeasuredDepths; std::vector expandedValues; size_t estimatedNumberOfPoints = m_curveVertices.size() + drawSurfaceVertices.size(); expandedCurveVertices.reserve(estimatedNumberOfPoints); - expandedBottomVertices.reserve(estimatedNumberOfPoints); expandedMeasuredDepths.reserve(estimatedNumberOfPoints); expandedValues.reserve(estimatedNumberOfPoints); @@ -348,17 +297,11 @@ void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongTriangleEdges(con cvf::Vec3d fullSegmentVector = m_curveVertices[i + 1] - m_curveVertices[i]; std::vector extraVertices; - std::vector extraBottomVertices; createNewVerticesAlongSegment(m_curveVertices[i], m_curveVertices[i + 1], drawSurfaceVertices, - &extraVertices, - &m_bottomVertices[i], - &m_bottomVertices[i + 1], - &extraBottomVertices); - - CVF_ASSERT(extraVertices.size() == extraBottomVertices.size()); + &extraVertices); for (const cvf::Vec3d& extraVertex : extraVertices) { @@ -375,22 +318,18 @@ void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongTriangleEdges(con expandedValues.push_back(valueAtPoint); lastVertex = extraVertex; } - expandedBottomVertices.insert(expandedBottomVertices.end(), extraBottomVertices.begin(), extraBottomVertices.end()); } else { // Add the invalid points and values. expandedCurveVertices.push_back(m_curveVertices[i]); - expandedBottomVertices.push_back(m_bottomVertices[i]); expandedMeasuredDepths.push_back(m_curveMeasuredDepths[i]); expandedValues.push_back(m_curveValues[i]); } } - CVF_ASSERT(expandedCurveVertices.size() == expandedBottomVertices.size()); m_curveVertices.swap(expandedCurveVertices); - m_bottomVertices.swap(expandedBottomVertices); m_curveMeasuredDepths.swap(expandedMeasuredDepths); m_curveValues.swap(expandedValues); } @@ -401,21 +340,11 @@ void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongTriangleEdges(con void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongSegment(const cvf::Vec3d& ptStart, const cvf::Vec3d& ptEnd, const std::vector& drawSurfaceVertices, - std::vector* extraVertices, - const cvf::Vec3d* ptBottomStart, - const cvf::Vec3d* ptBottomEnd, - std::vector* extraBottomVertices) + std::vector* extraVertices) { cvf::Vec3d fullSegmentVector = ptEnd - ptStart; extraVertices->push_back(ptStart); - cvf::Vec3d fullBottomVector; - if (ptBottomStart && ptBottomEnd && extraBottomVertices) - { - fullBottomVector = *ptBottomEnd - *ptBottomStart; - extraBottomVertices->push_back(*ptBottomStart); - } - // Find segments that intersects the triangle edges for (size_t j = 0; j < drawSurfaceVertices.size() - 2; j += 1) { @@ -437,34 +366,9 @@ void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongSegment(const cvf if (withinSegments && newSegmentVector.lengthSquared() < currentSubSegment.lengthSquared()) { extraVertices->push_back(newVertex); - - if (ptBottomStart && ptBottomEnd && extraBottomVertices) - { - // Do the same for the bottom line, however we need to ensure we add the same amount of points. - cvf::Vec3d currentBottomSegment = *ptBottomEnd - extraBottomVertices->back(); - cvf::Vec3d projectedBottomVector = - currentBottomSegment - (currentBottomSegment * triangleNormal) * triangleNormal; - caf::Line projectedBottomLine(extraBottomVertices->back(), - extraBottomVertices->back() + projectedBottomVector); - bool withinBottomSegments = false; - - caf::Line bottomConnectingLine = - projectedBottomLine.findLineBetweenNearestPoints(triangleEdge1, &withinBottomSegments); - cvf::Vec3d newBottomVertex = bottomConnectingLine.end(); - cvf::Vec3d newBottomVector = newBottomVertex - extraBottomVertices->back(); - if (!(withinBottomSegments && newBottomVector.lengthSquared() < fullBottomVector.lengthSquared())) - { - newBottomVertex = extraBottomVertices->back(); - } - extraBottomVertices->push_back(newBottomVertex); - } } } extraVertices->push_back(ptEnd); - if (ptBottomStart && ptBottomEnd && extraBottomVertices) - { - extraBottomVertices->push_back(*ptBottomEnd); - } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ModelVisualization/Riv3dWellLogCurveGeometryGenerator.h b/ApplicationCode/ModelVisualization/Riv3dWellLogCurveGeometryGenerator.h index 54623244da..d53d078640 100644 --- a/ApplicationCode/ModelVisualization/Riv3dWellLogCurveGeometryGenerator.h +++ b/ApplicationCode/ModelVisualization/Riv3dWellLogCurveGeometryGenerator.h @@ -59,7 +59,6 @@ public: const RigWellPath* wellPathGeometry() const; cvf::ref curveDrawable(); - cvf::ref curveFilledDrawable(); bool findClosestPointOnCurve(const cvf::Vec3d& globalIntersection, cvf::Vec3d* closestPoint, @@ -71,10 +70,7 @@ private: static void createNewVerticesAlongSegment(const cvf::Vec3d& ptStart, const cvf::Vec3d& ptEnd, const std::vector& drawSurfaceVertices, - std::vector* extraVertices, - const cvf::Vec3d* ptBottomStart = nullptr, - const cvf::Vec3d* ptBottomEnd = nullptr, - std::vector* extraBottomVertices = nullptr); + std::vector* extraVertices); static std::vector projectVerticesOntoTriangles(const std::vector& originalVertices, const std::vector& drawSurfaceVertices); static cvf::Vec3d projectPointOntoTriangle(const cvf::Vec3d& point, @@ -86,9 +82,7 @@ private: double m_planeWidth; cvf::ref m_curveDrawable; - cvf::ref m_curveFilledDrawable; std::vector m_curveVertices; - std::vector m_bottomVertices; std::vector m_curveMeasuredDepths; std::vector m_curveValues; diff --git a/ApplicationCode/ModelVisualization/Riv3dWellLogPlanePartMgr.cpp b/ApplicationCode/ModelVisualization/Riv3dWellLogPlanePartMgr.cpp index 370c1fe6f2..8eb5f33f26 100644 --- a/ApplicationCode/ModelVisualization/Riv3dWellLogPlanePartMgr.cpp +++ b/ApplicationCode/ModelVisualization/Riv3dWellLogPlanePartMgr.cpp @@ -126,30 +126,6 @@ void Riv3dWellLogPlanePartMgr::append3dWellLogCurveToModel(cvf::ModelBasicList* model->addPart(part.p()); } } - - if (rim3dWellLogCurve->drawStyle() == Rim3dWellLogCurve::FILLED) - { - Rim3dWellLogCurveCollection* curveCollection = m_wellPath->rim3dWellLogCurveCollection(); - cvf::ref sourceInfo = new RivObjectSourceInfo(curveCollection); - - cvf::ref curveFilledDrawable = generator->curveFilledDrawable(); - if (curveFilledDrawable.notNull() && curveFilledDrawable->boundingBox().isValid()) - { - caf::SurfaceEffectGenerator filledEffectGen(rim3dWellLogCurve->color(), caf::PO_NONE); - filledEffectGen.enableLighting(false); - cvf::ref filledEffect = filledEffectGen.generateCachedEffect(); - - cvf::ref part = new cvf::Part; - part->setDrawable(curveFilledDrawable.p()); - part->setEffect(filledEffect.p()); - - if (part.notNull()) - { - model->addPart(part.p()); - part->setSourceInfo(sourceInfo.p()); - } - } - } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Rim3dWellLogCurve.cpp b/ApplicationCode/ProjectDataModel/Rim3dWellLogCurve.cpp index d65ee13fb9..dfceae1f9d 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dWellLogCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dWellLogCurve.cpp @@ -51,13 +51,6 @@ namespace caf setDefault(Rim3dWellLogCurve::VERTICAL_ABOVE); } - template<> - void AppEnum< Rim3dWellLogCurve::DrawStyle >::setUp() - { - addItem(Rim3dWellLogCurve::LINE, "LINE", "Line"); - addItem(Rim3dWellLogCurve::FILLED, "FILLED", "Filled"); - setDefault(Rim3dWellLogCurve::LINE); - } } //-------------------------------------------------------------------------------------------------- @@ -75,7 +68,6 @@ Rim3dWellLogCurve::Rim3dWellLogCurve() CAF_PDM_InitField(&m_maxCurveUIValue, "MaxCurveValue", std::numeric_limits::infinity(), "Maximum Curve Value", "", "Clip curve values above this.", ""); CAF_PDM_InitField(&m_drawPlane, "DrawPlane", DrawPlaneEnum(VERTICAL_ABOVE), "Draw Plane", "", "", ""); - CAF_PDM_InitField(&m_drawStyle, "DrawStyle", DrawStyleEnum(LINE), "Draw Style", "", "", ""); CAF_PDM_InitField(&m_color, "CurveColor", cvf::Color3f(0.0f, 0.0f, 0.0f), "Curve Color", "", "", ""); this->uiCapability()->setUiTreeChildrenHidden(true); } @@ -105,14 +97,6 @@ Rim3dWellLogCurve::DrawPlane Rim3dWellLogCurve::drawPlane() const return m_drawPlane(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -Rim3dWellLogCurve::DrawStyle Rim3dWellLogCurve::drawStyle() const -{ - return m_drawStyle(); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -207,8 +191,6 @@ void Rim3dWellLogCurve::configurationUiOrdering(caf::PdmUiOrdering& uiOrdering) { caf::PdmUiGroup* configurationGroup = uiOrdering.addNewGroup("Curve Appearance"); configurationGroup->add(&m_drawPlane); -// Disable filled draw style in the GUI because of triangle stitching issue #2860. -// configurationGroup->add(&m_drawStyle); configurationGroup->add(&m_color); configurationGroup->add(&m_minCurveUIValue); configurationGroup->add(&m_maxCurveUIValue); diff --git a/ApplicationCode/ProjectDataModel/Rim3dWellLogCurve.h b/ApplicationCode/ProjectDataModel/Rim3dWellLogCurve.h index 244b58584e..fce0067f9e 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dWellLogCurve.h +++ b/ApplicationCode/ProjectDataModel/Rim3dWellLogCurve.h @@ -51,13 +51,6 @@ public: }; typedef caf::AppEnum DrawPlaneEnum; - enum DrawStyle - { - LINE, - FILLED - }; - typedef caf::AppEnum DrawStyleEnum; - public: Rim3dWellLogCurve(); virtual ~Rim3dWellLogCurve(); @@ -68,7 +61,6 @@ public: virtual QString resultPropertyString() const = 0; DrawPlane drawPlane() const; - DrawStyle drawStyle() const; double drawPlaneAngle() const; cvf::Color3f color() const; @@ -99,7 +91,6 @@ private: void resetMinMaxValues(); protected: caf::PdmField m_drawPlane; - caf::PdmField m_drawStyle; caf::PdmField m_color; caf::PdmField m_minCurveUIValue; caf::PdmField m_maxCurveUIValue;