KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IsPartOf_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: IsPartOf_PDU
32  DIS: (6) 1278.1A - 1998
33  created: 26:06:2009
34  author: Karl Jones
35 
36  purpose: Communicates the joining of two or more simulation entities to form a
37  single entity with constituent parts.
38  size: 416 bits / 52 octets
39 *********************************************************************/
40 
41 #pragma once
42 
43 #include "./../Simulation_Management/Simulation_Management_Header.h"
44 #include "./../../DataTypes/EntityIdentifier.h"
45 #include "./../../DataTypes/RelationshipRecord.h"
46 #include "./../../DataTypes/Vector.h"
47 #include "./../../DataTypes/NamedLocationIdentifier.h"
48 #include "./../../DataTypes/EntityType.h"
49 
50 namespace KDIS {
51 namespace PDU {
52 
54 {
55 protected:
56 
58 
60 
62 
64 
65 public:
66 
67  static const KUINT16 IS_PART_OF_PDU_SIZE = 52;
68 
69  IsPartOf_PDU();
70 
71  IsPartOf_PDU( KDataStream & stream ) throw( KException );
72 
73  IsPartOf_PDU( const Header & H, KDataStream & stream ) throw( KException );
74 
77 
78  virtual ~IsPartOf_PDU();
79 
80  //************************************
81  // FullName: KDIS::PDU::IsPartOf_PDU::SetRelationshipRecord
82  // KDIS::PDU::IsPartOf_PDU::GetRelationshipRecord
83  //!Description: Specifies the relationship of the part entity to its host entity.
84  // Parameter: const RelationshipRecord & RR
85  //************************************
86  void SetRelationshipRecord( const KDIS::DATA_TYPE::RelationshipRecord & RR );
87  const KDIS::DATA_TYPE::RelationshipRecord & GetRelationshipRecord() const;
88  KDIS::DATA_TYPE::RelationshipRecord & GetRelationshipRecord();
89 
90  //************************************
91  // FullName: KDIS::PDU::IsPartOf_PDU::SetLocationOfPart
92  // KDIS::PDU::IsPartOf_PDU::GetLocationOfPart
93  //!Description: Specifies the location of the part�s centroid in the host entity�s coordinate system.
94  //! Represented by an Entity Coordinate Vector record.
95  //! The syntax of the part�s location data shall be specified by the Station Name enumeration. When the
96  //! Station Name enumeration indicates On station (Range/Bearing or RNG/BRG), the three location data fields shall represent the Range (in meters),
97  //! the Bearing (in radians), and the third field (the value zero). When the Station Name enumeration indicates On station
98  //! (x, y, z), the three location data fields shall represent the x, y, and z coordinates of the part. When the
99  //! Station Name enumeration is other than On station (RNG/BRG) or On station (x, y, z), the three
100  //! fields of the Part Location record shall contain the value zero.
101  // Parameter: const Vector & LP
102  //************************************
103  void SetLocationOfPart( const KDIS::DATA_TYPE::Vector & LP );
104  const KDIS::DATA_TYPE::Vector & GetLocationOfPart() const;
105  KDIS::DATA_TYPE::Vector & GetLocationOfPart();
106 
107  //************************************
108  // FullName: KDIS::PDU::IsPartOf_PDU::SetNamedLocationIdentifier
109  // KDIS::PDU::IsPartOf_PDU::GetNamedLocationIdentifier
110  //!Description: Contaiins information about the discrete positional relationship of the part
111  //! entity with respect to the its host entity.
112  // Parameter: const NamedLocationIdentifier & NLI
113  //************************************
114  void SetNamedLocationIdentifier( const KDIS::DATA_TYPE::NamedLocationIdentifier & NLI );
115  const KDIS::DATA_TYPE::NamedLocationIdentifier & GetNamedLocationIdentifier() const;
116  KDIS::DATA_TYPE::NamedLocationIdentifier & GetNamedLocationIdentifier();
117 
118  //************************************
119  // FullName: KDIS::PDU::IsPartOf_PDU::SetPartType
120  // KDIS::PDU::IsPartOf_PDU::GetPartType
121  //!Description: Identifies the part type.
122  // Parameter: const EntityType & PT
123  //************************************
124  void SetPartType( const KDIS::DATA_TYPE::EntityType & PT );
125  const KDIS::DATA_TYPE::EntityType & GetPartType() const;
126  KDIS::DATA_TYPE::EntityType & GetPartType();
127 
128  //************************************
129  // FullName: KDIS::PDU::IsPartOf_PDU::GetAsString
130  //!Description: Returns a string representation of the PDU.
131  //************************************
132  virtual KString GetAsString() const;
133 
134  //************************************
135  // FullName: KDIS::PDU::IsPartOf_PDU::Decode
136  //!Description: Convert From Network Data.
137  // Parameter: KDataStream & stream
138  // Parameter: bool ignoreHeader = false - Decode the header from the stream?
139  //************************************
140  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
141 
142  //************************************
143  // FullName: KDIS::PDU::IsPartOf_PDU::Encode
144  //!Description: Convert To Network Data.
145  // Parameter: KDataStream & stream
146  //************************************
147  virtual KDataStream Encode() const;
148  virtual void Encode( KDataStream & stream ) const;
149 
150  KBOOL operator == ( const IsPartOf_PDU & Value ) const;
151  KBOOL operator != ( const IsPartOf_PDU & Value ) const;
152 };
153 
154 } // END namespace PDU
155 } // END namespace KDIS
Definition: Simulation_Management_Header.h:48
Definition: EntityType.h:46
unsigned short int KUINT16
Definition: KDefines.h:101
KDIS::DATA_TYPE::EntityType m_PrtTyp
Definition: IsPartOf_PDU.h:63
KDIS::DATA_TYPE::NamedLocationIdentifier m_NmLocID
Definition: IsPartOf_PDU.h:61
Definition: Vector.h:71
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: IsPartOf_PDU.h:53
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
Definition: NamedLocationIdentifier.h:47
Definition: RelationshipRecord.h:46
Definition: Header7.h:142
#define KDIS_EXPORT
Definition: KDefines.h:82
KDIS::DATA_TYPE::RelationshipRecord m_RelRec
Definition: IsPartOf_PDU.h:57
KDIS::DATA_TYPE::Vector m_LocPrt
Definition: IsPartOf_PDU.h:59