VR-Link API Documentation for DIS
 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 VT MAK
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 
45 {
46 public:
47 
48  enum { PduStaticSize=144 };
49 
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 
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;
203  char markingBuff[DtMaxEntityMarkingLength+1];
204 
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:1421
DtVector32 vel
Definition: entityStatePdu.h:199
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: exerciseConnDIS.h:61
Definition: netStructs.h:301
#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.
class DtPduFactory:
Definition: pduFactory.h:38
This file declares the class DtNetDeadReckonParameters and DtNetEntityStatePdu.
DtEntityType type
Definition: entityStatePdu.h:197
DtTaitBryans are used to represent orientation of an object, using a set of three Euler angles...
Definition: vlTaitBryan.h:43
DtVector loc
Definition: entityStatePdu.h:198
virtual void printDataToStream(std::ostream &stream) const
#define DtMaxNumAttachedParts
Definition: entityStatePdu.h:30
This file defines math constants and methods which may be useful in simulations.
#define DtMaxEntityMarkingLength
Definition: netStructs.h:42
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
DtBodyRates rvel
Definition: entityStatePdu.h:201
Definition: vlVector.h:162
DtEntityIdentifier myId
Definition: entityStatePdu.h:196
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
Definition: netStructs.h:245
DtAttachedPartCollection myAttPartList
Definition: entityStatePdu.h:207
virtual void printData() const
Print the PDU&#39;s data (not including header).
DtArticulatedPartCollection myArtPartList
Does not store state.
Definition: entityStatePdu.h:206
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
This class provides a wrapper around the DIS Entity State PDU network structure.
Definition: entityStatePdu.h:44
Contains the standard DIS enumerations.
DtTaitBryan ori
Definition: entityStatePdu.h:200
DtVector drParam
Definition: entityStatePdu.h:202
unsigned long DtU32
A 32 bit unsigned integer value.
Definition: vlMachineTypes.h:153
DtDeadReckonTypes
Definition: disEnums.h:993
DtAppearAttribute
If you put spaces between the &quot;&lt;&lt;&quot; and the surrounding strings, enumstr gets confused and thinks the ...
Definition: disEnums.h:1266
DtPduKind
([UID 4]) - PDU Type
Definition: disEnums.h:238
DtPduKind internalGetPduKind() const
Returns the PDU kind associated with the derived PDU class.
Definition: entityStatePdu.h:188
Instances of DtStateMsg are used to represent state data communicated via the network in a DIS (as op...
Definition: stateMsgDIS.h:21
void(* DtEntityStatePduCb)(DtEntityStatePdu *pdu, void *usr)
Definition: entityStatePdu.h:39
DtEntityType is used to represent the type an entity object.
Definition: entityType.h:26
virtual ~DtEntityStatePdu()
DTOR.
Definition: entityStatePdu.h:62
Definition: netStructs.h:311
This file provides a declaration of the class DtAttachedPartCollection.

Document ID: Generated on Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)