#ifndef __fpa__Base__RegionGrow__hxx__ #define __fpa__Base__RegionGrow__hxx__ #include // ------------------------------------------------------------------------- template< class _TSuperclass > typename fpa::Base::RegionGrow< _TSuperclass >:: TGrowFunction* fpa::Base::RegionGrow< _TSuperclass >:: GetGrowFunction( ) { // TODO: return( dynamic_cast< TGrowFunction* >( this->GetVertexFunction( ) ) ); return( this->m_GrowFunction ); } // ------------------------------------------------------------------------- template< class _TSuperclass > const typename fpa::Base::RegionGrow< _TSuperclass >:: TGrowFunction* fpa::Base::RegionGrow< _TSuperclass >:: GetGrowFunction( ) const { /* TODO return( dynamic_cast< const TGrowFunction* >( this->GetVertexFunction( ) ) ); */ return( this->m_GrowFunction ); } // ------------------------------------------------------------------------- template< class _TSuperclass > typename fpa::Base::RegionGrow< _TSuperclass >:: TOutput fpa::Base::RegionGrow< _TSuperclass >:: GetInsideValue( ) const { const TGrowFunction* f = this->GetGrowFunction( ); if( f != NULL ) return( f->GetInsideValue( ) ); else return( this->m_InitResult ); } // ------------------------------------------------------------------------- template< class _TSuperclass > typename fpa::Base::RegionGrow< _TSuperclass >:: TOutput fpa::Base::RegionGrow< _TSuperclass >:: GetOutsideValue( ) const { const TGrowFunction* f = this->GetGrowFunction( ); if( f != NULL ) return( f->GetOutsideValue( ) ); else return( this->m_InitResult ); } // ------------------------------------------------------------------------- template< class _TSuperclass > void fpa::Base::RegionGrow< _TSuperclass >:: SetGrowFunction( TGrowFunction* f ) { TGrowFunction* old_f = this->GetGrowFunction( ); if( old_f != NULL ) { f->SetInsideValue( old_f->GetInsideValue( ) ); f->SetOutsideValue( old_f->GetOutsideValue( ) ); } // fi this->m_GrowFunction = f; } // ------------------------------------------------------------------------- template< class _TSuperclass > void fpa::Base::RegionGrow< _TSuperclass >:: SetInsideValue( const TOutput& v ) { TGrowFunction* f = this->GetGrowFunction( ); if( f != NULL ) { f->SetInsideValue( v ); this->Modified( ); } // fi } // ------------------------------------------------------------------------- template< class _TSuperclass > void fpa::Base::RegionGrow< _TSuperclass >:: SetOutsideValue( const TOutput& v ) { TGrowFunction* f = this->GetGrowFunction( ); if( f != NULL ) { f->SetOutsideValue( v ); this->Modified( ); } // fi } // ------------------------------------------------------------------------- template< class _TSuperclass > fpa::Base::RegionGrow< _TSuperclass >:: RegionGrow( ) : Superclass( ) { typedef fpa::Base::Functors::RegionGrow::Tautology< TVertex, TOutput > _TFunc; this->SetGrowFunction( _TFunc::New( ) ); this->m_InitResult = this->GetGrowFunction( )->GetOutsideValue( ); } // ------------------------------------------------------------------------- template< class _TSuperclass > fpa::Base::RegionGrow< _TSuperclass >:: ~RegionGrow( ) { } // ------------------------------------------------------------------------- template< class _TSuperclass > bool fpa::Base::RegionGrow< _TSuperclass >:: _UpdateValue( _TQueueNode& v, const _TQueueNode& p ) { v.Result = this->_GetInputValue( v, p ); return( v.Result == this->GetInsideValue( ) ); } #endif // __fpa__Base__RegionGrow__hxx__ // eof - $RCSfile$