]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/SeedsInterface.h
...
[FrontAlgorithms.git] / lib / fpa / Base / SeedsInterface.h
index e9c67c3306362f1af8883948445c342129c64654..493b4dbfde30462c9902dde1a12f3a7dbb0e75b5 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <functional>
 #include <set>
+#include <vector>
 
 #include <itkConceptChecking.h>
 #include <itkProcessObject.h>
@@ -18,7 +19,7 @@ namespace fpa
   {
     /**
      */
-    template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare = std::greater< _TVertex > >
+    template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare = std::greater< _TVertex > >
     class SeedsInterface
     {
     public:
@@ -29,12 +30,23 @@ namespace fpa
 
     public:
       typedef _TVertex       TVertex;
+      typedef _TPoint        TPoint;
       typedef _TInputValue   TInputValue;
       typedef _TOutputValue  TOutputValue;
       typedef _TFrontId      TFrontId;
       typedef _TCompare      TCompare;
       typedef SeedsInterface Self;
 
+      struct TSeed
+      {
+        TVertex Vertex;
+        TPoint  Point;
+        bool    IsPoint;
+        bool    IsUnified;
+        TSeed( ) : IsUnified( false ) { }
+      };
+      typedef std::vector< TSeed > TSeeds;
+
       struct TNode
       {
         TVertex  Vertex;
@@ -52,22 +64,22 @@ namespace fpa
             return( cmp( a.Vertex, b.Vertex ) );
           }
       };
-      typedef std::set< TNode, TNodeCompare > TSeeds;
+      typedef std::set< TNode, TNodeCompare > TNodes;
 
     public:
-      unsigned int GetNumberOfSeeds( ) const;
       const TSeeds& GetSeeds( ) const;
-      typename TSeeds::const_iterator BeginSeeds( ) const;
-      typename TSeeds::const_iterator EndSeeds( ) const;
 
       virtual void AddSeed( const TVertex& seed );
-      virtual void RemoveSeed( const TVertex& seed );
+      virtual void AddSeed( const TPoint& seed );
       virtual void ClearSeeds( );
 
     protected:
       SeedsInterface( itk::ProcessObject* filter );
       virtual ~SeedsInterface( );
 
+      virtual TNodes _UnifySeeds( ) = 0;
+      virtual void _PrepareSeeds( TNodes& nodes ) = 0;
+
     protected:
       TSeeds m_Seeds;
       itk::ProcessObject* m_Filter;