1 #ifndef __FPA__BASE__MINIMUMSPANNINGTREE__H__
2 #define __FPA__BASE__MINIMUMSPANNINGTREE__H__
8 #include <itkSmartPointer.h>
16 template< class _TSuperclass, class _TVertex >
17 class MinimumSpanningTree
21 typedef MinimumSpanningTree Self;
22 typedef _TSuperclass Superclass;
23 typedef itk::SmartPointer< Self > Pointer;
24 typedef itk::SmartPointer< const Self > ConstPointer;
26 typedef _TVertex TVertex;
27 typedef std::vector< TVertex > TVertices;
28 typedef std::pair< TVertex, bool > TCollision;
29 typedef std::vector< TCollision > TCollisionsRow;
30 typedef std::vector< TCollisionsRow > TCollisions;
32 typedef itk::Point< double, TVertex::Dimension > TPoint;
33 typedef std::vector< TPoint > TPoints;
34 typedef std::multimap< double, TVertex > TNodeQueue;
37 typedef std::vector< unsigned long > _TRow;
38 typedef std::vector< _TRow > _TMatrix;
41 itkTypeMacro( MinimumSpanningTree, _TSuperclass );
43 itkBooleanMacro( FillNodeQueue );
45 itkGetConstReferenceMacro( Collisions, TCollisions );
46 itkGetConstReferenceMacro( NodeQueue, TNodeQueue );
47 itkGetConstMacro( FillNodeQueue, bool );
49 itkSetMacro( FillNodeQueue, bool );
52 void SetCollisions( const TCollisions& collisions );
53 TVertices GetPath( const TVertex& a ) const;
54 TVertices GetPath( const TVertex& a, const TVertex& b ) const;
56 virtual TPoints GetEuclideanPath( const TVertex& a ) const;
57 virtual TPoints GetEuclideanPath(
58 const TVertex& a, const TVertex& b
60 virtual bool IsDefinedInEuclideanSpace( ) const;
68 virtual void Clear( );
71 MinimumSpanningTree( );
72 virtual ~MinimumSpanningTree( );
74 virtual bool _HasVertex( const TVertex& a ) const = 0;
75 virtual short _FrontId( const TVertex& a ) const = 0;
76 virtual void _Path( TVertices& path, const TVertex& a ) const = 0;
79 // Purposely not implemented
80 MinimumSpanningTree( const Self& other );
81 Self& operator=( const Self& other );
84 TCollisions m_Collisions;
85 _TMatrix m_FrontPaths;
86 TNodeQueue m_NodeQueue;
89 static const unsigned long INF_VALUE;
96 #ifndef ITK_MANUAL_INSTANTIATION
97 #include <fpa/Base/MinimumSpanningTree.hxx>
98 #endif // ITK_MANUAL_INSTANTIATION
100 #endif // __FPA__BASE__MINIMUMSPANNINGTREE__H__