VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtPagedTilesIndirectManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
15 
18 
19 #include <osg/Matrixd>
20 #include <osg/Geode>
21 
22 #include <string>
23 #include <vector>
24 #include <unordered_set>
25 
26 #include <boost/thread/condition.hpp>
27 
28 namespace osg
29 {
30  class Node;
31  class Group;
32 }
33 
34 namespace makVrv
35 {
36  class DtCellToGeoTypicalIndirectGeoMap;
37  class DtCellToGeoSpecificIndirectGeoMap;
38  class DtCellIndirectGeo;
39  class DtCellGeoTypicalIndirectGeo;
40  class DtCellGeoSpecificIndirectGeo;
41  class DtIndirectModelsContainer;
42  class DtIndirectVisitorControlGroupCreator;
43  struct DtNodePlusTraversalInfo;
44 }
45 
46 //Debug/testing option for seeing if rendering the proxy nodes as a GS cell works better vs a GT cell
47 // Currently should be set to 1 since we want to use GT cells
48 #define DTPAGEDTILESINDIRECTMANAGER_PROXIES_USE_GT 1
49 
50 namespace makVrv
51 {
56  {
57 
58  protected:
59 
60  //Constructor, adjustLodStart is used if it is a metaflight terrain.
61  DtPagedTilesIndirectManager(DtDe& de, bool adjustLodStart, bool connectToPagingSignals);
62 
65 
66  public:
68  virtual ~DtPagedTilesIndirectManager();
69 
71  DtPagedTilesIndirectManager() = delete;
72 
75 
77  DtPagedTilesIndirectManager& operator=(const DtPagedTilesIndirectManager&) = delete;
78 
79  public:
80 
81  typedef std::vector< DtNodePlusTraversalInfo > ProxyNodesArray;
82 
84  virtual void setName(const std::string& name);
85 
90  virtual void nodePagedIn(const osg::Node* node, const std::string& fileName, osg::NodePath& parentalNodePath);
91 
95  virtual void nodePagingOut(const osg::Node* node);
96 
100  virtual void addTextureLoaderToSceneGraph(osg::Group& myTerrainGroup);
101 
105  virtual void slot_postTick();
106 
108  virtual void setMetaflightGroup(osg::Node* node);
109 
110  public:
112  boost::signalslib::signal<void(const DtPagedTilesIndirectManager&)> signal_terrainInstancesReadyToRender;
113  protected:
114 
119  virtual void slot_childLoaded(const osg::Group* page, const osg::Node* child, const std::string& fileName, osg::Node*& returnedNode);
120 
122  virtual bool shouldHandlePage(const osg::Group* page);
123 
128  virtual void slot_childPagedIn(const osg::Group* page, const osg::Node* child);
129 
132  virtual void indirectChildFromPageIn(const osg::Group* page, const osg::Node* child, const std::string& fileName, osg::NodePath& parentalNodePath);
133 
135  virtual void keyNodeGettingDeleted(const osg::Group* child, DtCellToGeoTypicalIndirectGeoMap* cellMap);
136 
138  virtual void keyNodeGettingDeleted(const osg::Group* child, DtCellToGeoSpecificIndirectGeoMap* cellMap);
139 
144  virtual void slot_childAboutToPageOut(const osg::Group* page, const osg::Node* child);
145 
149  virtual bool processProxyNodes(osg::Group *indirectGroup, const osg::Group* child, std::set<osg::Node*>& foundProxyNodes,
150  osg::NodePath& parentalNodePath);
151 
153  virtual void processGeodes(osg::Group* indirectGroup, osg::Group* child, const std::string& fileName,
154  const std::set<osg::Node*>& foundProxyNodes, bool backgroundThread, osg::NodePath& parentalNodePath);
155 
157  virtual void replaceChildWithGroup(const osg::Group* child, const osg::Group* childReplacement);
158 
160  virtual void indirectThisChild(osg::Group* intersectionGroup, osg::Group* child, const std::string& fileName,
161  bool backgroundThread, osg::NodePath& parentalNodePath);
162 
164  virtual void disconnectSignalsAndWait();
165 
167  virtual void printHierarchy(const osg::Node* node) const;
168 
170  virtual void removeNestedProxyNodes(ProxyNodesArray& proxyNodesArray) const;
171 
173  virtual DtIndirectModelsContainer* GTModelsContainer();
174 
176  virtual void terrainSkinCellCreatedAndInstancesAdded(const DtCellGeoSpecificIndirectGeo* cell, const std::unordered_set<int>& instances);
177 
179  virtual void terrainSkinCellGettingDeleted(const DtCellGeoSpecificIndirectGeo* cell);
180 
181  protected:
183 
184 #if DTPAGEDTILESINDIRECTMANAGER_PROXIES_USE_GT
187 #else
188  DtCellToGeoSpecificIndirectGeoMap* myCellToGSIndirectGeoMap;
189 #endif
190 
192 
194  std::unordered_map<const DtCellGeoSpecificIndirectGeo*, std::unordered_set<int> > myMapCelltoSetGeodesInCell;
195 
198 
200  typedef std::vector<boost::signalslib::connection> Connections;
201 
204 
207 
209 
210  boost::mutex mySignalMutex;
211  boost::condition mySignalConditional;
216  };
217 
221  {
222  public:
225 
228 
230  virtual DtPagedTilesIndirectManager* create(bool adjustSkinLodStart, bool connectToPagingSignals) const;
231 
234  static DtPagedTilesIndirectManagerCreator& instance(DtDe& de);
235 
237  static const std::string& theClassName();
238  protected:
240  };
241 }
boost::mutex myMapCelltoSetGeodesInCellMutex
lock for the map above
Definition: DtPagedTilesIndirectManager.h:197
Virtual base class.
Definition: DtVirtualBaseClass.h:19
Helper for managing a map of feature tile nodes (for a layer) to DtCellGeoSpecificIndirectGeo DtCellG...
Definition: DtCellToGeoSpecificIndirectGeoMap.h:39
DtCellToGeoSpecificIndirectGeoMap * myCellToGSIndirectGeoMapTerrainSkin
Definition: DtPagedTilesIndirectManager.h:191
handles the management of paged tiles and terrain patches being added to the indirect rendering syste...
Definition: DtPagedTilesIndirectManager.h:55
DtIndirectVisitorControlGroupCreator & myIndirectGeoIntersectionGroupCreator
Definition: DtPagedTilesIndirectManager.h:214
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Definition: featureContext.h:37
boost::mutex mySignalMutex
Definition: DtPagedTilesIndirectManager.h:210
std::vector< DtNodePlusTraversalInfo > ProxyNodesArray
Definition: DtPagedTilesIndirectManager.h:81
DtIndirectModelsContainer * myGTModelsContainer
Definition: DtPagedTilesIndirectManager.h:186
Connections myConnections
The connected signals for paging.
Definition: DtPagedTilesIndirectManager.h:203
bool myAdjustLodStart
Definition: DtPagedTilesIndirectManager.h:213
Helper for managing a map of feature tile nodes (for a layer) to DtCellGeoTypicalIndirectGeo DtCellGe...
Definition: DtCellToGeoTypicalIndirectGeoMap.h:39
creator for DtIndirectVisitorControlGroup
Definition: DtIndirectVisitorControlGroup.h:56
osg::Node * myMetaflightGroupNode
Definition: DtPagedTilesIndirectManager.h:215
class for holding an indirect geometry registrar (which holds the information about how to draw model...
Definition: DtIndirectModelsContainer.h:43
Contains makVrv::DtVirtualBaseClass class.
DtDe & myDe
Definition: DtPagedTilesIndirectManager.h:239
boost::signalslib::signal< void(const DtPagedTilesIndirectManager &)> signal_terrainInstancesReadyToRender
Emitted when instances of the terrain skin are ready to render.
Definition: DtPagedTilesIndirectManager.h:112
std::vector< boost::signalslib::connection > Connections
A collection of signals.
Definition: DtPagedTilesIndirectManager.h:200
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtDe & myDe
Definition: DtPagedTilesIndirectManager.h:182
osg::ref_ptr< DtIndirectTextureLoaderNode > myTextureLoaderNode
Definition: DtPagedTilesIndirectManager.h:208
boost::condition mySignalConditional
Definition: DtPagedTilesIndirectManager.h:211
Helper for managing indirect geometry, its intersection group and registrar corresponding to a &#39;tile ...
Definition: DtCellGeoSpecificIndirectGeo.h:26
int mySignalWaitCount
Definition: DtPagedTilesIndirectManager.h:212
Contains makVrv::DtIndirectTextureLoaderNode class.
Base class to provide boost signal/slot management.
Contains DLL export macros.
std::unordered_map< const DtCellGeoSpecificIndirectGeo *, std::unordered_set< int > > myMapCelltoSetGeodesInCell
map of each cell to the set of instance ids (in the indirect geometry) for that cell ...
Definition: DtPagedTilesIndirectManager.h:194
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Creator for the DtPagedTilesIndirectManager class.
Definition: DtPagedTilesIndirectManager.h:220
DtSignalConnectionManager myOtherConnections
manager for other connections
Definition: DtPagedTilesIndirectManager.h:206
DtCellToGeoTypicalIndirectGeoMap * myCellToGTIndirectGeoMap
Definition: DtPagedTilesIndirectManager.h:185

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)