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::TNodes TNodes;
32 typedef typename _TAlgorithm::TInputValue TInputValue;
33 typedef typename _TAlgorithm::TOutputValue TOutputValue;
34 typedef typename _TAlgorithm::TVertex TVertex;
36 typedef std::vector< TNode > TQueue;
39 bool operator()( const TNode& a, const TNode& b ) const
41 return( b.Value < a.Value );
44 typedef fpa::Base::Functors::Dijkstra::Function< TVertex, TOutputValue > TWeightFunction;
49 ( itk::Concept::IsFloatingPoint< TOutputValue > )
53 itkGetObjectMacro( WeightFunction, TWeightFunction );
54 itkSetObjectMacro( WeightFunction, TWeightFunction );
57 virtual itk::ModifiedTimeType GetMTime( ) const override;
61 virtual ~DijkstraBase( );
63 virtual void _ComputeOutputValue( TNode& n ) 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;
68 virtual void _PrepareSeeds( TNodes& nodes ) override;
71 // Purposely not implemented.
72 DijkstraBase( const Self& other );
73 Self& operator=( const Self& other );
76 typename TWeightFunction::Pointer m_WeightFunction;
79 TQueueOrder m_QueueOrder;
86 #ifndef ITK_MANUAL_INSTANTIATION
87 # include <fpa/Base/DijkstraBase.hxx>
88 #endif // ITK_MANUAL_INSTANTIATION
90 #endif // __fpa__Base__DijkstraBase__h__