Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Toolbox/DicomStructurePolygon2.h @ 1895:14c8f339d480
removed redundant definitions Point2D, Point3D and Vector3D from DicomStructureSetUtils.h
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 19 Jan 2022 14:51:55 +0100 |
parents | 7053b8a0aaec |
children |
comparison
equal
deleted
inserted
replaced
1894:438071a29f77 | 1895:14c8f339d480 |
---|---|
73 { | 73 { |
74 ORTHANC_ASSERT(state_ == Valid); | 74 ORTHANC_ASSERT(state_ == Valid); |
75 return points_.size(); | 75 return points_.size(); |
76 } | 76 } |
77 | 77 |
78 const Point3D& GetPoint(size_t i) const | 78 const Vector& GetPoint(size_t i) const |
79 { | 79 { |
80 ORTHANC_ASSERT(state_ == Valid); | 80 ORTHANC_ASSERT(state_ == Valid); |
81 return points_.at(i); | 81 return points_.at(i); |
82 } | 82 } |
83 | 83 |
84 void AddPoint(const Point3D& v) | 84 void AddPoint(const Vector& v) |
85 { | 85 { |
86 ORTHANC_ASSERT(state_ == Building); | 86 ORTHANC_ASSERT(state_ == Building); |
87 points_.push_back(v); | 87 points_.push_back(v); |
88 } | 88 } |
89 | 89 |
97 This method takes a plane+coord system that is parallel to the polygon | 97 This method takes a plane+coord system that is parallel to the polygon |
98 and adds to polygons a new vector with the ordered set of points projected | 98 and adds to polygons a new vector with the ordered set of points projected |
99 on the plane, in the plane coordinate system. | 99 on the plane, in the plane coordinate system. |
100 */ | 100 */ |
101 void ProjectOnParallelPlane( | 101 void ProjectOnParallelPlane( |
102 std::vector< std::pair<Point2D,Point2D> >& segments, | 102 std::vector< std::pair<ScenePoint2D, ScenePoint2D> >& segments, |
103 const CoordinateSystem3D& plane) const; | 103 const CoordinateSystem3D& plane) const; |
104 | 104 |
105 /** | 105 /** |
106 Returns the coordinates of the intersection of the polygon and a plane | 106 Returns the coordinates of the intersection of the polygon and a plane |
107 that is perpendicular to the polygons (plane has either constant X or | 107 that is perpendicular to the polygons (plane has either constant X or |
108 constant Y) | 108 constant Y) |
109 */ | 109 */ |
110 void ProjectOnConstantPlane( | 110 void ProjectOnConstantPlane( |
111 std::vector<Point2D>& intersections, | 111 std::vector<ScenePoint2D>& intersections, |
112 const CoordinateSystem3D& plane) const; | 112 const CoordinateSystem3D& plane) const; |
113 | 113 |
114 /** | 114 /** |
115 This method assumes polygon has a normal equal to 0,0,-1 and 0,0,1 (thus, | 115 This method assumes polygon has a normal equal to 0,0,-1 and 0,0,1 (thus, |
116 the polygon is parallel to the XY plane) and returns the Z coordinate of | 116 the polygon is parallel to the XY plane) and returns the Z coordinate of |
119 double GetZ() const; | 119 double GetZ() const; |
120 | 120 |
121 /** | 121 /** |
122 The normal sign is left undefined for now | 122 The normal sign is left undefined for now |
123 */ | 123 */ |
124 Vector3D GetNormal() const | 124 Vector GetNormal() const |
125 { | 125 { |
126 return normal_; | 126 return normal_; |
127 } | 127 } |
128 | 128 |
129 /** | 129 /** |
147 Building, | 147 Building, |
148 Valid | 148 Valid |
149 }; | 149 }; |
150 std::string referencedSopInstanceUid_; | 150 std::string referencedSopInstanceUid_; |
151 CoordinateSystem3D geometry_; | 151 CoordinateSystem3D geometry_; |
152 std::vector<Point3D> points_; | 152 std::vector<Vector> points_; |
153 Vector3D normal_; // sign is irrelevant for now | 153 Vector normal_; // sign is irrelevant for now |
154 State state_; | 154 State state_; |
155 double minX_, maxX_, minY_, maxY_, minZ_, maxZ_; | 155 double minX_, maxX_, minY_, maxY_, minZ_, maxZ_; |
156 Type type_; | 156 Type type_; |
157 }; | 157 }; |
158 } | 158 } |