From: Leonardo Flórez-Valencia Date: Fri, 1 Sep 2017 02:36:52 +0000 (-0500) Subject: ... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=adba0941ad4b140ffd4396da4cac103fc98fa7b6;p=FrontAlgorithms.git ... --- diff --git a/lib/fpa/DataStructures/MinimumSpanningTree.h b/lib/fpa/DataStructures/MinimumSpanningTree.h index aa5c89a..7d6ce1d 100644 --- a/lib/fpa/DataStructures/MinimumSpanningTree.h +++ b/lib/fpa/DataStructures/MinimumSpanningTree.h @@ -41,7 +41,7 @@ namespace fpa void SetCollisions( const TCollisions& collisions ); void ClearSeeds( ); - void AddSeed( const TVertex& seed ); + void AddSeed( const TVertex& seed, unsigned long fId ); virtual TVertex GetParent( const TVertex& v ) const = 0; virtual void SetParent( const TVertex& v, const TVertex& p ) = 0; diff --git a/lib/fpa/DataStructures/MinimumSpanningTree.hxx b/lib/fpa/DataStructures/MinimumSpanningTree.hxx index 2d6a906..c7083d9 100644 --- a/lib/fpa/DataStructures/MinimumSpanningTree.hxx +++ b/lib/fpa/DataStructures/MinimumSpanningTree.hxx @@ -76,6 +76,7 @@ SetCollisions( const TCollisions& collisions ) } // rof } // rof + this->m_Seeds.resize( N ); this->Modified( ); } @@ -91,9 +92,9 @@ ClearSeeds( ) // ------------------------------------------------------------------------- template< class _TVertex, class _Superclass > void fpa::DataStructures::MinimumSpanningTree< _TVertex, _Superclass >:: -AddSeed( const _TVertex& seed ) +AddSeed( const _TVertex& seed, unsigned long fId ) { - this->m_Seeds.push_back( seed ); + this->m_Seeds[ fId - 1 ] = seed; this->Modified( ); } diff --git a/lib/fpa/Filters/Dijkstra.h b/lib/fpa/Filters/Dijkstra.h index 37cb17e..9356ed8 100644 --- a/lib/fpa/Filters/Dijkstra.h +++ b/lib/fpa/Filters/Dijkstra.h @@ -42,6 +42,7 @@ namespace fpa Dijkstra( ); virtual ~Dijkstra( ); + virtual void _AfterGenerateData( ) override; virtual void _PostComputeOutputValue( TNode& n ) override; private: diff --git a/lib/fpa/Filters/Dijkstra.hxx b/lib/fpa/Filters/Dijkstra.hxx index 38ed116..e065e74 100644 --- a/lib/fpa/Filters/Dijkstra.hxx +++ b/lib/fpa/Filters/Dijkstra.hxx @@ -20,6 +20,20 @@ fpa::Filters::Dijkstra< _TDataInterface, _TMST >:: { } +// ------------------------------------------------------------------------- +template< class _TDataInterface, class _TMST > +void fpa::Filters::Dijkstra< _TDataInterface, _TMST >:: +_AfterGenerateData( ) +{ + this->Superclass::_AfterGenerateData( ); + + TMST* mst = this->GetMinimumSpanningTree( ); + mst->ClearSeeds( ); + mst->SetCollisions( this->m_Collisions ); + for( TNode seed: this->GetSeeds( ) ) + mst->AddSeed( seed.Vertex, seed.FrontId ); +} + // ------------------------------------------------------------------------- template< class _TDataInterface, class _TMST > void fpa::Filters::Dijkstra< _TDataInterface, _TMST >::