Add optional parameter

This commit is contained in:
Magne Sjaastad 2025-01-12 08:08:07 +01:00
parent 533885239d
commit 62bb40c4f4
4 changed files with 5 additions and 7 deletions

View File

@ -197,8 +197,7 @@ void RicPointTangentManipulatorPartMgr::updateManipulatorFromRay( const cvf::Ray
const auto& p1 = m_polyline[i];
const auto& p2 = m_polyline[i - 1];
double normalizedIntersection;
const auto pointOnLine = cvf::GeometryTools::projectPointOnLine( p1, p2, newOrigin, &normalizedIntersection );
const auto pointOnLine = cvf::GeometryTools::projectPointOnLine( p1, p2, newOrigin );
const double candidateDistance = pointOnLine.pointDistanceSquared( newOrigin );
if ( candidateDistance < closestDistance )

View File

@ -492,9 +492,7 @@ std::pair<std::vector<cvf::Vec3d>, std::vector<unsigned>> RifSurfaceImporter::re
const cvf::Vec2d linePoint2,
const cvf::Vec2d point ) -> int
{
double normalizedIntersection = 0.0;
cvf::Vec2d projectedPoint =
to2d( cvf::GeometryTools::projectPointOnLine( to3d( linePoint1 ), to3d( linePoint2 ), to3d( point ), &normalizedIntersection ) );
cvf::Vec2d projectedPoint = to2d( cvf::GeometryTools::projectPointOnLine( to3d( linePoint1 ), to3d( linePoint2 ), to3d( point ) ) );
if ( vectorFuzzyCompare( ( projectedPoint - to2d( surfacePoints[0] ) ).getNormalized(), primaryAxisVector.getNormalized(), epsilon ) )
return static_cast<int>( ( projectedPoint - to2d( surfacePoints[0] ) ).length() / primaryAxisVector.length() );
else

View File

@ -703,7 +703,7 @@ double RigCellGeometryTools::getLengthOfPolygonAlongLine( const std::pair<cvf::V
for ( const cvf::Vec3d& polygonPoint : polygon )
{
cvf::Vec3d pointOnLine = cvf::GeometryTools::projectPointOnLine( line.first, line.second, polygonPoint, nullptr );
cvf::Vec3d pointOnLine = cvf::GeometryTools::projectPointOnLine( line.first, line.second, polygonPoint );
lineBoundingBox.add( pointOnLine );
}

View File

@ -41,7 +41,8 @@ public:
static Vec3Type computePolygonCenter( const std::vector<Vec3Type>& polygon );
static cvf::Mat3f computePlaneHorizontalRotationMx( const cvf::Vec3f& inPlaneVec0, const cvf::Vec3f& inPlaneVec1 );
static cvf::Vec3d projectPointOnLine( const cvf::Vec3d& p1, const cvf::Vec3d& p2, const cvf::Vec3d& p3, double* normalizedIntersection );
static cvf::Vec3d
projectPointOnLine( const cvf::Vec3d& p1, const cvf::Vec3d& p2, const cvf::Vec3d& p3, double* normalizedIntersection = nullptr );
static double linePointSquareDist( const cvf::Vec3d& p1, const cvf::Vec3d& p2, const cvf::Vec3d& p3 );
static int intersectLineSegmentTriangle( const cvf::Vec3d& p0,