VR-Forces 5.0.2 Developer's Guide
 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) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
13 
15 
17 
19 
21 
22 #include <osgEarth/StateSetCache>
23 #include <osgEarth/Layer>
24 
25 #include <osg/observer_ptr>
26 
27 #include <boost/thread/mutex.hpp>
28 #include <boost/thread/condition_variable.hpp>
29 
30 #include <tbb/atomic.h>
31 #include <tbb/task.h>
32 
33 #include <unordered_map>
34 #include <unordered_set>
35 
36 namespace osgEarth
37 {
38  class Layer;
39  class SubstituteModelFilterNode;
40  class ExtrudeGeometryFilterNode;
41 }
42 namespace osg
43 {
44  class Node;
45  class Group;
46 }
47 
48 namespace makVrv
49 {
50  class DtDe;
51  class DtCellToGeoTypicalIndirectGeoMap;
52  class DtCellToGeoSpecificIndirectGeoMap;
53  class DtIndirectModelsContainer;
54  class DtModelSemanticsMapper;
55  class DtIndirectFeatureGeomHandler;
56  class DtCellIndirectGeo;
57 
61  {
62  public:
65  std::string requestMarkerName);
67  virtual tbb::task* execute();
68 
69  public:
70  protected:
72  std::string myRequestMarkerName;
73  };
74 
77 
80 
82  template <>
83  inline const char* creatorTypeName<DtIndirectFeatureGeomHandler>(void) { return "DtIndirectFeatureGeomHandlerCreator"; }
84 
92  {
93  public:
96 
97  protected:
99  DtIndirectFeatureGeomHandler(DtDe& de, const osgEarth::Layer& layer, const DtIndirectFadeParameters& fadeParameters, bool dynamicTerrainInstallerActive, bool cullFaceEnabled);
100 
103 
104  private:
108  DtIndirectFeatureGeomHandler &operator=(const DtIndirectFeatureGeomHandler &other) = delete;
109 
110  public:
112  virtual void onDataPremerge(osg::Node* data);
113 
115  virtual void onDataUnloaded(const osg::Node* data);
116 
121  virtual const osg::Node* preloadModelAndRunDynamicTerrainParser(const std::string& modelName);
122 
124  virtual void markTaskFinished();
125 
127  virtual void slot_postTick();
128 
129  protected:
131  virtual void processSubstituteModelFilterNodes(osg::Node* data);
132 
134  virtual void processExtrudeGeometryFilterNodes(osg::Node* data);
135 
137  virtual void processExtrudeGeometryFilterNode(osgEarth::ExtrudeGeometryFilterNode* pFeatureNode, osg::Node* data);
138 
139 
143  virtual void processSubstituteModelFilterNode(const osgEarth::SubstituteModelFilterNode* pFeatureNode, const osg::Node* data);
144 
146  virtual void processSubstituteModelFilterNodeAsGT(const osgEarth::SubstituteModelFilterNode* pFeatureNode, const osg::Group* keyNode);
147 
149  virtual void processSubstituteModelFilterNodeAsGS(const osgEarth::SubstituteModelFilterNode* pFeatureNode, const osg::Group* keyNode);
150 
153  virtual void processCustomFeatures(osg::Node* data);
154 
156  virtual void processCustomFeature(const osgEarth::CustomFeatureNode* pFeatureNode, const osg::Node* key);
157 
159  virtual void setLayerMask(const osgEarth::Layer* layer) const;
160 
162  virtual void turnOffIntersectionsIfSoSpecified(const osgEarth::Layer* layer) const;
163 
164  protected:
165 
172  osg::observer_ptr<const osgEarth::Layer> myLayer;
173 
177 
180 
184 
186 
188  boost::condition_variable myProcessedNodeMapCondition;
190  std::map<std::string, NodeRefPtr > myProcessedNodeMap;
191  std::map<std::string, bool > myIsProcessingNodeMap;
192 
193 
195  static tbb::atomic<int> theTotalNumActiveAsyncTasks;
196 
198  tbb::atomic<int> myActiveAsyncTasks;
199 
201  boost::condition_variable myWaitCondition;
202  boost::mutex myWaitMutex;
203 
205 
207 
209  const bool myCullFaceEnabled;
210 
213 
214  // Keep a set of models that could not be read and that we logged a warning for
215  // so, that we log the warning only once.
216  // This is because many feature markers could refer to the same model (that is not found)
217  std::unordered_set<std::string> myWarningLoggedForNotFoundModel;
218  };
219 }
friend DtIndirectFeatureGeomHandlerCreator
creator friend class so it is the only one that can create new DtIndirectFeatureGeomHandlers ...
Definition: DtIndirectFeatureGeomHandler.h:102
static tbb::atomic< int > theTotalNumActiveAsyncTasks
tracks how many total threads are active to avoid preemption
Definition: DtIndirectFeatureGeomHandler.h:195
DtIndirectFeatureGeomHandler * myHandler
Definition: DtIndirectFeatureGeomHandler.h:71
Helper for managing a map of feature tile nodes (for a layer) to DtCellGeoSpecificIndirectGeo DtCellG...
Definition: DtCellToGeoSpecificIndirectGeoMap.h:39
std::map< std::string, bool > myIsProcessingNodeMap
Definition: DtIndirectFeatureGeomHandler.h:191
tbb::atomic< int > myActiveAsyncTasks
tracks how many threads are active from this particular instance, when 0 the tasks are done...
Definition: DtIndirectFeatureGeomHandler.h:198
#define DT_DLL_VRVOSGEARTH
Definition: vrvOsgEarth.h:21
std::map< std::string, NodeRefPtr > myProcessedNodeMap
Definition: DtIndirectFeatureGeomHandler.h:190
boost::mutex myWaitMutex
Definition: DtIndirectFeatureGeomHandler.h:202
const bool myDynamicTerrainInstallerActive
Definition: DtIndirectFeatureGeomHandler.h:208
Helper for managing a map of feature tile nodes (for a layer) to DtCellGeoTypicalIndirectGeo DtCellGe...
Definition: DtCellToGeoTypicalIndirectGeoMap.h:39
osg::ref_ptr< osgEarth::StateSetCache > myStateSetCache
Definition: DtIndirectFeatureGeomHandler.h:204
DtIndirectModelsContainer * myGTModelsContainer
Definition: DtIndirectFeatureGeomHandler.h:176
class used to collect geometry coming in via feature_geom and add it to the indirect engine...
Definition: DtIndirectFeatureGeomHandler.h:91
const char * creatorTypeName< DtIndirectFeatureGeomHandler >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtIndirectFeatureGeomHandler.h:83
DtVirtualBaseClassCreator< DtIndirectFeatureGeomHandler, const osgEarth::Layer &, const DtIndirectFadeParameters &, const bool &, const bool & > DtIndirectFeatureGeomHandlerCreator
creator
Definition: DtIndirectFeatureGeomHandler.h:76
Creates another async class to load nodes.
Definition: DtIndirectFeatureGeomHandler.h:60
DtIndirectFadeParameters myFadeParameters
Definition: DtIndirectFeatureGeomHandler.h:206
class for holding an indirect geometry registrar (which holds the information about how to draw model...
Definition: DtIndirectModelsContainer.h:55
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:22
std::string myRequestMarkerName
Definition: DtIndirectFeatureGeomHandler.h:72
Custom Feature Node.
Definition: CustomFeatureNode.h:43
osg::ref_ptr< const osg::Node > NodeRefPtr
Definition: DtIndirectFeatureGeomHandler.h:189
Contains the CustomFeatureNode class declaration.
std::unordered_set< std::string > myWarningLoggedForNotFoundModel
Definition: DtIndirectFeatureGeomHandler.h:217
const bool myCullFaceEnabled
Definition: DtIndirectFeatureGeomHandler.h:209
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
struct for holding the fade parameters used by the indirect rendering cull compute shader ...
Definition: DtIndirectFadeParameters.h:17
Base class to provide boost signal/slot management.
DtCellToGeoSpecificIndirectGeoMap * myCellToGSIndirectGeoMap
GeoSpecific stuff.
Definition: DtIndirectFeatureGeomHandler.h:179
boost::mutex myProcessedNodeMapMutex
Definition: DtIndirectFeatureGeomHandler.h:187
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:70
DtCellToGeoTypicalIndirectGeoMap * myCellToGTIndirectGeoMap
GeoTypical stuff.
Definition: DtIndirectFeatureGeomHandler.h:175
DtCellToGeoSpecificIndirectGeoMap * myCellToProceduralGSIndirectGeoMap
Procedural stuff. Is also geospecific in the sense that each tile will have its own registrar...
Definition: DtIndirectFeatureGeomHandler.h:183
DtModelSemanticsMapper & myModelSematicsMapper
Definition: DtIndirectFeatureGeomHandler.h:185
DtDe & myDe
Definition: DtIndirectFeatureGeomHandler.h:166
boost::condition_variable myWaitCondition
signaling mutex and condition
Definition: DtIndirectFeatureGeomHandler.h:201
boost::condition_variable myProcessedNodeMapCondition
Definition: DtIndirectFeatureGeomHandler.h:188
The DtModelSemanticsMapper object is responsible for mapping Names of model semantics declarations (f...
Definition: DtModelSemanticsMapper.h:27
DtSignalConnectionManager myConnections
manager for connections
Definition: DtIndirectFeatureGeomHandler.h:212
Contains DLL export macros.
Contains makVrv::DtIndirectFadeParameters class.
osg::observer_ptr< const osgEarth::Layer > myLayer
store by observer ptr here onDataPremerge for a node can get launched (in another thread) just after ...
Definition: DtIndirectFeatureGeomHandler.h:172

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)