]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/Mori.hxx
...
[FrontAlgorithms.git] / lib / fpa / Base / Mori.hxx
index f0141448ef11996a484e35fe68201d0c6b8dcbb2..548d755983b58756b471339c92f842444e10814a 100644 (file)
@@ -114,7 +114,6 @@ _AfterGenerateData( )
     std::cout << int( sIt->first ) << " " << int( sIt->second.first ) << " " << sIt->second.second << std::endl;
 
   } // rof
-  std::cerr << ( this->m_CurrentThreshold != this->m_Thresholds.end( ) ) << std::endl;
 }
 
 // -------------------------------------------------------------------------
@@ -126,7 +125,6 @@ _FinishOneLoop( )
   {
     this->m_Signal[ this->m_Signal.size( ) + 1 ] =
       TSignalData( *this->m_CurrentThreshold, this->m_Count );
-    std::cerr << *( this->m_CurrentThreshold ) << std::endl;
     this->m_CurrentThreshold++;
     this->m_CurrentQueue = ( this->m_CurrentQueue + 1 ) % 2;
     if( this->m_CurrentThreshold != this->m_Thresholds.end( ) )
@@ -142,22 +140,35 @@ _FinishOneLoop( )
 
 // -------------------------------------------------------------------------
 template< class _TAlgorithm >
-bool fpa::Base::Mori< _TAlgorithm >::
+void fpa::Base::Mori< _TAlgorithm >::
 _ComputeOutputValue( TNode& n )
+{
+  // Do nothing!!!
+}
+
+// -------------------------------------------------------------------------
+template< class _TAlgorithm >
+void fpa::Base::Mori< _TAlgorithm >::
+_UpdateOutputValue( TNode& n )
 {
   TInputValue value = this->_GetInputValue( n.Vertex );
   bool inside = this->m_Predicate->Evaluate( value );
-  n.Value = this->m_InsideValue;
   if( !inside )
   {
+    n.Value = this->m_InitValue;
     n.FrontId++;
     this->m_Queues[ ( this->m_CurrentQueue + 1 ) % 2 ].push_back( n );
+    n.FrontId = 0;
   }
   else
+  {
+    n.Value = this->m_InsideValue;
     this->m_Count++;
-  return( inside );
+
+  } // fi
+  this->Superclass::_UpdateOutputValue( n );
 }
-  
+
 // -------------------------------------------------------------------------
 template< class _TAlgorithm >
 void fpa::Base::Mori< _TAlgorithm >::
@@ -201,7 +212,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__Mori__hxx__