]> Creatis software - FrontAlgorithms.git/commitdiff
...
authorLeonardo Flórez-Valencia <leonardo.florez@gmail.com>
Wed, 21 Jun 2017 02:31:45 +0000 (21:31 -0500)
committerLeonardo Flórez-Valencia <leonardo.florez@gmail.com>
Wed, 21 Jun 2017 02:31:45 +0000 (21:31 -0500)
lib/fpa/Base/Dijkstra.hxx
lib/fpa/Base/MinimumSpanningTree.hxx

index e858eb3cdb2566ef7a38666b51ed26d975236a39..40058e16e215541709704f455bb03ebbc79b1d6c 100644 (file)
@@ -53,13 +53,13 @@ _AfterGenerateData( )
 {
   typedef typename Superclass::TSeedsInterface::TSeeds::iterator _TIt;
 
+  this->Superclass::_AfterGenerateData( );
+
   TMST* mst = this->GetMinimumSpanningTree( );
   mst->ClearSeeds( );
   mst->SetCollisions( this->m_Collisions );
   for( _TIt sIt = this->BeginSeeds( ); sIt != this->EndSeeds( ); ++sIt )
     mst->AddSeed( sIt->Vertex );
-
-  this->Superclass::_AfterGenerateData( );
 }
 
 // -------------------------------------------------------------------------
index c5838f319be7784e4d949796aee058ac1d442a75..6004aaa183efea0514cc2839fea585a009fadfa6 100644 (file)
@@ -163,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[ 0 ] ][ fpath[ 1 ] ].first
+          a, this->m_Collisions[ fpath[ 1 ] ][ fpath[ 0 ] ].first
           );
 
         // Intermediary paths
@@ -182,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 - 1 ] ][ fpath[ N - 2 ] ].first, b
+            this->m_Collisions[ fpath[ N - 2 ] ][ fpath[ N - 1 ] ].first, b
             );
         for( long id = 0; id < lpath.size( ); ++id )
           vertices.push_back( lpath[ id ] );