VR-Link API Documentation for HLA 1516
esPdu.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
5 
9 
10 #ifndef esPdu_h_
11 #define esPdu_h_
12 
13 #if DtDIS
14 
15 
16 
17 #include "hostStructs.h"
18 #include "pdu.h"
19 #include "packets/entityStateP.h"
20 #include "stateMsg.h"
21 
24 #include <vlpi/disEnums.h>
25 
26 #include <matrix/vlMath.h>
27 #include <matrix/vlDcm.h>
28 #include <matrix/vlTaitBryan.h>
29 
30 #define DtMaxNumArtParts 83
31 #define DtMaxNumAttachedParts 83
32 #define DtINCREMENT -1
33 
34 #define DtNO_SUCH_ART_PART 0
35 #define DtART_PART_SUCCESS 1
36 
37 class DtExerciseConn;
38 class DtEntityStatePdu;
39 
40 typedef void (*DtEntityStatePduCb)(DtEntityStatePdu* pdu, void* usr);
41 
45 class DT_DLL_VL DtEntityStatePdu : public DtStateMsg
46 {
47 public:
48 
49  enum { PduStaticSize=144 };
50 
51  DtEntityStatePdu(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
52 
54  DtEntityStatePdu(const DtNetEntityStatePdu* initial,
56 
58  DtEntityStatePdu(const DtEntityIdentifier& id, const DtEntityType& type,
59  const DtEntityType& guise, DtDeadReckonTypes algorithm,
61 
63  virtual ~DtEntityStatePdu() {};
64 
65  /****************** INSPECTOR FUNCTIONS *******************/
66  const DtEntityIdentifier& id() const;
67  void setId(const DtEntityIdentifier& id);
68 
69  DtForceType forceId() const;
70  void setForceId(DtForceType force);
71 
72  int numArtParams() const;
73  int numAttachedParams() const;
74  int numArtPlusAttachedParams() const;
75 
76  const DtEntityType& entityType() const;
77  void setEntityType(const DtEntityType& type);
78 
79  const DtEntityType& guise() const;
80  void setGuise(const DtEntityType& type);
81 
82  const DtVector& velocity() const;
83  void setVelocity(const DtVector& Velocity);
84 
85  const DtVector& location() const;
86  void setLocation(const DtVector& Location);
87 
88  const DtTaitBryan& orientation() const;
89  void setOrientation(const DtTaitBryan& Orient);
90 
92  DtU32 appearance() const;
93 
95  void setAppearance(DtU32 app);
96 
98  DtAppearAttrVal appearanceAttribute(const DtAppearAttribute& attr) const;
99 
101  void setAppearanceAttribute(const DtAppearAttribute attr,
102  const DtAppearAttrVal val);
103 
104  DtDeadReckonTypes algorithm() const;
105  void setAlgorithm(DtDeadReckonTypes alg);
106 
107  const DtVector& acceleration() const;
108  void setAcceleration(const DtVector& Acceleration);
109 
110  const DtVector& rotationalVelocity() const;
111  void setRotationalVelocity(const DtVector& BodyRates);
112 
113  int markingCharSet() const;
114  void setMarkingText(const char* text);
115 
116  const char* markingText() const;
117  void setMarkingCharSet(int charSet);
118 
119  DtU32 capabilities() const;
120  void setCapabilities(DtU32 cap);
121 
123 
124 
125 
126  const DtArticulatedPartCollection& artPartList() const;
127  void setArtPartList(const DtArticulatedPartCollection& apList);
129 
131 
132 
133 
134  const DtAttachedPartCollection& attPartList() const;
135  void setAttPartList(const DtAttachedPartCollection& apList);
137 
138  void setNumArtPlusAttachedParams(int num);
139 
141 
142 
143 
144 
145  const DtNetArtPartRecord* artPartRecord(int index) const;
146  DtNetArtPartRecord* artPartRecord(int index);
148 
150 
151 
152 
153 
154  DtNetAttachedPart* attPartRecord(int index);
155  const DtNetAttachedPart* attPartRecord(int index) const;
157 
158 
159  void printData() const;
160  void printDataToStream(std::ostream& stream) const;
161 
163  static DtPdu* create(const DtNetPacket* initial,
165 
167  static void addCallback(DtExerciseConn* conn, DtEntityStatePduCb cb,
168  void* usr);
169 
171  static void removeCallback(DtExerciseConn* conn, DtEntityStatePduCb cb,
172  void* usr);
173 
174 protected:
175 
176  DtPduKind internalGetPduKind() const
177  {
178  return DtEntityStatePduKind;
179  }
180 
181  DtNetArtPartRecord* artPartRecord(int partType, int param) const;
182  DtNetArtPartRecord* attachedPartRecord(int station) const;
183 
185  DtEntityType type, theGuise;
186  DtVector vel, loc, acc;
187  DtTaitBryan ori;
188  DtBodyRates rvel;
189  char markingBuff[DtMaxEntityMarkingLength+1];
190 
192  mutable DtArticulatedPartCollection myArtPartList;
193  mutable DtAttachedPartCollection myAttPartList;
194  int myStationList[DtMaxNumAttachedParts];
195 
196 };
197 
198 DT_DLL_VL std::ostream& operator<<(std::ostream& str,
199  const DtEntityStatePdu& pdu);
200 
201 #endif
202 #endif

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)