X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FBase%2FDijkstra.h;h=08c704e83b9b7d019eafd6904be1b68158d8e771;hb=40fb0405cfef444001429f8ba49c407ce9168a94;hp=aa62f90bbe2dcd07eae54fd684c306d277f95c57;hpb=cf298be2de026712c5ab3487978e3a6954a809cd;p=FrontAlgorithms.git diff --git a/lib/fpa/Base/Dijkstra.h b/lib/fpa/Base/Dijkstra.h index aa62f90..08c704e 100644 --- a/lib/fpa/Base/Dijkstra.h +++ b/lib/fpa/Base/Dijkstra.h @@ -1,10 +1,7 @@ #ifndef __fpa__Base__Dijkstra__h__ #define __fpa__Base__Dijkstra__h__ -#include -#include -#include -#include +#include namespace fpa { @@ -14,40 +11,24 @@ namespace fpa */ template< class _TSuperclass, class _TMST > class Dijkstra - : public _TSuperclass + : public fpa::Base::PriorityQueueAlgorithm< _TSuperclass > { public: - typedef Dijkstra Self; - typedef _TSuperclass Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; + typedef Dijkstra Self; + typedef fpa::Base::PriorityQueueAlgorithm< _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; @@ -62,10 +43,6 @@ namespace fpa virtual bool _UpdateValue( _TQueueNode& v, const _TQueueNode& p ) override; - virtual unsigned long _QueueSize( ) const override; - virtual void _QueueClear( ) override; - virtual void _QueuePush( const _TQueueNode& node ) override; - virtual _TQueueNode _QueuePop( ) override; private: // Purposely not defined @@ -73,10 +50,6 @@ namespace fpa Self& operator=( const Self& other ); protected: - _TQueue m_Queue; - typename TCostFunction::Pointer m_CostFunction; - typename TCostConversionFunction::Pointer m_CostConversionFunction; - unsigned long m_MSTIndex; };