]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/SeedsInterface.hxx
77b1600c2597dad3948afcba0941914e7c5b7a27
[FrontAlgorithms.git] / lib / fpa / Base / SeedsInterface.hxx
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5
6 #ifndef __fpa__Base__SeedsInterface__hxx__
7 #define __fpa__Base__SeedsInterface__hxx__
8
9 // -------------------------------------------------------------------------
10 template< class _TTraits >
11 typename fpa::Base::SeedsInterface< _TTraits >::
12 TSeeds& fpa::Base::SeedsInterface< _TTraits >::
13 GetSeeds( )
14 {
15   return( this->m_Seeds );
16 }
17
18 // -------------------------------------------------------------------------
19 template< class _TTraits >
20 const typename fpa::Base::SeedsInterface< _TTraits >::
21 TSeeds& fpa::Base::SeedsInterface< _TTraits >::
22 GetSeeds( ) const
23 {
24   return( this->m_Seeds );
25 }
26
27 // -------------------------------------------------------------------------
28 template< class _TTraits >
29 void fpa::Base::SeedsInterface< _TTraits >::
30 AddSeed( const TVertex& seed )
31 {
32   TSeed s;
33   s.Vertex = seed;
34   s.IsPoint = false;
35   this->m_Seeds.push_back( s );
36   if( this->m_Filter != NULL )
37     this->m_Filter->Modified( );
38 }
39
40 // -------------------------------------------------------------------------
41 template< class _TTraits >
42 void fpa::Base::SeedsInterface< _TTraits >::
43 AddSeed( const TPoint& seed )
44 {
45   TSeed s;
46   s.Point = seed;
47   s.IsPoint = true;
48   this->m_Seeds.push_back( s );
49   if( this->m_Filter != NULL )
50     this->m_Filter->Modified( );
51 }
52
53 // -------------------------------------------------------------------------
54 template< class _TTraits >
55 void fpa::Base::SeedsInterface< _TTraits >::
56 ClearSeeds( )
57 {
58   if( this->m_Seeds.size( ) > 0 )
59   {
60     this->m_Seeds.clear( );
61     if( this->m_Filter != NULL )
62       this->m_Filter->Modified( );
63
64   } // fi
65 }
66
67 // -------------------------------------------------------------------------
68 template< class _TTraits >
69 fpa::Base::SeedsInterface< _TTraits >::
70 SeedsInterface( itk::ProcessObject* filter )
71   : m_Filter( filter )
72 {
73 }
74
75 // -------------------------------------------------------------------------
76 template< class _TTraits >
77 fpa::Base::SeedsInterface< _TTraits >::
78 ~SeedsInterface( )
79 {
80   this->m_Seeds.clear( );
81 }
82
83 #endif // __fpa__Base__SeedsInterface__hxx__
84
85 // eof - $RCSfile$