VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtStreamedSpeedTreeForest.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 
12 #include <vrvCore/DtUniqueID.h>
13 #include <vrvSt/vrvSt.h>
14 
15 #include <vrvCore/DtTreeRecord.h>
16 
17 #include <unordered_map>
18 #include <unordered_set>
19 
20 #include <tbb/mutex.h>
21 
22 namespace osg
23 {
24  class Node;
25  class Observer;
26 }
27 
28 namespace osgEarth
29 {
30  class Map;
31  class MapNode;
32  class Layer;
33  class VisibleLayer;
34 }
35 
36 namespace osgEarth
37 {
38  class CustomFeatureNode;
39 }
40 
41 namespace makVrv
42 {
43  class DtDe;
44  class DtSpeedTreeForest;
45  class DtOsgTerrainPatchObject;
46  class CellNodeObserver;
47 
52  {
53  public:
56 
57  void onDataLoaded(const DtOsgTerrainPatchObject& patch,
58  const osgEarth::Layer* layer, const osg::Node* data);
59  void onDataUnLoaded(const osgEarth::Layer* layer,
60  const osg::Node* data);
61 
62  void onLayerVisibilityChanged(const osgEarth::VisibleLayer* layer);
63 
64  void onLayerLoaded(const osgEarth::MapNode* mapNode,
65  osgEarth::Layer* layer);
66  void onLayerUnLoaded(const osgEarth::MapNode* mapNode,
67  const osgEarth::Layer* layer);
68 
69  void mapDataToCell(const osg::Node* dataNode, DtUniqueID cellID);
70 
71  void removeForestFromMapData(const osg::Node* dataNode);
72 
74  protected:
76  const osg::Node* data);
78  const osgEarth::CustomFeatureNode* pFeatureNode, const osg::Node* data);
79 
80  bool observerExists(const osg::Node* data);
81  void createObserver(const osgEarth::Layer* layer,
82  const osg::Node* data);
83  void destroyObserver(const osg::Node* data, bool bCheck);
85 
86  protected:
87  typedef std::map<std::string, std::pair<std::string, bool> > MarkerToModelDefinition;
88  static bool verifyExists(const osg::Observer* lhs, const osg::Node* data);
89  static bool getValidTreeModelDefinition(DtDe& de,
90  std::string& strCleanModelName, const std::string& strModelName,
92  typedef std::unordered_set<std::string> ModelDefinitionSet;
93  protected:
98 
99  typedef std::unordered_map<const osg::Node*, CellNodeObserver*>
102 
103  typedef std::set<DtUniqueID> IdSet;
104  typedef std::unordered_map<const osg::Node*, IdSet> MapCellsToSubCells;
107  };
108 }
void removeForestFromMapData(const osg::Node *dataNode)
void onLayerVisibilityChanged(const osgEarth::VisibleLayer *layer)
void onLayerUnLoaded(const osgEarth::MapNode *mapNode, const osgEarth::Layer *layer)
DtSpeedTreeForest * myForest
Definition: DtStreamedSpeedTreeForest.h:95
std::map< std::string, std::pair< std::string, bool > > MarkerToModelDefinition
Definition: DtStreamedSpeedTreeForest.h:87
static bool verifyExists(const osg::Observer *lhs, const osg::Node *data)
DtDe & myDe
Definition: DtStreamedSpeedTreeForest.h:97
DtStreamedSpeedTreeForest manages the streaming management for The DtSpeedTreeForest that is contains...
Definition: DtStreamedSpeedTreeForest.h:51
static bool getValidTreeModelDefinition(DtDe &de, std::string &strCleanModelName, const std::string &strModelName, MarkerToModelDefinition &cache)
void processNewFeatures(const DtOsgTerrainPatchObject &patch, const osg::Node *data)
void onDataUnLoaded(const osgEarth::Layer *layer, const osg::Node *data)
ModelDefinitionSet myValidModelDefinitions
Definition: DtStreamedSpeedTreeForest.h:94
void mapDataToCell(const osg::Node *dataNode, DtUniqueID cellID)
DtSpeedTreeForest * forest()
Contains DLL export macros.
std::vector< DtTreeRecord * > DtVectorTreeRecords
Definition: DtTreeRecord.h:139
tbb::mutex myMapCellsToSubCellsMutex
Definition: DtStreamedSpeedTreeForest.h:106
DtStreamedSpeedTreeForest(DtDe &de, DtUniqueID id)
bool observerExists(const osg::Node *data)
std::unordered_map< const osg::Node *, CellNodeObserver * > MapCellsToObservers
Definition: DtStreamedSpeedTreeForest.h:100
MapCellsToSubCells myMapCellsToSubCells
Definition: DtStreamedSpeedTreeForest.h:105
DtSpeedTreeForest is the SpeedTree implementation of a distributed DtForestObject.
Definition: DtSpeedTreeForest.h:50
Custom Feature Node.
Definition: CustomFeatureNode.h:43
A DtOsgTerrainPatchObject contains the methods for loading a file as a terrain. When loading a file a...
Definition: DtOsgTerrainPatchObject.h:54
void createObserver(const osgEarth::Layer *layer, const osg::Node *data)
std::set< DtUniqueID > IdSet
Definition: DtStreamedSpeedTreeForest.h:103
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
MapCellsToObservers myMapCellsToObservers
Definition: DtStreamedSpeedTreeForest.h:101
std::unordered_set< std::string > ModelDefinitionSet
Definition: DtStreamedSpeedTreeForest.h:92
void onLayerLoaded(const osgEarth::MapNode *mapNode, osgEarth::Layer *layer)
DtVectorTreeRecords myScratchVecTreeRecords
Definition: DtStreamedSpeedTreeForest.h:96
void processNewFeature(const DtOsgTerrainPatchObject &patch, const osgEarth::CustomFeatureNode *pFeatureNode, const osg::Node *data)
Contains makVrv::DtUniqueID type.
void onDataLoaded(const DtOsgTerrainPatchObject &patch, const osgEarth::Layer *layer, const osg::Node *data)
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
void destroyObserver(const osg::Node *data, bool bCheck)
Contains makVrv::DtTreeRecord class.
std::unordered_map< const osg::Node *, IdSet > MapCellsToSubCells
Definition: DtStreamedSpeedTreeForest.h:104

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)