fix: replaced invalid UTF8 characters
[KDIS.git] / include / KDIS / PDU / Entity_Management / IsPartOf_PDU.hpp
blobb2e695e6f081731bc440ce397254d69629f684f8
1 /*********************************************************************
2 Copyright 2013 Karl Jones
3 All rights reserved.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
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.
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.
25 For Further Information Please Contact me at
26 Karljj1@yahoo.com
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
30 /********************************************************************
31 class: IsPartOf_PDU
32 DIS: (6) 1278.1A - 1998
33 created: 26/06/2009
34 author: Karl Jones
36 purpose: Communicates the joining of two or more simulation entities to
37 form a single entity with constituent parts. size: 416 bits / 52 octets
38 *********************************************************************/
40 #pragma once
42 #include "KDIS/DataTypes/EntityIdentifier.hpp"
43 #include "KDIS/DataTypes/EntityType.hpp"
44 #include "KDIS/DataTypes/NamedLocationIdentifier.hpp"
45 #include "KDIS/DataTypes/RelationshipRecord.hpp"
46 #include "KDIS/DataTypes/Vector.hpp"
47 #include "KDIS/PDU/Simulation_Management/Simulation_Management_Header.hpp"
49 namespace KDIS {
50 namespace PDU {
52 class KDIS_EXPORT IsPartOf_PDU : public Simulation_Management_Header {
53 protected:
54 KDIS::DATA_TYPE::RelationshipRecord m_RelRec;
56 KDIS::DATA_TYPE::Vector m_LocPrt;
58 KDIS::DATA_TYPE::NamedLocationIdentifier m_NmLocID;
60 KDIS::DATA_TYPE::EntityType m_PrtTyp;
62 public:
63 static const KUINT16 IS_PART_OF_PDU_SIZE = 52;
65 IsPartOf_PDU();
67 IsPartOf_PDU(KDataStream& stream);
69 IsPartOf_PDU(const Header& H, KDataStream& stream);
71 IsPartOf_PDU(const KDIS::DATA_TYPE::RelationshipRecord& RR,
72 const KDIS::DATA_TYPE::Vector& LocationOfPart,
73 const KDIS::DATA_TYPE::NamedLocationIdentifier& NLI,
74 const KDIS::DATA_TYPE::EntityType& PartType);
76 virtual ~IsPartOf_PDU();
78 //************************************
79 // FullName: KDIS::PDU::IsPartOf_PDU::SetRelationshipRecord
80 // KDIS::PDU::IsPartOf_PDU::GetRelationshipRecord
81 // Description: Specifies the relationship of the part entity to its host
82 // entity. Parameter: const RelationshipRecord & RR
83 //************************************
84 void SetRelationshipRecord(const KDIS::DATA_TYPE::RelationshipRecord& RR);
85 const KDIS::DATA_TYPE::RelationshipRecord& GetRelationshipRecord() const;
86 KDIS::DATA_TYPE::RelationshipRecord& GetRelationshipRecord();
88 //************************************
89 // FullName: KDIS::PDU::IsPartOf_PDU::SetLocationOfPart
90 // KDIS::PDU::IsPartOf_PDU::GetLocationOfPart
91 // Description: Specifies the location of the part's centroid in the host
92 // entity's coordinate system.
93 // Represented by an Entity Coordinate Vector record.
94 // The syntax of the part's location data shall be specified by
95 // the Station Name enumeration. When the Station Name
96 // enumeration indicates On station (Range/Bearing or RNG/BRG),
97 // the three location data fields shall represent the Range (in
98 // meters), the Bearing (in radians), and the third field (the
99 // value zero). When the Station Name enumeration indicates On
100 // station (x, y, z), the three location data fields shall
101 // represent the x, y, and z coordinates of the part. When the
102 // Station Name enumeration is other than On station (RNG/BRG) or
103 // On station (x, y, z), the three fields of the Part Location
104 // record shall contain the value zero.
105 // Parameter: const Vector & LP
106 //************************************
107 void SetLocationOfPart(const KDIS::DATA_TYPE::Vector& LP);
108 const KDIS::DATA_TYPE::Vector& GetLocationOfPart() const;
109 KDIS::DATA_TYPE::Vector& GetLocationOfPart();
111 //************************************
112 // FullName: KDIS::PDU::IsPartOf_PDU::SetNamedLocationIdentifier
113 // KDIS::PDU::IsPartOf_PDU::GetNamedLocationIdentifier
114 // Description: Contaiins information about the discrete positional
115 // relationship of the part
116 // entity with respect to the its host entity.
117 // Parameter: const NamedLocationIdentifier & NLI
118 //************************************
119 void SetNamedLocationIdentifier(
120 const KDIS::DATA_TYPE::NamedLocationIdentifier& NLI);
121 const KDIS::DATA_TYPE::NamedLocationIdentifier& GetNamedLocationIdentifier()
122 const;
123 KDIS::DATA_TYPE::NamedLocationIdentifier& GetNamedLocationIdentifier();
125 //************************************
126 // FullName: KDIS::PDU::IsPartOf_PDU::SetPartType
127 // KDIS::PDU::IsPartOf_PDU::GetPartType
128 // Description: Identifies the part type.
129 // Parameter: const EntityType & PT
130 //************************************
131 void SetPartType(const KDIS::DATA_TYPE::EntityType& PT);
132 const KDIS::DATA_TYPE::EntityType& GetPartType() const;
133 KDIS::DATA_TYPE::EntityType& GetPartType();
135 //************************************
136 // FullName: KDIS::PDU::IsPartOf_PDU::GetAsString
137 // Description: Returns a string representation of the PDU.
138 //************************************
139 virtual KString GetAsString() const;
141 //************************************
142 // FullName: KDIS::PDU::IsPartOf_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);
149 //************************************
150 // FullName: KDIS::PDU::IsPartOf_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;
157 KBOOL operator==(const IsPartOf_PDU& Value) const;
158 KBOOL operator!=(const IsPartOf_PDU& Value) const;
161 } // END namespace PDU
162 } // END namespace KDIS