changeset 152:2e023be0563c wasm

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 01 Feb 2018 18:42:34 +0100
parents c5044bbfc303
children ae531ab5dcd9
files Framework/Toolbox/CoordinateSystem3D.cpp Framework/Toolbox/CoordinateSystem3D.h
diffstat 2 files changed, 3 insertions(+), 15 deletions(-) [+]
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);
   }
 }
--- 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;
   };