VR-Forces Developer's Guide
 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) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
14 
17 
18 #include <osg/Matrixd>
19 #include <osg/Geode>
20 
21 #include <string>
22 #include <vector>
23 #include <unordered_set>
24 #include <unordered_map>
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  class DtIndirectRegistrarDriverNode;
44  struct DtNodePlusTraversalInfo;
45  class DtLightPointNode;
46  class DtOsgTerrainPatchObject;
47 }
48 
49 //Debug/testing option for seeing if rendering the proxy nodes as a GS cell works better vs a GT cell
50 // Currently should be set to 1 since we want to use GT cells
51 #define DTPAGEDTILESINDIRECTMANAGER_PROXIES_USE_GT 1
52 
53 namespace makVrv
54 {
57 
60 
62  template <>
63  inline const char* creatorTypeName<DtPagedTilesIndirectManager>(void) { return "DtPagedTilesIndirectManagerCreator"; }
64 
65 
70  {
71 
72  protected:
73 
74  //Constructor, adjustLodStart is used if it is a metaflight terrain.
75  DtPagedTilesIndirectManager(DtDe& de, DtOsgTerrainPatchObject& terrainPatchObject, bool adjustLodStart, bool connectToPagingSignals);
76 
79 
80  public:
82  virtual ~DtPagedTilesIndirectManager();
83 
85  DtPagedTilesIndirectManager() = delete;
86 
89 
91  DtPagedTilesIndirectManager& operator=(const DtPagedTilesIndirectManager&) = delete;
92 
93  public:
94 
95  typedef std::vector< DtNodePlusTraversalInfo > ProxyNodesArray;
96 
98  virtual void setName(const std::string& name);
99 
104  virtual void nodePagedIn(const osg::Node* node, const std::string& fileName, osg::NodePath& parentalNodePath, bool oceanExtracted);
105 
109  virtual void nodePagingOut(const osg::Node* node);
110 
114  virtual void addTextureLoaderToSceneGraph(osg::Group& myTerrainGroup);
115 
119  virtual void slot_postTick();
120 
121  public:
123  boost::signalslib::signal<void(const DtPagedTilesIndirectManager&)> signal_terrainInstancesReadyToRender;
124  protected:
125 
130  virtual void slot_childLoaded(const osg::Group* page, const osg::Node* child, const std::string& fileName, osg::Node*& returnedNode);
131 
133  virtual bool pageBelongsToThisMetaFlightTerrain(const osg::Group* page) const;
134 
139  virtual void slot_childPagedIn(const osg::Group* page, const osg::Node* child);
140 
143  virtual void indirectChildFromPageIn(const osg::Group* page, const osg::Node* child, const std::string& fileName, osg::NodePath& parentalNodePath, bool oceanExtracted);
144 
146  virtual void keyNodeGettingDeleted(const osg::Group* child, DtCellToGeoTypicalIndirectGeoMap* cellMap);
147 
149  virtual void keyNodeGettingDeleted(const osg::Group* child, DtCellToGeoSpecificIndirectGeoMap* cellMap);
150 
155  virtual void slot_childAboutToPageOut(const osg::Group* page, const osg::Node* child);
156 
160  virtual bool processProxyNodes(osg::Group *indirectGroup, const osg::Group* child, std::set<osg::Node*>& foundProxyNodes,
161  osg::NodePath& parentalNodePath);
162 
164  virtual void processGeodes(osg::Group* indirectGroup, osg::Group* child, const std::string& fileName,
165  const std::set<osg::Node*>& foundProxyNodes, bool backgroundThread, osg::NodePath& parentalNodePath, bool oceanIsIndirect);
166 
168  virtual void replaceChildWithGroup(const osg::Group* child, const osg::Group* childReplacement);
169 
171  virtual void indirectThisChild(osg::Group* intersectionGroup, osg::Group* child, const std::string& fileName,
172  bool backgroundThread, osg::NodePath& parentalNodePath, bool oceanExtracted);
173 
175  virtual void disconnectSignalsAndWait();
176 
178  virtual void printHierarchy(const osg::Node* node) const;
179 
181  virtual void removeNestedProxyNodes(ProxyNodesArray& proxyNodesArray) const;
182 
184  virtual DtIndirectModelsContainer* GTModelsContainer();
185 
187  virtual void terrainSkinCellCreatedAndInstancesAdded(const DtCellGeoSpecificIndirectGeo* cell, const std::unordered_set<int>& instances);
188 
190  virtual void terrainSkinCellGettingDeleted(const DtCellGeoSpecificIndirectGeo* cell);
191 
192  protected:
194 
195 #if DTPAGEDTILESINDIRECTMANAGER_PROXIES_USE_GT
198 #else
199  DtCellToGeoSpecificIndirectGeoMap* myCellToGSIndirectGeoMap;
200 #endif
201 
203 
205  std::unordered_map<const DtCellGeoSpecificIndirectGeo*, std::unordered_set<int> > myMapCelltoSetGeodesInCell;
206 
209 
211  typedef std::vector<boost::signalslib::connection> Connections;
212 
215 
218 
220 
221  boost::mutex mySignalMutex;
222  boost::condition mySignalConditional;
226 
228  };
229 }
boost::mutex myMapCelltoSetGeodesInCellMutex
lock for the map above
Definition: DtPagedTilesIndirectManager.h:208
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
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:202
handles the management of paged tiles and terrain patches being added to the indirect rendering syste...
Definition: DtPagedTilesIndirectManager.h:69
DtIndirectVisitorControlGroupCreator & myIndirectGeoIntersectionGroupCreator
Definition: DtPagedTilesIndirectManager.h:225
DtOsgTerrainPatchObject & myOsgTerrainPatchObject
Definition: DtPagedTilesIndirectManager.h:227
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Definition: featureContext.h:36
boost::mutex mySignalMutex
Definition: DtPagedTilesIndirectManager.h:221
std::vector< DtNodePlusTraversalInfo > ProxyNodesArray
Definition: DtPagedTilesIndirectManager.h:95
DtIndirectModelsContainer * myGTModelsContainer
Definition: DtPagedTilesIndirectManager.h:197
Connections myConnections
The connected signals for paging.
Definition: DtPagedTilesIndirectManager.h:214
bool myAdjustLodStart
Definition: DtPagedTilesIndirectManager.h:224
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
friend DtPagedTilesIndirectManagerCreator
friend class creator so that it is the only thing that will create DtPageTilesIndirectManagers ...
Definition: DtPagedTilesIndirectManager.h:78
class for holding an indirect geometry registrar (which holds the information about how to draw model...
Definition: DtIndirectModelsContainer.h:71
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:23
DtVirtualBaseClassCreator< DtPagedTilesIndirectManager, DtOsgTerrainPatchObject &, const bool &, const bool & > DtPagedTilesIndirectManagerCreator
creator
Definition: DtPagedTilesIndirectManager.h:56
A DtOsgTerrainPatchObject contains the methods for loading a file as a terrain. When loading a file a...
Definition: DtOsgTerrainPatchObject.h:54
boost::signalslib::signal< void(const DtPagedTilesIndirectManager &)> signal_terrainInstancesReadyToRender
Emitted when instances of the terrain skin are ready to render.
Definition: DtPagedTilesIndirectManager.h:123
std::vector< boost::signalslib::connection > Connections
A collection of signals.
Definition: DtPagedTilesIndirectManager.h:211
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtDe & myDe
Definition: DtPagedTilesIndirectManager.h:193
boost::condition mySignalConditional
Definition: DtPagedTilesIndirectManager.h:222
Helper for managing indirect geometry, its intersection group and registrar corresponding to a &#39;tile ...
Definition: DtCellGeoSpecificIndirectGeo.h:26
int mySignalWaitCount
Definition: DtPagedTilesIndirectManager.h:223
Base class to provide boost signal/slot management.
const char * creatorTypeName< DtPagedTilesIndirectManager >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtPagedTilesIndirectManager.h:63
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:205
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
DtSignalConnectionManager myOtherConnections
manager for other connections
Definition: DtPagedTilesIndirectManager.h:217
DtCellToGeoTypicalIndirectGeoMap * myCellToGTIndirectGeoMap
Definition: DtPagedTilesIndirectManager.h:196
osg::ref_ptr< DtIndirectRegistrarDriverNode > myIndirectTextureLoaderNode
Definition: DtPagedTilesIndirectManager.h:219

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)