X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FDataStructures%2FSkeleton.hxx;fp=lib%2FcpExtensions%2FDataStructures%2FSkeleton.hxx;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=12f463f3796055dd017ac03255623102e5e5839c;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpExtensions/DataStructures/Skeleton.hxx b/lib/cpExtensions/DataStructures/Skeleton.hxx deleted file mode 100644 index 12f463f..0000000 --- a/lib/cpExtensions/DataStructures/Skeleton.hxx +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef __cpExtensions__DataStructures__Skeleton__hxx__ -#define __cpExtensions__DataStructures__Skeleton__hxx__ - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void cpExtensions::DataStructures::Skeleton< _VDim >:: -AddBranch( TPath* path ) -{ - // Check inputs - if( path == NULL ) - return; - unsigned long size = path->GetSize( ); - if( size == 0 ) - return; - TIndex a = path->GetVertex( 0 ); - TIndex b = path->GetVertex( size - 1 ); - if( this->HasEdge( a, b ) ) - return; - - // Add path - this->SetVertex( a, a ); - this->SetVertex( b, b ); - this->AddEdge( a, b, path ); - this->AddEdge( b, a, path ); - // TODO: this->Modified( ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -const typename cpExtensions::DataStructures::Skeleton< _VDim >:: -TPath* cpExtensions::DataStructures::Skeleton< _VDim >:: -GetBranch( const TIndex& a, const TIndex& b ) const -{ - static const TPath* null_path = NULL; - if( this->HasEdge( a, b ) ) - return( this->GetEdges( a, b ).front( ) ); - else - return( null_path ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -std::vector< typename cpExtensions::DataStructures::Skeleton< _VDim >::TIndex > -cpExtensions::DataStructures::Skeleton< _VDim >:: -GetEndPoints( ) const -{ - std::vector< TIndex > res; - auto mIt = this->BeginEdgesRows( ); - for( ; mIt != this->EndEdgesRows( ); ++mIt ) - { - unsigned long count = mIt->second.size( ); - if( count == 1 ) - res.push_back( mIt->first ); - - } // rof - return( res ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -std::vector< typename cpExtensions::DataStructures::Skeleton< _VDim >::TIndex > -cpExtensions::DataStructures::Skeleton< _VDim >:: -GetBifurcations( ) const -{ - std::vector< TIndex > res; - auto mIt = this->BeginEdgesRows( ); - for( ; mIt != this->EndEdgesRows( ); ++mIt ) - { - unsigned long count = mIt->second.size( ); - if( count > 1 ) - res.push_back( mIt->first ); - - } // rof - return( res ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -cpExtensions::DataStructures::Skeleton< _VDim >:: -Skeleton( ) - : Superclass( ) -{ -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -cpExtensions::DataStructures::Skeleton< _VDim >:: -~Skeleton( ) -{ -} - -#endif // __cpExtensions__DataStructures__Skeleton__hxx__ - -// eof - $RCSfile$