]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/DataStructures/Skeleton.hxx
...
[cpPlugins.git] / lib / cpExtensions / DataStructures / Skeleton.hxx
1 #ifndef __cpExtensions__DataStructures__Skeleton__hxx__
2 #define __cpExtensions__DataStructures__Skeleton__hxx__
3
4 // -------------------------------------------------------------------------
5 template< unsigned int _VDim >
6 void cpExtensions::DataStructures::Skeleton< _VDim >::
7 AddBranch( TPath* path )
8 {
9   // Check inputs
10   if( path == NULL )
11     return;
12   unsigned long size = path->GetSize( );
13   if( size == 0 )
14     return;
15   TIndex a = path->GetVertex( 0 );
16   TIndex b = path->GetVertex( size - 1 );
17   if( this->HasEdge( a, b ) )
18     return;
19
20   // Add path
21   this->SetVertex( a, a );
22   this->SetVertex( b, b );
23   this->AddEdge( a, b, path );
24   this->AddEdge( b, a, path );
25   // TODO: this->Modified( );
26 }
27
28 // -------------------------------------------------------------------------
29 template< unsigned int _VDim >
30 const typename cpExtensions::DataStructures::Skeleton< _VDim >::
31 TPath* cpExtensions::DataStructures::Skeleton< _VDim >::
32 GetBranch( const TIndex& a, const TIndex& b ) const
33 {
34   static const TPath* null_path = NULL;
35   if( this->HasEdge( a, b ) )
36     return( this->GetEdges( a, b ).front( ) );
37   else
38     return( null_path );
39 }
40
41 // -------------------------------------------------------------------------
42 template< unsigned int _VDim >
43 std::vector< typename cpExtensions::DataStructures::Skeleton< _VDim >::TIndex >
44 cpExtensions::DataStructures::Skeleton< _VDim >::
45 GetEndPoints( ) const
46 {
47   std::vector< TIndex > res;
48   return( res );
49 }
50
51 // -------------------------------------------------------------------------
52 template< unsigned int _VDim >
53 std::vector< typename cpExtensions::DataStructures::Skeleton< _VDim >::TIndex >
54 cpExtensions::DataStructures::Skeleton< _VDim >::
55 GetBifurcations( ) const
56 {
57   std::vector< TIndex > res;
58   return( res );
59 }
60
61 // -------------------------------------------------------------------------
62 template< unsigned int _VDim >
63 cpExtensions::DataStructures::Skeleton< _VDim >::
64 Skeleton( )
65   : Superclass( )
66 {
67 }
68
69 // -------------------------------------------------------------------------
70 template< unsigned int _VDim >
71 cpExtensions::DataStructures::Skeleton< _VDim >::
72 ~Skeleton( )
73 {
74 }
75
76 #endif // __cpExtensions__DataStructures__Skeleton__hxx__
77
78 // eof - $RCSfile$