VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTerrainPatchObjectForestManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
6 #pragma once
7 
8 #include <vrvSt/vrvSt.h>
9 #include <string>
10 
11 #include <unordered_map>
12 #include <unordered_set>
13 
14 #include <vrvCore/DtTreeRecord.h>
16 
17 namespace osg
18 {
19  class Node;
20 }
21 
22 namespace osgEarth
23 {
24  class Map;
25  class MapNode;
26  class Layer;
27  class VisibleLayer;
28 }
29 
30 namespace makVrv
31 {
32  class DtDe;
33  class DtOsgTerrainPatchObject;
34  class DtStreamedSpeedTreeForest;
35 
41  {
42  public:
46 
47  void onDataLoaded(const osgEarth::Layer* layer,
48  const osg::Node* data);
49  void onDataUnLoaded(const osgEarth::Layer* layer,
50  const osg::Node* data);
51 
53  void onLayerVisibilityChanged(const osgEarth::VisibleLayer* layer);
54 
55  void onLayerLoaded(const osgEarth::MapNode* mapNode,
56  osgEarth::Layer* layer);
57  void onLayerUnLoaded(const osgEarth::MapNode* mapNode,
58  const osgEarth::Layer* layer);
59 
60  void addSpeedTreesToForest(const std::string& forestName, const osg::Node* group, const DtVectorTreeRecords& treeRecords);
61 
62  void removeTreesFromForest(const std::string& forestName, const osg::Node* dataNode);
63 
64  protected:
65  DtStreamedSpeedTreeForest* createForest(const std::string& strName);
66  bool hasForest(const std::string& strName);
67  DtStreamedSpeedTreeForest* getForest(const std::string& strName);
68  void destroyForest(const std::string& strName);
69  size_t numForests(void) const;
70  void destroyAllForests(void);
71 
72  protected:
73  static std::string getForestName(const osgEarth::Layer* layer);
74 
75  protected:
76  typedef std::unordered_map<std::string, DtStreamedSpeedTreeForest*>
79 
81 
83  };
84 }
DtStreamedSpeedTreeForest manages the streaming management for The DtSpeedTreeForest that is contains...
Definition: DtStreamedSpeedTreeForest.h:51
MapStreamedForests myStreamedForests
Definition: DtTerrainPatchObjectForestManager.h:78
#define DT_DLL_VRVST
Definition: vrvSt.h:20
DtOsgTerrainPatchObject & myPatch
Definition: DtTerrainPatchObjectForestManager.h:80
Contains DLL export macros.
std::vector< DtTreeRecord * > DtVectorTreeRecords
Definition: DtTreeRecord.h:139
A DtOsgTerrainPatchObject contains the methods for loading a file as a terrain. When loading a file a...
Definition: DtOsgTerrainPatchObject.h:54
DtTerrainPatchObjectForestManager manages a collection of DtStreamedSpeedTreeForest objects...
Definition: DtTerrainPatchObjectForestManager.h:40
std::unordered_map< std::string, DtStreamedSpeedTreeForest * > MapStreamedForests
Definition: DtTerrainPatchObjectForestManager.h:77
DtDe & myDe
Definition: DtTerrainPatchObjectForestManager.h:82
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
Contains makVrv::DtTreeRecord class.
Contains makVrv::DtTerrainPatchObject class.

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)