1 #ifndef __fpa__Base__Dijkstra__h__
2 #define __fpa__Base__Dijkstra__h__
5 #include <fpa/Config.h>
6 #include <itkFunctionBase.h>
7 #include <fpa/Base/DijkstraCostFunctionBase.h>
15 template< class _TSuperclass, class _TMST >
20 typedef Dijkstra Self;
21 typedef _TSuperclass Superclass;
22 typedef itk::SmartPointer< Self > Pointer;
23 typedef itk::SmartPointer< const Self > ConstPointer;
26 typedef typename Superclass::TOutput TOutput;
27 typedef typename Superclass::TVertex TVertex;
29 typedef itk::FunctionBase< TOutput, TOutput > TCostConversionFunction;
30 typedef DijkstraCostFunctionBase< TVertex, TOutput > TCostFunction;
33 typedef typename Superclass::_TQueueNode _TQueueNode;
34 struct _TQueueNodeCompare
36 bool operator( )( const _TQueueNode& a, const _TQueueNode& b )
38 return( b.Result < a.Result );
41 typedef std::vector< _TQueueNode > _TQueue;
44 itkTypeMacro( Dijkstra, Algorithm );
46 itkGetObjectMacro( CostFunction, TCostFunction );
47 itkGetObjectMacro( CostConversionFunction, TCostConversionFunction );
48 itkSetObjectMacro( CostFunction, TCostFunction );
49 itkSetObjectMacro( CostConversionFunction, TCostConversionFunction );
52 _TMST* GetMinimumSpanningTree( );
53 const _TMST* GetMinimumSpanningTree( ) const;
59 virtual void _AfterGenerateData( ) fpa_OVERRIDE;
61 virtual void _UpdateResult( const _TQueueNode& n ) fpa_OVERRIDE;
62 virtual bool _UpdateValue(
63 _TQueueNode& v, const _TQueueNode& p
65 virtual unsigned long _QueueSize( ) const fpa_OVERRIDE;
66 virtual void _QueueClear( ) fpa_OVERRIDE;
67 virtual void _QueuePush( const _TQueueNode& node ) fpa_OVERRIDE;
68 virtual _TQueueNode _QueuePop( ) fpa_OVERRIDE;
71 // Purposely not defined
72 Dijkstra( const Self& other );
73 Self& operator=( const Self& other );
77 typename TCostFunction::Pointer m_CostFunction;
78 typename TCostConversionFunction::Pointer m_CostConversionFunction;
80 unsigned long m_MSTIndex;
87 #ifndef ITK_MANUAL_INSTANTIATION
88 # include <fpa/Base/Dijkstra.hxx>
89 #endif // ITK_MANUAL_INSTANTIATION
91 #endif // __fpa__Base__Dijkstra__h__