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