diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp index 806c258c83..1ce0af9c8a 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -228,13 +228,11 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di // Generate the well path geometry as a line and pipe structure { - RivPipeBranchData& pbd = m_pipeBranchData; + m_pipeGeomGenerator = new RivPipeGeometryGenerator; - pbd.m_pipeGeomGenerator = new RivPipeGeometryGenerator; - - pbd.m_pipeGeomGenerator->setRadius(wellPathRadius); - pbd.m_pipeGeomGenerator->setCrossSectionVertexCount(wellPathCollection->wellPathCrossSectionVertexCount()); - pbd.m_pipeGeomGenerator->setPipeColor( m_rimWellPath->wellPathColor()); + m_pipeGeomGenerator->setRadius(wellPathRadius); + m_pipeGeomGenerator->setCrossSectionVertexCount(wellPathCollection->wellPathCrossSectionVertexCount()); + m_pipeGeomGenerator->setPipeColor( m_rimWellPath->wellPathColor()); cvf::ref cvfCoords = new cvf::Vec3dArray; if (wellPathCollection->wellPathClip) @@ -264,11 +262,11 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di stepsize * (wellPathGeometry->m_wellPathPoints[firstVisibleSegmentIndex] - wellPathGeometry->m_wellPathPoints[firstVisibleSegmentIndex - 1]); clippedPoints.push_back(newPoint); - pbd.m_pipeGeomGenerator->setFirstVisibleSegmentIndex(firstVisibleSegmentIndex - 1); + m_pipeGeomGenerator->setFirstVisibleSegmentIndex(firstVisibleSegmentIndex - 1); } else { - pbd.m_pipeGeomGenerator->setFirstVisibleSegmentIndex(firstVisibleSegmentIndex); + m_pipeGeomGenerator->setFirstVisibleSegmentIndex(firstVisibleSegmentIndex); } for (size_t idx = firstVisibleSegmentIndex; idx < wellPathGeometry->m_wellPathPoints.size(); idx++) @@ -295,33 +293,33 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di textPosition = cvfCoords->get(0); - pbd.m_pipeGeomGenerator->setPipeCenterCoords(cvfCoords.p()); - pbd.m_surfaceDrawable = pbd.m_pipeGeomGenerator->createPipeSurface(); - pbd.m_centerLineDrawable = pbd.m_pipeGeomGenerator->createCenterLine(); + m_pipeGeomGenerator->setPipeCenterCoords(cvfCoords.p()); + m_surfaceDrawable = m_pipeGeomGenerator->createPipeSurface(); + m_centerLineDrawable = m_pipeGeomGenerator->createCenterLine(); - if (pbd.m_surfaceDrawable.notNull()) + if (m_surfaceDrawable.notNull()) { - pbd.m_surfacePart = new cvf::Part; - pbd.m_surfacePart->setDrawable(pbd.m_surfaceDrawable.p()); + m_surfacePart = new cvf::Part; + m_surfacePart->setDrawable(m_surfaceDrawable.p()); RivWellPathSourceInfo* sourceInfo = new RivWellPathSourceInfo(m_rimWellPath, m_rimView); - pbd.m_surfacePart->setSourceInfo(sourceInfo); + m_surfacePart->setSourceInfo(sourceInfo); caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(m_rimWellPath->wellPathColor()), caf::PO_1); cvf::ref eff = surfaceGen.generateCachedEffect(); - pbd.m_surfacePart->setEffect(eff.p()); + m_surfacePart->setEffect(eff.p()); } - if (pbd.m_centerLineDrawable.notNull()) + if (m_centerLineDrawable.notNull()) { - pbd.m_centerLinePart = new cvf::Part; - pbd.m_centerLinePart->setDrawable(pbd.m_centerLineDrawable.p()); + m_centerLinePart = new cvf::Part; + m_centerLinePart->setDrawable(m_centerLineDrawable.p()); caf::MeshEffectGenerator gen(m_rimWellPath->wellPathColor()); cvf::ref eff = gen.generateCachedEffect(); - pbd.m_centerLinePart->setEffect(eff.p()); + m_centerLinePart->setEffect(eff.p()); } } @@ -329,7 +327,6 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di textPosition.z() += 2.2 * characteristicCellSize; - m_wellLabelPart = nullptr; if (wellPathCollection->showWellPathLabel() && m_rimWellPath->showWellPathLabel() && !m_rimWellPath->name().isEmpty()) { cvf::Font* font = RiaApplication::instance()->customFont(); @@ -382,14 +379,14 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m // The pipe geometry needs to be rebuilt on scale change to keep the pipes round buildWellPathParts(displayCoordTransform, characteristicCellSize, wellPathClipBoundingBox); - if (m_pipeBranchData.m_surfacePart.notNull()) + if (m_surfacePart.notNull()) { - model->addPart(m_pipeBranchData.m_surfacePart.p()); + model->addPart(m_surfacePart.p()); } - if (m_pipeBranchData.m_centerLinePart.notNull()) + if (m_centerLinePart.notNull()) { - model->addPart(m_pipeBranchData.m_centerLinePart.p()); + model->addPart(m_centerLinePart.p()); } if (m_wellLabelPart.notNull()) @@ -431,11 +428,12 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* //-------------------------------------------------------------------------------------------------- void RivWellPathPartMgr::clearAllBranchData() { - m_pipeBranchData.m_pipeGeomGenerator = nullptr; - m_pipeBranchData.m_surfacePart = nullptr; - m_pipeBranchData.m_surfaceDrawable = nullptr; - m_pipeBranchData.m_centerLinePart = nullptr; - m_pipeBranchData.m_centerLineDrawable = nullptr; + m_pipeGeomGenerator = nullptr; + m_surfacePart = nullptr; + m_surfaceDrawable = nullptr; + m_centerLinePart = nullptr; + m_centerLineDrawable = nullptr; + m_wellLabelPart = nullptr; } //-------------------------------------------------------------------------------------------------- @@ -443,7 +441,7 @@ void RivWellPathPartMgr::clearAllBranchData() //-------------------------------------------------------------------------------------------------- size_t RivWellPathPartMgr::segmentIndexFromTriangleIndex(size_t triangleIndex) { - return m_pipeBranchData.m_pipeGeomGenerator->segmentIndexFromTriangleIndex(triangleIndex); + return m_pipeGeomGenerator->segmentIndexFromTriangleIndex(triangleIndex); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h index 0e96521871..79e83d7f0d 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h @@ -48,6 +48,9 @@ class Rim3dView; class QDateTime; +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- class RivWellPathPartMgr : public cvf::Object { public: @@ -95,18 +98,13 @@ private: inline double wellPathRadius(double characteristicCellSize, RimWellPathCollection* wellPathCollection); private: - caf::PdmPointer m_rimWellPath; - caf::PdmPointer m_rimView; + caf::PdmPointer m_rimWellPath; + caf::PdmPointer m_rimView; - struct RivPipeBranchData - { - cvf::ref m_pipeGeomGenerator; - cvf::ref m_surfacePart; - cvf::ref m_surfaceDrawable; - cvf::ref m_centerLinePart; - cvf::ref m_centerLineDrawable; - }; - - RivPipeBranchData m_pipeBranchData; - cvf::ref m_wellLabelPart; + cvf::ref m_pipeGeomGenerator; + cvf::ref m_surfacePart; + cvf::ref m_surfaceDrawable; + cvf::ref m_centerLinePart; + cvf::ref m_centerLineDrawable; + cvf::ref m_wellLabelPart; };