]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Filters/Dijkstra.hxx
...
[FrontAlgorithms.git] / lib / fpa / Filters / Dijkstra.hxx
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Filters__Dijkstra__hxx__
6 #define __fpa__Filters__Dijkstra__hxx__
7
8 // -------------------------------------------------------------------------
9 template< class _TDataInterface, class _TMST >
10 fpa::Filters::Dijkstra< _TDataInterface, _TMST >::
11 Dijkstra( )
12 {
13   fpaFilterOutputConfigureMacro( MinimumSpanningTree, TMST );
14 }
15
16 // -------------------------------------------------------------------------
17 template< class _TDataInterface, class _TMST >
18 fpa::Filters::Dijkstra< _TDataInterface, _TMST >::
19 ~Dijkstra( )
20 {
21 }
22
23 // -------------------------------------------------------------------------
24 template< class _TDataInterface, class _TMST >
25 void fpa::Filters::Dijkstra< _TDataInterface, _TMST >::
26 _AfterGenerateData( )
27 {
28   this->Superclass::_AfterGenerateData( );
29
30   TMST* mst = this->GetMinimumSpanningTree( );
31   mst->ClearSeeds( );
32   mst->SetCollisions( this->m_Collisions );
33   for( TNode seed: this->GetSeeds( ) )
34     mst->AddSeed( seed.Vertex, seed.FrontId );
35 }
36
37 // -------------------------------------------------------------------------
38 template< class _TDataInterface, class _TMST >
39 void fpa::Filters::Dijkstra< _TDataInterface, _TMST >::
40 _PostComputeOutputValue( TNode& n )
41 {
42   this->Superclass::_PostComputeOutputValue( n );
43   this->GetMinimumSpanningTree( )->SetParent( n.Vertex, n.Parent );
44 }
45
46 #endif // __fpa__Filters__Dijkstra__hxx__
47 // eof - $RCSfile$