#ifndef __CPM__ALGORITHMS__QUADEDGE__EDGEDECIMATIONFILTER__H__ #define __CPM__ALGORITHMS__QUADEDGE__EDGEDECIMATIONFILTER__H__ #include #include #include #include namespace cpm { namespace Algorithms { namespace QuadEdge { /** */ template< class I, class O, class C > class EdgeDecimationFilter : public DecimationFilter< I, O, C > { public: typedef EdgeDecimationFilter Self; typedef DecimationFilter< I, O, C > Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef I TInputMesh; typedef O TOutputMesh; typedef C TCriterion; typedef typename O::PointType TOutPoint; typedef typename O::PointIdentifier TOutPointIdentifier; typedef typename O::TPrimalEdge TOutPrimalEdge; typedef typename C::TPriority TPriority; typedef typename C::TQueueWrapper TQueueWrapper; typedef typename C::TQueueWrapper TPriorityQueueItem; typedef typename C::TScalar TScalar; typedef std::map< TOutPrimalEdge*, TPriorityQueueItem* > TQueueMap; typedef MeshEulerOperatorJoinVertexFunction< O > TOperator; typedef itk::PriorityQueueContainer< TPriorityQueueItem*, itk::ElementWrapperPointerInterface< TPriorityQueueItem* >, TPriority > TPriorityQueue; public: itkTypeMacro( EdgeDecimationFilter, DecimationFilter ); protected: EdgeDecimationFilter( ); virtual ~EdgeDecimationFilter( ); virtual TScalar MeasureEdge( TOutPrimalEdge* iEdge ) = 0; void FillPriorityQueue( ); void PushElement( TOutPrimalEdge* iEdge ); bool IsEdgeOKToBeProcessed( TOutPrimalEdge* iEdge ); void Extract( ); void DeleteElement( TOutPrimalEdge* iEdge ); virtual void DeletePoint( const TOutPointIdentifier& iIdToBeDeleted, const TOutPointIdentifier& iRemaining ); virtual void PushOrUpdateElement( TOutPrimalEdge* iEdge ); virtual void JoinVertexFailed( ); virtual bool ProcessWithoutAnyTopologicalGuarantee( ); virtual unsigned int CheckQEProcessingStatus( ); virtual bool ProcessWithTopologicalGuarantee( ); unsigned long NumberOfCommonVerticesIn0Ring( ) const; void RemoveSamosa( ); void TagElementOut( TOutPrimalEdge* iEdge ); void RemoveEye( ); virtual TOutPoint Relocate( TOutPrimalEdge* iEdge ) = 0; bool CheckOrientation( TOutPrimalEdge* iEdge, const TOutPointIdentifier& iId, const TOutPoint& iPt ); bool IsCriterionSatisfied( ); private: // Purposely not implemented EdgeDecimationFilter( const Self& ); void operator=( const Self& ); protected: bool m_Relocate; bool m_CheckOrientation; typename TPriorityQueue::Pointer m_PriorityQueue; typename TOperator::Pointer m_JoinVertexFunction; TQueueMap m_QueueMapper; TOutPrimalEdge* m_Element; TPriority m_Priority; }; } // ecapseman } // ecapseman } // ecapseman #include #endif // __CPM__ALGORITHMS__QUADEDGE__EDGEDECIMATIONFILTER__H__ // eof - $RCSfile$