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__
10 #include <itkConceptChecking.h>
11 #include <fpa/Config.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::TTraits TTraits;
31 fpa_Base_TraitTypes( typename TTraits );
34 typedef typename _TAlgorithm::TNode TNode;
35 typedef typename _TAlgorithm::TNodes TNodes;
36 typedef typename _TAlgorithm::TInputValue TInputValue;
37 typedef typename _TAlgorithm::TOutputValue TOutputValue;
38 typedef typename _TAlgorithm::TVertex TVertex;
41 typedef std::vector< TNode > TQueue;
44 bool operator()( const TNode& a, const TNode& b ) const
46 return( b.Value < a.Value );
49 typedef fpa::Base::Functors::Dijkstra::Function< TVertex, TOutputValue > TWeightFunction;
54 ( itk::Concept::IsFloatingPoint< TOutputValue > )
58 itkGetObjectMacro( WeightFunction, TWeightFunction );
59 itkSetObjectMacro( WeightFunction, TWeightFunction );
62 virtual itk::ModifiedTimeType GetMTime( ) const override;
66 virtual ~DijkstraBase( );
68 virtual void _ComputeOutputValue( TNode& n ) override;
69 virtual void _QueueClear( ) override;
70 virtual TNode _QueuePop( ) override;
71 virtual void _QueuePush( const TNode& node ) override;
72 virtual unsigned long _QueueSize( ) const override;
73 virtual void _PrepareSeeds( TNodes& nodes ) override;
76 // Purposely not implemented.
77 DijkstraBase( const Self& other );
78 Self& operator=( const Self& other );
81 typename TWeightFunction::Pointer m_WeightFunction;
84 TQueueOrder m_QueueOrder;
91 #ifndef ITK_MANUAL_INSTANTIATION
92 # include <fpa/Base/DijkstraBase.hxx>
93 #endif // ITK_MANUAL_INSTANTIATION
95 #endif // __fpa__Base__DijkstraBase__h__