VR-Forces 5.0.1 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 <map>
23 #include <set>
24 
25 namespace makVrv
26 {
27  class DtTerrainPatchObject;
28  class DtObserverObject;
29  class DtObserver;
30  class DtInputDriver;
31 
65  {
66  public:
67 
68  enum ShowIn
69  {
72  SHOW_IN_3D
73  };
74 
76  DtOsgEarthPaperMapManager() = delete;
77 
79  virtual ~DtOsgEarthPaperMapManager();
80 
83 
85  DtOsgEarthPaperMapManager& operator=(const DtOsgEarthPaperMapManager&) = delete;
86 
89  virtual void addToGroups(std::string groupStr, osgEarth::VisibleLayer* layer, bool isect);
90 
93  virtual void addToGroup(std::string groupName, osgEarth::VisibleLayer* layer, bool isect);
94 
96  virtual void activateGroup(std::string groupName);
97 
99  std::string activeGroup();
100 
103  virtual void reset();
104 
106  virtual void resetGroupMasks();
107 
109  virtual void enableAllGroupMasks();
110 
112  virtual void defaultGroupMasksVisible(ShowIn show);
113 
115  virtual bool hasGroup(const std::string& groupName);
116 
118  virtual void updateAnyObserver3D();
119 
121  virtual void addLayer(osgEarth::Layer* layer);
122 
124  virtual void removeLayer(osgEarth::Layer* layer);
125 
127  virtual void printState();
128 
130  virtual std::vector<std::string> groupNames();
131 
134  virtual void update(DtTime tNow) override;
135 
137  virtual void closeLayer(osgEarth::VisibleLayer* layer);
138 
140  virtual void openLayer(osgEarth::VisibleLayer* layer);
141 
144  virtual DtTime lastUpdateTime() const;
145 
147  virtual std::vector<std::string> getGroupsForLayer(osgEarth::VisibleLayer* layer);
148 
150  virtual bool layerInActiveGroup(osgEarth::VisibleLayer* layer);
151 
154  virtual void removeGroup(std::string groupName);
155 
156  protected:
159 
162 
164  virtual void slot_paperMapEnabledChanged(bool setting);
165 
167  virtual void slot_paperMapLayerTimeoutChanged(double timeout);
168 
170  virtual void slot_observerAdded(const std::string& observerName);
171 
173  virtual void slot_observerRemoved(const std::string& observerName);
174 
176  virtual void slot_onCurrentObserverChanged(DtInputDriver* inputDriver, DtObserver* observer);
177 
179  virtual void slot_observerGroupChanged(DtObserver* observer, std::string obsGroup);
180 
182  virtual void slot_projectionChanged(DtObserverObject* observer, bool is2D);
183 
185  virtual void slot_osgEarthMapNodeFound(DtTerrainPatchObject& tpo);
186 
188  virtual void slot_terrainPatchAboutToBeDeleted(DtTerrainPatchObject& patch);
189 
192  virtual void slot_paperMapIntersectionOverrideChanged(bool setting);
193 
194  public:
195 
197  static DtOsgEarthPaperMapManager& instance(DtDe& de);
198 
200  static const std::string& theClassName();
201 
202  protected:
203 
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 
238  {
239  public:
242 
245 
248 
251 
253  virtual DtOsgEarthPaperMapManager* create(DtDe& de);
254  };
255 }
std::set< osgEarth::VisibleLayer * > PaperMapLayerSet
Definition: DtOsgEarthPaperMapManager.h:209
Definition: DtOsgEarthPaperMapManager.h:71
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:70
A DtTerrainPatchObject contains the methods for loading a file as a terrain. When loading a file as a...
Definition: DtTerrainPatchObject.h:37
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:29
This class&#39;s main responsibility is to handle keyboard and mouse events from OSG (Qt events are route...
Definition: DtInputDriver.h:43
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
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:237
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:64
DtSignalConnectionManager myConnections
Definition: DtOsgEarthPaperMapManager.h:206
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:70
ShowIn
Definition: DtOsgEarthPaperMapManager.h:68
GroupLayerMap myGroupMap
Definition: DtOsgEarthPaperMapManager.h:214
DtDe & myDe
Definition: DtOsgEarthPaperMapManager.h:204
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 Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)