VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgEarthDynamicFidManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2024 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
14 
15 #include <vrvCore/DtTickable.h>
16 
19 
20 #include <matrix/vlVector.h>
21 #include <map>
22 #include <deque>
23 #include <boost/bind/bind.hpp>
24 
25 namespace makVrv
26 {
27  class DtProp;
28  class DtIntersector;
29  class DtTerrainPatchObject;
30  class DtOsgEarthDynamicFidManager;
31  class DtOsgEarthDynamicFidManagerCallback;
32  class DtOsgEarthDynamicFidManagerTickable;
33 
34  // Subclass of DtDynamicFidManager to operate within VRV.
36  {
37  protected:
38  // Subclass of DtDynamicFidEntry which adds storage for the debris model created as a DtProp.
40  {
41  public:
44 
45  // Set the debris model. Setting a nullptr will clear the debris.
46  void setDebris(DtProp* debris);
47  DtProp* debris();
48  protected:
50  };
51 
52  public:
53  typedef std::function< DtProp* (const std::string& modelDefinition, const DtVector& center, double orientation) > DtAddPropFcn;
54 
55  public:
57  DtOsgEarthDynamicFidManager( osgEarth::MapNode* mapNode, DtDe& de );
58 
59  // Default CTOR - Not Allowed
60  DtOsgEarthDynamicFidManager() = delete;
61 
62  // Copy CTOR - Not Allowed
64 
65  // Move CTOR - Not Allowed
67 
68  // Copy Assignment - Not Allowed
70 
71  // Move Assignment - Not Allowed
73 
75  virtual ~DtOsgEarthDynamicFidManager();
76 
77  public:
78  // Adds a change to the system potentially hiding buildings and replacing them with debris.
79  // Uses the DtOsgUtils::COMMAND_UID property of the changeCommand to index and track it for removal.
80  virtual void addChangeRequest(const makVrv::DtDynamicTerrainChange& changeCommand);
81  // Removes a previously added change to the system.
82  // Uses the DtOsgUtils::COMMAND_UID to locate the previouslly added change.
83  virtual void removeChange(const makVrv::DtDynamicTerrainChange& changeCommand);
84 
85  // Sets the function to use to add props to the system. Must be set after initializing
86  // for the debris models to be added when buildings are destroyed.
87  virtual void setAddPropFcn(DtAddPropFcn fcn);
88 
93  virtual void reapplyChangesIfRequired() override;
94  protected:
95  // Called whenever a fid entry changes to the destroyed state.
96  virtual void destroyFids(const std::vector<DtDynamicFidEntry*>& fidEntries) override;
97  // Called whenever a fid entry is restored from the destroyed state to the normal state.
98  virtual void resotreFids(const std::vector<DtDynamicFidEntry*>& fidEntries) override;
99 
100  virtual osgEarth::MapNode* mapNode() override;
101 
102  // Create and return DtOsgEarthDynamicFidEntry
103  virtual makVrv::DtDynamicFidEntry* createDynamicFidEntry(makVrv::DtFid fid) override;
104 
105  std::string getCommandId(const DtDynamicTerrainChange& changeCommand);
106 
108  void installCallbackOnTerrainPatchIfNeeded(DtTerrainPatchObject&);
109 
110  osgEarth::MapNode* myMapNode;
113  std::map<std::string, DtDynamicFidChangeId> myCommandId2ChangeIdMap;
115 
116  mutable tbb::spin_mutex myMutex;
117 
119 
122  };
123 }
DtProp * myDebrisProp
Definition: DtOsgEarthDynamicFidManager.h:49
tbb::spin_mutex myMutex
Definition: DtOsgEarthDynamicFidManager.h:116
osgEarth::MapNode * myMapNode
Definition: DtOsgEarthDynamicFidManager.h:110
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Definition: featureContext.h:36
DtIntersector is an abstract class that provides the interface for requesting intersections with the ...
Definition: DtIntersector.h:25
Definition: DtDynamicFidManager.h:120
DtSignalConnectionManager myConnections
Definition: DtOsgEarthDynamicFidManager.h:118
std::function< DtProp *(const std::string &modelDefinition, const DtVector &center, double orientation) > DtAddPropFcn
Definition: DtOsgEarthDynamicFidManager.h:53
Definition: DtOsgEarthDynamicFidManager.h:35
long long DtFid
Definition: DtDynamicFidManager.h:35
osg::ref_ptr< DtOsgEarthDynamicFidManagerCallback > myPagingCallback
Definition: DtOsgEarthDynamicFidManager.h:120
A DtTerrainPatchObject contains the methods for loading a file as a terrain. When loading a file as a...
Definition: DtTerrainPatchObject.h:35
Facade object for a scene prop.
Definition: DtProp.h:34
DtDe & myDe
Definition: DtOsgEarthDynamicFidManager.h:111
Provides an algorithm for shaking the camera.
Definition: DtOsgEarthDynamicFidManagerTickable.h:31
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtAddPropFcn myAddPropFcn
Definition: DtOsgEarthDynamicFidManager.h:112
virtual ~DtOsgEarthDynamicFidEntry()
Definition: DtOsgEarthDynamicFidManager.h:43
DtOsgEarthDynamicFidManagerTickable * myReapplyChangesTickable
Definition: DtOsgEarthDynamicFidManager.h:121
Base class to provide boost signal/slot management.
Contains the declaration for makVrv::DtTickable.
Definition: DtDynamicFidManager.h:40
Command which can be given to the dynamic terrain system to perform some change. This class is a simp...
Definition: DtDynamicTerrainChange.h:42
Definition: DtOsgEarthDynamicFidManager.h:39
Contains makVrv::DtOsgEarthFeatureDataBroker class.
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
DtIntersector * myIntersector
Definition: DtOsgEarthDynamicFidManager.h:114
std::map< std::string, DtDynamicFidChangeId > myCommandId2ChangeIdMap
Definition: DtOsgEarthDynamicFidManager.h:113
Contains the DtDynamicFidManager declaration.

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)