#ifndef __fpa__Base__Dijkstra__h__ #define __fpa__Base__Dijkstra__h__ #include #include #include #include namespace fpa { namespace Base { /** */ template< class _TSuperclass, class _TMST > class Dijkstra : public _TSuperclass { public: typedef Dijkstra Self; typedef _TSuperclass Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef _TMST TMST; typedef typename Superclass::TOutput TOutput; typedef typename Superclass::TVertex TVertex; typedef itk::FunctionBase< TOutput, TOutput > TCostConversionFunction; typedef DijkstraCostFunctionBase< TVertex, TOutput > TCostFunction; protected: typedef typename Superclass::_TQueueNode _TQueueNode; struct _TQueueNodeCompare { bool operator( )( const _TQueueNode& a, const _TQueueNode& b ) { return( b.Result < a.Result ); } }; typedef std::vector< _TQueueNode > _TQueue; public: itkTypeMacro( Dijkstra, Algorithm ); itkGetObjectMacro( CostFunction, TCostFunction ); itkGetObjectMacro( CostConversionFunction, TCostConversionFunction ); itkSetObjectMacro( CostFunction, TCostFunction ); itkSetObjectMacro( CostConversionFunction, TCostConversionFunction ); public: _TMST* GetMinimumSpanningTree( ); const _TMST* GetMinimumSpanningTree( ) const; protected: Dijkstra( ); virtual ~Dijkstra( ); virtual void _AfterGenerateData( ) fpa_OVERRIDE; virtual void _UpdateResult( const _TQueueNode& n ) fpa_OVERRIDE; virtual bool _UpdateValue( _TQueueNode& v, const _TQueueNode& p ) fpa_OVERRIDE; virtual unsigned long _QueueSize( ) const fpa_OVERRIDE; virtual void _QueueClear( ) fpa_OVERRIDE; virtual void _QueuePush( const _TQueueNode& node ) fpa_OVERRIDE; virtual _TQueueNode _QueuePop( ) fpa_OVERRIDE; private: // Purposely not defined Dijkstra( const Self& other ); Self& operator=( const Self& other ); protected: _TQueue m_Queue; typename TCostFunction::Pointer m_CostFunction; typename TCostConversionFunction::Pointer m_CostConversionFunction; unsigned long m_MSTIndex; }; } // ecapseman } // ecapseman #ifndef ITK_MANUAL_INSTANTIATION # include #endif // ITK_MANUAL_INSTANTIATION #endif // __fpa__Base__Dijkstra__h__ // eof - $RCSfile$