VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrfEnvironmentalWeatherStateRecord.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2017 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
13 #include <vl/globalObjectDesignatorList.h>
14 #include <vl/environmentalRecord.h>
15 #include <vlpi/disEnums.h>
16 
17 // Definition of the FIXED PORTION of the weather state object.
18 // This will be followed by a variable length string of bytes to represent
19 // the object label, and 0 or more global object designators to represent
20 // any subordinate objects within the object represented.
21 
23 {
24  DtNetEnvironmentalRecord myHeader;
25  DtNetU32 myRecordVersion;
26  DtNetFloat64 myAirTurbidity;
27  DtNetU32 myCloudState;
30  DtNetFloat64 myVisibility;
31  DtNetFloat64 myWindDirection;
32  DtNetFloat64 myWindSpeed;
33  DtNetFloat64 myIllumination;
34  DtNetFloat64 myTimeOfDay;
36 };
37 
39 {
40  DtNetEnvironmentalRecord myHeader;
41  DtNetU32 myRecordVersion;
42  DtNetFloat64 myAirTurbidity;
43  DtNetU32 myCloudState;
46  DtNetFloat64 myVisibility;
47  DtNetFloat64 myWindDirection;
48  DtNetFloat64 myWindSpeed;
49  DtNetFloat64 myIllumination;
50  DtNetFloat64 myTimeOfDay;
53 };
54 
56 {
57  DtNetEnvironmentalRecord myHeader;
58  DtNetU32 myRecordVersion;
59  DtNetFloat64 myAirTurbidity;
60  DtNetU32 myCloudState;
63  DtNetFloat64 myVisibility;
64  DtNetFloat64 myWindDirection;
65  DtNetFloat64 myWindSpeed;
66  DtNetFloat64 myIllumination;
67  DtNetFloat64 myTimeOfDay;
70  DtNetFloat64 myUnderwaterVisibility;
71  DtNetFloat64 mySurfaceTransparency;
72  DtNetFloat64 myWaterCurrentSpeed;
75  DtNetFloat64 myTidalOffset;
76  DtNetBoolean myTidalDirection;
77  DtNetFloat64 mySeaState;
78  DtNetFloat64 mySeaStateDirection;
80  DtNetU32 mySwellState;
81  DtNetFloat64 mySwellStateDirection;
82  DtNetFloat64 myChoppiness;
83  DtNetFloat64 mySurgeDepth;
94 };
95 
97 {
98  DtNetInt64 myDateAndTimeOfDay; // Sent in conjunction with time of day, this is date/time since 00:00 hours, Jan 1, 1970 UTC
99 };
100 
101 // This is the revamped version of the weather state record. The version above is just used for
102 // backward compatability
106 {
107  DtNetEnvironmentalRecord myHeader;
108  DtNetU32 myRecordVersion;
109  DtNetFloat64 myAirTurbidity;
110  DtNetU32 myCloudState;
113  DtNetFloat64 myVisibility;
114  DtNetFloat64 myWindDirection;
115  DtNetFloat64 myWindSpeed;
116  DtNetFloat64 myIllumination;
119  DtNetFloat64 mySurfaceTransparency;
120  DtNetFloat64 myWaterCurrentSpeed;
123  DtNetFloat64 myTidalOffset;
124  DtNetBoolean myTidalDirection;
125  DtNetFloat64 mySeaState;
126  DtNetFloat64 mySeaStateDirection;
128  DtNetU32 mySwellState;
129  DtNetFloat64 mySwellStateDirection;
130  DtNetFloat64 myChoppiness;
131  DtNetFloat64 mySurgeDepth;
142  DtNetInt32 myPriority;
143 };
144 
146 {
147  DtNetVector64 myFogColor;
148  DtNetFloat64 myFogHeight;
149 };
150 
151 //
152 // Class Description: DtVrfEnvironmentalWeatherStateRecord
153 //
155  public DtEnvironmentalRecord
156 {
157 public:
158  // Default Constructor. To function properly, the state record should be
159  // initialized with an entity type. If you don't know it yet at creation
160  // time, you can use this constructor; but call setEntityType() before
161  // using the appearance accessors.
163 
167 
168  // Assignment Operator
169  const DtVrfEnvironmentalWeatherStateRecord& operator=(
171 
172  // Destructor
174 
175  // Clone. Return a copy of this instance.
176  virtual DtEnvironmentalRecord* clone() const;
177 
178  // See #myAirTurbidity
180  virtual void setAirTurbidity(double value);
181  virtual double airTurbidity() const;
183 
184  // See #myPriority
186  virtual void setPriority(int value);
187  virtual int priority() const;
189 
190  // See #myAmbientAirTemperature
192  virtual void setAmbientAirTemperature(double value);
193  virtual double ambientAirTemperature() const;
195 
196  // See #myCloudState
198  virtual void setCloudState(unsigned int value);
199  virtual unsigned int cloudState() const;
201 
202  // See #myPrecipitationIntensity
204  virtual void setPrecipitationIntensity(double value);
205  virtual double precipitationIntensity() const;
207 
208  // See #myPrecipitationType
210  virtual void setPrecipitationType(unsigned int value);
211  virtual unsigned int precipitationType() const;
213 
214  // See #myWindSpeed
216  virtual void setWindSpeed(double value);
217  virtual double windSpeed() const;
219 
220  // See #myWindDirection
222  virtual void setWindDirection(double value);
223  virtual double windDirection() const;
225 
226  // See #myVisibility
228  virtual void setVisibility(double value);
229  virtual double visibility() const;
231 
232  // See #myIllumination
234  virtual void setIllumination(double value);
235  virtual double illumination() const;
237 
238  // Underwater visibility in meters
240  virtual void setUnderwaterVisibility(double underwaterVisibility);
241  virtual double underwaterVisibility();
243 
244  // Water surface transparency, a percentage represented by the range 0..1
245  // with 1 being fully transparent.
247  virtual void setSurfaceTransparency(double transparency);
248  virtual double surfaceTransparency();
250 
251  // Water velocity in meters per second
253  virtual void setWaterCurrentSpeed(double waterCurrentSpeed);
254  virtual double waterCurrentSpeed();
256 
257  // Water direction in radians clockwise from 0 (north)
259  virtual void setWaterCurrentDirection(double waterCurrentDirection);
260  virtual double waterCurrentDirection();
262 
263  // Ambient water temperature in Celsius
265  virtual void setAmbientWaterTemperature(double waterTemperature);
266  virtual double ambientWaterTemperature();
268 
269  // Tidal offset in meters from the water polygons in the database
271  virtual void setTidalOffset(double tidalOffset);
272  virtual double tidalOffset();
274 
275  // Tidal direction where true represents the tide going in and false
276  // represents the tide going out.
278  virtual void setTidalDirection(bool tidalDirection);
279  virtual bool tidalDirection();
281 
282  // Swell state according to the Douglas Sea Scale (integer 0 - 9)
284  virtual void setSwellState(unsigned int state);
285  virtual unsigned int swellState();
287 
288  // Swell direction in in radians clockwise from 0 (north)
290  virtual void setSwellStateDirection(double direction);
291  virtual double swellStateDirection();
293 
296  virtual void setSeaState(unsigned int douglasScale);
297  virtual unsigned int seaState();
299 
302  virtual void setSeaStateDirection(double radiansFromNorth);
303  virtual double seaStateDirection();
305 
308  void setWindDrivenSeaStateEnabled(bool enabled);
309  bool windDrivenSeaStateEnabled();
311 
312  // Wave choppiness (0..1)
314  virtual void setChoppiness(double choppiness);
315  virtual double choppiness();
317 
318  // Surge depth (meters)
320  virtual void setSurgeDepth(double depth);
321  virtual double surgeDepth();
323 
324  // Fog color
326  virtual void setFogColor(double red, double green, double blue);
327  virtual void getFogColor(double& red, double& green, double& blue);
328  virtual DtVector fogColor();
330 
332  virtual void setFogHeight(double);
333  virtual double fogHeight();
334 
335  // Thermocline depth (in meters) and permeability (a percentage based on the
336  // range 0..1 with 0 being impermeable and 1 being totally permeable). A
337  // depth of zero means that layer is not used.
339  virtual void setThermoclineLayer1Depth(double depth);
340  virtual double thermoclineLayer1Depth();
341  virtual void setThermoclineLayer1Permeability(double depth);
342  virtual double thermoclineLayer1Permeability();
343  virtual void setThermoclineLayer2Depth(double depth);
344  virtual double thermoclineLayer2Depth();
345  virtual void setThermoclineLayer2Permeability(double depth);
346  virtual double thermoclineLayer2Permeability();
347  virtual void setThermoclineLayer3Depth(double depth);
348  virtual double thermoclineLayer3Depth();
349  virtual void setThermoclineLayer3Permeability(double depth);
350  virtual double thermoclineLayer3Permeability();
351  virtual void setThermoclineLayer4Depth(double depth);
352  virtual double thermoclineLayer4Depth();
353  virtual void setThermoclineLayer4Permeability(double depth);
354  virtual double thermoclineLayer4Permeability();
355  virtual void setThermoclineLayer5Depth(double depth);
356  virtual double thermoclineLayer5Depth();
357  virtual void setThermoclineLayer5Permeability(double depth);
358  virtual double thermoclineLayer5Permeability();
360 
361  // This doesn't need to be called explicitly. If any routine that needs
362  // the repository finds that it hasn't been created yet, it calls this
363  // method.
364  virtual bool createNetworkRepresentation();
365 
366  // returns the network representation of the environmental record
367  const DtNetWeatherStateRecord* objStateNetRep() const;
368  DtNetWeatherStateRecord* objStateNetRep();
369 
370  // used by the PDU class to fill in the network representation
371  virtual void setFromNet(const DtNetEnvironmentalRecord& buffer, int protocolVersion);
372 
373  virtual int netRepSize() const;
374 
377  // The number of seconds past midnight.
379  virtual double timeOfDay() const;
381 
382  // The number of seconds past 00:00 hours, Jan 1, 1970 UTC. This routine will *also* set the time
383  // of day by stripping off the day/month/year and leaving only time of day. This MUST be set in UTC
384  // else the time of day will be off based on time zones
386  virtual time_t dateAndTimeOfDay() const;
388 
389  // The rate at which time of day is advancing, based on simulation time.
390  // For example, 0 indicates that TOD is paused, 1 means it is advancing normally.
392  virtual double timeOfDayAdvancementSpeed() const;
394 
395 protected:
396 
397  virtual bool resizeNetRep(int newSize);
398 
399  // Reworks the network buffer based on version
400  virtual void reworkStateRepForVersion(int bytesToCopy, int iVersion);
401 
402  // Casts the 'this' pointer for changing elements in a const function.
404 
405 protected:
409 };

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)