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 std::vector< typename cpExtensions::DataStructures::Skeleton< _VDim >::TIndex >
44 cpExtensions::DataStructures::Skeleton< _VDim >::
47 std::vector< TIndex > res;
48 auto mIt = this->BeginEdgesRows( );
49 for( ; mIt != this->EndEdgesRows( ); ++mIt )
51 unsigned long count = mIt->second.size( );
53 res.push_back( mIt->first );
59 // -------------------------------------------------------------------------
60 template< unsigned int _VDim >
61 std::vector< typename cpExtensions::DataStructures::Skeleton< _VDim >::TIndex >
62 cpExtensions::DataStructures::Skeleton< _VDim >::
63 GetBifurcations( ) const
65 std::vector< TIndex > res;
66 auto mIt = this->BeginEdgesRows( );
67 for( ; mIt != this->EndEdgesRows( ); ++mIt )
69 unsigned long count = mIt->second.size( );
71 res.push_back( mIt->first );
77 // -------------------------------------------------------------------------
78 template< unsigned int _VDim >
79 cpExtensions::DataStructures::Skeleton< _VDim >::
85 // -------------------------------------------------------------------------
86 template< unsigned int _VDim >
87 cpExtensions::DataStructures::Skeleton< _VDim >::
92 #endif // __cpExtensions__DataStructures__Skeleton__hxx__