]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/RegionGrowWithMultipleCriteria.hxx
Some more debug... almost there
[FrontAlgorithms.git] / lib / fpa / Base / RegionGrowWithMultipleCriteria.hxx
index 34420b24ad029a8e3164486082e632def436e652..5ec51ec6681fe044d2794a6c09d6199a31a7966c 100644 (file)
@@ -47,7 +47,7 @@ template< class V, class R, class VV, class VC, class B >
 void fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
 _BeforeLoop( )
 {
-  this->_BeforeLoop( );
+  this->Superclass::_BeforeLoop( );
   this->m_ActualFunction = this->m_Functions.begin( );
 }
 
@@ -60,7 +60,11 @@ _QueuePop( )
   _TNode node = this->Superclass::_QueuePop( );
   if( this->_IsQueueEmpty( ) )
   {
-    std::cerr << "ERROR!!!!" << std::endl;
+    // Replace queue
+    this->m_Queue = this->m_AuxiliaryQueue;
+
+    // Move to next function
+    this->m_ActualFunction++;
 
   } // fi
   return( node );
@@ -71,10 +75,15 @@ template< class V, class R, class VV, class VC, class B >
 bool fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
 _CheckMembership( const _TNode& n ) const
 {
-  bool ret = ( *( this->m_ActualFunction ) )->Evaluate( n.Vertex );
-  if( !ret )
-    this->m_AuxiliaryQueue.push( n );
-  return( ret );
+  if( this->m_ActualFunction != this->m_Functions.end( ) )
+  {
+    bool ret = ( *( this->m_ActualFunction ) )->Evaluate( n.Vertex );
+    if( !ret )
+      this->m_AuxiliaryQueue.push( n );
+    return( ret );
+  }
+  else
+    return( false );
 }
 
 #endif // __FPA__BASE__REGIONGROWWITHMULTIPLECRITERIA__HXX__