- bool ret = false;
- _TNode na = this->_Node( a );
- _TNode nb = this->_Node( b );
- long fa = na.FrontId;
- long fb = nb.FrontId;
-
- if( fa != fb )
- {
- // Mark collision, if it is new
- bool exists = this->m_Collisions[ fa ][ fb ].second;
- exists &= this->m_Collisions[ fb ][ fa ].second;
-
- if( !exists )
- {
- this->m_Collisions[ fa ][ fb ].first = na.Vertex;
- this->m_Collisions[ fa ][ fb ].second = true;
- this->m_Collisions[ fb ][ fa ].first = nb.Vertex;
- this->m_Collisions[ fb ][ fa ].second = true;
-
- // Stop if one front is desired
- if( this->m_StopAtOneFront )
- {
- // Perform a depth-first iteration on front graph
- unsigned long N = this->GetNumberOfSeeds( );
- unsigned long count = 0;
- std::vector< bool > m( N, false );
- std::queue< unsigned long > q;
- q.push( 0 );
- while( !q.empty( ) )
- {
- unsigned long f = q.front( );
- q.pop( );
-
- if( m[ f ] )
- continue;
- m[ f ] = true;
- count++;
-
- for( unsigned int n = 0; n < N; ++n )
- if( this->m_Collisions[ f ][ n ].second && !m[ n ] )
- q.push( n );
-
- } // elihw
- ret = ( count == N );
-
- } // fi
-
- } // fi
-
- } // fi
- return( ret );