From: Leonardo Flórez-Valencia Date: Fri, 14 Jul 2017 13:25:47 +0000 (-0500) Subject: ... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=FrontAlgorithms.git;a=commitdiff_plain;h=a44c34f8d4118730a65ab3a7f9b6fc12614ce67a ... --- diff --git a/lib/fpa/Base/MinimumSpanningTree.hxx b/lib/fpa/Base/MinimumSpanningTree.hxx index 00e4159..d04cd36 100644 --- a/lib/fpa/Base/MinimumSpanningTree.hxx +++ b/lib/fpa/Base/MinimumSpanningTree.hxx @@ -124,7 +124,6 @@ typename fpa::Base::MinimumSpanningTree< _TVertex, _Superclass >:: TVertices fpa::Base::MinimumSpanningTree< _TVertex, _Superclass >:: GetPath( const _TVertex& a, const _TVertex& b ) const { -#error no hace bien el backtracking! static const unsigned long _inf = std::numeric_limits< unsigned long >::max( ); @@ -164,7 +163,7 @@ GetPath( const _TVertex& a, const _TVertex& b ) const { // First path: from start vertex to first collision vertices = this->GetPath( - a, this->m_Collisions[ fpath[ 1 ] ][ fpath[ 0 ] ].first + a, this->m_Collisions[ fpath[ 0 ] ][ fpath[ 1 ] ].first ); // Intermediary paths @@ -172,8 +171,8 @@ GetPath( const _TVertex& a, const _TVertex& b ) const { TVertices ipath = this->GetPath( - this->m_Collisions[ fpath[ i ] ][ fpath[ i - 1 ] ].first, - this->m_Collisions[ fpath[ i ] ][ fpath[ i + 1 ] ].first + this->m_Collisions[ fpath[ i - 1 ] ][ fpath[ i ] ].first, + this->m_Collisions[ fpath[ i + 1 ] ][ fpath[ i ] ].first ); for( long id = 0; id < ipath.size( ); ++id ) vertices.push_back( ipath[ id ] ); @@ -183,7 +182,7 @@ GetPath( const _TVertex& a, const _TVertex& b ) const // Final path: from last collision to end point TVertices lpath = this->GetPath( - this->m_Collisions[ fpath[ N - 2 ] ][ fpath[ N - 1 ] ].first, b + this->m_Collisions[ fpath[ N - 1 ] ][ fpath[ N - 2 ] ].first, b ); for( long id = 0; id < lpath.size( ); ++id ) vertices.push_back( lpath[ id ] ); diff --git a/lib/fpa/Base/SingleSeedInterface.h b/lib/fpa/Base/SingleSeedInterface.h index dc45fe9..0b2147b 100644 --- a/lib/fpa/Base/SingleSeedInterface.h +++ b/lib/fpa/Base/SingleSeedInterface.h @@ -71,6 +71,7 @@ namespace fpa typedef std::set< TNode, TNodeCompare > TNodes; public: + TSeeds& GetSeeds( ); const TSeeds& GetSeeds( ) const; virtual void SetSeed( const TVertex& seed ); diff --git a/lib/fpa/Base/SingleSeedInterface.hxx b/lib/fpa/Base/SingleSeedInterface.hxx index 6db301c..c669618 100644 --- a/lib/fpa/Base/SingleSeedInterface.hxx +++ b/lib/fpa/Base/SingleSeedInterface.hxx @@ -6,6 +6,17 @@ #ifndef __fpa__Base__SingleSeedInterface__hxx__ #define __fpa__Base__SingleSeedInterface__hxx__ +// ------------------------------------------------------------------------- +template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare > +typename +fpa::Base::SingleSeedInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: +TSeeds& +fpa::Base::SingleSeedInterface< _TVertex, _TPoint, _TInputValue, _TOutputValue, _TFrontId, _TCompare >:: +GetSeeds( ) +{ + return( this->m_Seeds ); +} + // ------------------------------------------------------------------------- template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare > const typename