KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Linear_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: Linear_Object_State_PDU
32  DIS: (6) 1278.1a - 1998
33  created: 15/03/2010
34  author: Karl Jones
35 
36  purpose: Contains detailed information about the addition/modification of a
37  synthetic environment object that is geometrically anchored to the
38  terrain with one point and has size and orientation.
39 
40  size: 320 bits / 40 octets - Min size.
41 *********************************************************************/
42 
43 #pragma once
44 
45 #include "./Object_State_Header.h"
46 #include "./../../DataTypes/SimulationIdentifier.h"
47 #include "./../../DataTypes/ObjectType.h"
48 #include "./../../DataTypes/LinearSegmentParameter.h"
49 #include <vector>
50 
51 namespace KDIS {
52 namespace PDU {
53 
55 {
56 protected:
57 
59 
61 
63 
65 
66  std::vector<KDIS::DATA_TYPE::LinearSegmentParameter> m_vSegments;
67 
68 public:
69 
70  static const KUINT16 LINEAR_OBJECT_STATE_PDU_SIZE = 40;
71 
73 
74  Linear_Object_State_PDU( KDataStream & stream ) throw( KException );
75 
76  Linear_Object_State_PDU( const Header & H, KDataStream & stream ) throw( KException );
77 
80  const KDIS::DATA_TYPE::ObjectType & O );
81 
84  const KDIS::DATA_TYPE::ObjectType & O, std::vector<KDIS::DATA_TYPE::LinearSegmentParameter> & Segments );
85 
86  virtual ~Linear_Object_State_PDU();
87 
88  //************************************
89  // FullName: KDIS::PDU::Linear_Object_State_PDU::GetNumberOfSegments
90  //!Description: The number of Linear Segment Parameter records contained within this PDU.
91  //************************************
92  KUINT8 GetNumberOfSegments() const;
93 
94  //************************************
95  // FullName: KDIS::PDU::Linear_Object_State_PDU::SetRequestorSimulationID
96  // KDIS::PDU::Linear_Object_State_PDU::GetRequestorSimulationID
97  //!Description: The simulation application sending the PDU.
98  // Parameter: const SimulationIdentifier & ID
99  //************************************
100  void SetRequestorSimulationID( const KDIS::DATA_TYPE::SimulationIdentifier & ID );
101  const KDIS::DATA_TYPE::SimulationIdentifier & GetRequestorSimulationID() const;
102  KDIS::DATA_TYPE::SimulationIdentifier & GetRequestorSimulationID();
103 
104  //************************************
105  // FullName: KDIS::PDU::Linear_Object_State_PDU::SetReceivingSimulationID
106  // KDIS::PDU::Linear_Object_State_PDU::GetReceivingSimulationID
107  //!Description: The simulation application that is to receive the PDU.
108  // Parameter: const SimulationIdentifier & ID
109  //************************************
110  void SetReceivingSimulationID( const KDIS::DATA_TYPE::SimulationIdentifier & ID );
111  const KDIS::DATA_TYPE::SimulationIdentifier & GetReceivingSimulationID() const;
112  KDIS::DATA_TYPE::SimulationIdentifier & GetReceivingSimulationID();
113 
114  //************************************
115  // FullName: KDIS::PDU::Linear_Object_State_PDU::SetObjectType
116  // KDIS::PDU::Linear_Object_State_PDU::GetObjectType
117  //!Description: The type of object. Represented as DIS enumeration(domain, kind, Category and sub category).
118  // Parameter: const ObjectType & O
119  //************************************
120  void SetObjectType( const KDIS::DATA_TYPE::ObjectType & O );
121  const KDIS::DATA_TYPE::ObjectType & GetObjectType() const;
122  KDIS::DATA_TYPE::ObjectType & GetObjectType();
123 
124  //************************************
125  // FullName: KDIS::PDU::Linear_Object_State_PDU::AddLinearSegmentParameter
126  // KDIS::PDU::Linear_Object_State_PDU::SetLinearSegmentParameters
127  // KDIS::PDU::Linear_Object_State_PDU::GetLinearSegmentParameters
128  //!Description: Specifies the parameter values for representing each linear segment.
129  // Parameter: const LinearSegmentParameter & L, const vector<LinearSegmentParameter> & L
130  //************************************
131  void AddLinearSegmentParameter( const KDIS::DATA_TYPE::LinearSegmentParameter & L );
132  void SetLinearSegmentParameters( const std::vector<KDIS::DATA_TYPE::LinearSegmentParameter> & L );
133  const std::vector<KDIS::DATA_TYPE::LinearSegmentParameter> & GetLinearSegmentParameters() const;
134 
135  //************************************
136  // FullName: KDIS::PDU::Linear_Object_State_PDU::GetAsString
137  //!Description: Returns a string representation of the PDU.
138  //************************************
139  virtual KString GetAsString() const;
140 
141  //************************************
142  // FullName: KDIS::PDU::Linear_Object_State_PDU::Decode
143  //!Description: Convert From Network Data.
144  // Parameter: KDataStream & stream
145  // Parameter: bool ignoreHeader = false - Decode the header from the stream?
146  //************************************
147  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
148 
149  //************************************
150  // FullName: KDIS::PDU::Linear_Object_State_PDU::Encode
151  //!Description: Convert To Network Data.
152  // Parameter: KDataStream & stream
153  //************************************
154  virtual KDataStream Encode() const;
155  virtual void Encode( KDataStream & stream ) const;
156 
157  KBOOL operator == ( const Linear_Object_State_PDU & Value ) const;
158  KBOOL operator != ( const Linear_Object_State_PDU & Value ) const;
159 };
160 
161 } // END namespace PDU
162 } // END namespace KDIS
Definition: SimulationIdentifier.h:51
Definition: LinearSegmentParameter.h:50
Definition: ObjectType.h:47
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT8 m_ui8NumSegment
Definition: Linear_Object_State_PDU.h:58
std::vector< KDIS::DATA_TYPE::LinearSegmentParameter > m_vSegments
Definition: Linear_Object_State_PDU.h:66
Definition: KDefines.h:182
Definition: KDataStream.h:48
bool KBOOL
Definition: KDefines.h:119
KDIS::DATA_TYPE::SimulationIdentifier m_ReqID
Definition: Linear_Object_State_PDU.h:60
std::string KString
Definition: KDefines.h:116
Definition: EntityIdentifier.h:49
Definition: Linear_Object_State_PDU.h:54
ForceID
Definition: EnumEntityInfoInteraction.h:886
Definition: Header7.h:142
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: Object_State_Header.h:49
KDIS::DATA_TYPE::ObjectType m_ObjTyp
Definition: Linear_Object_State_PDU.h:64
KDIS::DATA_TYPE::SimulationIdentifier m_RecvID
Definition: Linear_Object_State_PDU.h:62