1 #ifndef __fpa__Base__RegionGrow__hxx__
2 #define __fpa__Base__RegionGrow__hxx__
4 #include <fpa/Base/Functors/RegionGrow/Tautology.h>
6 // -------------------------------------------------------------------------
7 template< class _TSuperclass >
8 typename fpa::Base::RegionGrow< _TSuperclass >::
9 TGrowFunction* fpa::Base::RegionGrow< _TSuperclass >::
12 // TODO: return( dynamic_cast< TGrowFunction* >( this->GetVertexFunction( ) ) );
13 return( this->m_GrowFunction );
16 // -------------------------------------------------------------------------
17 template< class _TSuperclass >
18 const typename fpa::Base::RegionGrow< _TSuperclass >::
19 TGrowFunction* fpa::Base::RegionGrow< _TSuperclass >::
20 GetGrowFunction( ) const
24 dynamic_cast< const TGrowFunction* >( this->GetVertexFunction( ) )
27 return( this->m_GrowFunction );
30 // -------------------------------------------------------------------------
31 template< class _TSuperclass >
32 typename fpa::Base::RegionGrow< _TSuperclass >::
33 TOutput fpa::Base::RegionGrow< _TSuperclass >::
34 GetInsideValue( ) const
36 const TGrowFunction* f = this->GetGrowFunction( );
38 return( f->GetInsideValue( ) );
40 return( this->m_InitResult );
43 // -------------------------------------------------------------------------
44 template< class _TSuperclass >
45 typename fpa::Base::RegionGrow< _TSuperclass >::
46 TOutput fpa::Base::RegionGrow< _TSuperclass >::
47 GetOutsideValue( ) const
49 const TGrowFunction* f = this->GetGrowFunction( );
51 return( f->GetOutsideValue( ) );
53 return( this->m_InitResult );
56 // -------------------------------------------------------------------------
57 template< class _TSuperclass >
58 void fpa::Base::RegionGrow< _TSuperclass >::
59 SetGrowFunction( TGrowFunction* f )
61 TGrowFunction* old_f = this->GetGrowFunction( );
64 f->SetInsideValue( old_f->GetInsideValue( ) );
65 f->SetOutsideValue( old_f->GetOutsideValue( ) );
68 this->m_GrowFunction = f;
71 // -------------------------------------------------------------------------
72 template< class _TSuperclass >
73 void fpa::Base::RegionGrow< _TSuperclass >::
74 SetInsideValue( const TOutput& v )
76 TGrowFunction* f = this->GetGrowFunction( );
79 f->SetInsideValue( v );
85 // -------------------------------------------------------------------------
86 template< class _TSuperclass >
87 void fpa::Base::RegionGrow< _TSuperclass >::
88 SetOutsideValue( const TOutput& v )
90 TGrowFunction* f = this->GetGrowFunction( );
93 f->SetOutsideValue( v );
99 // -------------------------------------------------------------------------
100 template< class _TSuperclass >
101 fpa::Base::RegionGrow< _TSuperclass >::
105 typedef fpa::Base::Functors::RegionGrow::Tautology< TVertex, TOutput > _TFunc;
106 this->SetGrowFunction( _TFunc::New( ) );
107 this->m_InitResult = this->GetGrowFunction( )->GetOutsideValue( );
110 // -------------------------------------------------------------------------
111 template< class _TSuperclass >
112 fpa::Base::RegionGrow< _TSuperclass >::
117 // -------------------------------------------------------------------------
118 template< class _TSuperclass >
119 bool fpa::Base::RegionGrow< _TSuperclass >::
120 _UpdateValue( _TQueueNode& v, const _TQueueNode& p )
122 v.Result = this->_GetInputValue( v, p );
123 return( v.Result == this->GetInsideValue( ) );
126 #endif // __fpa__Base__RegionGrow__hxx__