]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/SingleSeedInterface.hxx
...
[FrontAlgorithms.git] / lib / fpa / Base / SingleSeedInterface.hxx
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5
6 #ifndef __fpa__Base__SingleSeedInterface__hxx__
7 #define __fpa__Base__SingleSeedInterface__hxx__
8
9 // -------------------------------------------------------------------------
10 template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
11 typename
12 fpa::Base::SingleSeedInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
13 TSeeds&
14 fpa::Base::SingleSeedInterface< _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::SingleSeedInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
24 TSeeds&
25 fpa::Base::SingleSeedInterface< _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::SingleSeedInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
35 SetSeed( const TVertex& seed )
36 {
37   TSeed s;
38   s.Vertex = seed;
39   s.IsPoint = false;
40   this->m_Seeds[ 0 ] = 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::SingleSeedInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
49 SetSeed( const TPoint& seed )
50 {
51   TSeed s;
52   s.Point = seed;
53   s.IsPoint = true;
54   this->m_Seeds[ 0 ] = 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 fpa::Base::SingleSeedInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
62 SingleSeedInterface( itk::ProcessObject* filter )
63   : m_Filter( filter )
64 {
65   this->m_Seeds = TSeeds( 1 );
66 }
67
68 // -------------------------------------------------------------------------
69 template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare >
70 fpa::Base::SingleSeedInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >::
71 ~SingleSeedInterface( )
72 {
73   this->m_Seeds.clear( );
74 }
75
76 #endif // __fpa__Base__SingleSeedInterface__hxx__
77
78 // eof - $RCSfile$