// -------------------------------------------------------------------------
template< class _TAlgorithm >
-typename fpa::Base::RegionGrow< _TAlgorithm >::
-TOutputValue fpa::Base::RegionGrow< _TAlgorithm >::
-_ComputeOutputValue( const TNode& n )
+void fpa::Base::RegionGrow< _TAlgorithm >::
+_ComputeOutputValue( TNode& n )
{
- TInputValue value = this->_GetInputValue( n.Vertex );
- bool inside = false;
- if( this->m_ValuePredicate.IsNotNull( ) )
- inside = this->m_ValuePredicate->Evaluate( value );
- if( this->m_VertexPredicate.IsNotNull( ) )
- inside &= this->m_VertexPredicate->Evaluate( n.Vertex );
- return( ( inside )? this->m_InsideValue: this->m_InitValue );
+ // Do nothing!!!
}
// -------------------------------------------------------------------------
template< class _TAlgorithm >
void fpa::Base::RegionGrow< _TAlgorithm >::
-_QueueInit( )
+_UpdateOutputValue( TNode& n )
{
- typedef typename Superclass::TSeedsInterface::TSeeds::iterator _TIt;
-
- this->Superclass::_QueueInit( );
- for( _TIt sIt = this->BeginSeeds( ); sIt != this->EndSeeds( ); ++sIt )
- sIt->Value = this->m_InsideValue;
+ TInputValue value = this->_GetInputValue( n.Vertex );
+ bool inside = false;
+ if( this->m_ValuePredicate.IsNotNull( ) )
+ inside = this->m_ValuePredicate->Evaluate( value );
+ if( this->m_VertexPredicate.IsNotNull( ) )
+ inside &= this->m_VertexPredicate->Evaluate( n.Vertex );
+ if( !inside )
+ {
+ n.Value = this->m_InitValue;
+ n.FrontId = 0;
+ }
+ else
+ n.Value = this->m_InsideValue;
+ this->Superclass::_UpdateOutputValue( n );
}
// -------------------------------------------------------------------------
return( this->m_Queue.size( ) );
}
+// -------------------------------------------------------------------------
+template< class _TAlgorithm >
+void fpa::Base::RegionGrow< _TAlgorithm >::
+_PrepareSeeds( TNodes& nodes )
+{
+ typename TNodes::iterator nIt = nodes.begin( );
+ for( ; nIt != nodes.end( ); ++nIt )
+ nIt->Value = this->m_InitValue;
+}
+
#endif // __fpa__Base__RegionGrow__hxx__
// eof - $RCSfile$