open-dis-cpp
EntityStatePdu.h
1 #pragma once
2 
3 #include <dis6/EntityID.h>
4 #include <dis6/EntityType.h>
5 #include <dis6/EntityType.h>
6 #include <dis6/Vector3Float.h>
7 #include <dis6/Vector3Double.h>
8 #include <dis6/Orientation.h>
9 #include <dis6/DeadReckoningParameter.h>
10 #include <dis6/Marking.h>
11 #include <dis6/ArticulationParameter.h>
12 #include <vector>
13 #include <dis6/EntityInformationFamilyPdu.h>
14 #include <dis6/utils/DataStream.h>
15 #include <dis6/opendis6_export.h>
16 
17 
18 namespace DIS
19 {
20 // Section 5.3.3.1. Represents the postion and state of one entity in the world. COMPLETE
21 
22 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
23 //
24 // @author DMcG, jkg
25 
26 class OPENDIS6_EXPORT EntityStatePdu : public EntityInformationFamilyPdu
27 {
28 protected:
31 
33  unsigned char _forceId;
34 
37 
40 
41  EntityType _alternativeEntityType;
42 
45 
48 
51 
54 
57 
60 
63 
65  std::vector<ArticulationParameter> _articulationParameters;
66 
67 
68  public:
70  virtual ~EntityStatePdu();
71 
72  virtual void marshal(DataStream& dataStream) const;
73  virtual void unmarshal(DataStream& dataStream);
74 
75  EntityID& getEntityID();
76  const EntityID& getEntityID() const;
77  void setEntityID(const EntityID &pX);
78 
79  unsigned char getForceId() const;
80  void setForceId(unsigned char pX);
81 
82  char getNumberOfArticulationParameters() const;
83 
84  EntityType& getEntityType();
85  const EntityType& getEntityType() const;
86  void setEntityType(const EntityType &pX);
87 
88  EntityType& getAlternativeEntityType();
89  const EntityType& getAlternativeEntityType() const;
90  void setAlternativeEntityType(const EntityType &pX);
91 
92  Vector3Float& getEntityLinearVelocity();
93  const Vector3Float& getEntityLinearVelocity() const;
94  void setEntityLinearVelocity(const Vector3Float &pX);
95 
96  Vector3Double& getEntityLocation();
97  const Vector3Double& getEntityLocation() const;
98  void setEntityLocation(const Vector3Double &pX);
99 
100  Orientation& getEntityOrientation();
101  const Orientation& getEntityOrientation() const;
102  void setEntityOrientation(const Orientation &pX);
103 
104  int getEntityAppearance() const;
105  void setEntityAppearance(int pX);
106 
107  DeadReckoningParameter& getDeadReckoningParameters();
108  const DeadReckoningParameter& getDeadReckoningParameters() const;
109  void setDeadReckoningParameters(const DeadReckoningParameter &pX);
110 
111  Marking& getMarking();
112  const Marking& getMarking() const;
113  void setMarking(const Marking &pX);
114 
115  int getCapabilities() const;
116  void setCapabilities(int pX);
117 
118  std::vector<ArticulationParameter>& getArticulationParameters();
119  const std::vector<ArticulationParameter>& getArticulationParameters() const;
120  void setArticulationParameters(const std::vector<ArticulationParameter>& pX);
121 
122 
123 virtual int getMarshalledSize() const;
124 
125  bool operator ==(const EntityStatePdu& rhs) const;
126 };
127 }
128 
129 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
130 // Redistribution and use in source and binary forms, with or without
131 // modification, are permitted provided that the following conditions
132 // are met:
133 //
134 // * Redistributions of source code must retain the above copyright
135 // notice, this list of conditions and the following disclaimer.
136 // * Redistributions in binary form must reproduce the above copyright
137 // notice, this list of conditions and the following disclaimer
138 // in the documentation and/or other materials provided with the
139 // distribution.
140 // * Neither the names of the Naval Postgraduate School (NPS)
141 // Modeling Virtual Environments and Simulation (MOVES) Institute
142 // (http://www.nps.edu and http://www.MovesInstitute.org)
143 // nor the names of its contributors may be used to endorse or
144 // promote products derived from this software without specific
145 // prior written permission.
146 //
147 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
148 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
149 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
150 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
151 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
152 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
153 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
154 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
155 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
156 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
157 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
158 // POSSIBILITY OF SUCH DAMAGE.
EntityID _entityID
Unique ID for an entity that is tied to this state information.
Definition: EntityStatePdu.h:30
Definition: DeadReckoningParameter.h:17
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
Orientation _entityOrientation
describes the orientation of the entity, in euler angles
Definition: EntityStatePdu.h:50
int _capabilities
a series of bit flags
Definition: EntityStatePdu.h:62
Marking _marking
characters that can be used for debugging, or to draw unique strings on the side of entities in the w...
Definition: EntityStatePdu.h:59
Definition: Marking.h:15
DeadReckoningParameter _deadReckoningParameters
parameters used for dead reckoning
Definition: EntityStatePdu.h:56
Definition: EntityInformationFamilyPdu.h:16
a class to support managing a network buffer.
Definition: DataStream.h:28
std::vector< ArticulationParameter > _articulationParameters
variable length list of articulation parameters
Definition: EntityStatePdu.h:65
Vector3Float _entityLinearVelocity
Describes the speed of the entity in the world.
Definition: EntityStatePdu.h:44
Definition: Vector3Float.h:15
Definition: EntityID.h:15
int _entityAppearance
a series of bit flags that are used to help draw the entity, such as smoking, on fire, etc.
Definition: EntityStatePdu.h:53
Definition: EntityStatePdu.h:26
Definition: Vector3Double.h:15
Definition: Orientation.h:15
EntityType _entityType
Describes the type of entity in the world.
Definition: EntityStatePdu.h:39
Definition: EntityType.h:15
char _numberOfArticulationParameters
How many articulation parameters are in the variable length list.
Definition: EntityStatePdu.h:36
unsigned char _forceId
What force this entity is affiliated with, eg red, blue, neutral, etc.
Definition: EntityStatePdu.h:33
Vector3Double _entityLocation
describes the location of the entity in the world
Definition: EntityStatePdu.h:47