1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Base__DijkstraBase__h__
7 #define __fpa__Base__DijkstraBase__h__
11 #include <itkConceptChecking.h>
12 #include <fpa/Base/Functors/Dijkstra/Function.h>
20 template< class _TAlgorithm >
25 typedef DijkstraBase Self;
26 typedef _TAlgorithm Superclass;
27 typedef itk::SmartPointer< Self > Pointer;
28 typedef itk::SmartPointer< const Self > ConstPointer;
30 typedef typename _TAlgorithm::TNode TNode;
31 typedef typename _TAlgorithm::TInputValue TInputValue;
32 typedef typename _TAlgorithm::TOutputValue TOutputValue;
33 typedef typename _TAlgorithm::TVertex TVertex;
35 typedef std::vector< TNode > TQueue;
38 bool operator()( const TNode& a, const TNode& b ) const
40 return( b.Value < a.Value );
43 typedef fpa::Base::Functors::Dijkstra::Function< TVertex, TOutputValue > TWeightFunction;
48 ( itk::Concept::IsFloatingPoint< TOutputValue > )
52 itkGetObjectMacro( WeightFunction, TWeightFunction );
53 itkSetObjectMacro( WeightFunction, TWeightFunction );
56 virtual itk::ModifiedTimeType GetMTime( ) const override;
60 virtual ~DijkstraBase( );
62 virtual TOutputValue _ComputeOutputValue( const TNode& n ) override;
63 virtual void _QueueInit( ) override;
64 virtual void _QueueClear( ) override;
65 virtual TNode _QueuePop( ) override;
66 virtual void _QueuePush( const TNode& node ) override;
67 virtual unsigned long _QueueSize( ) const override;
70 // Purposely not implemented.
71 DijkstraBase( const Self& other );
72 Self& operator=( const Self& other );
75 typename TWeightFunction::Pointer m_WeightFunction;
78 TQueueOrder m_QueueOrder;
85 #ifndef ITK_MANUAL_INSTANTIATION
86 # include <fpa/Base/DijkstraBase.hxx>
87 #endif // ITK_MANUAL_INSTANTIATION
89 #endif // __fpa__Base__DijkstraBase__h__