1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Base__Skeleton__hxx__
7 #define __fpa__Base__Skeleton__hxx__
9 // -------------------------------------------------------------------------
10 template< unsigned int _VDim >
11 void fpa::Base::Skeleton< _VDim >::
12 AddBranch( TPath* path )
17 unsigned long size = path->GetSize( );
20 TIndex a = path->GetVertex( 0 );
21 TIndex b = path->GetVertex( size - 1 );
22 if( this->HasEdge( a, b ) )
26 this->SetVertex( a, a );
27 this->SetVertex( b, b );
28 this->AddEdge( a, b, path );
29 this->AddEdge( b, a, path );
30 // TODO: this->Modified( );
33 // -------------------------------------------------------------------------
34 template< unsigned int _VDim >
35 const typename fpa::Base::Skeleton< _VDim >::
36 TPath* fpa::Base::Skeleton< _VDim >::
37 GetBranch( const TIndex& a, const TIndex& b ) const
39 static const TPath* null_path = NULL;
40 if( this->HasEdge( a, b ) )
41 return( this->GetEdges( a, b ).front( ) );
46 // -------------------------------------------------------------------------
47 template< unsigned int _VDim >
48 std::vector< typename fpa::Base::Skeleton< _VDim >::TIndex >
49 fpa::Base::Skeleton< _VDim >::
52 std::vector< TIndex > res;
53 typename Superclass::TMatrix::const_iterator mIt = this->BeginEdgesRows( );
54 for( ; mIt != this->EndEdgesRows( ); ++mIt )
56 unsigned long count = mIt->second.size( );
58 res.push_back( mIt->first );
64 // -------------------------------------------------------------------------
65 template< unsigned int _VDim >
66 std::vector< typename fpa::Base::Skeleton< _VDim >::TIndex >
67 fpa::Base::Skeleton< _VDim >::
68 GetBifurcations( ) const
70 std::vector< TIndex > res;
71 typename Superclass::TMatrix::const_iterator mIt = this->BeginEdgesRows( );
72 for( ; mIt != this->EndEdgesRows( ); ++mIt )
74 unsigned long count = mIt->second.size( );
76 res.push_back( mIt->first );
82 // -------------------------------------------------------------------------
83 template< unsigned int _VDim >
84 fpa::Base::Skeleton< _VDim >::
90 // -------------------------------------------------------------------------
91 template< unsigned int _VDim >
92 fpa::Base::Skeleton< _VDim >::
97 #endif // __fpa__Base__Skeleton__hxx__