open-dis-cpp
AggregateStatePdu.h
1 #pragma once
2 
3 #include <dis6/EntityID.h>
4 #include <dis6/EntityType.h>
5 #include <dis6/AggregateMarking.h>
6 #include <dis6/Vector3Float.h>
7 #include <dis6/Orientation.h>
8 #include <dis6/Vector3Double.h>
9 #include <dis6/Vector3Float.h>
10 #include <dis6/AggregateID.h>
11 #include <dis6/EntityID.h>
12 #include <dis6/EntityType.h>
13 #include <dis6/EntityType.h>
14 #include <dis6/VariableDatum.h>
15 #include <vector>
16 #include <dis6/EntityManagementFamilyPdu.h>
17 #include <dis6/utils/DataStream.h>
18 #include <dis6/opendis6_export.h>
19 
20 
21 namespace DIS
22 {
23 // Section 5.3.9.1 informationa bout aggregating entities anc communicating information about the aggregated entities. requires manual intervention to fix the padding between entityID lists and silent aggregate sysem lists--this padding is dependent on how many entityIDs there are, and needs to be on a 32 bit word boundary. UNFINISHED
24 
25 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
26 //
27 // @author DMcG, jkg
28 
29 class OPENDIS6_EXPORT AggregateStatePdu : public EntityManagementFamilyPdu
30 {
31 protected:
34 
36  unsigned char _forceID;
37 
39  unsigned char _aggregateState;
40 
43 
45  unsigned int _formation;
46 
49 
52 
55 
58 
61 
63  unsigned short _numberOfDisAggregates;
64 
66  unsigned short _numberOfDisEntities;
67 
70 
72  unsigned short _numberOfSilentEntityTypes;
73 
75  std::vector<AggregateID> _aggregateIDList;
76 
78  std::vector<EntityID> _entityIDList;
79 
81  unsigned char _pad2;
82 
84  std::vector<EntityType> _silentAggregateSystemList;
85 
87  std::vector<EntityType> _silentEntitySystemList;
88 
91 
93  std::vector<VariableDatum> _variableDatumList;
94 
95 
96  public:
98  virtual ~AggregateStatePdu();
99 
100  virtual void marshal(DataStream& dataStream) const;
101  virtual void unmarshal(DataStream& dataStream);
102 
103  EntityID& getAggregateID();
104  const EntityID& getAggregateID() const;
105  void setAggregateID(const EntityID &pX);
106 
107  unsigned char getForceID() const;
108  void setForceID(unsigned char pX);
109 
110  unsigned char getAggregateState() const;
111  void setAggregateState(unsigned char pX);
112 
113  EntityType& getAggregateType();
114  const EntityType& getAggregateType() const;
115  void setAggregateType(const EntityType &pX);
116 
117  unsigned int getFormation() const;
118  void setFormation(unsigned int pX);
119 
120  AggregateMarking& getAggregateMarking();
121  const AggregateMarking& getAggregateMarking() const;
122  void setAggregateMarking(const AggregateMarking &pX);
123 
124  Vector3Float& getDimensions();
125  const Vector3Float& getDimensions() const;
126  void setDimensions(const Vector3Float &pX);
127 
128  Orientation& getOrientation();
129  const Orientation& getOrientation() const;
130  void setOrientation(const Orientation &pX);
131 
132  Vector3Double& getCenterOfMass();
133  const Vector3Double& getCenterOfMass() const;
134  void setCenterOfMass(const Vector3Double &pX);
135 
136  Vector3Float& getVelocity();
137  const Vector3Float& getVelocity() const;
138  void setVelocity(const Vector3Float &pX);
139 
140  unsigned short getNumberOfDisAggregates() const;
141 
142  unsigned short getNumberOfDisEntities() const;
143 
144  unsigned short getNumberOfSilentAggregateTypes() const;
145 
146  unsigned short getNumberOfSilentEntityTypes() const;
147 
148  std::vector<AggregateID>& getAggregateIDList();
149  const std::vector<AggregateID>& getAggregateIDList() const;
150  void setAggregateIDList(const std::vector<AggregateID>& pX);
151 
152  std::vector<EntityID>& getEntityIDList();
153  const std::vector<EntityID>& getEntityIDList() const;
154  void setEntityIDList(const std::vector<EntityID>& pX);
155 
156  unsigned char getPad2() const;
157  void setPad2(unsigned char pX);
158 
159  std::vector<EntityType>& getSilentAggregateSystemList();
160  const std::vector<EntityType>& getSilentAggregateSystemList() const;
161  void setSilentAggregateSystemList(const std::vector<EntityType>& pX);
162 
163  std::vector<EntityType>& getSilentEntitySystemList();
164  const std::vector<EntityType>& getSilentEntitySystemList() const;
165  void setSilentEntitySystemList(const std::vector<EntityType>& pX);
166 
167  unsigned int getNumberOfVariableDatumRecords() const;
168 
169  std::vector<VariableDatum>& getVariableDatumList();
170  const std::vector<VariableDatum>& getVariableDatumList() const;
171  void setVariableDatumList(const std::vector<VariableDatum>& pX);
172 
173 
174 virtual int getMarshalledSize() const;
175 
176  bool operator ==(const AggregateStatePdu& rhs) const;
177 };
178 }
179 
180 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
181 // Redistribution and use in source and binary forms, with or without
182 // modification, are permitted provided that the following conditions
183 // are met:
184 //
185 // * Redistributions of source code must retain the above copyright
186 // notice, this list of conditions and the following disclaimer.
187 // * Redistributions in binary form must reproduce the above copyright
188 // notice, this list of conditions and the following disclaimer
189 // in the documentation and/or other materials provided with the
190 // distribution.
191 // * Neither the names of the Naval Postgraduate School (NPS)
192 // Modeling Virtual Environments and Simulation (MOVES) Institute
193 // (http://www.nps.edu and http://www.MovesInstitute.org)
194 // nor the names of its contributors may be used to endorse or
195 // promote products derived from this software without specific
196 // prior written permission.
197 //
198 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
199 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
200 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
201 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
202 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
203 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
204 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
205 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
206 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
207 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
208 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
209 // POSSIBILITY OF SUCH DAMAGE.
std::vector< EntityID > _entityIDList
entity ID list
Definition: AggregateStatePdu.h:78
unsigned char _pad2
^^^padding to put the start of the next list on a 32 bit boundary.
Definition: AggregateStatePdu.h:81
unsigned int _formation
formation of aggregated entities
Definition: AggregateStatePdu.h:45
EntityType _aggregateType
entity type of the aggregated entities
Definition: AggregateStatePdu.h:42
Definition: AggregateStatePdu.h:29
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
a class to support managing a network buffer.
Definition: DataStream.h:28
Vector3Double _centerOfMass
center of mass of the aggregation
Definition: AggregateStatePdu.h:57
unsigned short _numberOfSilentAggregateTypes
number of silent aggregate types
Definition: AggregateStatePdu.h:69
unsigned short _numberOfSilentEntityTypes
number of silent entity types
Definition: AggregateStatePdu.h:72
std::vector< EntityType > _silentEntitySystemList
silent entity types
Definition: AggregateStatePdu.h:87
EntityID _aggregateID
ID of aggregated entities.
Definition: AggregateStatePdu.h:33
Orientation _orientation
orientation of the bounding box
Definition: AggregateStatePdu.h:54
unsigned char _forceID
force ID
Definition: AggregateStatePdu.h:36
unsigned short _numberOfDisAggregates
number of aggregates
Definition: AggregateStatePdu.h:63
std::vector< VariableDatum > _variableDatumList
variableDatums
Definition: AggregateStatePdu.h:93
Definition: Vector3Float.h:15
Definition: EntityID.h:15
Definition: Vector3Double.h:15
Definition: Orientation.h:15
Vector3Float _dimensions
dimensions of bounding box for the aggregated entities, origin at the center of mass ...
Definition: AggregateStatePdu.h:51
std::vector< EntityType > _silentAggregateSystemList
silent entity types
Definition: AggregateStatePdu.h:84
Definition: EntityType.h:15
Definition: EntityManagementFamilyPdu.h:16
unsigned char _aggregateState
state of aggregate
Definition: AggregateStatePdu.h:39
std::vector< AggregateID > _aggregateIDList
aggregates list
Definition: AggregateStatePdu.h:75
Definition: AggregateMarking.h:15
AggregateMarking _aggregateMarking
marking for aggregate; first char is charset type, rest is char data
Definition: AggregateStatePdu.h:48
unsigned short _numberOfDisEntities
number of entities
Definition: AggregateStatePdu.h:66
Vector3Float _velocity
velocity of aggregation
Definition: AggregateStatePdu.h:60
unsigned int _numberOfVariableDatumRecords
number of variable datum records
Definition: AggregateStatePdu.h:90