![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2008 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: envWeatherStateRec.h,v $ $Revision: 1.3 $ $State: Exp $ 00007 ** Created: 6/13/08 MEM 00008 /*******************************************************************************/ 00009 00010 // 00011 // File: envWeatherStateRec.h 00012 // 00013 // Class: DtVrfEnvironmentalWeatherStateRecord 00014 // 00015 #ifndef envWeatherStateRec_H_ 00016 #define envWeatherStateRec_H_ 00017 00018 #include <vl/envRec.h> 00019 #include <vlpi/disEnums.h> 00020 #include <vl/objDesList.h> 00021 #include <vrfExtObjects/vrfExtObjectsDefines.h> 00022 00023 // Definition of the FIXED PORTION of the weather state object. 00024 // This will be followed by a variable length string of bytes to represent 00025 // the object label, and 0 or more global object designators to represent 00026 // any subordinate objects within the object represented. 00027 00028 struct DtNetWeatherStateRecord : public DtNetEnvironmentalRecord 00029 { 00030 //DtNetEnvironmentalRecord myHeader; 00031 00032 DtNetU32 myRecordVersion; 00033 DtNetFloat64 myAirTurbidity; 00034 DtNetU32 myCloudState; 00035 DtNetFloat64 myPrecipitationIntensity; 00036 DtNetU32 myPrecipitationType; 00037 DtNetFloat64 myVisibility; 00038 DtNetFloat64 myWindDirection; 00039 DtNetFloat64 myWindSpeed; 00040 DtNetFloat64 myIllumination; 00041 DtNetFloat64 myTimeOfDay; 00042 DtNetFloat64 myTimeOfDayAdvancementSpeed; 00043 }; 00044 00045 // 00046 // Class Description: DtVrfEnvironmentalWeatherStateRecord 00047 // 00048 class DT_DLL_vrfExtObjects DtVrfEnvironmentalWeatherStateRecord : public DtEnvironmentalRecord 00049 { 00050 public: 00051 // Default Constructor. To function properly, the state record should be 00052 // initialized with an entity type. If you don't know it yet at creation 00053 // time, you can use this constructor; but call setEntityType() before 00054 // using the appearance accessors. 00055 DtVrfEnvironmentalWeatherStateRecord(); 00056 00057 // Copy Constructor 00058 DtVrfEnvironmentalWeatherStateRecord(const DtVrfEnvironmentalWeatherStateRecord& orig); 00059 00060 // Assignment Operator 00061 const DtVrfEnvironmentalWeatherStateRecord& operator=( 00062 const DtVrfEnvironmentalWeatherStateRecord& orig); 00063 00064 // Destructor 00065 virtual ~DtVrfEnvironmentalWeatherStateRecord(); 00066 00067 // Clone. Return a copy of this instance. 00068 virtual DtEnvironmentalRecord* clone() const; 00069 00070 // See #myAirTurbidity 00072 virtual void setAirTurbidity(double value); 00073 virtual double airTurbidity() const; 00075 00076 // See #myCloudState 00078 virtual void setCloudState(unsigned int value); 00079 virtual unsigned int cloudState() const; 00081 00082 // See #myPrecipitationIntensity 00084 virtual void setPrecipitationIntensity(double value); 00085 virtual double precipitationIntensity() const; 00087 00088 // See #myPrecipitationType 00090 virtual void setPrecipitationType(unsigned int value); 00091 virtual unsigned int precipitationType() const; 00093 00094 // See #myWindSpeed 00096 virtual void setWindSpeed(double value); 00097 virtual double windSpeed() const; 00099 00100 // See #myWindDirection 00102 virtual void setWindDirection(double value); 00103 virtual double windDirection() const; 00105 00106 // See #myVisibility 00108 virtual void setVisibility(double value); 00109 virtual double visibility() const; 00111 00112 // See #myIllumination 00114 virtual void setIllumination(double value); 00115 virtual double illumination() const; 00117 00118 // The number of seconds past midnight. 00120 virtual void setTimeOfDay(double seconds); 00121 virtual double timeOfDay() const; 00123 00124 // The rate at which time of day is advancing, based on simulation time. 00125 // For example, 0 indicates that TOD is paused, 1 means it is advancing normally. 00127 virtual void setTimeOfDayAdvancementSpeed(double factor); 00128 virtual double timeOfDayAdvancementSpeed() const; 00130 00131 // This doesn't need to be called explicitly. If any routine that needs 00132 // the repository finds that it hasn't been created yet, it calls this 00133 // method. 00134 virtual bool createNetworkRepresentation(); 00135 00136 // returns the network representation of the environmental record 00137 const DtNetWeatherStateRecord* objStateNetRep() const; 00138 DtNetWeatherStateRecord* objStateNetRep(); 00139 00140 // used by the PDU class to fill in the network representation 00141 virtual void setFromNet(const DtNetEnvironmentalRecord& buffer); 00142 00143 virtual int netRepSize() const; 00144 00145 protected: 00146 00147 virtual bool resizeNetRep(int newSize); 00148 00149 // Casts the 'this' pointer for changing elements in a const function. 00150 DtVrfEnvironmentalWeatherStateRecord* self() const; 00151 00152 00153 protected: 00154 00155 int myNetRepSize; 00156 }; 00157 00158 #endif // DIS_VERS >= 5