open-dis-cpp
MinefieldStatePdu.h
1 #pragma once
2 
3 #include <dis6/EntityID.h>
4 #include <dis6/EntityType.h>
5 #include <dis6/Vector3Double.h>
6 #include <dis6/Orientation.h>
7 #include <dis6/Point.h>
8 #include <dis6/EntityType.h>
9 #include <vector>
10 #include <dis6/MinefieldFamilyPdu.h>
11 #include <dis6/utils/DataStream.h>
12 #include <dis6/opendis6_export.h>
13 
14 
15 namespace DIS
16 {
17 // Section 5.3.10.1 Abstract superclass for PDUs relating to minefields. COMPLETE
18 
19 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
20 //
21 // @author DMcG, jkg
22 
23 class OPENDIS6_EXPORT MinefieldStatePdu : public MinefieldFamilyPdu
24 {
25 protected:
28 
30  unsigned short _minefieldSequence;
31 
33  unsigned char _forceID;
34 
36  unsigned char _numberOfPerimeterPoints;
37 
40 
42  unsigned short _numberOfMineTypes;
43 
46 
49 
51  unsigned short _appearance;
52 
54  unsigned short _protocolMode;
55 
57  std::vector<Point> _perimeterPoints;
58 
60  std::vector<EntityType> _mineType;
61 
62 
63  public:
65  virtual ~MinefieldStatePdu();
66 
67  virtual void marshal(DataStream& dataStream) const;
68  virtual void unmarshal(DataStream& dataStream);
69 
70  EntityID& getMinefieldID();
71  const EntityID& getMinefieldID() const;
72  void setMinefieldID(const EntityID &pX);
73 
74  unsigned short getMinefieldSequence() const;
75  void setMinefieldSequence(unsigned short pX);
76 
77  unsigned char getForceID() const;
78  void setForceID(unsigned char pX);
79 
80  unsigned char getNumberOfPerimeterPoints() const;
81 
82  EntityType& getMinefieldType();
83  const EntityType& getMinefieldType() const;
84  void setMinefieldType(const EntityType &pX);
85 
86  unsigned short getNumberOfMineTypes() const;
87 
88  Vector3Double& getMinefieldLocation();
89  const Vector3Double& getMinefieldLocation() const;
90  void setMinefieldLocation(const Vector3Double &pX);
91 
92  Orientation& getMinefieldOrientation();
93  const Orientation& getMinefieldOrientation() const;
94  void setMinefieldOrientation(const Orientation &pX);
95 
96  unsigned short getAppearance() const;
97  void setAppearance(unsigned short pX);
98 
99  unsigned short getProtocolMode() const;
100  void setProtocolMode(unsigned short pX);
101 
102  std::vector<Point>& getPerimeterPoints();
103  const std::vector<Point>& getPerimeterPoints() const;
104  void setPerimeterPoints(const std::vector<Point>& pX);
105 
106  std::vector<EntityType>& getMineType();
107  const std::vector<EntityType>& getMineType() const;
108  void setMineType(const std::vector<EntityType>& pX);
109 
110 
111 virtual int getMarshalledSize() const;
112 
113  bool operator ==(const MinefieldStatePdu& rhs) const;
114 };
115 }
116 
117 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
118 // Redistribution and use in source and binary forms, with or without
119 // modification, are permitted provided that the following conditions
120 // are met:
121 //
122 // * Redistributions of source code must retain the above copyright
123 // notice, this list of conditions and the following disclaimer.
124 // * Redistributions in binary form must reproduce the above copyright
125 // notice, this list of conditions and the following disclaimer
126 // in the documentation and/or other materials provided with the
127 // distribution.
128 // * Neither the names of the Naval Postgraduate School (NPS)
129 // Modeling Virtual Environments and Simulation (MOVES) Institute
130 // (http://www.nps.edu and http://www.MovesInstitute.org)
131 // nor the names of its contributors may be used to endorse or
132 // promote products derived from this software without specific
133 // prior written permission.
134 //
135 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
136 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
137 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
138 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
139 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
140 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
141 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
142 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
143 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
144 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
145 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
146 // POSSIBILITY OF SUCH DAMAGE.
EntityType _minefieldType
type of minefield
Definition: MinefieldStatePdu.h:39
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
unsigned char _forceID
force ID
Definition: MinefieldStatePdu.h:33
a class to support managing a network buffer.
Definition: DataStream.h:28
Orientation _minefieldOrientation
orientation of minefield
Definition: MinefieldStatePdu.h:48
std::vector< EntityType > _mineType
Type of mines.
Definition: MinefieldStatePdu.h:60
Vector3Double _minefieldLocation
location of minefield in world coords
Definition: MinefieldStatePdu.h:45
unsigned short _appearance
appearance bitflags
Definition: MinefieldStatePdu.h:51
Definition: EntityID.h:15
unsigned short _numberOfMineTypes
how many mine types
Definition: MinefieldStatePdu.h:42
Definition: Vector3Double.h:15
Definition: Orientation.h:15
Definition: EntityType.h:15
EntityID _minefieldID
Minefield ID.
Definition: MinefieldStatePdu.h:27
Definition: MinefieldFamilyPdu.h:16
Definition: MinefieldStatePdu.h:23
std::vector< Point > _perimeterPoints
perimeter points for the minefield
Definition: MinefieldStatePdu.h:57
unsigned short _minefieldSequence
Minefield sequence.
Definition: MinefieldStatePdu.h:30
unsigned char _numberOfPerimeterPoints
Number of permieter points.
Definition: MinefieldStatePdu.h:36
unsigned short _protocolMode
protocolMode
Definition: MinefieldStatePdu.h:54