18 #ifndef __itkEdgeDecimationQuadEdgeMeshFilter_h
19 #define __itkEdgeDecimationQuadEdgeMeshFilter_h
39 template<
class TInput,
class TOutput,
class TCriterion >
81 typedef std::map< OutputQEType *, PriorityQueueItemType * >
QueueMapType;
111 void FillPriorityQueue();
150 virtual void JoinVertexFailed();
155 virtual bool ProcessWithoutAnyTopologicalGuarantee();
161 virtual unsigned int CheckQEProcessingStatus();
167 virtual bool ProcessWithTopologicalGuarantee();
209 std::list< OutputCellIdentifier > r1, r2, elements_to_be_tested;
215 r1.push_back( qe_it->GetLeft() );
216 qe_it = qe_it->GetOnext();
218 while ( qe_it != qe );
220 qe = iEdge->GetSym();
221 qe_it = qe->GetOnext();
225 r2.push_back( qe_it->GetLeft() );
226 qe_it = qe_it->GetOnext();
228 while ( qe_it != qe );
233 std::set_symmetric_difference( r1.begin(), r1.end(),
234 r2.begin(), r2.end(),
235 std::back_inserter(elements_to_be_tested) );
237 typename std::list< OutputCellIdentifier >::iterator
238 it = elements_to_be_tested.begin();
242 bool orientation_ok(
true);
247 int k(0), replace_k(0);
252 while ( ( it != elements_to_be_tested.end() ) && orientation_ok )
263 p_id = qe_it->GetOrigin();
268 pt[k++] = output->GetPoint(p_id);
269 qe_it = qe_it->GetLnext();
271 while ( qe_it != qe );
273 n_bef = TriangleType::ComputeNormal(pt[0], pt[1], pt[2]);
278 n_aft = TriangleType::ComputeNormal(iPt, pt[1], pt[2]);
281 n_aft = TriangleType::ComputeNormal(pt[0], iPt, pt[2]);
284 n_aft = TriangleType::ComputeNormal(pt[0], pt[1], iPt);
288 orientation_ok = ( n_bef * n_aft ) < 0.;
292 return orientation_ok;
299 bool IsCriterionSatisfied();
303 void operator=(
const Self &);
307 #include "itkEdgeDecimationQuadEdgeMeshFilter.hxx"