# HG changeset patch # User Sebastien Jodogne # Date 1517506954 -3600 # Node ID 2e023be0563c44cf7b9a37aeb648ce4e1ba18e06 # Parent c5044bbfc3039d47a55ca76a6acdc2347b8ce57e cont diff -r c5044bbfc303 -r 2e023be0563c Framework/Toolbox/CoordinateSystem3D.cpp --- a/Framework/Toolbox/CoordinateSystem3D.cpp Thu Feb 01 17:37:03 2018 +0100 +++ b/Framework/Toolbox/CoordinateSystem3D.cpp Thu Feb 01 18:42:34 2018 +0100 @@ -170,22 +170,11 @@ } - bool CoordinateSystem3D::IntersectSegment(double& x, - double& y, + bool CoordinateSystem3D::IntersectSegment(Vector& p, const Vector& edgeFrom, const Vector& edgeTo) const { - Vector p; double d = -(normal_[0] * origin_[0] + normal_[1] * origin_[1] + normal_[2] * origin_[2]); - if (GeometryToolbox::IntersectPlaneAndSegment(p, normal_, d, edgeFrom, edgeTo)) - { - ProjectPoint(x, y, p); // TODO could be optimized, as the point - // is on the plane by construction - return true; - } - else - { - return false; - } + return GeometryToolbox::IntersectPlaneAndSegment(p, normal_, d, edgeFrom, edgeTo); } } diff -r c5044bbfc303 -r 2e023be0563c Framework/Toolbox/CoordinateSystem3D.h --- a/Framework/Toolbox/CoordinateSystem3D.h Thu Feb 01 17:37:03 2018 +0100 +++ b/Framework/Toolbox/CoordinateSystem3D.h Thu Feb 01 18:42:34 2018 +0100 @@ -92,8 +92,7 @@ double& offsetY, const Vector& point) const; - bool IntersectSegment(double& x, - double& y, + bool IntersectSegment(Vector& p, const Vector& edgeFrom, const Vector& edgeTo) const; };