comparison 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
comparison
equal deleted inserted replaced
1160:59906485896f 1161:19b1c8caade4
20 20
21 21
22 #pragma once 22 #pragma once
23 23
24 #include "LinearAlgebra.h" 24 #include "LinearAlgebra.h"
25 #include "../Scene2D/ScenePoint2D.h"
25 26
26 #include <Plugins/Samples/Common/IDicomDataset.h> 27 #include <Plugins/Samples/Common/IDicomDataset.h>
27 28
28 #include <iosfwd> 29 #include <iosfwd>
29 30
93 void SetOrigin(const Vector& origin); 94 void SetOrigin(const Vector& origin);
94 95
95 Vector MapSliceToWorldCoordinates(double x, 96 Vector MapSliceToWorldCoordinates(double x,
96 double y) const; 97 double y) const;
97 98
99 Vector MapSliceToWorldCoordinates(const ScenePoint2D& p) const
100 {
101 return MapSliceToWorldCoordinates(p.GetX(), p.GetY());
102 }
103
98 double ProjectAlongNormal(const Vector& point) const; 104 double ProjectAlongNormal(const Vector& point) const;
99 105
100 void ProjectPoint(double& offsetX, 106 void ProjectPoint(double& offsetX,
101 double& offsetY, 107 double& offsetY,
102 const Vector& point) const; 108 const Vector& point) const;
109
110 ScenePoint2D ProjectPoint(const Vector& point) const
111 {
112 double x, y;
113 ProjectPoint(x, y, point);
114 return ScenePoint2D(x, y);
115 }
103 116
104 /* 117 /*
105 Alternated faster implementation (untested yet) 118 Alternated faster implementation (untested yet)
106 */ 119 */
107 void ProjectPoint2(double& offsetX, 120 void ProjectPoint2(double& offsetX,
118 131
119 // Returns "false" is the two planes are not parallel 132 // Returns "false" is the two planes are not parallel
120 static bool ComputeDistance(double& distance, 133 static bool ComputeDistance(double& distance,
121 const CoordinateSystem3D& a, 134 const CoordinateSystem3D& a,
122 const CoordinateSystem3D& b); 135 const CoordinateSystem3D& b);
136
137 // Normalize a cutting plane so that the origin (0,0,0) of the 3D
138 // world is mapped to the origin of its (x,y) coordinate system
139 static CoordinateSystem3D NormalizeCuttingPlane(const CoordinateSystem3D& plane);
123 }; 140 };
124 } 141 }