VR-Forces 4.1.1 Class Documentation
DtEnvironment.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
14 
17 #include <vrvUtil/event_signal.h>
18 
19 #include <boost/signal.hpp>
20 #include <string>
21 
22 namespace makArchives
23 {
24  class DtCloudLayerRecord;
25  class DtEnvironmentRecord;
26 }
27 
28 namespace makVrv
29 {
30  class DtDe;
31  class DtAgentManagerInterface;
32  class DtSkyObjectAgent;
33  class DtEventQueueInterface;
34  class DtSharedSettingsManager;
35 
40  {
41  public:
42 
44  {
45  Rain = 0,
46  Snow = 1
47  };
48 
50  DtEnvironment(DtDe& de, DtAgentManagerInterface& sceneInterface);
51 
53  ~DtEnvironment();
54 
56  void clear();
57 
59  void getRecord(makArchives::DtEnvironmentRecord& record);
60 
62  void setFromRecord(const makArchives::DtEnvironmentRecord& record);
63 
65  void addCloudLayer(const makArchives::DtCloudLayerRecord& record);
66 
68  void setCloudLayerEnabled(unsigned int index, bool enabled);
69 
71  void setCloudLayerPosition(unsigned int index, double xCoord, double yCoord);
72 
74  void removeCloudLayer(unsigned int index);
75 
77  void setAirTurbidity(float turbidity);
78 
80  void setVisibleDistance(float distance);
81 
83  void setPrecipitationEnabled(bool enabled);
84 
86  void setPrecipitationType(PrecipitationType type);
87 
89  void setPrecipitationIntensity(float intensity);
90 
92  void setWindSpeed(float speed);
93 
95  void setWindDirection(float direction);
96 
98  void setAmbientAirTemperature(float temperature);
99 
101  void setSeaState(int state);
102 
105  void setSeaChoppiness(float chop);
106 
108  void setUnderwaterVisibility(float distance);
109 
111  void setAmbientWaterTemperature(float temperature);
112 
114  void setWaterCurrentSpeed(float speed);
115 
117  void setWaterCurrentDirection(float direction);
118 
120  void setTidalOffset(float meters);
121 
123  void setTidalDirection(bool inOut);
124 
125 
127  const makArchives::DtEnvironmentRecord& settings() const;
128 
129  //Helper Function
130  static int translateCloudTypeStringToEnum(const std::string& str);
131 
132  //Helper Function
133  static std::string translateCloudTypeEnumToString(int id);
134 
135  //Called from CTOR to load the default settings.
136  void loadDefaults(bool loadOnlyFactorySettings = false);
137 
138  // Restores to backup up environment from startup default
139  void restore();
140 
141  //Called to save the current settings as the default settings.
142  void saveAsDefaults();
143 
144  void exportSettings(const std::string& fileName);
145  void importSettings(const std::string& fileName);
146 
147  const DtSettingsBackup* settingsBackup() const
148  {
149  return mySettingsBackup;
150  }
151 
152  DtSettingsBackup* settingsBackup()
153  {
154  return mySettingsBackup;
155  }
156  protected:
157 
159  virtual void slot_coordinateSystemChanged( const std::string&, const std::string& );
160 
161  protected:
162 
165 
167 
168  DtSkyObjectAgent* mySkyObject;
171 
172  };
173 
177  {
178  public:
179 
181  static DtEnvironmentSignaler& instance(DtDe& de);
182 
184  virtual ~DtEnvironmentSignaler();
185 
186  //Signaled when any of the atmospheric parameters change.
187  boost::signal<void ()> signal_atmosphericParametersChanged;
188 
189  //Signaled when any of the precipitation parameters change.
190  boost::signal<void ()> signal_precipitationSettingsChanged;
191 
192  boost::signal<void (int index)> signal_cloudLayerAdded;
193  boost::signal<void (int index)> signal_cloudLayerToBeDestroyed;
194  boost::signal<void (int index, bool enabled)> signal_cloudLayerEnabledChanged;
195 
196  //Signaled when air parameters change.
197  boost::signal<void (float speed)> signal_windSpeedChanged;
198  boost::signal<void (float direction)> signal_windDirectionChanged;
199  boost::signal<void (float celsius)> signal_ambientAirTemperatureChanged;
200 
201  //Signaled when marine states change.
202  boost::signal<void (unsigned int seastate)> signal_seaStateChanged;
203  boost::signal<void (float chop)> signal_seaChoppinessChanged;
204  boost::signal<void (double meters)> signal_underwaterVisibilityChanged;
205  boost::signal<void (float celsius)> signal_ambientWaterTemperatureChanged;
206  boost::signal<void (float speed)> signal_waterCurrentSpeedChanged;
207  boost::signal<void (float direction)> signal_waterCurrentDirectionChanged;
208  boost::signal<void (float meters)> signal_tidalOffsetChanged;
209  boost::signal<void (bool inOut)> signal_tidalDirectionChanged;
210 
211  protected:
213  };
214 
219  {
220  public:
223  static DtWeatherProcessorSignaler& instance(const DtSharedSettingsManager& ssm);
224 
227  static DtWeatherProcessorSignaler& instance(DtEventQueueInterface& eqi);
228 
232  static DtWeatherProcessorSignaler* findInstance(DtEventQueueInterface* eqi);
233 
235  virtual ~DtWeatherProcessorSignaler();
236 
238 
239  protected:
241 
242  private:
245  };
246 
248 }

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)