VR-Forces 4.7 Class Documentation
 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>
15 #include <vrvUtil/DtUnicode.h>
16 #include <vrvCore/DtStateView.h>
17 #include <vrvUtil/signalslib.h>
22 
23 namespace makVrv
24 {
25  class DtDe;
26  class DtSimObjectEntry;
27  struct DtVrlinkSimulatedBaseState;
28 }
29 
30 namespace makVrf
31 {
32  struct DtVrlinkSimulatedEnvironmentProcess;
33  class DtWeatherLookModificationOperation;
34  class DtLocalWeatherLookOperationManager;
35 
37  {
38  public:
39  typedef std::map<makVrv::DtElementID, makVrv::DtStateView<DtVrlinkSimulatedEnvironmentProcess>*> WeatherObjects;
40 
42  {
45  };
46 
47  typedef std::map<makVrv::DtUniqueID, GlobalScenarioCreationData> GlobalWeatherObjects;
48 
49  public:
52 
54  virtual ~DtLocalWeatherManager();
55 
57  static DtLocalWeatherManager& instance(makVrv::DtDe& de);
58 
60  static void registerInstance(makVrv::DtDe&, DtLocalWeatherManager*);
61 
62  virtual const WeatherObjects& weatherObjects() const
63  {
64  return myWeatherObjects;
65  }
66 
68  virtual bool hasEnvironment(const std::string&) const;
69 
72  virtual void setupCommand(DtChangeWeatherCommand& weatherCommand, const std::string& environment) const;
73 
76  virtual void setupCommand(DtChangeWeatherCommand& weatherCommand, const makArchives::DtEnvironmentRecord& environment) const;
77  virtual void setupRecord(makArchives::DtEnvironmentRecord& environment, const DtChangeWeatherCommand& weatherCommand) const;
78 
81  virtual void setupCommand(DtChangeWeatherCommand& weatherCommand, const makVrv::DtStateView<DtVrlinkSimulatedWeatherState>* environment) const;
82  virtual void setupRecord(makArchives::DtEnvironmentRecord& rec,
84 
86  virtual int nextPriority() const;
87 
89  virtual void setShowWeather(bool);
90  virtual bool showWeather() const;
91 
94  virtual void setWeatherAreaFilled(bool);
95  virtual bool weatherAreaFilled() const;
96 
98  virtual void setUseDayNightIlluminationModel(bool);
99  virtual bool useDayNightIlluminationModel() const;
100 
103  virtual void increasePriorityOf(makVrv::DtElementID);
104 
107  virtual void decreasePriorityOf(makVrv::DtElementID);
108 
110  virtual void bringWeatherToFront(makVrv::DtElementID);
111 
114  virtual void sendWeatherToBack(makVrv::DtElementID);
115 
118  virtual void changePriorityOf(makVrv::DtElementID, int);
119 
120  const GlobalWeatherObjects& globalWeatherObjects() const
121  {
122  return myGlobalWeatherObjects;
123  }
124 
125  bool hasGlobalWeather() const
126  {
127  return (myGlobalWeatherObjects.size() != 0);
128  }
129 
132  virtual void setTimeBasedOnCreation(bool, int session = -1);
133 
134  public:
137  virtual int addWeatherLookModificationOperation(const DtWeatherLookModificationOperation&);
138 
140  virtual void removeWeatherLookModificationOperation(int);
141 
143  virtual void insertWeatherLookModificationOperation(int, const DtWeatherLookModificationOperation&);
144 
145  virtual DtLocalWeatherLookOperationManager::WeatherLookModificationOperations weatherLookModificationOperations() const;
146 
149  virtual void modifyColorForWeather(const makArchives::DtEnvironmentRecord&, float& r, float& g, float& b, float& a) const;
150 
152  virtual std::string weatherLookModelDefinitionFor(const makArchives::DtEnvironmentRecord&) const;
153 
156  virtual void setLocalWeatherLookManager(DtLocalWeatherLookOperationManager*);
157 
159  DtLocalWeatherLookOperationManager* localWeatherLookManager() const
160  {
161  return myLocalWeatherOperationLookManager;
162  }
163 
165  virtual bool isTimeFrozen() const;
166 
168  virtual bool isTimeSetToLocalOnFirstPlacement();
169 
170  virtual bool isLocalWeatherArea(makVrv::DtUniqueID id) const;
171 
172  public:
174  boost::signal<void (makVrv::DtElementID)> signal_removed;
175 
177  boost::signal<void (const makVrv::DtStateView<DtVrlinkSimulatedEnvironmentProcess>*)> signal_updated;
178  boost::signal<void (const makVrv::DtStateView<DtVrlinkSimulatedWeatherState>*)> signal_weatherUpdated;
179 
182  boost::signal<void (makVrv::DtUniqueID, bool)> signal_isTimeFrozenChanged;
183  boost::signal<void (makVrv::DtUniqueID, bool)> signal_isTimeSetToLocalOnFirstPlacementChanged;
184 
186  boost::signal<void ()> signal_weatherLookRulesChanged;
187 
188  protected:
190  virtual void addIfWeatherObject(const makVrv::DtStateView<makVrv::DtVrlinkSimulatedBaseState>*);
191 
192  virtual void slot_globalWeatherObjectStateUpdated(const makVrv::DtStateView<makVrv::DtVrlinkSimulatedBaseState>*);
193 
194  virtual void weatherObjectAdded(const makVrv::DtStateView<makVrv::DtVrlinkSimulatedBaseState>*);
195  virtual void weatherObjectRemoved(const makVrv::DtStateView<makVrv::DtVrlinkSimulatedBaseState>*);
196 
197  virtual void globalWeatherObjectAdded(const makVrv::DtStateView<makVrv::DtVrlinkSimulatedBaseState>*);
198  virtual void globalWeatherObjectRemoved(const makVrv::DtStateView<makVrv::DtVrlinkSimulatedBaseState>*);
199 
201  virtual void initExistingWeatherObjects();
202 
203  virtual void slot_onWeatherUpdated(const makVrv::DtStateView<makVrv::DtVrlinkSimulatedBaseState>* s);
204  virtual void slot_onWeatherStateUpdated(const makVrv::DtStateView<DtVrlinkSimulatedWeatherState>* s);
205 
208  virtual void offsetPriorityBy(makVrv::DtElementID id, int by);
209 
210  protected:
215 
217 
218  typedef std::map<makVrv::DtUniqueID, makVrv::DtSignalConnectionManager*> WeatherConnections;
221  };
222 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)