18 #ifndef itkEdgeDecimationQuadEdgeMeshFilter_h
19 #define itkEdgeDecimationQuadEdgeMeshFilter_h
39 template <
typename TInput,
typename TOutput,
typename TCriterion>
82 using QueueMapType = std::map<OutputQEType *, PriorityQueueItemType *>;
93 bool m_Relocate{
true };
94 bool m_CheckOrientation{
false };
108 MeasureEdge(OutputQEType * iEdge) = 0;
114 FillPriorityQueue()
override;
121 PushElement(OutputQEType * iEdge);
129 IsEdgeOKToBeProcessed(OutputQEType * iEdge);
142 DeleteElement(OutputQEType * iEdge);
145 DeletePoint(
const OutputPointIdentifier & iIdToBeDeleted,
const OutputPointIdentifier & iRemaining);
153 PushOrUpdateElement(OutputQEType * iEdge);
165 ProcessWithoutAnyTopologicalGuarantee()
override;
172 CheckQEProcessingStatus();
179 ProcessWithTopologicalGuarantee()
override;
185 NumberOfCommonVerticesIn0Ring()
const;
198 TagElementOut(OutputQEType * iEdge);
211 virtual OutputPointType
212 Relocate(OutputQEType * iEdge) = 0;
228 std::list<OutputCellIdentifier> r1;
231 r1.push_back(qe_it->GetLeft());
232 qe_it = qe_it->GetOnext();
233 }
while (qe_it != qe);
235 qe = iEdge->GetSym();
236 qe_it = qe->GetOnext();
238 std::list<OutputCellIdentifier> r2;
241 r2.push_back(qe_it->GetLeft());
242 qe_it = qe_it->GetOnext();
243 }
while (qe_it != qe);
248 std::list<OutputCellIdentifier> elements_to_be_tested;
249 std::set_symmetric_difference(
250 r1.begin(), r1.end(), r2.begin(), r2.end(), std::back_inserter(elements_to_be_tested));
252 typename std::list<OutputCellIdentifier>::iterator it = elements_to_be_tested.begin();
256 bool orientation_ok(
true);
265 while ((it != elements_to_be_tested.end()) && orientation_ok)
268 poly = dynamic_cast<OutputPolygonType *>(cells->GetElement(c_id));
276 p_id = qe_it->GetOrigin();
281 pt[k++] = output->GetPoint(p_id);
282 qe_it = qe_it->GetLnext();
283 }
while (qe_it != qe);
291 n_aft = TriangleType::ComputeNormal(iPt, pt[1], pt[2]);
294 n_aft = TriangleType::ComputeNormal(pt[0], iPt, pt[2]);
297 n_aft = TriangleType::ComputeNormal(pt[0], pt[1], iPt);
301 orientation_ok = (n_bef * n_aft) < 0.;
305 return orientation_ok;
313 IsCriterionSatisfied()
override;
317 #include "itkEdgeDecimationQuadEdgeMeshFilter.hxx"