diff Framework/Toolbox/CoordinateSystem3D.h @ 1161:19b1c8caade4 broker

fix sagittal geometry
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 19 Nov 2019 17:30:05 +0100
parents 53cc787bd7bc
children 0ca50d275b9a
line wrap: on
line diff
--- a/Framework/Toolbox/CoordinateSystem3D.h	Tue Nov 19 12:52:07 2019 +0100
+++ b/Framework/Toolbox/CoordinateSystem3D.h	Tue Nov 19 17:30:05 2019 +0100
@@ -22,6 +22,7 @@
 #pragma once
 
 #include "LinearAlgebra.h"
+#include "../Scene2D/ScenePoint2D.h"
 
 #include <Plugins/Samples/Common/IDicomDataset.h>
 
@@ -95,12 +96,24 @@
     Vector MapSliceToWorldCoordinates(double x,
                                       double y) const;
     
+    Vector MapSliceToWorldCoordinates(const ScenePoint2D& p) const
+    {
+      return MapSliceToWorldCoordinates(p.GetX(), p.GetY());
+    }
+    
     double ProjectAlongNormal(const Vector& point) const;
 
     void ProjectPoint(double& offsetX,
                       double& offsetY,
                       const Vector& point) const;
 
+    ScenePoint2D ProjectPoint(const Vector& point) const
+    {
+      double x, y;
+      ProjectPoint(x, y, point);
+      return ScenePoint2D(x, y);
+    }
+
     /*
     Alternated faster implementation (untested yet)
     */
@@ -120,5 +133,9 @@
     static bool ComputeDistance(double& distance,
                                 const CoordinateSystem3D& a,
                                 const CoordinateSystem3D& b);
+
+    // Normalize a cutting plane so that the origin (0,0,0) of the 3D
+    // world is mapped to the origin of its (x,y) coordinate system
+    static CoordinateSystem3D NormalizeCuttingPlane(const CoordinateSystem3D& plane);
   };
 }