X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FBase%2FAlgorithm.h;h=051d61b346b6ded0ca6fc192473059c826a9b23e;hb=c9542e420b94b0bfc1f285599f7816eab1191519;hp=785b818ea8be76bdf3290896cf8c95f63b41bf55;hpb=5bf766068f54d061d3816f4950a076c3cf3a4d8b;p=FrontAlgorithms.git diff --git a/lib/fpa/Base/Algorithm.h b/lib/fpa/Base/Algorithm.h index 785b818..051d61b 100644 --- a/lib/fpa/Base/Algorithm.h +++ b/lib/fpa/Base/Algorithm.h @@ -7,9 +7,8 @@ #define __fpa__Base__Algorithm__h__ #include - +#include #include -#include namespace fpa { @@ -17,66 +16,36 @@ namespace fpa { /** */ - template< class _TTraits > + template< class _TFilter, class _TMarks, class _TSeeds > class Algorithm - : public _TTraits::TFilter, - public _TTraits::TMarksInterface, - public _TTraits::TSeedsInterface + : public _TFilter, public _TMarks, public _TSeeds { public: - typedef _TTraits TTraits; - typedef typename TTraits::TFilter Superclass; - typedef typename TTraits::TMarksInterface TMarksInterface; - typedef typename TTraits::TSeedsInterface TSeedsInterface; - typedef Algorithm Self; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - typedef typename TTraits::TInputValue TInputValue; - typedef typename TTraits::TOutputValue TOutputValue; - typedef typename TTraits::TNeighborhood TNeighborhood; - typedef typename TTraits::TNode TNode; - typedef typename TTraits::TNodes TNodes; - typedef typename TTraits::TSeeds TSeeds; - typedef typename TTraits::TVertex TVertex; - - /** - */ - class TEvent - : public itk::EventObject - { - public: - typedef TEvent Self; - typedef itk::EventObject Superclass; - - public: - TEvent( ); - TEvent( const TVertex& v, unsigned long fid, bool intoq ); - virtual ~TEvent( ); - virtual const char* GetEventName( ) const override; - virtual bool CheckEvent( const itk::EventObject* e ) const override; - virtual itk::EventObject* MakeObject( ) const override; - - private: - // Purposely not implemented. - Self& operator=( const Self& other ); - - public: - TVertex Vertex; - unsigned long FrontId; - bool IntoQueue; - }; + typedef _TMarks TMarksInterface; + typedef _TSeeds TSeedsInterface; + typedef _TFilter Superclass; + typedef Algorithm Self; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; + + typedef typename _TMarks::TTraits TTraits; + fpa_Base_TraitTypes( typename TTraits ); + + private: + itkConceptMacro( + Marks_and_Seeds_SameTraits, + ( itk::Concept::SameType< typename _TSeeds::TTraits, TTraits > ) + ); public: itkTypeMacro( fpa::Base::Algorithm, _TFilter ); itkBooleanMacro( VisualDebug ); - - itkGetConstMacro( InitValue, TOutputValue ); itkGetConstMacro( VisualDebug, bool ); + itkSetMacro( VisualDebug, bool ); + itkGetConstMacro( InitValue, TOutputValue ); itkSetMacro( InitValue, TOutputValue ); - itkSetMacro( VisualDebug, bool ); public: virtual void InvokeEvent( const itk::EventObject& e );