]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/DataStructures/Skeleton.h
yet another refactoring
[cpPlugins.git] / lib / cpExtensions / DataStructures / Skeleton.h
diff --git a/lib/cpExtensions/DataStructures/Skeleton.h b/lib/cpExtensions/DataStructures/Skeleton.h
new file mode 100644 (file)
index 0000000..9d0bd9b
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef __cpExtensions__DataStructures__Skeleton__h__
+#define __cpExtensions__DataStructures__Skeleton__h__
+
+#include <cpExtensions/DataStructures/Graph.h>
+#include <cpExtensions/DataStructures/PolyLineParametricPath.h>
+
+namespace cpExtensions
+{
+  namespace DataStructures
+  {
+    /**
+     */
+    template< unsigned int _VDim >
+    class Skeleton
+      : public Graph< typename PolyLineParametricPath< _VDim >::TIndex, typename PolyLineParametricPath< _VDim >::Pointer, typename PolyLineParametricPath< _VDim >::TIndex, typename PolyLineParametricPath< _VDim >::TIndex::LexicographicCompare >
+    {
+    public:
+      typedef PolyLineParametricPath< _VDim >       TPath;
+      typedef typename TPath::TIndex                TIndex;
+      typedef typename TIndex::LexicographicCompare TIndexCompare;
+      typedef typename TPath::Pointer TPathPointer;
+
+      itkStaticConstMacro( Dimension, unsigned int, _VDim );
+
+      typedef Graph< TIndex, TPathPointer, TIndex, TIndexCompare > Superclass;
+      typedef Skeleton                        Self;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( Skeleton, Graph );
+
+    public:
+      void AddBranch( TPath* path );
+      const TPath* GetBranch( const TIndex& a, const TIndex& b ) const;
+
+    protected:
+      Skeleton( );
+      virtual ~Skeleton( );
+
+    private:
+      // Purposely not implemented
+      Skeleton( const Self& other );
+      Self& operator=( const Self& other );
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include <cpExtensions/DataStructures/Skeleton.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __cpExtensions__DataStructures__Skeleton__h__
+
+// eof - $RCSfile$