1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Base__SeedsInterface__hxx__
7 #define __fpa__Base__SeedsInterface__hxx__
9 // -------------------------------------------------------------------------
10 template< class _TVertex, class _TCompare >
11 unsigned int fpa::Base::SeedsInterface< _TVertex, _TCompare >::
12 GetNumberOfSeeds( ) const
14 return( this->m_Seeds.size( ) );
17 // -------------------------------------------------------------------------
18 template< class _TVertex, class _TCompare >
19 const typename fpa::Base::SeedsInterface< _TVertex, _TCompare >::
20 TSeeds& fpa::Base::SeedsInterface< _TVertex, _TCompare >::
23 return( this->m_Seeds );
26 // -------------------------------------------------------------------------
27 template< class _TVertex, class _TCompare >
28 typename fpa::Base::SeedsInterface< _TVertex, _TCompare >::
29 TSeeds::const_iterator fpa::Base::SeedsInterface< _TVertex, _TCompare >::
32 return( this->m_Seeds.begin( ) );
35 // -------------------------------------------------------------------------
36 template< class _TVertex, class _TCompare >
37 typename fpa::Base::SeedsInterface< _TVertex, _TCompare >::
38 TSeeds::const_iterator fpa::Base::SeedsInterface< _TVertex, _TCompare >::
41 return( this->m_Seeds.end( ) );
44 // -------------------------------------------------------------------------
45 template< class _TVertex, class _TCompare >
46 void fpa::Base::SeedsInterface< _TVertex, _TCompare >::
47 AddSeed( const TVertex& seed )
49 if( this->m_Seeds.insert( seed ).second && this->m_Filter != NULL )
50 this->m_Filter->Modified( );
53 // -------------------------------------------------------------------------
54 template< class _TVertex, class _TCompare >
55 void fpa::Base::SeedsInterface< _TVertex, _TCompare >::
56 RemoveSeed( const TVertex& seed )
58 typename TSeeds::const_iterator i = this->m_Seeds.find( seed );
59 if( i != this->m_Seeds.end( ) )
61 this->m_Seeds.erase( i );
62 if( this->m_Filter != NULL )
63 this->m_Filter->Modified( );
68 // -------------------------------------------------------------------------
69 template< class _TVertex, class _TCompare >
70 void fpa::Base::SeedsInterface< _TVertex, _TCompare >::
73 if( this->m_Seeds.size( ) > 0 )
75 this->m_Seeds.clear( );
76 if( this->m_Filter != NULL )
77 this->m_Filter->Modified( );
82 // -------------------------------------------------------------------------
83 template< class _TVertex, class _TCompare >
84 fpa::Base::SeedsInterface< _TVertex, _TCompare >::
85 SeedsInterface( itk::ProcessObject* filter )
90 // -------------------------------------------------------------------------
91 template< class _TVertex, class _TCompare >
92 fpa::Base::SeedsInterface< _TVertex, _TCompare >::
95 this->m_Seeds.clear( );
98 #endif // __fpa__Base__SeedsInterface__hxx__