X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FBase%2FSeedsInterface.h;h=8162675cf003469497f797b9c1cdd108e8dc7971;hb=c9542e420b94b0bfc1f285599f7816eab1191519;hp=61860cc5fd66570b868ca351795248b1e736bfe3;hpb=5bf766068f54d061d3816f4950a076c3cf3a4d8b;p=FrontAlgorithms.git diff --git a/lib/fpa/Base/SeedsInterface.h b/lib/fpa/Base/SeedsInterface.h index 61860cc..8162675 100644 --- a/lib/fpa/Base/SeedsInterface.h +++ b/lib/fpa/Base/SeedsInterface.h @@ -6,70 +6,79 @@ #ifndef __fpa__Base__SeedsInterface__h__ #define __fpa__Base__SeedsInterface__h__ -#include -#include -#include - +#include #include #include +/* TODO + #include + #include + #include +*/ + namespace fpa { namespace Base { /** */ - template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare = std::greater< _TVertex > > + template< class _TTraits > class SeedsInterface { public: + typedef SeedsInterface Self; + typedef _TTraits TTraits; + fpa_Base_TraitTypes( typename TTraits ); + + /* TODO + typedef _TVertex TVertex; + typedef _TPoint TPoint; + typedef _TInputValue TInputValue; + typedef _TOutputValue TOutputValue; + typedef _TFrontId TFrontId; + typedef _TCompare TCompare; + typedef SeedsInterface Self; + + struct TSeed + { + TVertex Vertex; + TPoint Point; + bool IsPoint; + bool IsUnified; + TFrontId FrontId; + TSeed( ) + : IsUnified( false ), + FrontId( TFrontId( 0 ) ) + { } + }; + typedef std::vector< TSeed > TSeeds; + + struct TNode + { + TVertex Vertex; + TVertex Parent; + TFrontId FrontId; + + // Hack to hide the fact that seed values need to be initialized + mutable TOutputValue Value; + }; + struct TNodeCompare + { + bool operator()( const TNode& a, const TNode& b ) const + { + TCompare cmp; + return( cmp( a.Vertex, b.Vertex ) ); + } + }; + typedef std::set< TNode, TNodeCompare > TNodes; + */ + + private: itkConceptMacro( Check_TFrontId, ( itk::Concept::IsUnsignedInteger< _TFrontId > ) ); - public: - typedef _TVertex TVertex; - typedef _TPoint TPoint; - typedef _TInputValue TInputValue; - typedef _TOutputValue TOutputValue; - typedef _TFrontId TFrontId; - typedef _TCompare TCompare; - typedef SeedsInterface Self; - - struct TSeed - { - TVertex Vertex; - TPoint Point; - bool IsPoint; - bool IsUnified; - TFrontId FrontId; - TSeed( ) - : IsUnified( false ), - FrontId( TFrontId( 0 ) ) - { } - }; - typedef std::vector< TSeed > TSeeds; - - struct TNode - { - TVertex Vertex; - TVertex Parent; - TFrontId FrontId; - - // Hack to hide the fact that seed values need to be initialized - mutable TOutputValue Value; - }; - struct TNodeCompare - { - bool operator()( const TNode& a, const TNode& b ) const - { - TCompare cmp; - return( cmp( a.Vertex, b.Vertex ) ); - } - }; - typedef std::set< TNode, TNodeCompare > TNodes; - public: TSeeds& GetSeeds( ); const TSeeds& GetSeeds( ) const;