X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FBase%2FRegionGrow.hxx;h=bf0a862e23b36ee15e3bb512003c4d8f35a44245;hb=89393f2267e42e921571c0184320d6c6382f34ab;hp=503222c1fc7d9ec6f6c770d7ba74dfd764f6f66a;hpb=721b19efb3da24f38076b689517b6ed1ddbd03d2;p=FrontAlgorithms.git diff --git a/lib/fpa/Base/RegionGrow.hxx b/lib/fpa/Base/RegionGrow.hxx index 503222c..bf0a862 100644 --- a/lib/fpa/Base/RegionGrow.hxx +++ b/lib/fpa/Base/RegionGrow.hxx @@ -90,8 +90,16 @@ fpa::Base::RegionGrow< _TAlgorithm >:: // ------------------------------------------------------------------------- template< class _TAlgorithm > -bool fpa::Base::RegionGrow< _TAlgorithm >:: +void fpa::Base::RegionGrow< _TAlgorithm >:: _ComputeOutputValue( TNode& n ) +{ + // Do nothing!!! +} + +// ------------------------------------------------------------------------- +template< class _TAlgorithm > +void fpa::Base::RegionGrow< _TAlgorithm >:: +_UpdateOutputValue( TNode& n ) { TInputValue value = this->_GetInputValue( n.Vertex ); bool inside = false; @@ -99,8 +107,14 @@ _ComputeOutputValue( TNode& n ) inside = this->m_ValuePredicate->Evaluate( value ); if( this->m_VertexPredicate.IsNotNull( ) ) inside &= this->m_VertexPredicate->Evaluate( n.Vertex ); - n.Value = ( inside )? this->m_InsideValue: this->m_InitValue; - return( inside ); + if( !inside ) + { + n.Value = this->m_InitValue; + n.FrontId = 0; + } + else + n.Value = this->m_InsideValue; + this->Superclass::_UpdateOutputValue( n ); } // ------------------------------------------------------------------------- @@ -145,7 +159,7 @@ _PrepareSeeds( TNodes& nodes ) { typename TNodes::iterator nIt = nodes.begin( ); for( ; nIt != nodes.end( ); ++nIt ) - nIt->Value = this->m_InsideValue; + nIt->Value = this->m_InitValue; } #endif // __fpa__Base__RegionGrow__hxx__