open-dis-cpp
FastEntityStatePdu.h
1 #pragma once
2 
3 #include <dis6/ArticulationParameter.h>
4 #include <vector>
5 #include <dis6/EntityInformationFamilyPdu.h>
6 #include <dis6/utils/DataStream.h>
7 #include <dis6/opendis6_export.h>
8 
9 
10 namespace DIS
11 {
12 // Section 5.3.3.1. Represents the postion and state of one entity in the world. This is identical in function to entity state pdu, but generates less garbage to collect in the Java world. COMPLETE
13 
14 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
15 //
16 // @author DMcG, jkg
17 
18 class OPENDIS6_EXPORT FastEntityStatePdu : public EntityInformationFamilyPdu
19 {
20 protected:
22  unsigned short _site;
23 
25  unsigned short _application;
26 
28  unsigned short _entity;
29 
31  unsigned char _forceId;
32 
35 
37  unsigned char _entityKind;
38 
40  unsigned char _domain;
41 
43  unsigned short _country;
44 
46  unsigned char _category;
47 
49  unsigned char _subcategory;
50 
52  unsigned char _specific;
53 
54  unsigned char _extra;
55 
57  unsigned char _altEntityKind;
58 
60  unsigned char _altDomain;
61 
63  unsigned short _altCountry;
64 
66  unsigned char _altCategory;
67 
69  unsigned char _altSubcategory;
70 
72  unsigned char _altSpecific;
73 
74  unsigned char _altExtra;
75 
77  float _xVelocity;
78 
80  float _yVelocity;
81 
83  float _zVelocity;
84 
86  double _xLocation;
87 
89  double _yLocation;
90 
92  double _zLocation;
93 
94  float _psi;
95 
96  float _theta;
97 
98  float _phi;
99 
102 
104  unsigned char _deadReckoningAlgorithm;
105 
107  char _otherParameters[15];
108 
111 
114 
117 
120 
123 
126 
128  char _marking[12];
129 
132 
134  std::vector<ArticulationParameter> _articulationParameters;
135 
136 
137  public:
139  virtual ~FastEntityStatePdu();
140 
141  virtual void marshal(DataStream& dataStream) const;
142  virtual void unmarshal(DataStream& dataStream);
143 
144  unsigned short getSite() const;
145  void setSite(unsigned short pX);
146 
147  unsigned short getApplication() const;
148  void setApplication(unsigned short pX);
149 
150  unsigned short getEntity() const;
151  void setEntity(unsigned short pX);
152 
153  unsigned char getForceId() const;
154  void setForceId(unsigned char pX);
155 
156  unsigned char getNumberOfArticulationParameters() const;
157 
158  unsigned char getEntityKind() const;
159  void setEntityKind(unsigned char pX);
160 
161  unsigned char getDomain() const;
162  void setDomain(unsigned char pX);
163 
164  unsigned short getCountry() const;
165  void setCountry(unsigned short pX);
166 
167  unsigned char getCategory() const;
168  void setCategory(unsigned char pX);
169 
170  unsigned char getSubcategory() const;
171  void setSubcategory(unsigned char pX);
172 
173  unsigned char getSpecific() const;
174  void setSpecific(unsigned char pX);
175 
176  unsigned char getExtra() const;
177  void setExtra(unsigned char pX);
178 
179  unsigned char getAltEntityKind() const;
180  void setAltEntityKind(unsigned char pX);
181 
182  unsigned char getAltDomain() const;
183  void setAltDomain(unsigned char pX);
184 
185  unsigned short getAltCountry() const;
186  void setAltCountry(unsigned short pX);
187 
188  unsigned char getAltCategory() const;
189  void setAltCategory(unsigned char pX);
190 
191  unsigned char getAltSubcategory() const;
192  void setAltSubcategory(unsigned char pX);
193 
194  unsigned char getAltSpecific() const;
195  void setAltSpecific(unsigned char pX);
196 
197  unsigned char getAltExtra() const;
198  void setAltExtra(unsigned char pX);
199 
200  float getXVelocity() const;
201  void setXVelocity(float pX);
202 
203  float getYVelocity() const;
204  void setYVelocity(float pX);
205 
206  float getZVelocity() const;
207  void setZVelocity(float pX);
208 
209  double getXLocation() const;
210  void setXLocation(double pX);
211 
212  double getYLocation() const;
213  void setYLocation(double pX);
214 
215  double getZLocation() const;
216  void setZLocation(double pX);
217 
218  float getPsi() const;
219  void setPsi(float pX);
220 
221  float getTheta() const;
222  void setTheta(float pX);
223 
224  float getPhi() const;
225  void setPhi(float pX);
226 
227  int getEntityAppearance() const;
228  void setEntityAppearance(int pX);
229 
230  unsigned char getDeadReckoningAlgorithm() const;
231  void setDeadReckoningAlgorithm(unsigned char pX);
232 
233  char* getOtherParameters();
234  const char* getOtherParameters() const;
235  void setOtherParameters( const char* pX);
236 
237  float getXAcceleration() const;
238  void setXAcceleration(float pX);
239 
240  float getYAcceleration() const;
241  void setYAcceleration(float pX);
242 
243  float getZAcceleration() const;
244  void setZAcceleration(float pX);
245 
246  float getXAngularVelocity() const;
247  void setXAngularVelocity(float pX);
248 
249  float getYAngularVelocity() const;
250  void setYAngularVelocity(float pX);
251 
252  float getZAngularVelocity() const;
253  void setZAngularVelocity(float pX);
254 
255  char* getMarking();
256  const char* getMarking() const;
257  void setMarking( const char* pX);
258  void setByStringMarking(const char* pX);
259 
260  int getCapabilities() const;
261  void setCapabilities(int pX);
262 
263  std::vector<ArticulationParameter>& getArticulationParameters();
264  const std::vector<ArticulationParameter>& getArticulationParameters() const;
265  void setArticulationParameters(const std::vector<ArticulationParameter>& pX);
266 
267 
268 virtual int getMarshalledSize() const;
269 
270  bool operator ==(const FastEntityStatePdu& rhs) const;
271 };
272 }
273 
274 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
275 // Redistribution and use in source and binary forms, with or without
276 // modification, are permitted provided that the following conditions
277 // are met:
278 //
279 // * Redistributions of source code must retain the above copyright
280 // notice, this list of conditions and the following disclaimer.
281 // * Redistributions in binary form must reproduce the above copyright
282 // notice, this list of conditions and the following disclaimer
283 // in the documentation and/or other materials provided with the
284 // distribution.
285 // * Neither the names of the Naval Postgraduate School (NPS)
286 // Modeling Virtual Environments and Simulation (MOVES) Institute
287 // (http://www.nps.edu and http://www.MovesInstitute.org)
288 // nor the names of its contributors may be used to endorse or
289 // promote products derived from this software without specific
290 // prior written permission.
291 //
292 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
293 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
294 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
295 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
296 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
297 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
298 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
299 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
300 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
301 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
302 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
303 // POSSIBILITY OF SUCH DAMAGE.
int _entityAppearance
a series of bit flags that are used to help draw the entity, such as smoking, on fire, etc.
Definition: FastEntityStatePdu.h:101
std::vector< ArticulationParameter > _articulationParameters
variable length list of articulation parameters
Definition: FastEntityStatePdu.h:134
unsigned short _altCountry
country to which the design of the entity is attributed
Definition: FastEntityStatePdu.h:63
float _yVelocity
y Value
Definition: FastEntityStatePdu.h:80
int _capabilities
a series of bit flags
Definition: FastEntityStatePdu.h:131
unsigned char _altSpecific
specific info based on subcategory field
Definition: FastEntityStatePdu.h:72
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
unsigned char _altDomain
Domain of entity (air, surface, subsurface, space, etc)
Definition: FastEntityStatePdu.h:60
unsigned char _deadReckoningAlgorithm
enumeration of what dead reckoning algorighm to use
Definition: FastEntityStatePdu.h:104
float _yAcceleration
y Value
Definition: FastEntityStatePdu.h:113
Definition: EntityInformationFamilyPdu.h:16
a class to support managing a network buffer.
Definition: DataStream.h:28
float _xVelocity
X velo.
Definition: FastEntityStatePdu.h:77
unsigned char _altCategory
category of entity
Definition: FastEntityStatePdu.h:66
float _zAngularVelocity
Z value.
Definition: FastEntityStatePdu.h:125
float _xAcceleration
X value.
Definition: FastEntityStatePdu.h:110
unsigned char _subcategory
subcategory of entity
Definition: FastEntityStatePdu.h:49
unsigned char _numberOfArticulationParameters
How many articulation parameters are in the variable length list.
Definition: FastEntityStatePdu.h:34
unsigned char _entityKind
Kind of entity.
Definition: FastEntityStatePdu.h:37
unsigned short _application
The application ID.
Definition: FastEntityStatePdu.h:25
unsigned short _country
country to which the design of the entity is attributed
Definition: FastEntityStatePdu.h:43
float _xAngularVelocity
X value.
Definition: FastEntityStatePdu.h:119
double _yLocation
y Value
Definition: FastEntityStatePdu.h:89
unsigned short _entity
the entity ID
Definition: FastEntityStatePdu.h:28
unsigned short _site
The site ID.
Definition: FastEntityStatePdu.h:22
double _xLocation
X value.
Definition: FastEntityStatePdu.h:86
unsigned char _category
category of entity
Definition: FastEntityStatePdu.h:46
unsigned char _altEntityKind
Kind of entity.
Definition: FastEntityStatePdu.h:57
unsigned char _domain
Domain of entity (air, surface, subsurface, space, etc)
Definition: FastEntityStatePdu.h:40
unsigned char _altSubcategory
subcategory of entity
Definition: FastEntityStatePdu.h:69
double _zLocation
Z value.
Definition: FastEntityStatePdu.h:92
Definition: FastEntityStatePdu.h:18
float _zAcceleration
Z value.
Definition: FastEntityStatePdu.h:116
unsigned char _forceId
what force this entity is affiliated with, eg red, blue, neutral, etc
Definition: FastEntityStatePdu.h:31
float _yAngularVelocity
y Value
Definition: FastEntityStatePdu.h:122
unsigned char _specific
specific info based on subcategory field
Definition: FastEntityStatePdu.h:52
float _zVelocity
Z value.
Definition: FastEntityStatePdu.h:83