]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/RegionGrow.hxx
...
[FrontAlgorithms.git] / lib / fpa / Base / RegionGrow.hxx
index 503222c1fc7d9ec6f6c770d7ba74dfd764f6f66a..bf0a862e23b36ee15e3bb512003c4d8f35a44245 100644 (file)
@@ -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__