VR-Link API Documentation for DIS
NetStructs.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *********************************************************************/
00005 
00006 
00007 #ifndef _NetStructs_H_
00008 #define _NetStructs_H_
00009 
00010 #include <vlutil/vlTime.h>
00011 #include <matrix/vlMath.h>
00012 #include <matrix/vlTaitBryan.h>
00013 #include <vlutil/vlNetTypes.h>
00014 #include <vlutil/vlNetTimeStamp.h>
00015 #include "oldTStamp.h"
00016 
00019 
00020 
00021 class DT_DLL_VLPROTIND  DtEntityIdentifier;
00022 class DT_DLL_VLPROTIND  DtBurstDescriptor;
00023 class DT_DLL_VLPROTIND  DtEventId;
00024 class DT_DLL_VLPROTIND  DtEntityType;
00025 class DT_DLL_VLPROTIND  DtRadioEntityType;
00026 class DT_DLL_VLPROTIND  DtSimulationAddress;
00027 
00028 typedef DtSimulationAddress DtFederateId;
00029 
00030 class DT_DLL_VLPROTIND DtNetFederateId
00031 {
00032 public:
00033    DtNetU16 site;
00034    DtNetU16 app;
00035 
00036    DtFederateId operator=(const DtFederateId &);
00037    DtNetFederateId& operator=(const DtNetFederateId &);
00038 };
00039 
00040 
00041 class DT_DLL_VLPROTIND DtNetEntityMarking
00042 {
00043   public:
00044     DtNetU8     DtCharacterSet;
00045 #define DtMaxEntityMarkingLength                  11
00046     DtNetU8     DtText[DtMaxEntityMarkingLength];
00047 };
00048 
00049 class DT_DLL_VLPROTIND DtNetAggregateMarking
00050 {
00051 public:
00052    DtNetU8     DtCharacterSet;
00053 #define DtMaxAggregateMarkingLength               31
00054    DtNetU8     DtText[DtMaxAggregateMarkingLength];
00055 };
00056 
00057 class DT_DLL_VLPROTIND DtNetEntityType
00058 {
00059   public:
00060     DtNetU8 DtEntityKind;
00061     DtNetU8 DtDomain;
00062     DtNetU16   DtCountry;
00063     DtNetU8 DtCategory;
00064     DtNetU8 DtSubCategory;
00065     DtNetU8 DtSpecific;
00066     DtNetU8 DtExtra; 
00067     
00068     DtEntityType operator=(const DtEntityType&);
00069     DtNetEntityType& operator=(const DtNetEntityType &);
00070 };
00071 
00072 class DT_DLL_VLPROTIND DtNetRadioEntityType
00073 {
00074   public:
00075     DtNetU8    kind;
00076     DtNetU8    domain;
00077     DtNetU16   country;
00078     DtNetU8    category;
00079     DtNetU8    nomenclatureVersion;
00080     DtNetU16   nomenclature;
00081     
00082     DtRadioEntityType operator=(const DtRadioEntityType &);
00083     DtNetRadioEntityType&operator=(const DtNetRadioEntityType &);
00084 };
00085 
00086 class DT_DLL_VLPROTIND DtNetBurstDescriptor
00087 {
00088   public:
00089     DtNetEntityType  DtMunition;
00090     DtNetU16      DtWarhead;
00091     DtNetU16      DtFuze;
00092     DtNetU16      DtQuantity;
00093     DtNetU16      DtRate;
00094 
00095     DtBurstDescriptor operator=(const DtBurstDescriptor&);
00096     DtNetBurstDescriptor& operator=(const DtNetBurstDescriptor&);
00097 };
00098 
00099 class DT_DLL_VLPROTIND DtNetSimulationAddress
00100 {
00101  public:
00102     DtNetU16   DtSite;
00103     DtNetU16   DtHost;
00104 
00105     DtSimulationAddress operator=(const DtSimulationAddress&);
00106     DtNetSimulationAddress& operator=(const DtNetSimulationAddress&);
00107 };
00108 
00109 class DT_DLL_VLPROTIND DtNetEntityIdentifier
00110 {
00111   public:
00112     DtNetSimulationAddress DtSimulator;
00113     DtNetU16         DtEntity;
00114 
00115     DtEntityIdentifier operator=(const DtEntityIdentifier&);
00116     DtNetEntityIdentifier& operator=(const DtNetEntityIdentifier&);
00117 };
00118 
00119 
00120 
00123 class DT_DLL_VLPROTIND DtNet64Vector
00124 {
00125   public:
00126     DtNet64Vector()
00127     {rep[0] = rep[1] = rep[2] = 0.0;}
00128     DtNet64Vector(const DtVector &vec)
00129     {rep[0] = vec[0]; rep[1] = vec[1]; rep[2] = vec[2];}
00130     DtVector operator=(const DtVector &vec) 
00131     {rep[0] = vec[0]; rep[1] = vec[1]; rep[2] = vec[2]; return vec;}
00132     operator DtVector() const {return DtVector(rep[0], rep[1], rep[2]);}
00133     DtNetFloat64 &operator[](int i) { return rep[i];}
00134     DtNetFloat64 operator[](int i) const { return rep[i];}
00135   private:
00136     DtNetFloat64 rep[3];
00137 };
00138 
00141 class DT_DLL_VLPROTIND DtNet32Vector
00142 {
00143   public:
00144     DtNet32Vector()
00145     {rep[0] = rep[1] = rep[2] = (float)0.0;}
00146     DtNet32Vector(const DtVector &vec)
00147     {rep[0] = (float)vec[0]; rep[1] = (float)vec[1]; rep[2] = (float)vec[2];}
00148     DtVector operator=(const DtVector &vec)  
00149     {rep[0] = (float)vec[0]; rep[1] = (float)vec[1]; rep[2] = (float)vec[2]; return vec;}
00150     operator DtVector() const 
00151     {return DtVector((DtFloat32) rep[0], (DtFloat32) rep[1], (DtFloat32) rep[2]);}
00152     DtNetFloat32 &operator[](int i) { return rep[i];}
00153     DtNetFloat32 operator[](int i) const { return rep[i];}
00154   private:
00155     DtNetFloat32 rep[3];
00156 };
00157 
00158 class DT_DLL_VLPROTIND DtNetEulerAngles
00159 {
00160   public:
00161    DtNetEulerAngles() { psi = theta = phi = (float)0.0;}
00162    DtNetEulerAngles(const DtTaitBryan &tait)
00163    {psi = (DtFloat32)tait.psi(); theta = (DtFloat32)tait.theta(); phi = (DtFloat32)tait.phi();} 
00164    DtTaitBryan operator=(const DtTaitBryan &tait)
00165    {psi = (DtFloat32)tait.psi(); theta = (DtFloat32)tait.theta(); phi = (DtFloat32)tait.phi(); return tait;}   
00166    operator DtTaitBryan() const {return DtTaitBryan(psi, theta, phi);}
00167    DtNetFloat32 psi;    /* Counter clockwise about z */
00168    DtNetFloat32 theta;     /* Counter clockwise about y */
00169    DtNetFloat32 phi;    /* Counter clockwise about x */
00170 };
00171 
00172 /***************************************************************
00173  These structures don't need to be C++ classes even on little endian machines. 
00174 ****************************************************************/
00175 
00176 typedef struct DtNetArtParamRecordRPR1
00177 {
00178     DtNetU8       myChange;
00179     DtNetU8       padding;
00180     DtNetU16      myAttachedTo;
00181     DtNetU32      myArtOrAttached;
00182     DtNetU32      myClass;
00183     DtNetU32      myTypeMetric;
00184     DtNetFloat32  myValue;
00185 } DtNetArtParamRecordRPR1;
00186 
00187 typedef struct DtNetArtParamRecord
00188 {
00189     DtNetU8       artOrAttached;
00190     DtNetU8       DtChange;
00191     DtNetU16      DtAttachedTo;
00192     DtNetU32      DtType;
00193     DtNet64Bits   DtValue;
00194 } DtNetArtParamRecord;
00195 
00196 typedef DtNetArtParamRecord DtArticulatedParts;
00197 typedef DtNetArtParamRecord DtNetArtPartRecord;
00198 
00199 typedef struct DtNetAttachedPartRPR1
00200 {
00201    DtNetU8           myChange;
00202    DtNetU8           padding;
00203    DtNetU16          myAttachedTo;
00204    DtNetU32          myArtOrAttatched;
00205    DtNetU32          myStation;
00206    DtNetEntityType   myType;
00207 } DtNetAttachedPartRPR1;
00208 
00209 typedef struct DtNetAttachedPart
00210 {
00211 
00212    DtNetU8           myArtOrAttached;
00213    DtNetU8           myChange;
00214    DtNetU16          myAttachedTo;
00215    DtNetU32          myStation;
00216    DtNetEntityType   myType;
00217 } DtNetAttachedPart;
00218 
00219 typedef struct DtNetAngularVelocity
00220 {
00221     DtNetFloat32 wx;
00222     DtNetFloat32 wy; 
00223     DtNetFloat32 wz; 
00224 } DtNetAngularVelocity;
00225 
00226 typedef struct DtNetLinearVelocity
00227 {
00228     DtNetFloat32 DtX;
00229     DtNetFloat32 DtY;
00230     DtNetFloat32 DtZ;
00231 } DtNetLinearVelocity;
00232 
00233 typedef struct DtNetWorldCoordinates
00234 {
00235     DtNetFloat64 DtX;
00236     DtNetFloat64 DtY;
00237     DtNetFloat64 DtZ;
00238 } DtNetWorldCoordinates;
00239 
00240 typedef struct DtNetEntityCoordinates
00241 {
00242     DtNetFloat32 DtX;
00243     DtNetFloat32 DtY;
00244     DtNetFloat32 DtZ;
00245 } DtNetEntityCoordinates;
00246 
00247 typedef struct DtNetTopoUpCoord
00248 {
00249     DtNetFloat32 East;
00250     DtNetFloat32 North;
00251     DtNetFloat32 Up;
00252 } DtNetTopoUpCoord;
00253 
00254 typedef struct 
00255 {
00256     DtNetInt32          hour;
00257     DtNetTimeStamp      hourFrac;
00258 } DtNetClockTime;
00259 
00260 DT_DLL_VLPROTIND DtTime DtClockTime2AbsTime(const DtNetClockTime *clock);
00261 DT_DLL_VLPROTIND void DtAbsTime2ClockTime(DtTime absTime, DtNetClockTime *clock);
00262 
00263 #endif /* _NETSTRUCTS_H_ */
00264 
00265 
00266 

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)