X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FBase%2FRegionGrow.hxx;h=09fe59a726de35fa761af02f636317ee09db42f6;hb=c370699e769d8db284c58534c7a45f11dc9fb8b3;hp=b942dfd9eb1fb6f1fb4eb7c6bd6b667f68847388;hpb=e82144a4e9fb907de430c8aca4b92577a81033fb;p=FrontAlgorithms.git diff --git a/lib/fpa/Base/RegionGrow.hxx b/lib/fpa/Base/RegionGrow.hxx index b942dfd..09fe59a 100644 --- a/lib/fpa/Base/RegionGrow.hxx +++ b/lib/fpa/Base/RegionGrow.hxx @@ -121,7 +121,8 @@ GenerateData( ) // Add neighborhood TVertices neighbors = this->_GetNeighbors( node.first ); typename TVertices::const_iterator neighIt = neighbors.begin( ); - for( ; neighIt != neighbors.end( ); ++neighIt ) + bool coll = false; + while( neighIt != neighbors.end( ) && !coll ) { TVertex neigh = *neighIt; if( this->_IsMarked( neigh ) ) @@ -133,13 +134,18 @@ GenerateData( ) this->GetNumberOfSeeds( ) > 1 && nColl == 1 ) + { while( q.size( ) > 0 ) q.pop( ); + coll = true; + + } // fi } else q.push( _TNode( neigh, node.second ) ); + ++neighIt; - } // rof + } // elihw } // elihw this->_FreeMarks( );