0028815: Visualization, StdPrs_WFShape - fix misprint in condition
authorkgv <kgv@opencascade.com>
Tue, 6 Jun 2017 07:27:55 +0000 (10:27 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 9 Jun 2017 09:58:47 +0000 (12:58 +0300)
src/OSD/OSD_Parallel.hxx
src/StdPrs/StdPrs_WFShape.cxx

index 592452a..3f34408 100644 (file)
@@ -171,7 +171,14 @@ public: //! @name public methods
   //! Returns number of logical proccesrs.
   Standard_EXPORT static Standard_Integer NbLogicalProcessors();
 
-  //! Simple primitive for parallelization of "foreach" loops.
+  //! Simple primitive for parallelization of "foreach" loops, e.g.:
+  //! @code
+  //!   for (std::iterator anIter = theBegin; anIter != theEnd; ++anIter) {}
+  //! @endcode
+  //! @param theBegin   the first index (incusive)
+  //! @param theEnd     the last  index (exclusive)
+  //! @param theFunctor functor providing an interface "void operator(InputIterator theIter){}" performing task for specified iterator position
+  //! @param isForceSingleThreadExecution if true, then no threads will be created
   template <typename InputIterator, typename Functor>
   static void ForEach( InputIterator  theBegin,
                        InputIterator  theEnd,
@@ -179,7 +186,14 @@ public: //! @name public methods
                        const Standard_Boolean isForceSingleThreadExecution
                          = Standard_False );
 
-  //! Simple primitive for parallelization of "for" loops.
+  //! Simple primitive for parallelization of "for" loops, e.g.:
+  //! @code
+  //!   for (int anIter = theBegin; anIter < theEnd; ++anIter) {}
+  //! @endcode
+  //! @param theBegin   the first index (incusive)
+  //! @param theEnd     the last  index (exclusive)
+  //! @param theFunctor functor providing an interface "void operator(int theIndex){}" performing task for specified index
+  //! @param isForceSingleThreadExecution if true, then no threads will be created
   template <typename Functor>
   static void For( const Standard_Integer theBegin,
                    const Standard_Integer theEnd,
@@ -209,7 +223,7 @@ void OSD_Parallel::ForEach( InputIterator          theBegin,
 {
   if ( isForceSingleThreadExecution )
   {
-    for ( InputIterator it(theBegin); it != theEnd; it++ )
+    for ( InputIterator it(theBegin); it != theEnd; ++it )
       theFunctor(*it);
 
     return;
index 418e0a3..f400871 100644 (file)
@@ -173,7 +173,7 @@ void StdPrs_WFShape::Add (const Handle(Prs3d_Presentation)& thePresentation,
         }
 
         StdPrs_WFShape_IsoFunctor anIsoFunctor (*aUPolylinesPtr, *aVPolylinesPtr, aFaces, theDrawer, aShapeDeflection);
-        OSD_Parallel::For (0, aNbFaces - 1, anIsoFunctor, aNbFaces < 2);
+        OSD_Parallel::For (0, aNbFaces, anIsoFunctor, aNbFaces < 2);
       }
     }