]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/Algorithm.h
...
[FrontAlgorithms.git] / lib / fpa / Base / Algorithm.h
index e5b6f2b0285951b5949a878b1746135e9855dd42..785b818ea8be76bdf3290896cf8c95f63b41bf55 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <fpa/Config.h>
 
-#include <vector>
 #include <itkObject.h>
 #include <itkEventObject.h>
 
@@ -18,27 +17,28 @@ namespace fpa
   {
     /**
      */
-    template< class _TFilter, class _TMarksInterface, class _TSeedsInterface >
+    template< class _TTraits >
     class Algorithm
-      : public _TFilter,
-        public _TMarksInterface,
-        public _TSeedsInterface
+      : public _TTraits::TFilter,
+        public _TTraits::TMarksInterface,
+        public _TTraits::TSeedsInterface
     {
     public:
-      typedef Algorithm                       Self;
-      typedef _TFilter                        Superclass;
-      typedef _TMarksInterface                TMarksInterface;
-      typedef _TSeedsInterface                TSeedsInterface;
-      typedef itk::SmartPointer< Self >       Pointer;
-      typedef itk::SmartPointer< const Self > ConstPointer;
-
-      typedef typename _TSeedsInterface::TInputValue  TInputValue;
-      typedef typename _TSeedsInterface::TOutputValue TOutputValue;
-      typedef typename _TSeedsInterface::TNode        TNode;
-      typedef typename _TSeedsInterface::TSeeds       TSeeds;
-      typedef typename _TSeedsInterface::TVertex      TVertex;
-
-      typedef std::vector< TVertex > TNeighborhood;
+      typedef _TTraits                          TTraits;
+      typedef typename TTraits::TFilter         Superclass;
+      typedef typename TTraits::TMarksInterface TMarksInterface;
+      typedef typename TTraits::TSeedsInterface TSeedsInterface;
+      typedef Algorithm                         Self;
+      typedef itk::SmartPointer< Self >         Pointer;
+      typedef itk::SmartPointer< const Self >   ConstPointer;
+
+      typedef typename TTraits::TInputValue   TInputValue;
+      typedef typename TTraits::TOutputValue  TOutputValue;
+      typedef typename TTraits::TNeighborhood TNeighborhood;
+      typedef typename TTraits::TNode         TNode;
+      typedef typename TTraits::TNodes        TNodes;
+      typedef typename TTraits::TSeeds        TSeeds;
+      typedef typename TTraits::TVertex       TVertex;
 
       /**
        */
@@ -89,6 +89,7 @@ namespace fpa
       virtual void GenerateData( ) override;
       virtual void _BeforeGenerateData( );
       virtual void _AfterGenerateData( );
+      virtual void _FinishOneLoop( );
 
       virtual void _QueueInit( );
 
@@ -97,8 +98,8 @@ namespace fpa
       virtual TInputValue _GetInputValue( const TVertex& v ) const = 0;
       virtual TOutputValue _GetOutputValue( const TVertex& v ) const = 0;
 
-      virtual TOutputValue _ComputeOutputValue( const TNode& n ) = 0;
-      virtual void _UpdateOutputValue( const TNode& n ) = 0;
+      virtual void _ComputeOutputValue( TNode& n ) = 0;
+      virtual void _UpdateOutputValue( TNode& n ) = 0;
       virtual void _QueueClear( ) = 0;
       virtual void _QueuePush( const TNode& node ) = 0;
       virtual unsigned long _QueueSize( ) const = 0;