comparison Framework/Toolbox/SlicesSorter.cpp @ 648:1088d4c4d78c

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 13 May 2019 17:19:04 +0200
parents 6af3099ed8da
children e9339f2b5de7
comparison
equal deleted inserted replaced
647:6af3099ed8da 648:1088d4c4d78c
146 146
147 hasNormal_ = true; 147 hasNormal_ = true;
148 } 148 }
149 149
150 150
151 void SlicesSorter::Sort() 151 void SlicesSorter::SortInternal()
152 { 152 {
153 if (!hasNormal_) 153 if (!hasNormal_)
154 { 154 {
155 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 155 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
156 } 156 }
235 235
236 return found; 236 return found;
237 } 237 }
238 238
239 239
240 bool SlicesSorter::Sort()
241 {
242 if (GetSlicesCount() > 0)
243 {
244 Vector normal;
245 if (SelectNormal(normal))
246 {
247 FilterNormal(normal);
248 SetNormal(normal);
249 SortInternal();
250 return true;
251 }
252 }
253
254 return false;
255 }
256
257
240 bool SlicesSorter::LookupClosestSlice(size_t& index, 258 bool SlicesSorter::LookupClosestSlice(size_t& index,
241 double& distance, 259 double& distance,
242 const CoordinateSystem3D& slice) const 260 const CoordinateSystem3D& slice) const
243 { 261 {
244 // TODO Turn this linear-time lookup into a log-time lookup, 262 // TODO Turn this linear-time lookup into a log-time lookup,