VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIndirectFeatureGeomHandler.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <set>
13 
15 
17 
19 
20 #include <boost/thread/mutex.hpp>
21 #include <boost/thread/condition_variable.hpp>
22 
23 #include <tbb/atomic.h>
24 #include <tbb/task.h>
25 
27 
28 #include <osgEarth/StateSetCache>
29 
30 namespace osgEarth
31 {
32  class Layer;
33  class SubstituteModelFilterNode;
34  class ExtrudeGeometryFilterNode;
35 }
36 namespace osg
37 {
38  class Node;
39  class Group;
40 }
41 
42 namespace makVrv
43 {
44  class DtDe;
45  class DtCellToGeoTypicalIndirectGeoMap;
46  class DtCellToGeoSpecificIndirectGeoMap;
47  class DtIndirectModelsContainer;
48  class DtModelSemanticsMapper;
49  class DtIndirectFeatureGeomHandler;
50 
53  class DtIndirectFeatureGeomHandlerAsyncLoader : public tbb::task
54  {
55  public:
58  std::string requestMarkerName);
60  virtual tbb::task* execute();
61 
62  public:
63  protected:
65  std::string myRequestMarkerName;
66 
67  };
68 
76  {
77  public:
80 
81  protected:
83  DtIndirectFeatureGeomHandler(DtDe& de, const osgEarth::Layer& layer, const DtIndirectFadeParameters& fadeParameters, bool dynamicTerrainInstallerActive);
84 
87 
88  private:
93 
94  public:
96  virtual void onDataPremerge(osg::Node* data);
97 
99  virtual void onDataUnloaded(const osg::Node* data);
100 
105  virtual const osg::Node* preloadModelAndRunDynamicTerrainParser(const std::string& modelName);
106 
108  virtual void markTaskFinished();
109 
110  protected:
112  virtual void processSubstituteModelFilterNodes(osg::Node* data);
113 
115  virtual void processExtrudeGeometryFilterNodes(osg::Node* data);
116 
118  virtual void processExtrudeGeometryFilterNode(osgEarth::ExtrudeGeometryFilterNode* pFeatureNode, osg::Node* data);
119 
120 
124  virtual void processSubstituteModelFilterNode(const osgEarth::SubstituteModelFilterNode* pFeatureNode, const osg::Node* data);
125 
127  virtual void processSubstituteModelFilterNodeAsGT(const osgEarth::SubstituteModelFilterNode* pFeatureNode, const osg::Group* keyNode);
128 
130  virtual void processSubstituteModelFilterNodeAsGS(const osgEarth::SubstituteModelFilterNode* pFeatureNode, const osg::Group* keyNode);
131 
134  virtual void processCustomFeatures(osg::Node* data);
135 
137  virtual void processCustomFeature(const osgEarth::CustomFeatureNode* pFeatureNode, const osg::Node* key);
138 
139  protected:
140 
142  const osgEarth::Layer& myLayer;
143 
147 
150 
154 
156 
158  boost::condition_variable myProcessedNodeMapCondition;
160  std::map<std::string, NodeRefPtr > myProcessedNodeMap;
161  std::map<std::string, bool > myIsProcessingNodeMap;
162 
163 
165  static tbb::atomic<int> theTotalNumActiveAsyncTasks;
166 
168  tbb::atomic<int> myActiveAsyncTasks;
169 
171  boost::condition_variable myWaitCondition;
172  boost::mutex myWaitMutex;
173 
175 
178  };
179 
182  {
183  public:
186 
189 
190  private:
195 
196  public:
198  virtual DtIndirectFeatureGeomHandler* create(const osgEarth::Layer& layer, const DtIndirectFadeParameters& fadeParameters, bool dynamicTerrainInstallerActive) const;
199 
202  static DtIndirectFeatureGeomHandlerCreator& instance(DtDe& de);
203 
205  static const std::string& theClassName();
206  protected:
208  };
209 }
virtual tbb::task * execute()
runs the task in a background thread
static tbb::atomic< int > theTotalNumActiveAsyncTasks
tracks how many total threads are active to avoid preemption
Definition: DtIndirectFeatureGeomHandler.h:165
Virtual base class.
Definition: DtVirtualBaseClass.h:22
DtIndirectFeatureGeomHandler * myHandler
Definition: DtIndirectFeatureGeomHandler.h:64
struct for holding the fade parameters used by the indirect rendering cull compute shader ...
Definition: DtGpuCullingAndLodDefines.h:21
Helper for managing a map of feature tile nodes (for a layer) to DtCellGeoSpecificIndirectGeo DtCellG...
Definition: DtCellToGeoSpecificIndirectGeoMap.h:36
std::map< std::string, bool > myIsProcessingNodeMap
Definition: DtIndirectFeatureGeomHandler.h:161
bool myDynamicTerrainInstallerActive
Definition: DtIndirectFeatureGeomHandler.h:177
tbb::atomic< int > myActiveAsyncTasks
tracks how many threads are active from this particular instance, when 0 the tasks are done...
Definition: DtIndirectFeatureGeomHandler.h:168
#define DT_DLL_VRVOSGEARTH
Definition: vrvOsgEarth.h:21
std::map< std::string, NodeRefPtr > myProcessedNodeMap
Definition: DtIndirectFeatureGeomHandler.h:160
DtIndirectFeatureGeomHandlerAsyncLoader(DtIndirectFeatureGeomHandler *handler, std::string requestMarkerName)
constructor
boost::mutex myWaitMutex
Definition: DtIndirectFeatureGeomHandler.h:172
Helper for managing a map of feature tile nodes (for a layer) to DtCellGeoTypicalIndirectGeo DtCellGe...
Definition: DtCellToGeoTypicalIndirectGeoMap.h:31
osg::ref_ptr< osgEarth::StateSetCache > myStateSetCache
Definition: DtIndirectFeatureGeomHandler.h:174
DtIndirectModelsContainer * myGTModelsContainer
Definition: DtIndirectFeatureGeomHandler.h:146
DtDe & myDe
Definition: DtIndirectFeatureGeomHandler.h:207
class used to collect geometry coming in via feature_geom and add it to the indirect engine...
Definition: DtIndirectFeatureGeomHandler.h:75
Creates another async class to load nodes.
Definition: DtIndirectFeatureGeomHandler.h:53
DtIndirectFadeParameters myFadeParameters
Definition: DtIndirectFeatureGeomHandler.h:176
class for holding an indirect geometry registrar (which holds the information about how to draw model...
Definition: DtIndirectModelsContainer.h:47
const osgEarth::Layer & myLayer
Definition: DtIndirectFeatureGeomHandler.h:142
Contains makVrv::DtVirtualBaseClass class.
std::string myRequestMarkerName
Definition: DtIndirectFeatureGeomHandler.h:65
Custom Feature Node.
Definition: CustomFeatureNode.h:43
osg::ref_ptr< const osg::Node > NodeRefPtr
Definition: DtIndirectFeatureGeomHandler.h:159
Contains the CustomFeatureNode class declaration.
Definition: DtIndirectFeatureGeomHandler.h:181
Declarations for classes used in DtICullingAndLOD.
DtCellToGeoSpecificIndirectGeoMap * myCellToGSIndirectGeoMap
GeoSpecific stuff.
Definition: DtIndirectFeatureGeomHandler.h:149
boost::mutex myProcessedNodeMapMutex
Definition: DtIndirectFeatureGeomHandler.h:157
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
DtCellToGeoTypicalIndirectGeoMap * myCellToGTIndirectGeoMap
GeoTypical stuff.
Definition: DtIndirectFeatureGeomHandler.h:145
DtCellToGeoSpecificIndirectGeoMap * myCellToProceduralGSIndirectGeoMap
Procedural stuff.
Definition: DtIndirectFeatureGeomHandler.h:153
DtModelSemanticsMapper & myModelSematicsMapper
Definition: DtIndirectFeatureGeomHandler.h:155
DtDe & myDe
Definition: DtIndirectFeatureGeomHandler.h:141
boost::condition_variable myWaitCondition
signaling mutex and condition
Definition: DtIndirectFeatureGeomHandler.h:171
boost::condition_variable myProcessedNodeMapCondition
Definition: DtIndirectFeatureGeomHandler.h:158
The DtModelSemanticsMapper object is responsible for mapping Names of model semantics declarations (f...
Definition: DtModelSemanticsMapper.h:27
Contains DLL export macros.

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)