- auto ma = this->_GetMark( a );
- auto mb = this->_GetMark( b );
- if( ma == mb || ma == 0 || mb == 0 )
- return;
-
- // Mark collision, if it is new
- ma--; mb--;
- bool ret = false;
- bool exists = this->m_Collisions[ ma ][ mb ].second;
- exists &= this->m_Collisions[ mb ][ ma ].second;
- if( !exists )
- {
- this->m_Collisions[ ma ][ mb ].first = a;
- this->m_Collisions[ ma ][ mb ].second = true;
- this->m_Collisions[ mb ][ ma ].first = b;
- this->m_Collisions[ mb ][ ma ].second = true;
-
- // Update number of fronts
- unsigned long N = this->m_Seeds.size( );
- 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
- this->m_NumberOfFronts = N - count;
-
- } // fi