mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add optional parameter
This commit is contained in:
@@ -197,8 +197,7 @@ void RicPointTangentManipulatorPartMgr::updateManipulatorFromRay( const cvf::Ray
|
|||||||
const auto& p1 = m_polyline[i];
|
const auto& p1 = m_polyline[i];
|
||||||
const auto& p2 = m_polyline[i - 1];
|
const auto& p2 = m_polyline[i - 1];
|
||||||
|
|
||||||
double normalizedIntersection;
|
const auto pointOnLine = cvf::GeometryTools::projectPointOnLine( p1, p2, newOrigin );
|
||||||
const auto pointOnLine = cvf::GeometryTools::projectPointOnLine( p1, p2, newOrigin, &normalizedIntersection );
|
|
||||||
|
|
||||||
const double candidateDistance = pointOnLine.pointDistanceSquared( newOrigin );
|
const double candidateDistance = pointOnLine.pointDistanceSquared( newOrigin );
|
||||||
if ( candidateDistance < closestDistance )
|
if ( candidateDistance < closestDistance )
|
||||||
|
@@ -492,9 +492,7 @@ std::pair<std::vector<cvf::Vec3d>, std::vector<unsigned>> RifSurfaceImporter::re
|
|||||||
const cvf::Vec2d linePoint2,
|
const cvf::Vec2d linePoint2,
|
||||||
const cvf::Vec2d point ) -> int
|
const cvf::Vec2d point ) -> int
|
||||||
{
|
{
|
||||||
double normalizedIntersection = 0.0;
|
cvf::Vec2d projectedPoint = to2d( cvf::GeometryTools::projectPointOnLine( to3d( linePoint1 ), to3d( linePoint2 ), to3d( point ) ) );
|
||||||
cvf::Vec2d projectedPoint =
|
|
||||||
to2d( cvf::GeometryTools::projectPointOnLine( to3d( linePoint1 ), to3d( linePoint2 ), to3d( point ), &normalizedIntersection ) );
|
|
||||||
if ( vectorFuzzyCompare( ( projectedPoint - to2d( surfacePoints[0] ) ).getNormalized(), primaryAxisVector.getNormalized(), epsilon ) )
|
if ( vectorFuzzyCompare( ( projectedPoint - to2d( surfacePoints[0] ) ).getNormalized(), primaryAxisVector.getNormalized(), epsilon ) )
|
||||||
return static_cast<int>( ( projectedPoint - to2d( surfacePoints[0] ) ).length() / primaryAxisVector.length() );
|
return static_cast<int>( ( projectedPoint - to2d( surfacePoints[0] ) ).length() / primaryAxisVector.length() );
|
||||||
else
|
else
|
||||||
|
@@ -703,7 +703,7 @@ double RigCellGeometryTools::getLengthOfPolygonAlongLine( const std::pair<cvf::V
|
|||||||
|
|
||||||
for ( const cvf::Vec3d& polygonPoint : polygon )
|
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 );
|
lineBoundingBox.add( pointOnLine );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,7 +41,8 @@ public:
|
|||||||
static Vec3Type computePolygonCenter( const std::vector<Vec3Type>& polygon );
|
static Vec3Type computePolygonCenter( const std::vector<Vec3Type>& polygon );
|
||||||
static cvf::Mat3f computePlaneHorizontalRotationMx( const cvf::Vec3f& inPlaneVec0, const cvf::Vec3f& inPlaneVec1 );
|
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 double linePointSquareDist( const cvf::Vec3d& p1, const cvf::Vec3d& p2, const cvf::Vec3d& p3 );
|
||||||
static int intersectLineSegmentTriangle( const cvf::Vec3d& p0,
|
static int intersectLineSegmentTriangle( const cvf::Vec3d& p0,
|
||||||
|
Reference in New Issue
Block a user