VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgEarthPaperMapManager.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 
13 #include <osgEarth/MapCallback>
14 
16 #include <vrvCore/DtTickable.h>
17 
19 
20 #include <osgEarth/VisibleLayer>
21 
22 #include <vrvUtil/signalslib.h>
23 
24 #include <map>
25 #include <set>
26 
27 namespace makVrv
28 {
29  class DtTerrainPatchObject;
30  class DtObserverObject;
31  class DtObserver;
32  class DtInputDriver;
33 
67  {
68  public:
69 
70  enum ShowIn
71  {
74  SHOW_IN_3D
75  };
76 
78  DtOsgEarthPaperMapManager() = delete;
79 
81  virtual ~DtOsgEarthPaperMapManager();
82 
85 
87  DtOsgEarthPaperMapManager& operator=(const DtOsgEarthPaperMapManager&) = delete;
88 
91  virtual void addToGroups(std::string groupStr, osgEarth::VisibleLayer* layer, bool isect);
92 
95  virtual void addToGroup(std::string groupName, osgEarth::VisibleLayer* layer, bool isect);
96 
98  virtual void activateGroup(std::string groupName);
99 
101  std::string activeGroup();
102 
105  virtual void reset();
106 
108  virtual void resetGroupMasks();
109 
111  virtual void enableAllGroupMasks();
112 
114  virtual void defaultGroupMasksVisible(ShowIn show);
115 
117  virtual bool hasGroup(const std::string& groupName);
118 
120  virtual void updateAnyObserver3D();
121 
123  virtual void addLayer(osgEarth::Layer* layer);
124 
126  virtual void removeLayer(osgEarth::Layer* layer);
127 
129  virtual void printState();
130 
132  virtual std::vector<std::string> groupNames();
133 
136  virtual void update(DtTime tNow) override;
137 
139  virtual void closeLayer(osgEarth::VisibleLayer* layer);
140 
142  virtual void openLayer(osgEarth::VisibleLayer* layer);
143 
146  virtual DtTime lastUpdateTime() const;
147 
149  virtual std::vector<std::string> getGroupsForLayer(osgEarth::VisibleLayer* layer);
150 
152  virtual bool layerInActiveGroup(osgEarth::VisibleLayer* layer);
153 
156  virtual void removeGroup(std::string groupName);
157 
158  protected:
161 
164 
166  virtual void slot_paperMapEnabledChanged(bool setting);
167 
169  virtual void slot_paperMapLayerTimeoutChanged(double timeout);
170 
172  virtual void slot_observerAdded(const std::string& observerName);
173 
175  virtual void slot_observerRemoved(const std::string& observerName);
176 
178  virtual void slot_onCurrentObserverChanged(DtInputDriver* inputDriver, DtObserver* observer);
179 
181  virtual void slot_observerGroupChanged(DtObserver* observer, std::string obsGroup);
182 
184  virtual void slot_projectionChanged(DtObserverObject* observer, bool is2D);
185 
187  virtual void slot_osgEarthMapNodeFound(DtTerrainPatchObject& tpo);
188 
190  virtual void slot_terrainPatchAboutToBeDeleted(DtTerrainPatchObject& patch);
191 
194  virtual void slot_paperMapIntersectionOverrideChanged(bool setting);
195 
196  public:
197 
199  static DtOsgEarthPaperMapManager& instance(DtDe& de);
200 
202  static const std::string& theClassName();
203 
204  protected:
205 
207 
208  typedef std::map<DtObserverObject*, bool> ObserverObj2DMap;
209  typedef std::set<osgEarth::VisibleLayer*> PaperMapLayerSet;
210  typedef std::map<std::string, PaperMapLayerSet > GroupLayerMap;
211  typedef std::map<osgEarth::VisibleLayer*, bool > LayerBoolMap;
212  typedef std::map<osgEarth::VisibleLayer*, DtTime> LayerTimeMap;
213 
217  std::string myActiveGroupName;
218 
219  // We need to keep track to see if any observers are in 2D (otherwise they are 3D)
220  // Well actually DtObserverObjects because DtObservers are not on the slave
223 
224  // Keep track of when layers are closed or reopened
227 
230 
232 
233  vrvSignalsLib::connection myLodScaleChangedConnection;
234  vrvSignalsLib::connection myPaperMapLayerChangedConnection;
235  };
236 
241  {
242  public:
245 
248 
251 
254 
256  virtual DtOsgEarthPaperMapManager* create(DtDe& de);
257  };
258 }
std::set< osgEarth::VisibleLayer * > PaperMapLayerSet
Definition: DtOsgEarthPaperMapManager.h:209
Definition: DtOsgEarthPaperMapManager.h:73
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
DtObserver * myCurrentObserver
Definition: DtOsgEarthPaperMapManager.h:231
bool myAnyObserverIn3D
Definition: DtOsgEarthPaperMapManager.h:222
LayerBoolMap myLayerIsInDefault
Definition: DtOsgEarthPaperMapManager.h:215
#define DT_DLL_VRVOSGEARTH
Definition: vrvOsgEarth.h:21
std::map< osgEarth::VisibleLayer *, DtTime > LayerTimeMap
Definition: DtOsgEarthPaperMapManager.h:212
bool myIntersectionOverride
Definition: DtOsgEarthPaperMapManager.h:229
An abstract base class for objects that require updates. This object automatically adds itself to a D...
Definition: DtTickable.h:26
Definition: DtOsgEarthPaperMapManager.h:72
A DtTerrainPatchObject contains the methods for loading a file as a terrain. When loading a file as a...
Definition: DtTerrainPatchObject.h:35
vrvSignalsLib::connection myPaperMapLayerChangedConnection
Definition: DtOsgEarthPaperMapManager.h:234
A facade for a DtObserverObject.
Definition: DtObserver.h:37
This abstract base class defines the interface for OS-specific keyboard and mouse event listeners...
Definition: DtObserverObject.h:32
vrvSignalsLib::connection myLodScaleChangedConnection
Definition: DtOsgEarthPaperMapManager.h:233
This class&#39;s main responsibility is to handle keyboard and mouse events from OSG (Qt events are route...
Definition: DtInputDriver.h:43
std::map< DtObserverObject *, bool > ObserverObj2DMap
Definition: DtOsgEarthPaperMapManager.h:208
double myLayerTimeOut
Definition: DtOsgEarthPaperMapManager.h:226
bool myPaperMapFeatureEnabled
Definition: DtOsgEarthPaperMapManager.h:228
LayerBoolMap myGroupIsect
Definition: DtOsgEarthPaperMapManager.h:216
DtOsgEarthPaperMapManagerCreator is used to create a DtOsgEarthPaperMapManager.
Definition: DtOsgEarthPaperMapManager.h:240
Base class to provide boost signal/slot management.
Contains the declaration for makVrv::DtTickable.
Manager that adds, clears, activates/deactives groups (if any) read in by the DtPaperMapCallback The ...
Definition: DtOsgEarthPaperMapManager.h:66
Contains the DtPaperMapManagerSignaler class declaration.
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:72
ShowIn
Definition: DtOsgEarthPaperMapManager.h:70
GroupLayerMap myGroupMap
Definition: DtOsgEarthPaperMapManager.h:214
DtDe & myDe
Definition: DtOsgEarthPaperMapManager.h:206
std::string myActiveGroupName
Definition: DtOsgEarthPaperMapManager.h:217
LayerTimeMap myLayerTime
Definition: DtOsgEarthPaperMapManager.h:225
std::map< osgEarth::VisibleLayer *, bool > LayerBoolMap
Definition: DtOsgEarthPaperMapManager.h:211
Contains DLL export macros.
std::map< std::string, PaperMapLayerSet > GroupLayerMap
Definition: DtOsgEarthPaperMapManager.h:210
ObserverObj2DMap myObserverObj2DMap
Definition: DtOsgEarthPaperMapManager.h:221

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)