![]() |
VR-Link API Documentation for HLA Evolved
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 00006 00007 #ifndef hPhysEntDec_H_ 00008 #define hPhysEntDec_H_ 00009 00010 #if DtHLA 00011 00012 #include "hBaseEntDec.h" 00013 #include <vlutil/vlTime.h> 00014 00018 00019 class DtEntityStateRepository; 00020 class DtArticulatedPartCollection; 00021 class DtAttachedPartCollection; 00022 struct DtNetArtParamRecord; 00023 struct DtNetArtParamRecordRPR1; 00024 struct DtNetAttachedPart; 00025 00031 00032 class DT_DLL_VL DtPhysicalEntityDecoder : public DtBaseEntityDecoder 00033 { 00034 public: 00035 00037 DtPhysicalEntityDecoder( 00038 DtExerciseConn* exConn, 00039 DtObjClassDesc* classDesc); 00040 00042 virtual ~DtPhysicalEntityDecoder(); 00043 00045 DtPhysicalEntityDecoder(const DtPhysicalEntityDecoder& orig); 00046 00048 DtPhysicalEntityDecoder& operator=(const DtPhysicalEntityDecoder& orig); 00049 00050 public: 00051 00054 static DtHlaStateDecoder* create( 00055 DtExerciseConn* exConn, 00056 DtObjClassDesc* classDesc); 00057 00058 protected: 00059 00063 void addMyDecoders(); 00064 00067 virtual void decode(const DtStateMsg& msg, DtStateRepository* rep) const; 00068 00069 protected: 00070 00072 DtDECLARE_ENTITY_ATTR_DECODER(DamageState); 00073 DtDECLARE_ENTITY_ATTR_DECODER(EngineSmokeOn); 00074 DtDECLARE_ENTITY_ATTR_DECODER(FlamesPresent); 00075 DtDECLARE_ENTITY_ATTR_DECODER(HasFuelSupplyCap); 00076 DtDECLARE_ENTITY_ATTR_DECODER(HasRecoveryCap); 00077 DtDECLARE_ENTITY_ATTR_DECODER(HasRepairCap); 00078 DtDECLARE_ENTITY_ATTR_DECODER(Immobilized); 00079 DtDECLARE_ENTITY_ATTR_DECODER(Marking); 00080 DtDECLARE_ENTITY_ATTR_DECODER(PowerPlantOn); 00081 DtDECLARE_ENTITY_ATTR_DECODER(SmokePlumePresent); 00082 DtDECLARE_ENTITY_ATTR_DECODER(TentDeployed); 00083 00085 DtDECLARE_ENTITY_ATTR_DECODER(ArticulatedParametersArrayPre09); 00086 DtDECLARE_ENTITY_ATTR_DECODER(TrailState); 00087 DtDECLARE_ENTITY_ATTR_DECODER(HatchState); 00088 DtDECLARE_ENTITY_ATTR_DECODER(LifeformState); 00089 DtDECLARE_ENTITY_ATTR_DECODER(LightsState); 00090 DtDECLARE_ENTITY_ATTR_DECODER(RampDeployed); 00091 00093 DtDECLARE_ENTITY_ATTR_DECODER(ArticulatedParametersArray); 00094 DtDECLARE_ENTITY_ATTR_DECODER(TrailingEffectsCode); 00095 DtDECLARE_ENTITY_ATTR_DECODER(AlternateEntityType); 00096 DtDECLARE_ENTITY_ATTR_DECODER(CamouflageType); 00097 DtDECLARE_ENTITY_ATTR_DECODER(FirePowerDisabled); 00098 DtDECLARE_ENTITY_ATTR_DECODER(ForceIdentifier); 00099 DtDECLARE_ENTITY_ATTR_DECODER(IsConcealed); 00100 DtDECLARE_ENTITY_ATTR_DECODER(HasAmmunitionSupplyCap); 00101 00103 DtDECLARE_ENTITY_ATTR_DECODER(AcousticSignatureIndex); 00104 DtDECLARE_ENTITY_ATTR_DECODER(InfraredSignatureIndex); 00105 DtDECLARE_ENTITY_ATTR_DECODER(PropulsionSystemsData); 00106 DtDECLARE_ENTITY_ATTR_DECODER(RadarCrossSectionSignatureIndex); 00107 DtDECLARE_ENTITY_ATTR_DECODER(VectoringNozzleSystemData); 00108 DtDECLARE_ENTITY_ATTR_DECODER(LiveEntityMeasuredSpeed); 00109 00111 DtDECLARE_ENTITY_ATTR_DECODER(DIGuyAction); 00112 DtDECLARE_ENTITY_ATTR_DECODER(DIGuyAppearance); 00113 DtDECLARE_ENTITY_ATTR_DECODER(DIGuyArc); 00114 DtDECLARE_ENTITY_ATTR_DECODER(DIGuyType); 00115 DtDECLARE_ENTITY_ATTR_DECODER(DIGuyParent); 00116 00117 00119 static void decodeAttParts(int numParams, 00120 DtNetAttachedPart* netParams, DtAttachedPartCollection* attList); 00121 00123 static void convertFromRPR1_0( 00124 DtNetArtParamRecord* netParams, 00125 DtNetArtParamRecordRPR1* netParamsRPR1, 00126 int numRecords); 00127 }; 00128 00134 #define DtDEFINE_SIMPLE_PHYS_ENTITY_ATTR_DECODER_WITH_CAST( \ 00135 attrName, netType, mutator, castExpr) \ 00136 DtDEFINE_SIMPLE_ATTR_DECODER_WITH_CAST( \ 00137 DtPhysicalEntityDecoder, DtEntityStateRepository, \ 00138 attrName, netType, mutator, castExpr) 00139 00140 #define DtDEFINE_SIMPLE_PHYS_ENTITY_ATTR_DECODER( \ 00141 attrName, netType, inspector) \ 00142 DtDEFINE_SIMPLE_PHYS_ENTITY_ATTR_DECODER_WITH_CAST( \ 00143 attrName, netType, inspector, (netType)) 00144 00145 #define DtDEFINE_LIGHT_ATTR_DECODER( \ 00146 decClass, attrName, arg1) \ 00147 void decClass::decode##attrName( \ 00148 DtEntityStateRepository* stateRep, \ 00149 const RTI::AttributeHandleValuePairSet& attrs, \ 00150 int pairSetIndex) \ 00151 { \ 00152 RTI::ULong length = attrs.getValueLength(pairSetIndex); \ 00153 if (length > sizeof(DtNetBoolean)) \ 00154 { \ 00155 DtWarn("Size of value decoded from RTI update for attribute %s (%d)\n", \ 00156 #attrName, length); \ 00157 DtWarn(" is larger than size of %s (%d)\n", "DtNetBoolean", sizeof(DtNetBoolean)); \ 00158 } \ 00159 DtNetBoolean netVal; \ 00160 attrs.getValue(pairSetIndex, (char *) &netVal, length); \ 00161 stateRep->setLightState(arg1, (bool) (DtU32) netVal); \ 00162 } 00163 00164 #endif 00165 #endif 00166