comparison Framework/Toolbox/CoordinateSystem3D.cpp @ 860:238693c3bc51 am-dev

merge default -> am-dev
author Alain Mazy <alain@mazy.be>
date Mon, 24 Jun 2019 14:35:00 +0200
parents 1181e1ad98ec
children 32eaf4929b08
comparison
equal deleted inserted replaced
856:a6e17a5a39e7 860:238693c3bc51
141 SetupCanonical(); 141 SetupCanonical();
142 } 142 }
143 } 143 }
144 144
145 145
146 void CoordinateSystem3D::SetOrigin(const Vector& origin)
147 {
148 if (origin.size() != 3)
149 {
150 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
151 }
152 else
153 {
154 origin_ = origin;
155 }
156 }
157
158
146 Vector CoordinateSystem3D::MapSliceToWorldCoordinates(double x, 159 Vector CoordinateSystem3D::MapSliceToWorldCoordinates(double x,
147 double y) const 160 double y) const
148 { 161 {
149 return origin_ + x * axisX_ + y * axisY_; 162 return origin_ + x * axisX_ + y * axisY_;
150 } 163 }
187 { 200 {
188 return GeometryToolbox::IntersectPlaneAndLine(p, normal_, d_, origin, direction); 201 return GeometryToolbox::IntersectPlaneAndLine(p, normal_, d_, origin, direction);
189 } 202 }
190 203
191 204
192 bool CoordinateSystem3D::GetDistance(double& distance, 205 bool CoordinateSystem3D::ComputeDistance(double& distance,
193 const CoordinateSystem3D& a, 206 const CoordinateSystem3D& a,
194 const CoordinateSystem3D& b) 207 const CoordinateSystem3D& b)
195 { 208 {
196 bool opposite; // Ignored 209 bool opposite; // Ignored
197 210
198 if (OrthancStone::GeometryToolbox::IsParallelOrOpposite( 211 if (OrthancStone::GeometryToolbox::IsParallelOrOpposite(
199 opposite, a.GetNormal(), b.GetNormal())) 212 opposite, a.GetNormal(), b.GetNormal()))