VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
localWeatherManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
7 
8 #pragma once
9 
10 #include <vrfGuiCore/vrfGuiCore.h>
14 #include <vrvUtil/DtUnicode.h>
15 
20 
21 namespace makVrv
22 {
23  class DtDe;
24 }
25 
26 namespace makVrf
27 {
28  class DtWeatherLookModificationOperation;
29  class DtLocalWeatherLookOperationManager;
30 
32  {
33  public:
34  typedef std::map<DtUUID, DtSimObjectReference> WeatherObjects;
35 
37  {
38  bool isTimeFrozen = true;
39  bool isTimeSetToLocalOnFirstPlacement = true;
40  bool userModifiedTime = false;
41  };
42 
43  typedef std::map<DtUUID, GlobalScenarioCreationData> GlobalWeatherObjects;
44 
45  public:
48 
50  virtual ~DtLocalWeatherManager() override;
51 
53  static DtLocalWeatherManager& instance(makVrv::DtDe& de);
54 
56  static void registerInstance(makVrv::DtDe&, DtLocalWeatherManager*);
57 
58  virtual const WeatherObjects& weatherObjects() const
59  {
60  return myWeatherObjects;
61  }
62 
64  virtual bool hasEnvironment(const std::string&) const;
65 
68  virtual void setupCommand(DtChangeWeatherCommand& weatherCommand, const std::string& environment) const;
69 
72  virtual void setupCommand(DtChangeWeatherCommand& weatherCommand, const makArchives::DtEnvironmentRecord& environment) const;
73  virtual void setupRecord(makArchives::DtEnvironmentRecord& environment, const DtChangeWeatherCommand& weatherCommand) const;
74 
77  virtual void setupCommand(DtChangeWeatherCommand& weatherCommand, DtSimObjectReference environment) const;
78  virtual void setupRecord(makArchives::DtEnvironmentRecord& rec, DtSimObjectReference environment) const;
79 
81  virtual int nextPriority() const;
82 
84  virtual void setShowWeather(bool);
85  virtual bool showWeather() const;
86 
88  virtual void setUseGlobalTimeZone(bool);
89  virtual bool useGlobalTimeZone() const;
90 
93  virtual void increasePriorityOf(const DtUUID&);
94 
97  virtual void decreasePriorityOf(const DtUUID&);
98 
100  virtual void bringWeatherToFront(const DtUUID&);
101 
104  virtual void sendWeatherToBack(const DtUUID&);
105 
108  virtual void changePriorityOf(const DtUUID&, int);
109 
111  {
112  return myGlobalWeatherObjects;
113  }
114 
115  bool hasGlobalWeather() const
116  {
117  return (myGlobalWeatherObjects.size() != 0);
118  }
119 
122  virtual void setTimeBasedOnCreation(bool, int session = -1);
123 
124  public:
127  virtual int addWeatherLookModificationOperation(const DtWeatherLookModificationOperation&);
128 
130  virtual void removeWeatherLookModificationOperation(int);
131 
133  virtual void insertWeatherLookModificationOperation(int, const DtWeatherLookModificationOperation&);
134 
135  virtual DtLocalWeatherLookOperationManager::WeatherLookModificationOperations weatherLookModificationOperations() const;
136 
139  virtual void modifyColorForWeather(const makArchives::DtEnvironmentRecord&, float& r, float& g, float& b, float& a) const;
140 
142  virtual std::string weatherLookModelDefinitionFor(const makArchives::DtEnvironmentRecord&) const;
143 
146  virtual void setLocalWeatherLookManager(DtLocalWeatherLookOperationManager*);
147 
150  {
151  return myLocalWeatherOperationLookManager;
152  }
153 
155  virtual bool isTimeFrozen() const;
156 
158  virtual bool isTimeSetToLocalOnFirstPlacement();
159 
161  virtual bool userModifiedTime() const;
162 
163  virtual bool isLocalWeatherArea(const DtUUID& id) const;
164 
166  {
167  return myGlobalWeather;
168  }
169 
170  virtual bool isWeatherObject(const DtUUID&) const;
171 
173  virtual const DtUUID& weatherAreaNear(const DtUUID&) const;
174 
177  virtual const DtUUID& weatherAreaNear(const DtVector&) const;
178 
179  public:
181  boost::signals2::signal<void (const DtUUID&)> signal_removed;
182 
184  boost::signals2::signal<void (DtSimObjectReference)> signal_weatherUpdated;
185 
188  boost::signals2::signal<void (const DtUUID&, bool)> signal_isTimeFrozenChanged;
189  boost::signals2::signal<void (const DtUUID&, bool)> signal_isTimeSetToLocalOnFirstPlacementChanged;
190 
192  boost::signals2::signal<void ()> signal_weatherLookRulesChanged;
193 
195  boost::signals2::signal<void (const DtUUID&)> signal_globalWeatherDiscovered;
196 
198  boost::signals2::signal<void (const DtUUID&)> signal_globalWeatherRemoved;
199 
200  boost::signals2::signal<void ()> signal_globalWeatherObjectStateUpdated;
201 
202  protected:
204  virtual void addIfWeatherObject(DtSimObjectReference);
205 
206  virtual void slot_globalWeatherObjectStateUpdated(DtSimObjectReference);
207 
208  virtual void weatherObjectAdded(DtSimObjectReference);
209  virtual void weatherObjectRemoved(DtSimObjectReference);
210 
211  virtual void globalWeatherObjectAdded(DtSimObjectReference);
212  virtual void globalWeatherObjectRemoved(DtSimObjectReference);
213 
215  virtual void initExistingWeatherObjects();
216 
217  virtual void slot_onWeatherUpdated(DtSimObjectReference s);
218  virtual void slot_onWeatherStateUpdated(DtSimObjectReference s);
219 
222  virtual void offsetPriorityBy(const DtUUID& id, int by);
223  virtual void scenarioRewound();
224 
225  protected:
230 
232 
233  typedef std::map<DtUUID, makVrv::DtSignalConnectionManager*> WeatherConnections;
237  bool myIsTimeFrozen = true;
238  bool myIsTimeSetToLocalOnFirstPlacement = true;
239  double myLastTOD = 0.;
240  };
241 
242  DT_DLL_VRFGUICORE bool operator==(const std::vector<makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord>& lhs, const std::vector<makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord>& rhs);
243  DT_DLL_VRFGUICORE bool operator!=(const std::vector<makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord>& lhs, const std::vector<makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord>& rhs);
246 
249 }
boost::signals2::signal< void(DtSimObjectReference)> signal_weatherUpdated
Signal sent when the local weather area is updated.
Definition: localWeatherManager.h:184
UUID is a unique ID wrapper class.
Definition: uuid.h:59
std::map< DtUUID, DtSimObjectReference > WeatherObjects
Definition: localWeatherManager.h:34
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
WeatherConnections myWeatherConnections
Definition: localWeatherManager.h:235
Definition: localWeatherLookOperationManager.h:22
boost::signals2::signal< void()> signal_globalWeatherObjectStateUpdated
Definition: localWeatherManager.h:200
const GlobalWeatherObjects & globalWeatherObjects() const
Definition: localWeatherManager.h:110
std::map< DtUUID, makVrv::DtSignalConnectionManager * > WeatherConnections
Definition: localWeatherManager.h:233
boost::signals2::signal< void(const DtUUID &)> signal_globalWeatherDiscovered
Signal when global weather is discovered.
Definition: localWeatherManager.h:195
DT_DLL_VRFGUICORE bool operator==(const std::vector< makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord > &lhs, const std::vector< makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord > &rhs)
DtSimObjectReference myGlobalWeather
Definition: localWeatherManager.h:236
bool hasGlobalWeather() const
Definition: localWeatherManager.h:115
makVrv::DtDe & myDe
Definition: localWeatherManager.h:226
Definition: localWeatherManager.h:31
#define DT_DLL_VRFGUICORE
Contains DLL export macros.
Definition: vrfGuiCore.h:25
DtLocalWeatherLookOperationManager * myLocalWeatherOperationLookManager
Definition: localWeatherManager.h:229
Contains makVrv::DtObserverSettingsManager class.
Record for an elevational configuration A record of this type consists of 1) a base MSL altitude...
Definition: DtEnvironmentRecord.h:251
boost::signals2::signal< void()> signal_weatherLookRulesChanged
Signal sent when the weather look rules have changed.
Definition: localWeatherManager.h:192
std::vector< DtWeatherLookModificationOperation * > WeatherLookModificationOperations
Definition: localWeatherLookOperationManager.h:25
Contains makVrv::DtVirtualBaseClass class.
std::map< DtUUID, GlobalScenarioCreationData > GlobalWeatherObjects
Definition: localWeatherManager.h:43
The declaration of the makArchives::DtEnvironmentRecord class.
boost::signals2::signal< void(const DtUUID &, bool)> signal_isTimeFrozenChanged
Signals sent when information about a particular global weather has updated. If ID is 0 check to see ...
Definition: localWeatherManager.h:188
virtual const WeatherObjects & weatherObjects() const
Definition: localWeatherManager.h:58
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
GlobalWeatherObjects myGlobalWeatherObjects
Definition: localWeatherManager.h:231
Record of environment/weather settings Includes precipitation, air, and clouds.
Definition: DtEnvironmentRecord.h:45
boost::signals2::signal< void(const DtUUID &)> signal_removed
Signal sent when the local weather area is removed.
Definition: localWeatherManager.h:181
A DtSimCommand subclass which specifies a change to the weather settings for the specified weather ar...
Definition: changeWeatherCommand.h:29
DT_DLL_VRFGUICORE bool operator!=(const std::vector< makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord > &lhs, const std::vector< makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord > &rhs)
Base class to provide boost signal/slot management.
DtSimObjectReference globalWeather() const
Definition: localWeatherManager.h:165
boost::signals2::signal< void(const DtUUID &, bool)> signal_isTimeSetToLocalOnFirstPlacementChanged
Definition: localWeatherManager.h:189
DtLocalWeatherLookOperationManager * localWeatherLookManager() const
Accessor for the manager.
Definition: localWeatherManager.h:149
WeatherObjects myWeatherObjects
Definition: localWeatherManager.h:227
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
This class will be the interface for deciding what icons or colors to display for weather areas...
Definition: weatherLookModificationOperation.h:24
boost::signals2::signal< void(const DtUUID &)> signal_globalWeatherRemoved
Signal when all global weathers are removed.
Definition: localWeatherManager.h:198
WeatherConnections myGlobalWeatherObjectConnections
Definition: localWeatherManager.h:234
makVrv::DtSignalConnectionManager myConnectionManager
Definition: localWeatherManager.h:228

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)