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<makVrv::DtElementID, DtSimObjectReference> WeatherObjects;
35 
37  {
38  bool isTimeFrozen = true;
39  bool isTimeSetToLocalOnFirstPlacement = true;
40  bool userModifiedTime = false;
41  };
42 
43  typedef std::map<makVrv::DtUniqueID, 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(makVrv::DtElementID);
94 
97  virtual void decreasePriorityOf(makVrv::DtElementID);
98 
100  virtual void bringWeatherToFront(makVrv::DtElementID);
101 
104  virtual void sendWeatherToBack(makVrv::DtElementID);
105 
108  virtual void changePriorityOf(makVrv::DtElementID, 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(makVrv::DtUniqueID id) const;
164 
166  {
167  return myGlobalWeather;
168  }
169 
170  virtual bool isWeatherObject(makVrv::DtUniqueID) const;
171 
173  virtual makVrv::DtUniqueID weatherAreaNear(makVrv::DtUniqueID) const;
174 
177  virtual makVrv::DtUniqueID weatherAreaNear(const DtVector&) const;
178 
179  public:
181  boost::signals2::signal<void (makVrv::DtElementID)> signal_removed;
182 
184  boost::signals2::signal<void (DtSimObjectReference)> signal_weatherUpdated;
185 
188  boost::signals2::signal<void (makVrv::DtUniqueID, bool)> signal_isTimeFrozenChanged;
189  boost::signals2::signal<void (makVrv::DtUniqueID, bool)> signal_isTimeSetToLocalOnFirstPlacementChanged;
190 
192  boost::signals2::signal<void ()> signal_weatherLookRulesChanged;
193 
195  boost::signals2::signal<void (makVrv::DtUniqueID)> signal_globalWeatherDiscovered;
196 
198  boost::signals2::signal<void (makVrv::DtUniqueID)> 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(makVrv::DtElementID id, int by);
223 
224  protected:
229 
231 
232  typedef std::map<makVrv::DtUniqueID, makVrv::DtSignalConnectionManager*> WeatherConnections;
236  bool myIsTimeFrozen = true;
237  bool myIsTimeSetToLocalOnFirstPlacement = true;
238  };
239 
240  DT_DLL_VRFGUICORE bool operator==(const std::vector<makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord>& lhs, const std::vector<makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord>& rhs);
241  DT_DLL_VRFGUICORE bool operator!=(const std::vector<makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord>& lhs, const std::vector<makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord>& rhs);
244 
247 }
boost::signals2::signal< void(DtSimObjectReference)> signal_weatherUpdated
Signal sent when the local weather area is updated.
Definition: localWeatherManager.h:184
boost::signals2::signal< void(makVrv::DtUniqueID)> signal_globalWeatherDiscovered
Signal when global weather is discovered.
Definition: localWeatherManager.h:195
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:234
Definition: localWeatherLookOperationManager.h:22
boost::signals2::signal< void()> signal_globalWeatherObjectStateUpdated
Definition: localWeatherManager.h:200
const GlobalWeatherObjects & globalWeatherObjects() const
Definition: localWeatherManager.h:110
boost::signals2::signal< void(makVrv::DtUniqueID, 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
DT_DLL_VRFGUICORE bool operator==(const std::vector< makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord > &lhs, const std::vector< makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord > &rhs)
std::map< makVrv::DtUniqueID, makVrv::DtSignalConnectionManager * > WeatherConnections
Definition: localWeatherManager.h:232
std::map< makVrv::DtElementID, DtSimObjectReference > WeatherObjects
Definition: localWeatherManager.h:34
DtSimObjectReference myGlobalWeather
Definition: localWeatherManager.h:235
bool hasGlobalWeather() const
Definition: localWeatherManager.h:115
makVrv::DtDe & myDe
Definition: localWeatherManager.h:225
Definition: localWeatherManager.h:31
#define DT_DLL_VRFGUICORE
Contains DLL export macros.
Definition: vrfGuiCore.h:25
DtLocalWeatherLookOperationManager * myLocalWeatherOperationLookManager
Definition: localWeatherManager.h:228
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:23
Contains makVrv::DtObserverSettingsManager class.
std::map< makVrv::DtUniqueID, GlobalScenarioCreationData > GlobalWeatherObjects
Definition: localWeatherManager.h:43
boost::signals2::signal< void(makVrv::DtUniqueID)> signal_globalWeatherRemoved
Signal when all global weathers are removed.
Definition: localWeatherManager.h:198
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.
The declaration of the makArchives::DtEnvironmentRecord class.
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:230
Record of environment/weather settings Includes precipitation, air, and clouds.
Definition: DtEnvironmentRecord.h:45
A DtSimCommand subclass which specifies a change to the weather settings for the specified weather ar...
Definition: changeWeatherCommand.h:29
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
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.
boost::signals2::signal< void(makVrv::DtElementID)> signal_removed
Signal sent when the local weather area is removed.
Definition: localWeatherManager.h:181
DtSimObjectReference globalWeather() const
Definition: localWeatherManager.h:165
boost::signals2::signal< void(makVrv::DtUniqueID, bool)> signal_isTimeSetToLocalOnFirstPlacementChanged
Definition: localWeatherManager.h:189
DtLocalWeatherLookOperationManager * localWeatherLookManager() const
Accessor for the manager.
Definition: localWeatherManager.h:149
WeatherObjects myWeatherObjects
Definition: localWeatherManager.h:226
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
WeatherConnections myGlobalWeatherObjectConnections
Definition: localWeatherManager.h:233
makVrv::DtSignalConnectionManager myConnectionManager
Definition: localWeatherManager.h:227

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)