1 #ifndef __CPM__ALGORITHMS__QUADEDGE__EDGEDECIMATIONFILTER__H__
2 #define __CPM__ALGORITHMS__QUADEDGE__EDGEDECIMATIONFILTER__H__
6 #include <itkPriorityQueueContainer.h>
8 #include <cpm/Algorithms/QuadEdge/DecimationFilter.h>
9 #include <cpm/Algorithms/QuadEdge/MeshEulerOperatorJoinVertexFunction.h>
19 template< class I, class O, class C >
20 class EdgeDecimationFilter
21 : public DecimationFilter< I, O, C >
24 typedef EdgeDecimationFilter Self;
25 typedef DecimationFilter< I, O, C > Superclass;
26 typedef itk::SmartPointer< Self > Pointer;
27 typedef itk::SmartPointer< const Self > ConstPointer;
30 typedef O TOutputMesh;
33 typedef typename O::PointType TOutPoint;
34 typedef typename O::PointIdentifier TOutPointIdentifier;
35 typedef typename O::TPrimalEdge TOutPrimalEdge;
37 typedef typename C::TPriority TPriority;
38 typedef typename C::TQueueWrapper TQueueWrapper;
39 typedef typename C::TQueueWrapper TPriorityQueueItem;
40 typedef typename C::TScalar TScalar;
42 typedef std::map< TOutPrimalEdge*, TPriorityQueueItem* > TQueueMap;
43 typedef MeshEulerOperatorJoinVertexFunction< O > TOperator;
45 typedef itk::PriorityQueueContainer< TPriorityQueueItem*, itk::ElementWrapperPointerInterface< TPriorityQueueItem* >, TPriority > TPriorityQueue;
48 itkTypeMacro( EdgeDecimationFilter, DecimationFilter );
51 EdgeDecimationFilter( );
52 virtual ~EdgeDecimationFilter( );
54 virtual TScalar MeasureEdge( TOutPrimalEdge* iEdge ) = 0;
55 void FillPriorityQueue( );
56 void PushElement( TOutPrimalEdge* iEdge );
57 bool IsEdgeOKToBeProcessed( TOutPrimalEdge* iEdge );
59 void DeleteElement( TOutPrimalEdge* iEdge );
60 virtual void DeletePoint(
61 const TOutPointIdentifier& iIdToBeDeleted,
62 const TOutPointIdentifier& iRemaining
64 virtual void PushOrUpdateElement( TOutPrimalEdge* iEdge );
65 virtual void JoinVertexFailed( );
66 virtual bool ProcessWithoutAnyTopologicalGuarantee( );
67 virtual unsigned int CheckQEProcessingStatus( );
68 virtual bool ProcessWithTopologicalGuarantee( );
69 unsigned long NumberOfCommonVerticesIn0Ring( ) const;
71 void TagElementOut( TOutPrimalEdge* iEdge );
73 virtual TOutPoint Relocate( TOutPrimalEdge* iEdge ) = 0;
74 bool CheckOrientation(
75 TOutPrimalEdge* iEdge,
76 const TOutPointIdentifier& iId,
79 bool IsCriterionSatisfied( );
82 // Purposely not implemented
83 EdgeDecimationFilter( const Self& );
84 void operator=( const Self& );
88 bool m_CheckOrientation;
90 typename TPriorityQueue::Pointer m_PriorityQueue;
91 typename TOperator::Pointer m_JoinVertexFunction;
93 TQueueMap m_QueueMapper;
94 TOutPrimalEdge* m_Element;
104 #include <cpm/Algorithms/QuadEdge/EdgeDecimationFilter.hxx>
106 #endif // __CPM__ALGORITHMS__QUADEDGE__EDGEDECIMATIONFILTER__H__