]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/RegionGrowWithMultipleCriteria.hxx
Plugins updated
[FrontAlgorithms.git] / lib / fpa / Base / RegionGrowWithMultipleCriteria.hxx
index 5ec51ec6681fe044d2794a6c09d6199a31a7966c..0fd4378c5fbabef49d5cd827d25e44bcfcd927d6 100644 (file)
@@ -45,29 +45,46 @@ fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
 // -------------------------------------------------------------------------
 template< class V, class R, class VV, class VC, class B >
 void fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
-_BeforeLoop( )
+_BeforeMainLoop( )
 {
-  this->Superclass::_BeforeLoop( );
+  this->Superclass::_BeforeMainLoop( );
   this->m_ActualFunction = this->m_Functions.begin( );
 }
 
 // -------------------------------------------------------------------------
 template< class V, class R, class VV, class VC, class B >
-typename fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
-_TNode fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
-_QueuePop( )
+void fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
+_AfterLoop( )
 {
-  _TNode node = this->Superclass::_QueuePop( );
-  if( this->_IsQueueEmpty( ) )
+  this->Superclass::_AfterLoop( );
+
+  // Replace queue
+  this->_QueueClear( );
+  while( !( this->m_AuxiliaryQueue.empty( ) ) )
   {
-    // Replace queue
-    this->m_Queue = this->m_AuxiliaryQueue;
+    // Get node
+    _TNode node = this->m_AuxiliaryQueue.front( );
+    this->m_AuxiliaryQueue.pop( );
+    this->_QueuePush( node );
 
-    // Move to next function
-    this->m_ActualFunction++;
+    // Unmark it
+    typename _TMarks::iterator mIt = this->m_Marks.find( node.Vertex );
+    if( mIt != this->m_Marks.end( ) )
+      this->m_Marks.erase( mIt );
+    
+  } // elihw
+
+  // Move to next function
+  this->m_ActualFunction++;
+}
 
-  } // fi
-  return( node );
+// -------------------------------------------------------------------------
+template< class V, class R, class VV, class VC, class B >
+void fpa::Base::RegionGrowWithMultipleCriteria< V, R, VV, VC, B >::
+_Loop( )
+{
+  while( this->m_ActualFunction != this->m_Functions.end( ) )
+    this->Superclass::_Loop( );
 }
 
 // -------------------------------------------------------------------------