]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/MinimumSpanningTree.h
Windows compilation (1/2)
[FrontAlgorithms.git] / lib / fpa / Image / MinimumSpanningTree.h
index 652547d62debf33c7ecb79d27d809f5f54efb4a6..371664c3b10b9e7e0eca1f9b89b5f917086e70ef 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __FPA__IMAGE__MINIMUMSPANNINGTREE__H__
-#define __FPA__IMAGE__MINIMUMSPANNINGTREE__H__
+#ifndef __fpa__Image__MinimumSpanningTree__h__
+#define __fpa__Image__MinimumSpanningTree__h__
 
-#include <itkImage.h>
 #include <fpa/Base/MinimumSpanningTree.h>
+#include <itkImage.h>
 
 namespace fpa
 {
@@ -10,35 +10,42 @@ namespace fpa
   {
     /**
      */
-    template< class V, class N, class C, unsigned int D, unsigned long L >
+    template< unsigned int _VDim >
     class MinimumSpanningTree
-      : public fpa::Base::MinimumSpanningTree< V, C, itk::Image< N, D > >
+      : public fpa::Base::MinimumSpanningTree< itk::Index< _VDim >, itk::Image< itk::Offset< _VDim >, _VDim > >
     {
     public:
-      typedef fpa::Base::MinimumSpanningTree< V, C, itk::Image< N, D > > Superclass;
-      typedef MinimumSpanningTree             Self;
-      typedef itk::SmartPointer< Self >       Pointer;
-      typedef itk::SmartPointer< const Self > ConstPointer;
-
-      typedef V TVertex;
-      typedef C TCollisions;
-
-    protected:
-      typedef N _TNode;
+      typedef itk::Index< _VDim >                               TVertex;
+      typedef itk::Offset< _VDim >                              TOffset;
+      typedef itk::Image< TOffset, _VDim >                      TImage;
+      typedef fpa::Base::MinimumSpanningTree< TVertex, TImage > Superclass;
+      typedef MinimumSpanningTree                               Self;
+      typedef itk::SmartPointer< Self >                         Pointer;
+      typedef itk::SmartPointer< const Self >                   ConstPointer;
+
+      typedef typename Superclass::TVertices TVertices;
+      typedef typename TImage::PointType TPoint;
+      typedef std::deque< TPoint > TPoints;
 
     public:
       itkNewMacro( Self );
-      itkTypeMacro( MinimumSpanningTree, fpa_Base_MinimumSpanningTree );
+      itkTypeMacro(
+        fpa::Image::MinimumSpanningTree, fpa::Base::MinimumSpanningTree
+        );
+
+    public:
+      virtual TVertex GetParent( const TVertex& v ) const fpa_OVERRIDE;
+      virtual void SetParent( const TVertex& v, const TVertex& p ) fpa_OVERRIDE;
+
+      TPoints GetEuclideanPath( const TVertex& a ) const;
+      TPoints GetEuclideanPath( const TVertex& a, const TVertex& b ) const;
 
     protected:
       MinimumSpanningTree( );
       virtual ~MinimumSpanningTree( );
 
-      virtual long _FrontId( const V& v ) const;
-      virtual V _Parent( const V& v ) const;
-
     private:
-      // Purposely not implemented
+      // Purposely not defined
       MinimumSpanningTree( const Self& other );
       Self& operator=( const Self& other );
     };
@@ -47,8 +54,10 @@ namespace fpa
 
 } // ecapseman
 
-#include <fpa/Image/MinimumSpanningTree.hxx>
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include <fpa/Image/MinimumSpanningTree.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
 
-#endif // __FPA__IMAGE__MINIMUMSPANNINGTREE__H__
+#endif // __fpa__Image__MinimumSpanningTree__h__
 
 // eof - $RCSfile$