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 return( dynamic_cast< TGrowFunction* >( this->GetVertexFunction( ) ) );
15 // -------------------------------------------------------------------------
16 template< class _TSuperclass >
17 const typename fpa::Base::RegionGrow< _TSuperclass >::
18 TGrowFunction* fpa::Base::RegionGrow< _TSuperclass >::
19 GetGrowFunction( ) const
22 dynamic_cast< const TGrowFunction* >( this->GetVertexFunction( ) )
26 // -------------------------------------------------------------------------
27 template< class _TSuperclass >
28 typename fpa::Base::RegionGrow< _TSuperclass >::
29 TOutput fpa::Base::RegionGrow< _TSuperclass >::
30 GetInsideValue( ) const
32 const TGrowFunction* f = this->GetGrowFunction( );
34 return( f->GetInsideValue( ) );
36 return( this->m_InitResult );
39 // -------------------------------------------------------------------------
40 template< class _TSuperclass >
41 typename fpa::Base::RegionGrow< _TSuperclass >::
42 TOutput fpa::Base::RegionGrow< _TSuperclass >::
43 GetOutsideValue( ) const
45 const TGrowFunction* f = this->GetGrowFunction( );
47 return( f->GetOutsideValue( ) );
49 return( this->m_InitResult );
52 // -------------------------------------------------------------------------
53 template< class _TSuperclass >
54 void fpa::Base::RegionGrow< _TSuperclass >::
55 SetGrowFunction( TGrowFunction* f )
57 TGrowFunction* old_f = this->GetGrowFunction( );
60 f->SetInsideValue( old_f->GetInsideValue( ) );
61 f->SetOutsideValue( old_f->GetOutsideValue( ) );
64 this->SetVertexFunction( f );
67 // -------------------------------------------------------------------------
68 template< class _TSuperclass >
69 void fpa::Base::RegionGrow< _TSuperclass >::
70 SetInsideValue( const TOutput& v )
72 TGrowFunction* f = this->GetGrowFunction( );
75 f->SetInsideValue( v );
81 // -------------------------------------------------------------------------
82 template< class _TSuperclass >
83 void fpa::Base::RegionGrow< _TSuperclass >::
84 SetOutsideValue( const TOutput& v )
86 TGrowFunction* f = this->GetGrowFunction( );
89 f->SetOutsideValue( v );
95 // -------------------------------------------------------------------------
96 template< class _TSuperclass >
97 fpa::Base::RegionGrow< _TSuperclass >::
101 typedef fpa::Base::Functors::RegionGrow::Tautology< TVertex, TOutput > _TFunc;
102 this->SetGrowFunction( _TFunc::New( ) );
103 this->m_InitResult = this->GetGrowFunction( )->GetOutsideValue( );
106 // -------------------------------------------------------------------------
107 template< class _TSuperclass >
108 fpa::Base::RegionGrow< _TSuperclass >::
113 // -------------------------------------------------------------------------
114 template< class _TSuperclass >
115 bool fpa::Base::RegionGrow< _TSuperclass >::
116 _UpdateValue( _TQueueNode& v, const _TQueueNode& p )
118 v.Result = this->_GetInputValue( v, p );
119 return( v.Result == this->GetInsideValue( ) );
122 #endif // __fpa__Base__RegionGrow__hxx__