VR-Link API Documentation for DIS
hPhysEntDec.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
5 
6 
7 #ifndef hPhysEntDec_H_
8 #define hPhysEntDec_H_
9 
10 #if DtHLA
11 
12 #include "hBaseEntDec.h"
13 #include <vlutil/vlTime.h>
14 
18 
22 struct DtNetArtParamRecord;
24 struct DtNetAttachedPart;
25 
31 
32 class DT_DLL_VL DtPhysicalEntityDecoder : public DtBaseEntityDecoder
33 {
34 public:
35 
37  DtPhysicalEntityDecoder(
38  DtExerciseConn* exConn,
39  DtObjClassDesc* classDesc);
40 
42  virtual ~DtPhysicalEntityDecoder();
43 
45  DtPhysicalEntityDecoder(const DtPhysicalEntityDecoder& orig);
46 
48  DtPhysicalEntityDecoder& operator=(const DtPhysicalEntityDecoder& orig);
49 
50 public:
51 
54  static DtHlaStateDecoder* create(
55  DtExerciseConn* exConn,
56  DtObjClassDesc* classDesc);
57 
58 protected:
59 
63  void addMyDecoders();
64 
67  virtual void decode(const DtStateMsg& msg, DtStateRepository* rep) const;
68 
69 protected:
70 
72  DtDECLARE_ENTITY_ATTR_DECODER(DamageState);
73  DtDECLARE_ENTITY_ATTR_DECODER(EngineSmokeOn);
74  DtDECLARE_ENTITY_ATTR_DECODER(FlamesPresent);
75  DtDECLARE_ENTITY_ATTR_DECODER(HasFuelSupplyCap);
76  DtDECLARE_ENTITY_ATTR_DECODER(HasRecoveryCap);
77  DtDECLARE_ENTITY_ATTR_DECODER(HasRepairCap);
78  DtDECLARE_ENTITY_ATTR_DECODER(Immobilized);
79  DtDECLARE_ENTITY_ATTR_DECODER(Marking);
80  DtDECLARE_ENTITY_ATTR_DECODER(PowerPlantOn);
81  DtDECLARE_ENTITY_ATTR_DECODER(SmokePlumePresent);
82  DtDECLARE_ENTITY_ATTR_DECODER(TentDeployed);
83 
85  DtDECLARE_ENTITY_ATTR_DECODER(ArticulatedParametersArrayPre09);
86  DtDECLARE_ENTITY_ATTR_DECODER(TrailState);
87  DtDECLARE_ENTITY_ATTR_DECODER(HatchState);
88  DtDECLARE_ENTITY_ATTR_DECODER(LifeformState);
89  DtDECLARE_ENTITY_ATTR_DECODER(LightsState);
90  DtDECLARE_ENTITY_ATTR_DECODER(RampDeployed);
91 
93  DtDECLARE_ENTITY_ATTR_DECODER(ArticulatedParametersArray);
94  DtDECLARE_ENTITY_ATTR_DECODER(TrailingEffectsCode);
95  DtDECLARE_ENTITY_ATTR_DECODER(AlternateEntityType);
96  DtDECLARE_ENTITY_ATTR_DECODER(CamouflageType);
97  DtDECLARE_ENTITY_ATTR_DECODER(FirePowerDisabled);
98  DtDECLARE_ENTITY_ATTR_DECODER(ForceIdentifier);
99  DtDECLARE_ENTITY_ATTR_DECODER(IsConcealed);
100  DtDECLARE_ENTITY_ATTR_DECODER(HasAmmunitionSupplyCap);
101 
103  DtDECLARE_ENTITY_ATTR_DECODER(AcousticSignatureIndex);
104  DtDECLARE_ENTITY_ATTR_DECODER(InfraredSignatureIndex);
105  DtDECLARE_ENTITY_ATTR_DECODER(PropulsionSystemsData);
106  DtDECLARE_ENTITY_ATTR_DECODER(RadarCrossSectionSignatureIndex);
107  DtDECLARE_ENTITY_ATTR_DECODER(VectoringNozzleSystemData);
108  DtDECLARE_ENTITY_ATTR_DECODER(LiveEntityMeasuredSpeed);
109 
111  DtDECLARE_ENTITY_ATTR_DECODER(DIGuyAction);
112  DtDECLARE_ENTITY_ATTR_DECODER(DIGuyAppearance);
113  DtDECLARE_ENTITY_ATTR_DECODER(DIGuyArc);
114  DtDECLARE_ENTITY_ATTR_DECODER(DIGuyType);
115  DtDECLARE_ENTITY_ATTR_DECODER(DIGuyParent);
116 
117 
119  static void decodeAttParts(int numParams,
120  DtNetAttachedPart* netParams, DtAttachedPartCollection* attList);
121 
123  static void convertFromRPR1_0(
124  DtNetArtParamRecord* netParams,
125  DtNetArtParamRecordRPR1* netParamsRPR1,
126  int numRecords);
127 };
128 
134 #define DtDEFINE_SIMPLE_PHYS_ENTITY_ATTR_DECODER_WITH_CAST( \
135  attrName, netType, mutator, castExpr) \
136  DtDEFINE_SIMPLE_ATTR_DECODER_WITH_CAST( \
137  DtPhysicalEntityDecoder, DtEntityStateRepository, \
138  attrName, netType, mutator, castExpr)
139 
140 #define DtDEFINE_SIMPLE_PHYS_ENTITY_ATTR_DECODER( \
141  attrName, netType, inspector) \
142  DtDEFINE_SIMPLE_PHYS_ENTITY_ATTR_DECODER_WITH_CAST( \
143  attrName, netType, inspector, (netType))
144 
145 #define DtDEFINE_LIGHT_ATTR_DECODER( \
146  decClass, attrName, arg1) \
147 void decClass::decode##attrName( \
148  DtEntityStateRepository* stateRep, \
149  const RTI::AttributeHandleValuePairSet& attrs, \
150  int pairSetIndex) \
151 { \
152  RTI::ULong length = attrs.getValueLength(pairSetIndex); \
153  if (length > sizeof(DtNetBoolean)) \
154  { \
155  DtWarn("Size of value decoded from RTI update for attribute %s (%d)\n", \
156  #attrName, length); \
157  DtWarn(" is larger than size of %s (%d)\n", "DtNetBoolean", sizeof(DtNetBoolean)); \
158  } \
159  DtNetBoolean netVal; \
160  attrs.getValue(pairSetIndex, (char *) &netVal, length); \
161  stateRep->setLightState(arg1, (bool) (DtU32) netVal); \
162 }
163 
164 #endif
165 #endif
166 

Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)