VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSpeedTreeCore.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2024 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvSt/vrvSt.h>
13 
16 
18 
19 #include <unordered_set>
20 
21 namespace makOsgSpeedTree
22 {
23  class Core;
24  struct SForestRenderInfo;
25 }
26 
27 namespace osg
28 {
29  class Camera;
30 }
31 
32 namespace makVrv
33 {
34  class DtThreadCameraStreamDataManager;
35 
39  {
40 
41  public:
42  typedef std::unordered_set<int> ProgramBlocks;
43 
44  public:
46  DtSpeedTreeCore(DtDe& de);
47 
49  virtual ~DtSpeedTreeCore();
50 
52  DtSpeedTreeCore() = delete;
54  DtSpeedTreeCore(const DtSpeedTreeCore &other) = delete;
56  DtSpeedTreeCore &operator=(const DtSpeedTreeCore &other) = delete;
57 
58  public:
60  static DtSpeedTreeCore& instance(DtDe& de);
61 
63  static void registerInstance(DtDe& de, DtSpeedTreeCore* anInstance);
64 
65  public:
66 
69  virtual makOsgSpeedTree::Core* speedTreeCore(void)
70  {
71  return mySpeedTreeCore;
72  }
73 
74  virtual void slot_displayToBeDestroyed(const std::string& displayName, DtDe* de);
75 
80  virtual void set3DLodDistances(float fHighDetail3dDistance,
81  float fLowDetail3dDistance);
82 
86  virtual void setBillboardStartEndDistances(float fBillboardStartDistance,
87  float fBillboardEndDistance);
88 
89  virtual void setTreesEnabled(bool enabled);
90  virtual void enableBillboardRendering(bool enable);
91  virtual void enable3DTreeRendering(bool enable);
92 
93  virtual void setAmbientScalar(float val);
94  virtual void setDiffuseScalar(float val);
95  virtual void setSpecularScalar(float val);
96  virtual void setTransmissionScalar(float val);
97  virtual void setAlphaScalar(float val);
98 
101  virtual void setVertexUserFunctionFileName(
102  const std::string& vertexUserFunctionFilename);
103 
106  virtual void setMultiViewVertexUserFunctionFileName(
107  const std::string& vertexUserFunctionFilename);
108 
111  virtual void setFragmentUserFunctionFileName(
112  const std::string& fragmentUserFunctionFilename);
113 
115  virtual const std::string& vertexUserFunctionFileName() const;
116 
118  virtual const std::string& multiViewVertexUserFunctionFileName() const;
119 
121  virtual const std::string& fragmentUserFunctionFileName() const;
122 
124  virtual void setFreezeEnabled(bool enable);
127  virtual bool freezeEnabled() const;
128 
130  virtual void setProfilingActive(bool active);
131 
132  //Get the program id's that have been bound already.
133  // This changed from being in the forest because it needs to be cleared for all
134  // forests if one forest uploads new functions to the core
135  virtual ProgramBlocks& programBlocks();
136 
138  virtual DtSpeedTreeTcsUserData* getOrCreateUserData(const osg::Camera* osgCamera);
139 
141  virtual DtSpeedTreeTcsUserData* findUserData(const osg::Camera* osgCamera);
142 
144  virtual const DtSpeedTreeTcsUserData* findUserData(const osg::Camera* osgCamera) const;
145 
147  virtual void clearAllUserDataUniformLocationMaps();
148 
150  virtual void incrementNumForestsRenderedThisFrame(void);
151 
153  virtual void resetNumForestsRenderedThisFrame(void);
154 
155  virtual int numForestsRenderedThisFrame(void) const;
156 
157  protected:
158  virtual void connectSignals(void);
159  virtual void disconnectSignals(void);
160 
161  virtual void slot_preTick(void);
162  protected:
163  static void initRenderInfo(
164  makOsgSpeedTree::SForestRenderInfo& sForestRenderInfo);
165 
166  protected:
168 
169  makOsgSpeedTree::Core* mySpeedTreeCore;
171 
176 
178 
181 
183  };
184 }
Manager for DtThreadCameraStreamData Holds them as cameras come in. Deletes them as cameras go out (v...
Definition: DtThreadCameraStreamDataManager.h:86
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
#define DT_DLL_VRVST
Definition: vrvSt.h:20
DtSpeedTreeTcsUserDataCreator & myUserDataCreator
Definition: DtSpeedTreeCore.h:180
DtThreadCameraStreamDataManager & myTcsDataManager
Definition: DtSpeedTreeCore.h:179
Contains DLL export macros.
bool myFreezeEnabled
Definition: DtSpeedTreeCore.h:175
DtSpeedTreeCore wraps and provides the interface to makOsgSpeedTree.
Definition: DtSpeedTreeCore.h:38
std::string myVertexUserFunctionFilename
Definition: DtSpeedTreeCore.h:172
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:23
Contains makVrv::DtVirtualBaseClass class.
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
makOsgSpeedTree::Core * mySpeedTreeCore
Definition: DtSpeedTreeCore.h:169
DtSignalConnectionManager myConnections
Definition: DtSpeedTreeCore.h:170
ProgramBlocks myProgramBlocks
Definition: DtSpeedTreeCore.h:177
This represents per camera, context (tcs) specific data for speedtree.
Definition: DtSpeedTreeTcsUserData.h:26
Base class to provide boost signal/slot management.
std::string myFragmentUserFunctionFilename
Definition: DtSpeedTreeCore.h:174
std::unordered_set< int > ProgramBlocks
Definition: DtSpeedTreeCore.h:42
static DtSpeedTreeCore * mySpeedTreeCore
Definition: vrvSt.h:34
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
Contains makVrv::DtSpeedTreeTcsUserData class.
std::string myMultiViewVertexUserFunctionFileName
Definition: DtSpeedTreeCore.h:173
DtDe & myDe
Definition: DtSpeedTreeCore.h:167
virtual makOsgSpeedTree::Core * speedTreeCore(void)
Get a pointer to the makOsgSpeedTree::Core wrapped by this object.
Definition: DtSpeedTreeCore.h:69
std::atomic< int > myNumForestsRenderedThisFrame
Definition: DtSpeedTreeCore.h:182

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)