VR-Vantage API Documentation
DtEnvironment.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2011 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtEnvironment.h,v $ $Revision: 1.16 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtEnvironment_H_
14 #define DtEnvironment_H_
15 
16 #include <vrvCore/vrvCore.h>
18 
21 #include <vrvUtil/event_signal.h>
22 
23 #include <boost/signal.hpp>
24 #include <string>
25 
26 namespace makArchives
27 {
28  class DtCloudLayerRecord;
29  class DtEnvironmentRecord;
30 }
31 
32 namespace makVrv
33 {
34  class DtDe;
35  class DtAgentManagerInterface;
36  class DtSkyObjectAgent;
37  class DtEventQueueInterface;
38  class DtSharedSettingsManager;
39 
44  {
45  public:
46 
48  {
49  Rain = 0,
50  Snow = 1
51  };
52 
54  DtEnvironment(DtDe& de, DtAgentManagerInterface& sceneInterface);
55 
57  ~DtEnvironment();
58 
60  void clear();
61 
63  void getRecord(makArchives::DtEnvironmentRecord& record);
64 
66  void setFromRecord(const makArchives::DtEnvironmentRecord& record);
67 
69  void addCloudLayer(const makArchives::DtCloudLayerRecord& record);
70 
72  void setCloudLayerEnabled(unsigned int index, bool enabled);
73 
75  void setCloudLayerPosition(unsigned int index, double xCoord, double yCoord);
76 
78  void removeCloudLayer(unsigned int index);
79 
81  void setAirTurbidity(float turbidity);
82 
84  void setVisibleDistance(float distance);
85 
87  void setPrecipitationEnabled(bool enabled);
88 
90  void setPrecipitationType(PrecipitationType type);
91 
93  void setPrecipitationIntensity(float intensity);
94 
95 
97  const makArchives::DtEnvironmentRecord& settings() const;
98 
99  //Helper Function
100  static int translateCloudTypeStringToEnum(const std::string& str);
101 
102  //Helper Function
103  static std::string translateCloudTypeEnumToString(int id);
104 
105  //Called from CTOR to load the default settings.
106  void loadDefaults(bool loadOnlyFactorySettings = false);
107 
108  // Restores to backup up environment from startup default
109  void restore();
110 
111  //Called to save the current settings as the default settings.
112  void saveAsDefaults();
113 
114  void exportSettings(const std::string& fileName);
115  void importSettings(const std::string& fileName);
116 
117  const DtSettingsBackup* settingsBackup() const
118  {
119  return mySettingsBackup;
120  }
121 
122  DtSettingsBackup* settingsBackup()
123  {
124  return mySettingsBackup;
125  }
126  protected:
127 
129  virtual void slot_coordinateSystemChanged( const std::string&, const std::string& );
130 
131  protected:
132 
135 
137 
141 
142  };
143 
147  {
148  public:
149 
151  static DtEnvironmentSignaler& instance(DtDe& de);
152 
154  virtual ~DtEnvironmentSignaler();
155 
156  //Signaled when any of the atmospheric parameters change.
157  boost::signal<void ()> signal_atmosphericParametersChanged;
158 
159  //Signaled when any of the precipitation parameters change.
160  boost::signal<void ()> signal_precipitationSettingsChanged;
161 
162  boost::signal<void (int index)> signal_cloudLayerAdded;
163  boost::signal<void (int index)> signal_cloudLayerToBeDestroyed;
164  boost::signal<void (int index, bool enabled)> signal_cloudLayerEnabledChanged;
165 
166  protected:
168 
169  };
170 
175  {
176  public:
179  static DtWeatherProcessorSignaler& instance(const DtSharedSettingsManager& ssm);
180 
183  static DtWeatherProcessorSignaler& instance(DtEventQueueInterface& eqi);
184 
188  static DtWeatherProcessorSignaler* findInstance(DtEventQueueInterface* eqi);
189 
191  virtual ~DtWeatherProcessorSignaler();
192 
194 
195  protected:
197 
198  private:
201  };
202 
204 }
205 
206 #endif
207 


Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)