18 #ifndef itkEdgeDecimationQuadEdgeMeshFilter_h
19 #define itkEdgeDecimationQuadEdgeMeshFilter_h
39 template<
typename TInput,
typename TOutput,
typename TCriterion >
48 TInput, TOutput, TCriterion >;
81 using QueueMapType = std::map< OutputQEType *, PriorityQueueItemType * >;
93 bool m_Relocate{
true};
94 bool m_CheckOrientation{
false};
112 void FillPriorityQueue()
override;
130 void Extract()
override;
151 virtual void JoinVertexFailed();
156 bool ProcessWithoutAnyTopologicalGuarantee()
override;
162 virtual unsigned int CheckQEProcessingStatus();
168 bool ProcessWithTopologicalGuarantee()
override;
210 std::list< OutputCellIdentifier > r1, r2, elements_to_be_tested;
216 r1.push_back( qe_it->GetLeft() );
217 qe_it = qe_it->GetOnext();
219 while ( qe_it != qe );
221 qe = iEdge->GetSym();
222 qe_it = qe->GetOnext();
226 r2.push_back( qe_it->GetLeft() );
227 qe_it = qe_it->GetOnext();
229 while ( qe_it != qe );
234 std::set_symmetric_difference( r1.begin(), r1.end(),
235 r2.begin(), r2.end(),
236 std::back_inserter(elements_to_be_tested) );
238 typename std::list< OutputCellIdentifier >::iterator
239 it = elements_to_be_tested.begin();
243 bool orientation_ok(
true);
248 int k(0), replace_k(0);
253 while ( ( it != elements_to_be_tested.end() ) && orientation_ok )
264 p_id = qe_it->GetOrigin();
269 pt[k++] = output->GetPoint(p_id);
270 qe_it = qe_it->GetLnext();
272 while ( qe_it != qe );
274 n_bef = TriangleType::ComputeNormal(pt[0], pt[1], pt[2]);
279 n_aft = TriangleType::ComputeNormal(iPt, pt[1], pt[2]);
282 n_aft = TriangleType::ComputeNormal(pt[0], iPt, pt[2]);
285 n_aft = TriangleType::ComputeNormal(pt[0], pt[1], iPt);
289 orientation_ok = ( n_bef * n_aft ) < 0.;
293 return orientation_ok;
300 bool IsCriterionSatisfied()
override;
304 void operator=(
const Self &) =
delete;
309 #include "itkEdgeDecimationQuadEdgeMeshFilter.hxx"
typename OutputMeshType::CellsContainerIterator OutputCellsContainerIterator
QueueMapType m_QueueMapper
Light weight base class for most itk classes.
typename QueueMapType::iterator QueueMapIterator
OperatorPointer m_JoinVertexFunction
typename OutputMeshType::CellType OutputCellType
unsigned long SizeValueType
PriorityQueuePointer m_PriorityQueue
std::map< OutputQEType *, PriorityQueueItemType * > QueueMapType
typename OutputMeshType::CellIdentifier OutputCellIdentifier
Collapse a given edge by joining its dest and its org.
QuadEdgeType * GetEdgeRingEntry() const
typename PriorityQueueType::Pointer PriorityQueuePointer
typename CriterionType::PriorityQueueWrapperType PriorityQueueItemType
typename CriterionType::MeasureType MeasureType
A convenience class for computation of various triangle elements in 2D or 3D.
typename CriterionType::PriorityType PriorityType
bool CheckOrientation(OutputQEType *iEdge, const OutputPointIdentifier &iId, const OutputPointType &iPt)
typename OutputMeshType::Pointer OutputMeshPointer
typename OutputMeshType::PointIdentifier OutputPointIdentifier
typename OperatorType::Pointer OperatorPointer
typename OutputMeshType::QEType OutputQEType
typename CriterionType::Pointer CriterionPointer
ImageBaseType::PointType PointType
typename InputMeshType::Pointer InputMeshPointer
typename OutputPointType::VectorType OutputVectorType
typename OutputMeshType::CellsContainerPointer OutputCellsContainerPointer
typename OutputMeshType::PointType OutputPointType
ImageBaseType::SpacingType VectorType
typename OutputMeshType::EdgeCellType OutputEdgeCellType
typename QueueMapType::const_iterator QueueMapConstIterator