KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Point_Object_State_PDU.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: Point_Object_State_PDU
32  DIS: (6) 1278.1a - 1998
33  created: 04/12/2009
34  author: Karl Jones
35 
36  purpose: Details the addition/modification of an object in the
37  synthetic environment geometrically anchored to the terrain
38  with a single point.
39 
40  size: 704 bits / 88 octets
41 *********************************************************************/
42 
43 #pragma once
44 
45 #include "./Object_State_Header.h"
46 #include "./../../DataTypes/ObjectType.h"
47 #include "./../../DataTypes/WorldCoordinates.h"
48 #include "./../../DataTypes/EulerAngles.h"
49 #include "./../../DataTypes/PointObjectAppearance.h"
50 #include "./../../DataTypes/SimulationIdentifier.h"
51 
52 namespace KDIS {
53 namespace PDU {
54 
56 {
57 protected:
58 
59  union
60  {
61  struct
62  {
63  KUINT8 m_ui8LocBit : 1;
64  KUINT8 m_ui8OriBit : 1;
65  KUINT8 m_ui8Unused : 6;
66  };
67 
69  } m_ModificationUnion;
70 
72 
74 
76 
78 
80 
82 
84 
86 
87 public:
88 
89  static const KUINT16 POINT_OBJECT_STATE_PDU_SIZE = 88;
90 
92 
93  Point_Object_State_PDU( KDataStream & stream ) throw( KException );
94 
95  Point_Object_State_PDU( const Header & H, KDataStream & stream ) throw( KException );
96 
100  const KDIS::DATA_TYPE::SimulationIdentifier & RecvID );
101 
102  virtual ~Point_Object_State_PDU();
103 
104  //************************************
105  // FullName: KDIS::PDU::Point_Object_State_PDU::SetModification
106  // KDIS::PDU::Point_Object_State_PDU::GetModification
107  // KDIS::PDU::Point_Object_State_PDU::SetModificationLocation
108  // KDIS::PDU::Point_Object_State_PDU::IsModificationLocation
109  // KDIS::PDU::Point_Object_State_PDU::SetModificationOrientation
110  // KDIS::PDU::Point_Object_State_PDU::IsModificationOrientation
111  //!Description: Identifies whether a modification has been made to the point object�s
112  //! location or orientation. Modification is represented by a single 8 bit unsigned int, where
113  //! bit 0 is the location modified flag and bit 1 is the orientation flag. A value of 1(true)
114  //! indicates the field has been changed.
115  //! You can also set these values using SetModificationLocation and SetModificationOrientation.
116  //! All values are set to false(0) by default.
117  // Parameter: KUINT8 M, KBOOL M = true
118  //************************************
119  void SetModification( KUINT8 M );
120  KUINT8 GetModification() const;
121  void SetModificationLocation( KBOOL M = true );
122  KBOOL IsModificationLocation() const;
123  void SetModificationOrientation( KBOOL M = true );
124  KBOOL IsModificationOrientation() const;
125 
126  //************************************
127  // FullName: KDIS::PDU::Point_Object_State_PDU::SetObjectType
128  // KDIS::PDU::Point_Object_State_PDU::GetObjectType
129  //!Description: The type of object. Represented as DIS enumeration(domain, kind, Category and sub category).
130  // Parameter: const ObjectType & O
131  //************************************
132  void SetObjectType( const KDIS::DATA_TYPE::ObjectType & O );
133  const KDIS::DATA_TYPE::ObjectType & GetObjectType() const;
134  KDIS::DATA_TYPE::ObjectType & GetObjectType();
135 
136  //************************************
137  // FullName: KDIS::PDU::Point_Object_State_PDU::SetLocation
138  // KDIS::PDU::Point_Object_State_PDU::GetLocation
139  //!Description: The physical location of the object.
140  // Parameter: const WorldCoordinates & L
141  //************************************
142  void SetLocation( const KDIS::DATA_TYPE::WorldCoordinates & L );
143  const KDIS::DATA_TYPE::WorldCoordinates & GetLocation() const;
144  KDIS::DATA_TYPE::WorldCoordinates & GetLocation();
145 
146  //************************************
147  // FullName: KDIS::PDU::Point_Object_State_PDU::SetOrientation
148  // KDIS::PDU::Point_Object_State_PDU::GetOrientation
149  //!Description: The objects orientation.
150  // Parameter: const EulerAngles & O
151  //************************************
152  void SetOrientation( const KDIS::DATA_TYPE::EulerAngles & O );
153  const KDIS::DATA_TYPE::EulerAngles & GetOrientation() const;
154  KDIS::DATA_TYPE::EulerAngles & GetOrientation();
155 
156  //************************************
157  // FullName: KDIS::PDU::Point_Object_State_PDU::SetObjectAppearance
158  // KDIS::PDU::Point_Object_State_PDU::GetObjectAppearance
159  //!Description: Specifies the dynamic changes to an object�s appearance attributes.
160  // Parameter: const PointObjectAppearance & O
161  //************************************
162  void SetObjectAppearance( const KDIS::DATA_TYPE::PointObjectAppearance & A );
163  const KDIS::DATA_TYPE::PointObjectAppearance & GetObjectAppearance() const;
164  KDIS::DATA_TYPE::PointObjectAppearance & GetObjectAppearance();
165 
166  //************************************
167  // FullName: KDIS::PDU::Point_Object_State_PDU::SetRequestorSimulationID
168  // KDIS::PDU::Point_Object_State_PDU::GetRequestorSimulationID
169  //!Description: The simulation application sending the PDU.
170  // Parameter: const SimulationIdentifier & ID
171  //************************************
172  void SetRequestorSimulationID( const KDIS::DATA_TYPE::SimulationIdentifier & ID );
173  const KDIS::DATA_TYPE::SimulationIdentifier & GetRequestorSimulationID() const;
174  KDIS::DATA_TYPE::SimulationIdentifier & GetRequestorSimulationID();
175 
176  //************************************
177  // FullName: KDIS::PDU::Point_Object_State_PDU::SetReceivingSimulationID
178  // KDIS::PDU::Point_Object_State_PDU::GetReceivingSimulationID
179  //!Description: The simulation application that is to receive the PDU.
180  // Parameter: const SimulationIdentifier & ID
181  //************************************
182  void SetReceivingSimulationID( const KDIS::DATA_TYPE::SimulationIdentifier & ID );
183  const KDIS::DATA_TYPE::SimulationIdentifier & GetReceivingSimulationID() const;
184  KDIS::DATA_TYPE::SimulationIdentifier & GetReceivingSimulationID();
185 
186  //************************************
187  // FullName: KDIS::PDU::Point_Object_State_PDU::GetAsString
188  //!Description: Returns a string representation of the PDU.
189  //************************************
190  virtual KString GetAsString() const;
191 
192  //************************************
193  // FullName: KDIS::PDU::Point_Object_State_PDU::Decode
194  //!Description: Convert From Network Data.
195  // Parameter: KDataStream & stream
196  // Parameter: bool ignoreHeader = false - Decode the header from the stream?
197  //************************************
198  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
199 
200  //************************************
201  // FullName: KDIS::PDU::Point_Object_State_PDU::Encode
202  //!Description: Convert To Network Data.
203  // Parameter: KDataStream & stream
204  //************************************
205  virtual KDataStream Encode() const;
206  virtual void Encode( KDataStream & stream ) const;
207 
208  KBOOL operator == ( const Point_Object_State_PDU & Value ) const;
209  KBOOL operator != ( const Point_Object_State_PDU & Value ) const;
210 };
211 
212 } // END namespace PDU
213 } // END namespace KDIS
KDIS::DATA_TYPE::SimulationIdentifier m_ReqID
Definition: Point_Object_State_PDU.h:81
Definition: SimulationIdentifier.h:51
unsigned int KUINT32
Definition: KDefines.h:103
Definition: ObjectType.h:47
KDIS::DATA_TYPE::WorldCoordinates m_Loc
Definition: Point_Object_State_PDU.h:73
KDIS::DATA_TYPE::PointObjectAppearance m_Apperance
Definition: Point_Object_State_PDU.h:77
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT16 m_ui16Padding
Definition: Point_Object_State_PDU.h:79
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: WorldCoordinates.h:52
bool KBOOL
Definition: KDefines.h:119
Definition: Point_Object_State_PDU.h:55
Definition: EulerAngles.h:46
Definition: PointObjectAppearance.h:46
KDIS::DATA_TYPE::ObjectType m_ObjTyp
Definition: Point_Object_State_PDU.h:71
std::string KString
Definition: KDefines.h:116
Definition: EntityIdentifier.h:49
ForceID
Definition: EnumEntityInfoInteraction.h:886
Definition: Header7.h:142
KDIS::DATA_TYPE::EulerAngles m_Ori
Definition: Point_Object_State_PDU.h:75
unsigned char KUINT8
Definition: KDefines.h:99
KDIS::DATA_TYPE::SimulationIdentifier m_RecvID
Definition: Point_Object_State_PDU.h:83
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: Object_State_Header.h:49
KUINT32 m_ui32Padding1
Definition: Point_Object_State_PDU.h:85
KUINT8 m_ui8Modifications
Definition: Point_Object_State_PDU.h:68