VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSpeedTreePreCullJobManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
11 
12 #pragma once
13 
14 #include <vrvSt/vrvSt.h>
15 
17 
18 #include <osg/ref_ptr>
19 #include <osg/Camera>
20 
21 #include <tbb/task.h>
22 
23 #include <set>
24 
25 namespace makVrv
26 {
28 
29  typedef std::set<DtSpeedTreeForest*> SpeedTreeForestSet;
30 
37  {
38  public:
40  DtSpeedTreeForestUpdateAsyncTask(const SpeedTreeForestSet& pForest, osg::ref_ptr<osg::Camera> camera, unsigned int frameNumber);
41 
44 
45  private:
52 
53  public:
54 
56  virtual tbb::task* execute();
57 
58  protected:
59  //Camera should not be accessed. Only used as a pointer for maps within the makSpeedTree forest
62  unsigned int myFrameNumber;
63  //Kept separate from the camera for thread safety.
64  std::string myCameraName;
65  };
66 
70  class DT_DLL_VRVST DtSpeedTreeForestPreCullJob : public osg::Operation
71  {
72  public:
74  DtSpeedTreeForestPreCullJob(bool enabled);
75 
77  virtual ~DtSpeedTreeForestPreCullJob();
78 
79  private:
86 
87  public:
88 
90  virtual void operator () (osg::Object* sv);
91 
93  virtual void addSpeedTreeForestToJob(DtSpeedTreeForest& forest);
94 
96  virtual void removeSpeedTreeForestFromJob(DtSpeedTreeForest& forest);
97 
99  virtual void setEnabled(bool enabled);
100 
102  virtual bool enabled() const;
103 
104  protected:
105 
107 
108  bool myEnabled;
109 
110  };
111 
116  {
117  protected:
118 
121 
123  virtual ~DtSpeedTreePreCullJobManager();
124 
125  private:
132 
133  public:
136  static DtSpeedTreePreCullJobManager& instance(DtDe& de);
137 
139  static const std::string& theClassName();
140 
141  public:
142 
144  virtual void addSpeedTreeForestToJob(DtSpeedTreeForest& forest);
145 
147  virtual void removeSpeedTreeForestFromJob(DtSpeedTreeForest& forest);
148 
149  //Enable or disable the asynchronous speedtree update
150  virtual void setEnableAsyncUpdate(bool enableAsyncUpdate);
151 
152  protected:
153 
155  virtual void initialize();
156 
157  protected:
160  };
161 }
responsible for starting update code off in a separate thread when culling starts it runs in the cull...
Definition: DtSpeedTreePreCullJobManager.h:70
Virtual base class.
Definition: DtVirtualBaseClass.h:19
#define DT_DLL_VRVST
Definition: vrvSt.h:20
std::set< DtSpeedTreeForest * > SpeedTreeForestSet
Definition: DtSpeedTreePreCullJobManager.h:27
osg::ref_ptr< DtSpeedTreeForestPreCullJob > myPreCullJob
Definition: DtSpeedTreePreCullJobManager.h:158
bool myEnabled
Definition: DtSpeedTreePreCullJobManager.h:108
Contains DLL export macros.
DtSpeedTreeForestUpdateAsyncTask is a tbb task for running the speed tree forest updates in the backg...
Definition: DtSpeedTreePreCullJobManager.h:36
SpeedTreeForestSet myForests
Definition: DtSpeedTreePreCullJobManager.h:61
Contains makVrv::DtVirtualBaseClass class.
DtSpeedTreeForest is the SpeedTree implementation of a distributed DtForestObject.
Definition: DtSpeedTreeForest.h:48
SpeedTreeForestSet myForests
Definition: DtSpeedTreePreCullJobManager.h:106
osg::ref_ptr< osg::Camera > myCamera
Definition: DtSpeedTreePreCullJobManager.h:60
DtDe & myDe
Definition: DtSpeedTreePreCullJobManager.h:159
DtSpeedTreePreCullJobManager is a singleton manager for adding the pre cull job and used to control t...
Definition: DtSpeedTreePreCullJobManager.h:115
std::string myCameraName
Definition: DtSpeedTreePreCullJobManager.h:64
unsigned int myFrameNumber
Definition: DtSpeedTreePreCullJobManager.h:62
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)