VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vrfEnvironmentalWeatherStateRecord.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 //
7 // File: envWeatherStateRec.h
8 //
9 // Class: DtVrfEnvironmentalWeatherStateRecord
10 //
11 #pragma once
12 
13 #include <vl/environmentalRecord.h>
14 #include <vlpi/disEnums.h>
15 #include <vl/globalObjectDesignatorList.h>
17 
18 // Definition of the FIXED PORTION of the weather state object.
19 // This will be followed by a variable length string of bytes to represent
20 // the object label, and 0 or more global object designators to represent
21 // any subordinate objects within the object represented.
22 
24 {
25  DtNetEnvironmentalRecord myHeader;
26  DtNetU32 myRecordVersion;
27  DtNetFloat64 myAirTurbidity;
28  DtNetU32 myCloudState;
31  DtNetFloat64 myVisibility;
32  DtNetFloat64 myWindDirection;
33  DtNetFloat64 myWindSpeed;
34  DtNetFloat64 myIllumination;
35  DtNetFloat64 myTimeOfDay;
37 };
38 
40 {
41  DtNetEnvironmentalRecord myHeader;
42  DtNetU32 myRecordVersion;
43  DtNetFloat64 myAirTurbidity;
44  DtNetU32 myCloudState;
47  DtNetFloat64 myVisibility;
48  DtNetFloat64 myWindDirection;
49  DtNetFloat64 myWindSpeed;
50  DtNetFloat64 myIllumination;
51  DtNetFloat64 myTimeOfDay;
54 };
55 
57 {
58  DtNetEnvironmentalRecord myHeader;
59  DtNetU32 myRecordVersion;
60  DtNetFloat64 myAirTurbidity;
61  DtNetU32 myCloudState;
64  DtNetFloat64 myVisibility;
65  DtNetFloat64 myWindDirection;
66  DtNetFloat64 myWindSpeed;
67  DtNetFloat64 myIllumination;
68  DtNetFloat64 myTimeOfDay;
71  DtNetFloat64 myUnderwaterVisibility;
72  DtNetFloat64 mySurfaceTransparency;
73  DtNetFloat64 myWaterCurrentSpeed;
76  DtNetFloat64 myTidalOffset;
77  DtNetBoolean myTidalDirection;
78  DtNetFloat64 mySeaState;
79  DtNetFloat64 mySeaStateDirection;
81  DtNetU32 mySwellState;
82  DtNetFloat64 mySwellStateDirection;
83  DtNetFloat64 myChoppiness;
84  DtNetFloat64 mySurgeDepth;
95 };
96 
98 {
99  DtNetInt64 myDateAndTimeOfDay; // Sent in conjunction with time of day, this is date/time since 00:00 hours, Jan 1, 1970 UTC
100 };
101 
102 // This is the revamped version of the weather state record. The version above is just used for
103 // backward compatability
107 {
108  DtNetEnvironmentalRecord myHeader;
109  DtNetU32 myRecordVersion;
110  DtNetFloat64 myAirTurbidity;
111  DtNetU32 myCloudState;
114  DtNetFloat64 myVisibility;
115  DtNetFloat64 myWindDirection;
116  DtNetFloat64 myWindSpeed;
117  DtNetFloat64 myIllumination;
120  DtNetFloat64 mySurfaceTransparency;
121  DtNetFloat64 myWaterCurrentSpeed;
124  DtNetFloat64 myTidalOffset;
125  DtNetBoolean myTidalDirection;
126  DtNetFloat64 mySeaState;
127  DtNetFloat64 mySeaStateDirection;
129  DtNetU32 mySwellState;
130  DtNetFloat64 mySwellStateDirection;
131  DtNetFloat64 myChoppiness;
132  DtNetFloat64 mySurgeDepth;
143  DtNetInt32 myPriority;
144 };
145 
147 {
148  DtNetVector64 myFogColor;
149  DtNetFloat64 myFogHeight;
150 };
151 
152 //
153 // Class Description: DtVrfEnvironmentalWeatherStateRecord
154 //
156  public DtEnvironmentalRecord
157 {
158 public:
159  // Default Constructor. To function properly, the state record should be
160  // initialized with an entity type. If you don't know it yet at creation
161  // time, you can use this constructor; but call setEntityType() before
162  // using the appearance accessors.
164 
168 
169  // Assignment Operator
170  const DtVrfEnvironmentalWeatherStateRecord& operator=(
172 
173  // Destructor
175 
176  // Clone. Return a copy of this instance.
177  virtual DtEnvironmentalRecord* clone() const;
178 
179  // See #myAirTurbidity
181  virtual void setAirTurbidity(double value);
182  virtual double airTurbidity() const;
184 
185  // See #myPriority
187  virtual void setPriority(int value);
188  virtual int priority() const;
190 
191  // See #myAmbientAirTemperature
193  virtual void setAmbientAirTemperature(double value);
194  virtual double ambientAirTemperature() const;
196 
197  // See #myCloudState
199  virtual void setCloudState(unsigned int value);
200  virtual unsigned int cloudState() const;
202 
203  // See #myPrecipitationIntensity
205  virtual void setPrecipitationIntensity(double value);
206  virtual double precipitationIntensity() const;
208 
209  // See #myPrecipitationType
211  virtual void setPrecipitationType(unsigned int value);
212  virtual unsigned int precipitationType() const;
214 
215  // See #myWindSpeed
217  virtual void setWindSpeed(double value);
218  virtual double windSpeed() const;
220 
221  // See #myWindDirection
223  virtual void setWindDirection(double value);
224  virtual double windDirection() const;
226 
227  // See #myVisibility
229  virtual void setVisibility(double value);
230  virtual double visibility() const;
232 
233  // See #myIllumination
235  virtual void setIllumination(double value);
236  virtual double illumination() const;
238 
239  // Underwater visibility in meters
241  virtual void setUnderwaterVisibility(double underwaterVisibility);
242  virtual double underwaterVisibility();
244 
245  // Water surface transparency, a percentage represented by the range 0..1
246  // with 1 being fully transparent.
248  virtual void setSurfaceTransparency(double transparency);
249  virtual double surfaceTransparency();
251 
252  // Water velocity in meters per second
254  virtual void setWaterCurrentSpeed(double waterCurrentSpeed);
255  virtual double waterCurrentSpeed();
257 
258  // Water direction in radians clockwise from 0 (north)
260  virtual void setWaterCurrentDirection(double waterCurrentDirection);
261  virtual double waterCurrentDirection();
263 
264  // Ambient water temperature in Celsius
266  virtual void setAmbientWaterTemperature(double waterTemperature);
267  virtual double ambientWaterTemperature();
269 
270  // Tidal offset in meters from the water polygons in the database
272  virtual void setTidalOffset(double tidalOffset);
273  virtual double tidalOffset();
275 
276  // Tidal direction where true represents the tide going in and false
277  // represents the tide going out.
279  virtual void setTidalDirection(bool tidalDirection);
280  virtual bool tidalDirection();
282 
283  // Swell state according to the Douglas Sea Scale (integer 0 - 9)
285  virtual void setSwellState(unsigned int state);
286  virtual unsigned int swellState();
288 
289  // Swell direction in in radians clockwise from 0 (north)
291  virtual void setSwellStateDirection(double direction);
292  virtual double swellStateDirection();
294 
297  virtual void setSeaState(unsigned int douglasScale);
298  virtual unsigned int seaState();
300 
303  virtual void setSeaStateDirection(double radiansFromNorth);
304  virtual double seaStateDirection();
306 
309  void setWindDrivenSeaStateEnabled(bool enabled);
310  bool windDrivenSeaStateEnabled();
312 
313  // Wave choppiness (0..1)
315  virtual void setChoppiness(double choppiness);
316  virtual double choppiness();
318 
319  // Surge depth (meters)
321  virtual void setSurgeDepth(double depth);
322  virtual double surgeDepth();
324 
325  // Fog color
327  virtual void setFogColor(double red, double green, double blue);
328  virtual void getFogColor(double& red, double& green, double& blue);
329  virtual DtVector fogColor();
331 
333  virtual void setFogHeight(double);
334  virtual double fogHeight();
335 
336  // Thermocline depth (in meters) and permeability (a percentage based on the
337  // range 0..1 with 0 being impermeable and 1 being totally permeable). A
338  // depth of zero means that layer is not used.
340  virtual void setThermoclineLayer1Depth(double depth);
341  virtual double thermoclineLayer1Depth();
342  virtual void setThermoclineLayer1Permeability(double depth);
343  virtual double thermoclineLayer1Permeability();
344  virtual void setThermoclineLayer2Depth(double depth);
345  virtual double thermoclineLayer2Depth();
346  virtual void setThermoclineLayer2Permeability(double depth);
347  virtual double thermoclineLayer2Permeability();
348  virtual void setThermoclineLayer3Depth(double depth);
349  virtual double thermoclineLayer3Depth();
350  virtual void setThermoclineLayer3Permeability(double depth);
351  virtual double thermoclineLayer3Permeability();
352  virtual void setThermoclineLayer4Depth(double depth);
353  virtual double thermoclineLayer4Depth();
354  virtual void setThermoclineLayer4Permeability(double depth);
355  virtual double thermoclineLayer4Permeability();
356  virtual void setThermoclineLayer5Depth(double depth);
357  virtual double thermoclineLayer5Depth();
358  virtual void setThermoclineLayer5Permeability(double depth);
359  virtual double thermoclineLayer5Permeability();
361 
362  // This doesn't need to be called explicitly. If any routine that needs
363  // the repository finds that it hasn't been created yet, it calls this
364  // method.
365  virtual bool createNetworkRepresentation();
366 
367  // returns the network representation of the environmental record
368  const DtNetWeatherStateRecord* objStateNetRep() const;
369  DtNetWeatherStateRecord* objStateNetRep();
370 
371  // used by the PDU class to fill in the network representation
372  virtual void setFromNet(const DtNetEnvironmentalRecord& buffer, int protocolVersion);
373 
374  virtual int netRepSize() const;
375 
378  // The number of seconds past midnight.
380  virtual double timeOfDay() const;
382 
383  // The number of seconds past 00:00 hours, Jan 1, 1970 UTC. This routine will *also* set the time
384  // of day by stripping off the day/month/year and leaving only time of day. This MUST be set in UTC
385  // else the time of day will be off based on time zones
387  virtual time_t dateAndTimeOfDay() const;
389 
390  // The rate at which time of day is advancing, based on simulation time.
391  // For example, 0 indicates that TOD is paused, 1 means it is advancing normally.
393  virtual double timeOfDayAdvancementSpeed() const;
395 
396 protected:
397 
398  virtual bool resizeNetRep(int newSize);
399 
400  // Reworks the network buffer based on version
401  virtual void reworkStateRepForVersion(int bytesToCopy, int iVersion);
402 
403  // Casts the 'this' pointer for changing elements in a const function.
405 
406 protected:
410 };

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)