]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/Algorithm.hxx
Experiments going well :-)
[FrontAlgorithms.git] / lib / fpa / Base / Algorithm.hxx
index 286343f647d589c4e0f44607796a5f8de3c22c08..f4ccfdb5c95ae0bdce26cac35df7869783fa7ef8 100644 (file)
@@ -88,9 +88,27 @@ GenerateData( )
   this->m_CollisionSites.clear( );
   this->m_CollisionSites.
     resize( N, _TCollisionSitesRow( N, _TCollision( TVertex( ), false ) ) );
-  this->_BeforeLoop( );
+
+  this->_BeforeMainLoop( );
+  this->_InitializeMarks( );
+  this->_InitializeResults( );
+  this->_InitializeQueue( );
   this->_Loop( );
-  this->_AfterLoop( );
+  this->_AfterMainLoop( );
+}
+
+// -------------------------------------------------------------------------
+template< class T, class B >
+void fpa::Base::Algorithm< T, B >::
+_BeforeMainLoop( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class T, class B >
+void fpa::Base::Algorithm< T, B >::
+_AfterMainLoop( )
+{
 }
 
 // -------------------------------------------------------------------------
@@ -112,9 +130,7 @@ template< class T, class B >
 void fpa::Base::Algorithm< T, B >::
 _Loop( )
 {
-  this->_InitializeMarks( );
-  this->_InitializeResults( );
-  this->_InitializeQueue( );
+  this->_BeforeLoop( );
   while( !( this->_IsQueueEmpty( ) ) )
   {
     _TNode n = this->_QueuePop( );
@@ -172,6 +188,7 @@ _Loop( )
 
   } // elihw
   this->InvokeEvent( TEndEvent( ) );
+  this->_AfterLoop( );
 }
 
 // -------------------------------------------------------------------------
@@ -279,10 +296,7 @@ _Parent( const TVertex& v ) const
 {
   typename _TMarks::const_iterator mIt = this->m_Marks.find( v );
   if( mIt == this->m_Marks.end( ) )
-  {
-    TVertex v;
-    return( v );
-  }
+    return( TVertex( ) );
   else
     return( mIt->second.Parent );
 }