VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
entityStatePdu.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2013 MAK Technologies, Inc
3 ** All rights reserved.
4 *********************************************************************/
5 
9 
10 #pragma once
11 
12 #if DtDIS
13 
14 
15 
16 #include "hostStructs.h"
17 #include "pdu.h"
18 #include "packets/entityStateP.h"
19 #include "stateMsg.h"
20 
23 #include <vlpi/disEnums.h>
24 
25 #include <matrix/vlMath.h>
26 #include <matrix/vlDcm.h>
27 #include <matrix/vlTaitBryan.h>
28 
29 #define DtMaxNumArtParts 83
30 #define DtMaxNumAttachedParts 83
31 #define DtINCREMENT -1
32 
33 #define DtNO_SUCH_ART_PART 0
34 #define DtART_PART_SUCCESS 1
35 
36 class DtExerciseConn;
37 class DtEntityStatePdu;
38 
39 typedef void (*DtEntityStatePduCb)(DtEntityStatePdu* pdu, void* usr);
40 
44 class DT_DLL_VL DtEntityStatePdu : public DtStateMsg
45 {
46 public:
47 
48  enum { PduStaticSize=144 };
49 
50  DtEntityStatePdu(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
51 
53  DtEntityStatePdu(const DtNetEntityStatePdu* initial,
54  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0);
55 
57  DtEntityStatePdu(const DtEntityIdentifier& id, const DtEntityType& type,
58  const DtEntityType& guise, DtDeadReckonTypes algorithm,
60 
62  virtual ~DtEntityStatePdu() {};
63 
64  /****************** INSPECTOR FUNCTIONS *******************/
65  const DtEntityIdentifier& id() const;
66  void setId(const DtEntityIdentifier& id);
67 
68  DtForceType forceId() const;
69  void setForceId(DtForceType force);
70 
71  int numArtParams() const;
72  int numAttachedParams() const;
73  int numArtPlusAttachedParams() const;
74 
75  const DtEntityType& entityType() const;
76  void setEntityType(const DtEntityType& type);
77 
78  const DtEntityType& guise() const;
79  void setGuise(const DtEntityType& type);
80 
81  const DtVector32& velocity() const;
82  void setVelocity(const DtVector32& Velocity);
83 
84  const DtVector& location() const;
85  void setLocation(const DtVector& Location);
86 
87  const DtTaitBryan& orientation() const;
88  void setOrientation(const DtTaitBryan& Orient);
89 
91  DtU32 appearance() const;
92 
94  void setAppearance(DtU32 app);
95 
97  DtAppearAttrVal appearanceAttribute(const DtAppearAttribute& attr) const;
98 
100  void setAppearanceAttribute(const DtAppearAttribute attr,
101  const DtAppearAttrVal val);
102 
103  DtDeadReckonTypes algorithm() const;
104  void setAlgorithm(DtDeadReckonTypes alg);
105 
106  const DtVector32& acceleration() const;
107  void setAcceleration(const DtVector32& Acceleration);
108 
109  const DtVector32& rotationalVelocity() const;
110  void setRotationalVelocity(const DtVector32& BodyRates);
111 
112  char deadReckonParamType() const;
113  void setDeadReckonParamType(char param);
114 
115  short deadReckon0Param() const;
116  void setDeadReckon0Param(short param);
117 
118  const DtVector& deadReckonXYZParams() const;
119  void setDeadReckonXYZParams(const DtVector& params);
120 
121 
122  int markingCharSet() const;
123  void setMarkingText(const char* text);
124 
125  const char* markingText() const;
126  void setMarkingCharSet(int charSet);
127 
128  DtU32 capabilities() const;
129  void setCapabilities(DtU32 cap);
130 
132  const DtArticulatedPartCollection& artPartList() const;
136  void setArtPartList(const DtArticulatedPartCollection& apList);
138 
140  const DtAttachedPartCollection& attPartList() const;
144  void setAttPartList(const DtAttachedPartCollection& apList);
146 
147  void setNumArtPlusAttachedParams(int num);
148 
150  const DtNetArtPartRecord* artPartRecord(int index) const;
155  DtNetArtPartRecord* artPartRecord(int index);
157 
159  DtNetAttachedPart* attPartRecord(int index);
164  const DtNetAttachedPart* attPartRecord(int index) const;
166 
167  DtNetVPRecord* variableParameterRecord(int index);
168  const DtNetVPRecord* variableParameterRecord(int index) const;
169 
170 
171  void printData() const;
172  void printDataToStream(std::ostream& stream) const;
173 
175  static DtPdu* create(const DtNetPacket* initial,
176  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0);
177 
179  static void addCallback(DtExerciseConn* conn, DtEntityStatePduCb cb,
180  void* usr);
181 
183  static void removeCallback(DtExerciseConn* conn, DtEntityStatePduCb cb,
184  void* usr);
185 
186 protected:
187 
188  DtPduKind internalGetPduKind() const
189  {
190  return DtEntityStatePduKind;
191  }
192 
193  DtNetArtPartRecord* artPartRecord(int partType, int param) const;
194  DtNetArtPartRecord* attachedPartRecord(int station) const;
195 
197  DtEntityType type, theGuise;
198  DtVector loc;
199  DtVector32 vel, acc;
200  DtTaitBryan ori;
201  DtBodyRates rvel;
202  DtVector drParam;
203  char markingBuff[DtMaxEntityMarkingLength+1];
204 
206  mutable DtArticulatedPartCollection myArtPartList;
207  mutable DtAttachedPartCollection myAttPartList;
208  int myStationList[DtMaxNumAttachedParts];
209 
210 };
211 
212 DT_DLL_VL std::ostream& operator<<(std::ostream& str,
213  const DtEntityStatePdu& pdu);
214 
215 #endif
DtAppearAttrVal
Create an enumeration type, but since many of the names will have the same value, define them all as ...
Definition: disEnums.h:1425
Definition: disEnums.h:241
A DtAttachedPartCollection is a collection of attached parts of an entity.
Definition: attachedPartCollection.h:24
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnHLA.h:61
Definition: netStructs.h:534
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
std::ostream & operator<<(std::ostream &os, const Dt3dChord &chord)
Definition: pduHeader.h:14
This file provides a declaration of the class DtArticulatedPartCollection.
This file declares DtDcm and several helper classes and functions.
This file declares the class DtNetDeadReckonParameters and DtNetEntityStatePdu.
DtTaitBryans are used to represent orientation of an object, using a set of three Euler angles...
Definition: vlTaitBryan.h:43
objHandle myId
Definition: stateMsgHLA.h:187
This file defines math constants and methods which may be useful in simulations.
#define DtMaxEntityMarkingLength
Definition: netStructs.h:43
A DtArticulatedPartCollection is a collection of articulated parts typically of an entity...
Definition: articulatedPartCollection.h:29
Definition: vlVector.h:224
This file declares DtTaitBryan.
DtPdu is the base class for all PDU&#39;s in VR-Link.
Definition: pdu.h:69
Definition: vlVector.h:162
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
Definition: netStructs.h:478
This file is deprecated - Please see simulationAddress.h, entityIdentifier.h, entityType.h, burstDescriptor.h, and NetStructs.h.
struct DtBufferPlaceHolder * DtBufferPtr
Definition: vlBaseMsg.h:17
DtForceType
Section 4.
Definition: disEnums.h:199
Definition: entityStateP.h:33
#define DtUSE_INTERNAL_BUFFER
Definition: vlBaseMsg.h:22
Contains the standard DIS enumerations.
unsigned long DtU32
A 32 bit unsigned integer value.
Definition: vlMachineTypes.h:153
DtDeadReckonTypes
Definition: disEnums.h:997
DtAppearAttribute
If you put spaces between the &quot;&lt;&lt;&quot; and the surrounding strings, enumstr gets confused and thinks the ...
Definition: disEnums.h:1270
DtPduKind
([UID 4]) - PDU Type
Definition: disEnums.h:238
class DtStateMsg:
Definition: stateMsgHLA.h:32
DtEntityType is used to represent the type an entity object.
Definition: entityType.h:26
Definition: netStructs.h:543
This file provides a declaration of the class DtAttachedPartCollection.

Document ID: Generated on Thu Sep 19 02:12:35 EDT 2024 from SVN revision 269601
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)