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 _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
12 fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
13 GetNumberOfSeeds( ) const
15 return( this->m_Seeds.size( ) );
18 // -------------------------------------------------------------------------
19 template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
21 fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
23 fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
26 return( this->m_Seeds );
29 // -------------------------------------------------------------------------
30 template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
32 fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
33 TSeeds::const_iterator
34 fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
37 return( this->m_Seeds.begin( ) );
40 // -------------------------------------------------------------------------
41 template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
43 fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
44 TSeeds::const_iterator
45 fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
48 return( this->m_Seeds.end( ) );
51 // -------------------------------------------------------------------------
52 template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
54 fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
55 AddSeed( const TVertex& seed )
60 node.FrontId = TFrontId( this->m_Seeds.size( ) + 1 );
61 if( this->m_Seeds.insert( node ).second && this->m_Filter != NULL )
62 this->m_Filter->Modified( );
65 // -------------------------------------------------------------------------
66 template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
68 fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
69 RemoveSeed( const TVertex& seed )
74 typename TSeeds::const_iterator i = this->m_Seeds.find( node );
75 if( i != this->m_Seeds.end( ) )
77 this->m_Seeds.erase( i );
78 if( this->m_Filter != NULL )
79 this->m_Filter->Modified( );
84 // -------------------------------------------------------------------------
85 template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
87 fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
90 if( this->m_Seeds.size( ) > 0 )
92 this->m_Seeds.clear( );
93 if( this->m_Filter != NULL )
94 this->m_Filter->Modified( );
99 // -------------------------------------------------------------------------
100 template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
101 fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
102 SeedsInterface( itk::ProcessObject* filter )
107 // -------------------------------------------------------------------------
108 template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
109 fpa::Base::SeedsInterface< _TVertex, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
112 this->m_Seeds.clear( );
115 #endif // __fpa__Base__SeedsInterface__hxx__