VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
backgroundBvhBuilder.h
Go to the documentation of this file.
1 #pragma once
2 
5 #include <atomic>
6 #include <tbb/tbb_thread.h>
7 #include <tbb/concurrent_queue.h>
8 #include <thread>
9 #include <mutex>
10 #include <condition_variable>
11 
15 {
16 public:
18  virtual ~DtBackgroundBvhBuilder();
19 
20  virtual void addTrianleMeshShape(DtBvhTriangleMeshShape::Ptr shape);
21 
22 protected:
23  static void threadMain(DtBackgroundBvhBuilder* builder);
24 
25  tbb::concurrent_queue<DtBvhTriangleMeshShape::Ptr> myShapesToProcess;
27  std::atomic<bool> myShutdownFlag;
28 
29  tbb::tbb_thread* myProcessingThread;
31  std::mutex myMutex;
32  std::condition_variable myThreadCV;
33 
34 };
std::atomic< bool > myShutdownFlag
Set my destructor to true to indicate that the processing thread(s) should stop processing.
Definition: backgroundBvhBuilder.h:27
std::mutex myMutex
Mutex and condition_variable used to wake up worker thread when needed.
Definition: backgroundBvhBuilder.h:31
tbb::concurrent_queue< DtBvhTriangleMeshShape::Ptr > myShapesToProcess
Definition: backgroundBvhBuilder.h:25
std::condition_variable myThreadCV
Definition: backgroundBvhBuilder.h:32
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
This class encapsulates a worker thread which calls buildBvh() on each DtBvhTriangleMeshShape that is...
Definition: backgroundBvhBuilder.h:14
tbb::tbb_thread * myProcessingThread
Definition: backgroundBvhBuilder.h:29
boost::shared_ptr< DtBvhTriangleMeshShape > Ptr
Definition: bvhTriangleMeshShape.h:83

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)