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;
225 std::list<OutputCellIdentifier> r1, r2, elements_to_be_tested;
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();
240 r2.push_back(qe_it->GetLeft());
241 qe_it = qe_it->GetOnext();
242 }
while (qe_it != qe);
247 std::set_symmetric_difference(
248 r1.begin(), r1.end(), r2.begin(), r2.end(), std::back_inserter(elements_to_be_tested));
250 typename std::list<OutputCellIdentifier>::iterator it = elements_to_be_tested.begin();
254 bool orientation_ok(
true);
259 int k(0), replace_k(0);
264 while ((it != elements_to_be_tested.end()) && orientation_ok)
267 poly = dynamic_cast<OutputPolygonType *>(cells->GetElement(c_id));
275 p_id = qe_it->GetOrigin();
280 pt[k++] = output->GetPoint(p_id);
281 qe_it = qe_it->GetLnext();
282 }
while (qe_it != qe);
284 n_bef = TriangleType::ComputeNormal(pt[0], pt[1], pt[2]);
289 n_aft = TriangleType::ComputeNormal(iPt, pt[1], pt[2]);
292 n_aft = TriangleType::ComputeNormal(pt[0], iPt, pt[2]);
295 n_aft = TriangleType::ComputeNormal(pt[0], pt[1], iPt);
299 orientation_ok = (n_bef * n_aft) < 0.;
303 return orientation_ok;
311 IsCriterionSatisfied()
override;
315 #include "itkEdgeDecimationQuadEdgeMeshFilter.hxx"