KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
GED_BasicGroundCombatVehicle.h
Go to the documentation of this file.
1 /*********************************************************************
2 Copyright 2013 Karl Jones
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7 
8 1. Redistributions of source code must retain the above copyright notice, this
9  list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright notice,
11  this list of conditions and the following disclaimer in the documentation
12  and/or other materials provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 
25 For Further Information Please Contact me at
26 Karljj1@yahoo.com
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
29 
30 /********************************************************************
31  class: GED_BasicGroundCombatVehicle
32  created: 13:05:2009
33  author: Karl Jones
34 
35  purpose: Contains entity state information about an individual entity
36  within a group of basic ground combat vehicles.
37  size: 160 bits / 20 octets
38 *********************************************************************/
39 
40 #pragma once
41 
42 #include "./GED.h"
43 #include "./EntityAppearance.h"
44 
45 namespace KDIS {
46 namespace DATA_TYPE {
47 
49 {
50 protected:
51 
53 
54  KINT16 m_i16Offsets[3];
55 
57 
58  KINT8 m_i8Ori[3];
59 
61 
63 
65 
67 
69 
70 public:
71 
72  static const KUINT16 GED_BASIC_GROUND_COMBAT_VEHICLE_SIZE = 20;
73 
75 
77 
78  GED_BasicGroundCombatVehicle( KUINT16 ID, KINT16 XOffset, KINT16 YOffset, KINT16 ZOffset, const EntityAppearance & EA,
79  KINT8 Psi, KINT8 Theta, KINT8 Phi, KINT8 Speed, KINT8 TurretAzimuth, KINT8 GunElevation,
80  KINT8 TurretSlewRate, KINT8 GunElevationRate );
81 
83 
84  //************************************
85  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetGroupedEntityCategory
86  //!Description: Identifies the derived GED class.
87  //! Not part of the DIS PDU.
88  //************************************
89  virtual KDIS::DATA_TYPE::ENUMS::GroupedEntityCategory GetGroupedEntityCategory() const;
90 
91  //************************************
92  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetLength
93  //!Description: Returns size of the GED in octets.
94  //! Not part of the DIS PDU.
95  //************************************
96  virtual KUINT8 GetLength() const;
97 
98  //************************************
99  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetEntityID
100  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetEntityID
101  //!Description: Entity identifier unique within the group.
102  //! The Site Identifier and Application Identifiers shall be the same as
103  //! those designated in the Group Entity ID field.
104  // Parameter: KUINT16 ID, void
105  //************************************
106  void SetEntityID( KUINT16 ID );
107  KUINT16 GetEntityID() const;
108 
109  //************************************
110  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetEntityLocation
111  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetEntityLocationXOffset
112  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetEntityLocationYOffset
113  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetEntityLocationZOffset
114  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetEntityLocationXOffset
115  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetEntityLocationYOffset
116  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetEntityLocationZOffset
117  //!Description: Location of the grouped entity specified by a set of three offsets.
118  //! Determined by the difference, in meters, of the grouped entity from the Group Reference Point.
119  // Parameter: KINT16, void
120  //************************************
121  void SetEntityLocation( KINT16 XOffset, KINT16 YOffset, KINT16 ZOffset );
122  void SetEntityLocation( KINT16 Offsets[3] );
123  void SetEntityLocationXOffset( KINT16 X );
124  void SetEntityLocationYOffset( KINT16 Y );
125  void SetEntityLocationZOffset( KINT16 Z );
126  KINT16 GetEntityLocationXOffset() const;
127  KINT16 GetEntityLocationYOffset() const;
128  KINT16 GetEntityLocationZOffset() const;
129 
130  //************************************
131  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetEntityAppearance
132  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetEntityAppearance
133  //!Description: Entity appearance bit field accessors/mutator
134  // Parameter: const EntityAppearance & EA, void
135  //************************************
136  void SetEntityAppearance( const EntityAppearance & EA );
137  const EntityAppearance & GetEntityAppearance() const;
138  EntityAppearance & GetEntityAppearance();
139 
140  //************************************
141  // GetEntityOrientationPhi
142  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetEntityOrientation
143  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetEntityOrientationPsi
144  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetEntityOrientationTheta
145  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetEntityOrientationPhi
146  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetEntityOrientationPsi
147  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetEntityOrientationTheta
148  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetEntityOrientationPhi
149  //!Description: Entity orientation in euler angles, psi, theta and phi, in 25 milliradian increments.
150  // Parameter: KINT8, void
151  //************************************
152  void SetEntityOrientation( KINT8 Psi, KINT8 Theta, KINT8 Phi );
153  void SetEntityOrientation( KINT8 Ori[3] );
154  void SetEntityOrientationPsi( KINT8 P );
155  void SetEntityOrientationTheta( KINT8 T );
156  void SetEntityOrientationPhi( KINT8 P );
157  KINT8 GetEntityOrientationPsi() const;
158  KINT8 GetEntityOrientationTheta() const;
159  KINT8 GetEntityOrientationPhi() const;
160 
161  //************************************
162  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetSpeed
163  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetSpeed
164  //!Description: Signed magnitude value of the entity�s absolute velocity vector.
165  //! A negative value shall indicate that the entity is moving backwards.
166  //! Measured in Meters Per Secound (m/s).
167  // Parameter: KINT8 S, void
168  //************************************
169  void SetSpeed( KINT8 S );
170  KINT8 GetSpeed() const;
171 
172  //************************************
173  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetTurretAzimuth
174  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetTurretAzimuth
175  //!Description: Turret azimuth specified in 25 milliradian increments.
176  // Parameter: KINT8 T, void
177  //************************************
178  void SetTurretAzimuth( KINT8 T );
179  KINT8 GetTurretAzimuth() const;
180 
181  //************************************
182  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetGunElevation
183  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetGunElevation
184  //!Description: Gun elevation specified in 25 milliradian increments.
185  // Parameter: KINT8 G, void
186  //************************************
187  void SetGunElevation( KINT8 G );
188  KINT8 GetGunElevation() const;
189 
190  //************************************
191  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetTurretSlewRate
192  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetTurretSlewRate
193  //!Description: Turret slew rate specified in 25 milliradian per secound increments.
194  // Parameter: KINT8 T, void
195  //************************************
196  void SetTurretSlewRate( KINT8 T );
197  KINT8 GetTurretSlewRate() const;
198 
199  //************************************
200  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::SetGunElevationRate
201  // KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetGunElevationRate
202  //!Description: Gun elevation rate specified in 25 milliradian per secound increments.
203  // Parameter: KINT8 G, void
204  //************************************
205  void SetGunElevationRate( KINT8 G );
206  KINT8 GetGunElevationRate() const;
207 
208  //************************************
209  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::GetAsString
210  //!Description: Returns a string representation
211  //************************************
212  virtual KString GetAsString() const;
213 
214  //************************************
215  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::Decode
216  //!Description: Convert From Network Data.
217  // Parameter: KDataStream & stream
218  //************************************
219  virtual void Decode( KDataStream & stream ) throw( KException );
220 
221  //************************************
222  // FullName: KDIS::DATA_TYPE::GED_BasicGroundCombatVehicle::Encode
223  //!Description: Convert To Network Data.
224  // Parameter: KDataStream & stream
225  //************************************
226  virtual KDataStream Encode() const;
227  virtual void Encode( KDataStream & stream ) const;
228 
229  KBOOL operator == ( const GED_BasicGroundCombatVehicle & Value ) const;
230  KBOOL operator != ( const GED_BasicGroundCombatVehicle & Value ) const;
231 };
232 
233 } // END namespace DATA_TYPES
234 } // END namespace KDIS
235 
KINT8 m_i8GnElvRt
Definition: GED_BasicGroundCombatVehicle.h:68
short int KINT16
Definition: KDefines.h:102
unsigned short int KUINT16
Definition: KDefines.h:101
KINT8 m_i8GnElv
Definition: GED_BasicGroundCombatVehicle.h:64
KINT8 m_i8TrrtAz
Definition: GED_BasicGroundCombatVehicle.h:62
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: GED.h:59
KUINT16 m_ui16EntityID
Definition: GED_BasicGroundCombatVehicle.h:52
Definition: EntityAppearance.h:58
char KINT8
Definition: KDefines.h:100
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
Definition: GED_BasicGroundCombatVehicle.h:48
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82
GroupedEntityCategory
Definition: EnumEntityManagement.h:118
KINT8 m_i8Spd
Definition: GED_BasicGroundCombatVehicle.h:60
KINT8 m_i8TrrtSlwRt
Definition: GED_BasicGroundCombatVehicle.h:66
EntityAppearance m_EA
Definition: GED_BasicGroundCombatVehicle.h:56