0024018: Voxel_FastConverter::Convert - avoiding unnecessary iterations when using...
authorPawel <pawel-kowalski@wp.pl>
Thu, 6 Jun 2013 19:58:39 +0000 (21:58 +0200)
committerPawel <pawel-kowalski@wp.pl>
Thu, 13 Jun 2013 10:49:26 +0000 (14:49 +0400)
After processing 'end_thread_triangle' the method exits instead of just continuing the iteration.
Formatting adjusted.

src/Voxel/Voxel_FastConverter.cxx

index 2cdc21a..6d5b35a 100755 (executable)
@@ -217,8 +217,18 @@ Standard_Boolean Voxel_FastConverter::Convert(Standard_Integer&      progress,
     for (; itriangle <= nb_triangles; itriangle++)
     {
       ithread_triangle++;
-      if (ithread_triangle < start_thread_triangle || ithread_triangle > end_thread_triangle)
-       continue;
+      if (ithread_triangle < start_thread_triangle )
+        continue;
+      if (ithread_triangle > end_thread_triangle)
+      {
+        if (ithread == 1)
+          progress = 100;
+#ifdef CONV_DUMP
+        if (ithread == 1)
+          printf("Progress = %d  \r", progress);
+#endif
+        return Standard_True;
+      }
 
       const Poly_Triangle& t = triangles.Value(itriangle);
       t.Get(n1, n2, n3);
@@ -227,9 +237,9 @@ Standard_Boolean Voxel_FastConverter::Convert(Standard_Integer&      progress,
       gp_Pnt p3 = nodes.Value(n3);
       if (transform)
       {
-       p1.Transform(trsf);
-       p2.Transform(trsf);
-       p3.Transform(trsf);
+        p1.Transform(trsf);
+        p2.Transform(trsf);
+        p3.Transform(trsf);
       }
 
       // Get boundary box of the triangle