VR-Forces 4.8 Class Documentation
 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) 2020 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 <boost/unordered_map.hpp>
18 #include <boost/unordered_set.hpp>
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 }
34 
35 namespace osgEarth
36 {
37  class CustomFeatureNode;
38 }
39 
40 namespace makVrv
41 {
42  class DtDe;
43  class DtSpeedTreeForest;
44  class DtOsgTerrainPatchObject;
45  class CellNodeObserver;
46 
51  {
52  public:
55 
56  void onDataLoaded(const DtOsgTerrainPatchObject& patch, const osgEarth::Map* map,
57  const osgEarth::Layer* layer, const osg::Node* data);
58  void onDataUnLoaded(const osgEarth::Map* map, const osgEarth::Layer* layer,
59  const osg::Node* data);
60 
61  void onLayerLoaded(const osgEarth::MapNode* mapNode,
62  osgEarth::Layer* layer);
63  void onLayerUnLoaded(const osgEarth::MapNode* mapNode,
64  const osgEarth::Layer* layer);
65 
66  void mapDataToCell(const osg::Node* dataNode, DtUniqueID cellID);
67 
68  void removeForestFromMapData(const osg::Node* dataNode);
69 
71  protected:
73  const osg::Node* data);
75  const osgEarth::CustomFeatureNode* pFeatureNode, const osg::Node* data);
76 
77  bool observerExists(const osg::Node* data);
78  void createObserver(const osgEarth::Map* map, const osgEarth::Layer* layer,
79  const osg::Node* data);
80  void destroyObserver(const osg::Node* data, bool bCheck);
82 
83  protected:
84  typedef std::map<std::string, std::pair<std::string, bool> > MarkerToModelDefinition;
85  static bool verifyExists(const osg::Observer* lhs, const osg::Node* data);
86  static bool getValidTreeModelDefinition(DtDe& de,
87  std::string& strCleanModelName, const std::string& strModelName,
89  typedef boost::unordered_set<std::string> ModelDefinitionSet;
90  protected:
95 
96  typedef boost::unordered_map<const osg::Node*, CellNodeObserver*>
99 
100  typedef std::set<DtUniqueID> IdSet;
101  typedef boost::unordered_map<const osg::Node*, IdSet> MapCellsToSubCells;
104  };
105 }
void removeForestFromMapData(const osg::Node *dataNode)
void onLayerUnLoaded(const osgEarth::MapNode *mapNode, const osgEarth::Layer *layer)
DtSpeedTreeForest * myForest
Definition: DtStreamedSpeedTreeForest.h:92
std::map< std::string, std::pair< std::string, bool > > MarkerToModelDefinition
Definition: DtStreamedSpeedTreeForest.h:84
static bool verifyExists(const osg::Observer *lhs, const osg::Node *data)
DtDe & myDe
Definition: DtStreamedSpeedTreeForest.h:94
DtStreamedSpeedTreeForest manages the streaming management for The DtSpeedTreeForest that is contains...
Definition: DtStreamedSpeedTreeForest.h:50
static bool getValidTreeModelDefinition(DtDe &de, std::string &strCleanModelName, const std::string &strModelName, MarkerToModelDefinition &cache)
void processNewFeatures(const DtOsgTerrainPatchObject &patch, const osg::Node *data)
ModelDefinitionSet myValidModelDefinitions
Definition: DtStreamedSpeedTreeForest.h:91
void mapDataToCell(const osg::Node *dataNode, DtUniqueID cellID)
DtSpeedTreeForest * forest()
Contains DLL export macros.
std::vector< DtTreeRecord * > DtVectorTreeRecords
Definition: DtTreeRecord.h:137
tbb::mutex myMapCellsToSubCellsMutex
Definition: DtStreamedSpeedTreeForest.h:103
DtStreamedSpeedTreeForest(DtDe &de, DtUniqueID id)
bool observerExists(const osg::Node *data)
MapCellsToSubCells myMapCellsToSubCells
Definition: DtStreamedSpeedTreeForest.h:102
boost::unordered_map< const osg::Node *, IdSet > MapCellsToSubCells
Definition: DtStreamedSpeedTreeForest.h:101
DtSpeedTreeForest is the SpeedTree implementation of a distributed DtForestObject.
Definition: DtSpeedTreeForest.h:47
Custom Feature Node.
Definition: CustomFeatureNode.h:43
A DtOsgTerrainPatchObject contains the methods for loading a file as a terrain.
Definition: DtOsgTerrainPatchObject.h:50
boost::unordered_set< std::string > ModelDefinitionSet
Definition: DtStreamedSpeedTreeForest.h:89
void onDataUnLoaded(const osgEarth::Map *map, const osgEarth::Layer *layer, const osg::Node *data)
std::set< DtUniqueID > IdSet
Definition: DtStreamedSpeedTreeForest.h:100
boost::unordered_map< const osg::Node *, CellNodeObserver * > MapCellsToObservers
Definition: DtStreamedSpeedTreeForest.h:97
unsigned long long DtUniqueID
Definition: DtUniqueID.h:22
MapCellsToObservers myMapCellsToObservers
Definition: DtStreamedSpeedTreeForest.h:98
void onLayerLoaded(const osgEarth::MapNode *mapNode, osgEarth::Layer *layer)
void createObserver(const osgEarth::Map *map, const osgEarth::Layer *layer, const osg::Node *data)
DtVectorTreeRecords myScratchVecTreeRecords
Definition: DtStreamedSpeedTreeForest.h:93
void processNewFeature(const DtOsgTerrainPatchObject &patch, const osgEarth::CustomFeatureNode *pFeatureNode, const osg::Node *data)
Contains makVrv::DtUniqueID type.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
void destroyObserver(const osg::Node *data, bool bCheck)
void onDataLoaded(const DtOsgTerrainPatchObject &patch, const osgEarth::Map *map, const osgEarth::Layer *layer, const osg::Node *data)
Contains makVrv::DtTreeRecord class.

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)