X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2Ffpa%2FBase%2FSeedsInterface.hxx;h=5c272167310267cf9c12882674d2ae03ec7daaad;hb=e8b46a839b86641f48f593d021234566877ac683;hp=4e20760a7408fd036b36ace4ec99e3d38add2fdb;hpb=617f49bff4a6db5ed51b4f767c3634d1915fdced;p=FrontAlgorithms.git diff --git a/lib/fpa/Base/SeedsInterface.hxx b/lib/fpa/Base/SeedsInterface.hxx index 4e20760..5c27216 100644 --- a/lib/fpa/Base/SeedsInterface.hxx +++ b/lib/fpa/Base/SeedsInterface.hxx @@ -7,55 +7,71 @@ #define __fpa__Base__SeedsInterface__hxx__ // ------------------------------------------------------------------------- -template< class _TVertex, class _TCompare > -unsigned int fpa::Base::SeedsInterface< _TVertex, _TCompare >:: +template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare > +unsigned int +fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: GetNumberOfSeeds( ) const { return( this->m_Seeds.size( ) ); } // ------------------------------------------------------------------------- -template< class _TVertex, class _TCompare > -const typename fpa::Base::SeedsInterface< _TVertex, _TCompare >:: -TSeeds& fpa::Base::SeedsInterface< _TVertex, _TCompare >:: +template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare > +const typename +fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: +TSeeds& +fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: GetSeeds( ) const { return( this->m_Seeds ); } // ------------------------------------------------------------------------- -template< class _TVertex, class _TCompare > -typename fpa::Base::SeedsInterface< _TVertex, _TCompare >:: -TSeeds::const_iterator fpa::Base::SeedsInterface< _TVertex, _TCompare >:: +template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare > +typename +fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: +TSeeds::const_iterator +fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: BeginSeeds( ) const { return( this->m_Seeds.begin( ) ); } // ------------------------------------------------------------------------- -template< class _TVertex, class _TCompare > -typename fpa::Base::SeedsInterface< _TVertex, _TCompare >:: -TSeeds::const_iterator fpa::Base::SeedsInterface< _TVertex, _TCompare >:: +template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare > +typename +fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: +TSeeds::const_iterator +fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: EndSeeds( ) const { return( this->m_Seeds.end( ) ); } // ------------------------------------------------------------------------- -template< class _TVertex, class _TCompare > -void fpa::Base::SeedsInterface< _TVertex, _TCompare >:: +template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare > +void +fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: AddSeed( const TVertex& seed ) { - if( this->m_Seeds.insert( seed ).second && this->m_Filter != NULL ) + TNode node; + node.Vertex = seed; + node.Parent = seed; + node.FrontId = TFrontId( this->m_Seeds.size( ) + 1 ); + if( this->m_Seeds.insert( node ).second && this->m_Filter != NULL ) this->m_Filter->Modified( ); } // ------------------------------------------------------------------------- -template< class _TVertex, class _TCompare > -void fpa::Base::SeedsInterface< _TVertex, _TCompare >:: +template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare > +void +fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: RemoveSeed( const TVertex& seed ) { - typename TSeeds::const_iterator i = this->m_Seeds.find( seed ); + TNode node; + node.Vertex = seed; + node.Parent = seed; + typename TSeeds::const_iterator i = this->m_Seeds.find( node ); if( i != this->m_Seeds.end( ) ) { this->m_Seeds.erase( i ); @@ -66,8 +82,9 @@ RemoveSeed( const TVertex& seed ) } // ------------------------------------------------------------------------- -template< class _TVertex, class _TCompare > -void fpa::Base::SeedsInterface< _TVertex, _TCompare >:: +template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare > +void +fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: ClearSeeds( ) { if( this->m_Seeds.size( ) > 0 ) @@ -80,16 +97,16 @@ ClearSeeds( ) } // ------------------------------------------------------------------------- -template< class _TVertex, class _TCompare > -fpa::Base::SeedsInterface< _TVertex, _TCompare >:: +template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare > +fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: SeedsInterface( itk::ProcessObject* filter ) : m_Filter( filter ) { } // ------------------------------------------------------------------------- -template< class _TVertex, class _TCompare > -fpa::Base::SeedsInterface< _TVertex, _TCompare >:: +template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare > +fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: ~SeedsInterface( ) { this->m_Seeds.clear( );