From adba0941ad4b140ffd4396da4cac103fc98fa7b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Thu, 31 Aug 2017 21:36:52 -0500 Subject: [PATCH] ... --- lib/fpa/DataStructures/MinimumSpanningTree.h | 2 +- lib/fpa/DataStructures/MinimumSpanningTree.hxx | 5 +++-- lib/fpa/Filters/Dijkstra.h | 1 + lib/fpa/Filters/Dijkstra.hxx | 14 ++++++++++++++ 4 files changed, 19 insertions(+), 3 deletions(-) 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 >:: -- 2.47.1