]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/RegionGrow.hxx
...
[FrontAlgorithms.git] / lib / fpa / Base / RegionGrow.hxx
index b942dfd9eb1fb6f1fb4eb7c6bd6b667f68847388..09fe59a726de35fa761af02f636317ee09db42f6 100644 (file)
@@ -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( );