]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/Algorithm.hxx
...
[FrontAlgorithms.git] / lib / fpa / Base / Algorithm.hxx
index 4ad828c773dbae60c5ec2c90b796649e094079c1..c29ff03e174791bea40b5155fab7e55f2526db72 100644 (file)
@@ -36,6 +36,15 @@ _TQueueNode( const _TVertex& v, const _TQueueNode& n )
   this->FrontId = n.FrontId;
 }
 
+// -------------------------------------------------------------------------
+template < class _TFilter, class _TVertex, class _TOutput >
+void fpa::Base::Algorithm< _TFilter, _TVertex, _TOutput >::
+ClearSeeds( )
+{
+  this->m_Seeds.clear( );
+  this->Modified( );
+}
+
 // -------------------------------------------------------------------------
 template < class _TFilter, class _TVertex, class _TOutput >
 void fpa::Base::Algorithm< _TFilter, _TVertex, _TOutput >::
@@ -95,13 +104,23 @@ GenerateData( )
     this->_InitResults( this->m_InitResult );
 
     // Main loop
-    this->_Loop( );
+    do
+      this->_Loop( );
+    while( this->_ContinueGenerateData( ) );
 
   } // fi
   this->_AfterGenerateData( );
   this->InvokeEvent( TEndEvent( ) );
 }
 
+// -------------------------------------------------------------------------
+template < class _TFilter, class _TVertex, class _TOutput >
+bool fpa::Base::Algorithm< _TFilter, _TVertex, _TOutput >::
+_ContinueGenerateData( )
+{
+  return( false );
+}
+
 // -------------------------------------------------------------------------
 template < class _TFilter, class _TVertex, class _TOutput >
 void fpa::Base::Algorithm< _TFilter, _TVertex, _TOutput >::
@@ -232,6 +251,19 @@ _UpdateCollisions( const TVertex& a, const TVertex& b )
   } // fi
 }
 
+// -------------------------------------------------------------------------
+template < class _TFilter, class _TVertex, class _TOutput >
+_TOutput fpa::Base::Algorithm< _TFilter, _TVertex, _TOutput >::
+_GetInputValue( const _TQueueNode& v, const _TQueueNode& p )
+{
+  _TOutput res = this->m_InitResult;
+  if( this->m_VertexFunction.IsNotNull( ) )
+    res = this->m_VertexFunction->Evaluate( v.Vertex, p.Vertex );
+  if( this->m_ConversionFunction.IsNotNull( ) )
+    res = this->m_ConversionFunction->Evaluate( res );
+  return( res );
+}
+
 #endif // __fpa__Base__Algorithm__hxx__
 
 // eof - $RCSfile$