VR-Forces Development_Version 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 
146 //
147 // Class Description: DtVrfEnvironmentalWeatherStateRecord
148 //
150  public DtEnvironmentalRecord
151 {
152 public:
153  // Default Constructor. To function properly, the state record should be
154  // initialized with an entity type. If you don't know it yet at creation
155  // time, you can use this constructor; but call setEntityType() before
156  // using the appearance accessors.
158 
162 
163  // Assignment Operator
164  const DtVrfEnvironmentalWeatherStateRecord& operator=(
166 
167  // Destructor
169 
170  // Clone. Return a copy of this instance.
171  virtual DtEnvironmentalRecord* clone() const;
172 
173  // See #myAirTurbidity
175  virtual void setAirTurbidity(double value);
176  virtual double airTurbidity() const;
178 
179  // See #myPriority
181  virtual void setPriority(int value);
182  virtual int priority() const;
184 
185  // See #myAmbientAirTemperature
187  virtual void setAmbientAirTemperature(double value);
188  virtual double ambientAirTemperature() const;
190 
191  // See #myCloudState
193  virtual void setCloudState(unsigned int value);
194  virtual unsigned int cloudState() const;
196 
197  // See #myPrecipitationIntensity
199  virtual void setPrecipitationIntensity(double value);
200  virtual double precipitationIntensity() const;
202 
203  // See #myPrecipitationType
205  virtual void setPrecipitationType(unsigned int value);
206  virtual unsigned int precipitationType() const;
208 
209  // See #myWindSpeed
211  virtual void setWindSpeed(double value);
212  virtual double windSpeed() const;
214 
215  // See #myWindDirection
217  virtual void setWindDirection(double value);
218  virtual double windDirection() const;
220 
221  // See #myVisibility
223  virtual void setVisibility(double value);
224  virtual double visibility() const;
226 
227  // See #myIllumination
229  virtual void setIllumination(double value);
230  virtual double illumination() const;
232 
233  // Underwater visibility in meters
235  virtual void setUnderwaterVisibility(double underwaterVisibility);
236  virtual double underwaterVisibility();
238 
239  // Water surface transparency, a percentage represented by the range 0..1
240  // with 1 being fully transparent.
242  virtual void setSurfaceTransparency(double transparency);
243  virtual double surfaceTransparency();
245 
246  // Water velocity in meters per second
248  virtual void setWaterCurrentSpeed(double waterCurrentSpeed);
249  virtual double waterCurrentSpeed();
251 
252  // Water direction in radians clockwise from 0 (north)
254  virtual void setWaterCurrentDirection(double waterCurrentDirection);
255  virtual double waterCurrentDirection();
257 
258  // Ambient water temperature in Celsius
260  virtual void setAmbientWaterTemperature(double waterTemperature);
261  virtual double ambientWaterTemperature();
263 
264  // Tidal offset in meters from the water polygons in the database
266  virtual void setTidalOffset(double tidalOffset);
267  virtual double tidalOffset();
269 
270  // Tidal direction where true represents the tide going in and false
271  // represents the tide going out.
273  virtual void setTidalDirection(bool tidalDirection);
274  virtual bool tidalDirection();
276 
277  // Swell state according to the Douglas Sea Scale (integer 0 - 9)
279  virtual void setSwellState(unsigned int state);
280  virtual unsigned int swellState();
282 
283  // Swell direction in in radians clockwise from 0 (north)
285  virtual void setSwellStateDirection(double direction);
286  virtual double swellStateDirection();
288 
291  virtual void setSeaState(unsigned int douglasScale);
292  virtual unsigned int seaState();
294 
297  virtual void setSeaStateDirection(double radiansFromNorth);
298  virtual double seaStateDirection();
300 
303  void setWindDrivenSeaStateEnabled(bool enabled);
304  bool windDrivenSeaStateEnabled();
306 
307  // Wave choppiness (0..1)
309  virtual void setChoppiness(double choppiness);
310  virtual double choppiness();
312 
313  // Surge depth (meters)
315  virtual void setSurgeDepth(double depth);
316  virtual double surgeDepth();
318 
319  // Thermocline depth (in meters) and permeability (a percentage based on the
320  // range 0..1 with 0 being impermeable and 1 being totally permeable). A
321  // depth of zero means that layer is not used.
323  virtual void setThermoclineLayer1Depth(double depth);
324  virtual double thermoclineLayer1Depth();
325  virtual void setThermoclineLayer1Permeability(double depth);
326  virtual double thermoclineLayer1Permeability();
327  virtual void setThermoclineLayer2Depth(double depth);
328  virtual double thermoclineLayer2Depth();
329  virtual void setThermoclineLayer2Permeability(double depth);
330  virtual double thermoclineLayer2Permeability();
331  virtual void setThermoclineLayer3Depth(double depth);
332  virtual double thermoclineLayer3Depth();
333  virtual void setThermoclineLayer3Permeability(double depth);
334  virtual double thermoclineLayer3Permeability();
335  virtual void setThermoclineLayer4Depth(double depth);
336  virtual double thermoclineLayer4Depth();
337  virtual void setThermoclineLayer4Permeability(double depth);
338  virtual double thermoclineLayer4Permeability();
339  virtual void setThermoclineLayer5Depth(double depth);
340  virtual double thermoclineLayer5Depth();
341  virtual void setThermoclineLayer5Permeability(double depth);
342  virtual double thermoclineLayer5Permeability();
344 
345  // This doesn't need to be called explicitly. If any routine that needs
346  // the repository finds that it hasn't been created yet, it calls this
347  // method.
348  virtual bool createNetworkRepresentation();
349 
350  // returns the network representation of the environmental record
351  const DtNetWeatherStateRecord* objStateNetRep() const;
352  DtNetWeatherStateRecord* objStateNetRep();
353 
354  // used by the PDU class to fill in the network representation
355  virtual void setFromNet(const DtNetEnvironmentalRecord& buffer, int protocolVersion);
356 
357  virtual int netRepSize() const;
358 
361  // The number of seconds past midnight.
363  virtual double timeOfDay() const;
365 
366  // The number of seconds past 00:00 hours, Jan 1, 1970 UTC. This routine will *also* set the time
367  // of day by stripping off the day/month/year and leaving only time of day. This MUST be set in UTC
368  // else the time of day will be off based on time zones
370  virtual time_t dateAndTimeOfDay() const;
372 
373  // The rate at which time of day is advancing, based on simulation time.
374  // For example, 0 indicates that TOD is paused, 1 means it is advancing normally.
376  virtual double timeOfDayAdvancementSpeed() const;
378 
379 protected:
380 
381  virtual bool resizeNetRep(int newSize);
382 
383  // Reworks the network buffer based on version
384  virtual void reworkStateRepForVersion(int bytesToCopy, int iVersion);
385 
386  // Casts the 'this' pointer for changing elements in a const function.
388 
389 protected:
393 };

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)