mutable NCollection_Array1<Standard_Real> myArrOfParam;
};
+
+class GeomLib_CheckCurveOnSurface_Wrapper
+{
+public:
+ GeomLib_CheckCurveOnSurface_Wrapper(const GeomLib_CheckCurveOnSurface_Local& theFunctor) : myFunctor(theFunctor) {}
+
+ void operator() (int theThreadIndex, int theElemIndex) const
+ {
+ (void)theThreadIndex;
+ myFunctor(theElemIndex);
+ }
+private:
+ GeomLib_CheckCurveOnSurface_Wrapper(const GeomLib_CheckCurveOnSurface_Wrapper&);
+ void operator= (const GeomLib_CheckCurveOnSurface_Wrapper&);
+ const GeomLib_CheckCurveOnSurface_Local& myFunctor;
+};
+
//=======================================================================
//function : GeomLib_CheckCurveOnSurface
//purpose :
GeomLib_CheckCurveOnSurface_Local aComp(myCurve,theCurveOnSurface, anIntervals,
anEpsilonRange, aNbParticles);
+ if (true/*isMultiThread*/)
+ {
+ const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool();
+ const int aNbThreads = isMultiThread ? Min(anIntervals.Size(), aThreadPool->NbDefaultThreadsToLaunch()) : 1;
+ NCollection_Array1<Adaptor3d_Curve> anAdaptorArray(0, aNbThreads - 1);
+ for (Standard_Integer anI = 0; anI < aNbThreads; ++anI)
+ {
+// anAdaptorArray[anI] = myCurve.ShallowCopy();
+ }
+ OSD_ThreadPool::Launcher aLauncher(*aThreadPool, aNbThreads);
+ GeomLib_CheckCurveOnSurface_Wrapper aFunctor(aComp);
+ aLauncher.Perform(anIntervals.Lower(), anIntervals.Upper()+1, aFunctor);
+ }
+ else
+ {
+ for (Standard_Integer anI = anIntervals.Lower(); anI <= anIntervals.Upper(); ++anI)
+ {
+ aComp(anI);
+ }
+ }
+
+
- OSD_Parallel::For(anIntervals.Lower(), anIntervals.Upper(), aComp, false/*!isMultiThread*/);
+// OSD_Parallel::For(anIntervals.Lower(), anIntervals.Upper(), aComp, false/*!isMultiThread*/);
aComp.OptimalValues(myMaxDistance, myMaxParameter);