unsigned long N = this->m_Seeds.size( );
for( unsigned long i = 0; i < N; ++i )
{
- if( this->m_Seeds[ i ] == pa->GetVertex( 0 ) )
+ if( this->m_Seeds[ i ] == pa->GetVertex( pa->GetSize( ) - 1 ) )
ia = i;
- if( this->m_Seeds[ i ] == pb->GetVertex( 0 ) )
+ if( this->m_Seeds[ i ] == pb->GetVertex( pb->GetSize( ) - 1 ) )
ib = i;
} // rof
if( ia != ib )
{
// Compute front path
- /* TODO
- std::vector< long > fpath;
- fpath.push_back( ia );
- while( ia != ib )
- {
- ia = this->m_FrontPaths[ ia ][ ib ];
- fpath.push_back( ia );
-
- } // elihw
-
- // Continue only if both fronts are connected
- unsigned int N = fpath.size( );
- if( N > 0 )
- {
- // First path: from start vertex to first collision
- this->GetPath(
- path, a,
- this->m_Collisions[ fpath[ 0 ] ][ fpath[ 1 ] ].first
- );
-
- // Intermediary paths
- for( unsigned int i = 1; i < N - 1; ++i )
- {
- TPathTVertices ipath =
- this->GetPath(
- this->m_Collisions[ fpath[ i ] ][ fpath[ i - 1 ] ].first,
- this->m_Collisions[ fpath[ i ] ][ fpath[ i + 1 ] ].first
- );
- path.insert( path.end( ), ipath.begin( ), ipath.end( ) );
-
- } // rof
-
- // Final path: from last collision to end point
- TVertices lpath =
- this->GetPath(
- this->m_Collisions[ fpath[ N - 1 ] ][ fpath[ N - 2 ] ].first, b
- );
- path.insert( path.end( ), lpath.begin( ), lpath.end( ) );
-
- } // fi
-
- } // fi
- */
+ std::vector< long > fpath;
+ fpath.push_back( ia );
+ while( ia != ib )
+ {
+ ia = this->m_FrontPaths[ ia ][ ib ];
+ fpath.push_back( ia );
+
+ } // elihw
+
+ // Continue only if both fronts are connected
+ unsigned int N = fpath.size( );
+ if( N > 0 )
+ {
+ // First path: from start vertex to first collision
+ this->GetPath(
+ path, a,
+ this->m_Collisions[ fpath[ 0 ] ][ fpath[ 1 ] ].first
+ );
+
+ // Intermediary paths
+ for( unsigned int i = 1; i < N - 1; ++i )
+ {
+ typename _TPath::Pointer ipath;
+ this->GetPath(
+ ipath,
+ this->m_Collisions[ fpath[ i ] ][ fpath[ i - 1 ] ].first,
+ this->m_Collisions[ fpath[ i ] ][ fpath[ i + 1 ] ].first
+ );
+ for( long id = 0; id < ipath->GetSize( ); ++id )
+ path->AddVertex( ipath->GetVertex( id ) );
+
+ } // rof
+
+ // Final path: from last collision to end point
+ typename _TPath::Pointer lpath;
+ this->GetPath(
+ lpath,
+ this->m_Collisions[ fpath[ N - 1 ] ][ fpath[ N - 2 ] ].first, b
+ );
+ for( long id = 0; id < lpath->GetSize( ); ++id )
+ path->AddVertex( lpath->GetVertex( id ) );
+
+ } // fi
}
else
{