comparison Framework/Toolbox/SlicesSorter.cpp @ 77:f5f54ed8d307 wasm

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 24 May 2017 21:13:29 +0200
parents ffa6dded91bd
children 53025eecbc95
comparison
equal deleted inserted replaced
76:0aef120d7e1c 77:f5f54ed8d307
190 } 190 }
191 } 191 }
192 192
193 return found; 193 return found;
194 } 194 }
195
196
197 bool SlicesSorter::LookupSlice(size_t& index,
198 const SliceGeometry& slice) const
199 {
200 // TODO Turn this linear-time lookup into a log-time lookup,
201 // keeping track of whether the slices are sorted along the normal
202
203 for (size_t i = 0; i < slices_.size(); i++)
204 {
205 if (slices_[i]->GetSlice().ContainsPlane(slice))
206 {
207 index = i;
208 return true;
209 }
210 }
211
212 return false;
213 }
195 } 214 }