]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/SeedsInterface.hxx
...
[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 _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
11 typename
12 fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
13 TSeeds&
14 fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
15 GetSeeds( )
16 {
17   return( this->m_Seeds );
18 }
19
20 // -------------------------------------------------------------------------
21 template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
22 const typename
23 fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
24 TSeeds&
25 fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
26 GetSeeds( ) const
27 {
28   return( this->m_Seeds );
29 }
30
31 // -------------------------------------------------------------------------
32 template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
33 void
34 fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
35 AddSeed( const TVertex& seed )
36 {
37   TSeed s;
38   s.Vertex = seed;
39   s.IsPoint = false;
40   this->m_Seeds.push_back( s );
41   if( this->m_Filter != NULL )
42     this->m_Filter->Modified( );
43 }
44
45 // -------------------------------------------------------------------------
46 template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
47 void
48 fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
49 AddSeed( const TPoint& seed )
50 {
51   TSeed s;
52   s.Point = seed;
53   s.IsPoint = true;
54   this->m_Seeds.push_back( s );
55   if( this->m_Filter != NULL )
56     this->m_Filter->Modified( );
57 }
58
59 // -------------------------------------------------------------------------
60 template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
61 void
62 fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
63 ClearSeeds( )
64 {
65   if( this->m_Seeds.size( ) > 0 )
66   {
67     this->m_Seeds.clear( );
68     if( this->m_Filter != NULL )
69       this->m_Filter->Modified( );
70
71   } // fi
72 }
73
74 // -------------------------------------------------------------------------
75 template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
76 fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
77 SeedsInterface( itk::ProcessObject* filter )
78   : m_Filter( filter )
79 {
80 }
81
82 // -------------------------------------------------------------------------
83 template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
84 fpa::Base::SeedsInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
85 ~SeedsInterface( )
86 {
87   this->m_Seeds.clear( );
88 }
89
90 #endif // __fpa__Base__SeedsInterface__hxx__
91
92 // eof - $RCSfile$