comparison Framework/Toolbox/CoordinateSystem3D.cpp @ 647:6af3099ed8da

uncoupling OrthancStone::SlicesSorter from OrthancStone::Slice
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 13 May 2019 17:03:46 +0200
parents b70e9be013e4
children f7c236894c1a
comparison
equal deleted inserted replaced
646:b4fe9642e83b 647:6af3099ed8da
185 const Vector& origin, 185 const Vector& origin,
186 const Vector& direction) const 186 const Vector& direction) const
187 { 187 {
188 return GeometryToolbox::IntersectPlaneAndLine(p, normal_, d_, origin, direction); 188 return GeometryToolbox::IntersectPlaneAndLine(p, normal_, d_, origin, direction);
189 } 189 }
190
191
192 bool CoordinateSystem3D::GetDistance(double& distance,
193 const CoordinateSystem3D& a,
194 const CoordinateSystem3D& b)
195 {
196 bool opposite; // Ignored
197
198 if (OrthancStone::GeometryToolbox::IsParallelOrOpposite(
199 opposite, a.GetNormal(), b.GetNormal()))
200 {
201 distance = std::abs(a.ProjectAlongNormal(a.GetOrigin()) -
202 a.ProjectAlongNormal(b.GetOrigin()));
203 return true;
204 }
205 else
206 {
207 return false;
208 }
209 }
190 } 210 }