// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#ifdef HAVE_TBB
- // On Windows, function TryEnterCriticalSection has appeared in Windows NT
- // and is surrounded by #ifdef in MS VC++ 7.1 headers.
- // Thus to use it we need to define appropriate macro saying that we will
- // run on Windows NT 4.0 at least
- #if defined(_WIN32) && !defined(_WIN32_WINNT)
- #define _WIN32_WINNT 0x0501
- #endif
-
- #include <tbb/tbb.h>
-#endif
+#include <Standard_Assert.hxx>
+#include <OSD_Parallel.hxx>
#include <OpenGl_SceneGeometry.hxx>
Materials.swap (anEmptyMaterials);
}
-#ifdef HAVE_TBB
-
struct OpenGL_BVHParallelBuilder
{
BVH_ObjectSet<Standard_ShortReal, 3>* Set;
//
}
- void operator() (const tbb::blocked_range<size_t>& theRange) const
+ void operator() (const Standard_Integer theObjectIdx) const
{
- for (size_t anObjectIdx = theRange.begin(); anObjectIdx != theRange.end(); ++anObjectIdx)
- {
- OpenGl_TriangleSet* aTriangleSet = dynamic_cast<OpenGl_TriangleSet*> (
- Set->Objects().ChangeValue (static_cast<Standard_Integer> (anObjectIdx)).operator->());
+ OpenGl_TriangleSet* aTriangleSet = dynamic_cast<OpenGl_TriangleSet*> (
+ Set->Objects().ChangeValue (static_cast<Standard_Integer> (theObjectIdx)).operator->());
- if (aTriangleSet != NULL)
- {
- aTriangleSet->BVH();
- }
- }
+ if (aTriangleSet != NULL)
+ aTriangleSet->BVH();
}
};
-#endif
-
// =======================================================================
// function : ProcessAcceleration
// purpose : Performs post-processing of high-level BVH
aTimer.Start();
#endif
-#ifdef HAVE_TBB
- // If Intel TBB is available, perform the preliminary
- // construction of bottom-level scene BVHs
- tbb::parallel_for (tbb::blocked_range<size_t> (0, Size()),
- OpenGL_BVHParallelBuilder (this));
-#endif
+ OSD_Parallel::For(0, Size(), OpenGL_BVHParallelBuilder(this));
myBottomLevelTreeDepth = 0;