diff --git a/ApplicationLibCode/ModelVisualization/Riv3dWellLogDrawSurfaceGenerator.cpp b/ApplicationLibCode/ModelVisualization/Riv3dWellLogDrawSurfaceGenerator.cpp index 9605d3675b..99d02239fa 100644 --- a/ApplicationLibCode/ModelVisualization/Riv3dWellLogDrawSurfaceGenerator.cpp +++ b/ApplicationLibCode/ModelVisualization/Riv3dWellLogDrawSurfaceGenerator.cpp @@ -86,17 +86,17 @@ bool Riv3dWellLogDrawSurfaceGenerator::createDrawSurface( const caf::DisplayCoor size_t indexToFirstVisibleSegment = 0u; if ( wellPathCollection->wellPathClip ) { - double clipZDistance = wellPathCollection->wellPathClipZDistance; - cvf::Vec3d clipLocation = wellPathClipBoundingBox.max() + clipZDistance * cvf::Vec3d( 0, 0, 1 ); - clipLocation = displayCoordTransform->transformToDisplayCoord( clipLocation ); - double horizontalLengthAlongWellToClipPoint = 0.0; - double measuredDepthAtFirstClipPoint = 0.0; + double clipZDistance = wellPathCollection->wellPathClipZDistance; + cvf::Vec3d clipLocation = wellPathClipBoundingBox.max() + clipZDistance * cvf::Vec3d::Z_AXIS; + auto clipLocationDisplay = displayCoordTransform->transformToDisplayCoord( clipLocation ); + double horizontalLengthAlongWellToClipPoint = 0.0; + double measuredDepthAtFirstClipPoint = 0.0; wellPathDisplayCoords = RigWellPath::clipPolylineStartAboveZ( wellPathDisplayCoords, - clipLocation.z(), - &horizontalLengthAlongWellToClipPoint, - &measuredDepthAtFirstClipPoint, - &indexToFirstVisibleSegment ); + clipLocationDisplay.z(), + horizontalLengthAlongWellToClipPoint, + measuredDepthAtFirstClipPoint, + indexToFirstVisibleSegment ); } // Create curve normal vectors using the unclipped well path points and normals. diff --git a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp index 9047b896c1..80ffedb372 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -628,9 +628,9 @@ void RivWellPathPartMgr::buildWellPathParts( const caf::DisplayCoordTransform* d double maxZClipHeight = wellPathClipBoundingBox.max().z() + wellPathCollection->wellPathClipZDistance; clippedWellPathCenterLine = RigWellPath::clipPolylineStartAboveZ( wellpathCenterLine, maxZClipHeight, - &horizontalLengthAlongWellToClipPoint, - &measuredDepthAtFirstClipPoint, - &idxToFirstVisibleSegment ); + horizontalLengthAlongWellToClipPoint, + measuredDepthAtFirstClipPoint, + idxToFirstVisibleSegment ); } else { @@ -703,7 +703,8 @@ void RivWellPathPartMgr::buildWellPathParts( const caf::DisplayCoordTransform* d const double distanceBetweenLabels = m_rimWellPath->measuredDepthLabelInterval().value(); // Create a round number as start for measured depth label - const double startMeasuredDepth = ( int( measuredDepthAtFirstClipPoint / distanceBetweenLabels ) + 1 ) * distanceBetweenLabels; + const double startMeasuredDepth = + ( static_cast( measuredDepthAtFirstClipPoint / distanceBetweenLabels ) + 1 ) * distanceBetweenLabels; std::vector labelTexts; std::vector labelDisplayCoords; diff --git a/ApplicationLibCode/ModelVisualization/Seismic/RivSeismicSectionPartMgr.cpp b/ApplicationLibCode/ModelVisualization/Seismic/RivSeismicSectionPartMgr.cpp index e3f104621d..b53637764a 100644 --- a/ApplicationLibCode/ModelVisualization/Seismic/RivSeismicSectionPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/Seismic/RivSeismicSectionPartMgr.cpp @@ -223,11 +223,8 @@ void RivSeismicSectionPartMgr::appendSurfaceIntersectionLines( cvf::ModelBasicLi { const auto& texturePart = texSection->part( i ); - std::vector polyLineForSection; - // Each part of the seismic section is a rectangle, use two corners of the rectangle to create a polyline - polyLineForSection.push_back( texturePart.rect[0] ); - polyLineForSection.push_back( texturePart.rect[1] ); + std::vector polyLineForSection = { texturePart.rect[0], texturePart.rect[1] }; bool closePolyLine = false; auto polyLineDisplayCoords = projectPolyLineOntoSurface( polyLineForSection, surface, displayCoordTransform ); diff --git a/ApplicationLibCode/ProjectDataModel/Intersections/RimExtrudedCurveIntersection.cpp b/ApplicationLibCode/ProjectDataModel/Intersections/RimExtrudedCurveIntersection.cpp index 26fa03be3c..01a3d57286 100644 --- a/ApplicationLibCode/ProjectDataModel/Intersections/RimExtrudedCurveIntersection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Intersections/RimExtrudedCurveIntersection.cpp @@ -764,9 +764,9 @@ std::vector> RimExtrudedCurveIntersection::polyLines( cv double dummyDouble; lines[0] = RigWellPath::clipPolylineStartAboveZ( lines[0], ownerCase->activeCellsBoundingBox().max().z(), - &horizontalProjectedLengthAlongWellPathToClipPoint, - &dummyDouble, - &dummy ); + horizontalProjectedLengthAlongWellPathToClipPoint, + dummyDouble, + dummy ); } } } diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellPath.cpp b/ApplicationLibCode/ReservoirDataModel/RigWellPath.cpp index 62adcd0649..cb8132afeb 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellPath.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigWellPath.cpp @@ -584,18 +584,15 @@ bool RigWellPath::isAnyPointInsideBoundingBox( const std::vector& po /// //-------------------------------------------------------------------------------------------------- std::vector RigWellPath::clipPolylineStartAboveZ( const std::vector& polyLine, - double maxZ, - double* horizontalLengthAlongWellToClipPoint, - double* measuredDepthAtFirstClipPoint, - size_t* indexToFirstVisibleSegment ) + const double maxZ, + double& horizontalLengthAlongWellToClipPoint, + double& measuredDepthAtFirstClipPoint, + size_t& indexToFirstVisibleSegment ) { - CVF_ASSERT( horizontalLengthAlongWellToClipPoint ); - CVF_ASSERT( indexToFirstVisibleSegment ); - // Find first visible point, and accumulate distance along wellpath - *horizontalLengthAlongWellToClipPoint = 0.0; - *indexToFirstVisibleSegment = cvf::UNDEFINED_SIZE_T; + horizontalLengthAlongWellToClipPoint = 0.0; + indexToFirstVisibleSegment = cvf::UNDEFINED_SIZE_T; size_t firstVisiblePointIndex = cvf::UNDEFINED_SIZE_T; @@ -606,13 +603,10 @@ std::vector RigWellPath::clipPolylineStartAboveZ( const std::vector< if ( vxIdx > 0 ) { cvf::Vec3d segment = polyLine[vxIdx] - polyLine[vxIdx - 1]; - if ( measuredDepthAtFirstClipPoint ) - { - *measuredDepthAtFirstClipPoint += segment.length(); - } + measuredDepthAtFirstClipPoint += segment.length(); segment[2] = 0.0; - *horizontalLengthAlongWellToClipPoint += segment.length(); + horizontalLengthAlongWellToClipPoint += segment.length(); } } else @@ -641,16 +635,16 @@ std::vector RigWellPath::clipPolylineStartAboveZ( const std::vector< { cvf::Vec3d segment = intersection - polyLine[firstVisiblePointIndex - 1]; segment[2] = 0.0; - *horizontalLengthAlongWellToClipPoint += segment.length(); + horizontalLengthAlongWellToClipPoint += segment.length(); clippedPolyLine.push_back( intersection ); } - *indexToFirstVisibleSegment = firstVisiblePointIndex - 1; + indexToFirstVisibleSegment = firstVisiblePointIndex - 1; } else { - *indexToFirstVisibleSegment = 0; + indexToFirstVisibleSegment = 0; } // Add the rest of the polyline diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellPath.h b/ApplicationLibCode/ReservoirDataModel/RigWellPath.h index 16cbb0b483..6bc5bbc412 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellPath.h +++ b/ApplicationLibCode/ReservoirDataModel/RigWellPath.h @@ -86,10 +86,10 @@ class RigWellPath : public cvf::Object, public caf::SignalEmitter static bool isAnyPointInsideBoundingBox( const std::vector& points, const cvf::BoundingBox& boundingBox ); static std::vector clipPolylineStartAboveZ( const std::vector& polyLine, - double maxZ, - double* horizontalLengthAlongWellToClipPoint, - double* measuredDepthAtFirstClipPoint, - size_t* indexToFirstVisibleSegment ); + const double maxZ, + double& horizontalLengthAlongWellToClipPoint, + double& measuredDepthAtFirstClipPoint, + size_t& indexToFirstVisibleSegment ); private: std::pair closestIndices( const cvf::Vec3d& position ) const;