diff Framework/Toolbox/CoordinateSystem3D.cpp @ 152:2e023be0563c wasm

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 01 Feb 2018 18:42:34 +0100
parents c5044bbfc303
children 2309e8d86efe
line wrap: on
line diff
--- 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);
   }
 }