1 #ifndef __cpExtensions__DataStructures__Skeleton__hxx__
2 #define __cpExtensions__DataStructures__Skeleton__hxx__
4 // -------------------------------------------------------------------------
5 template< unsigned int _VDim >
6 void cpExtensions::DataStructures::Skeleton< _VDim >::
7 AddBranch( TPath* path )
12 unsigned long size = path->GetSize( );
15 TIndex a = path->GetVertex( 0 );
16 TIndex b = path->GetVertex( size - 1 );
17 if( this->HasEdge( a, b ) )
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( );
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
34 static const TPath* null_path = NULL;
35 if( this->HasEdge( a, b ) )
36 return( this->GetEdges( a, b ).front( ) );
41 // -------------------------------------------------------------------------
42 template< unsigned int _VDim >
43 cpExtensions::DataStructures::Skeleton< _VDim >::
49 // -------------------------------------------------------------------------
50 template< unsigned int _VDim >
51 cpExtensions::DataStructures::Skeleton< _VDim >::
56 #endif // __cpExtensions__DataStructures__Skeleton__hxx__