1 /*********************************************************************
2 Copyright 2013 Karl Jones
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
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
30 /********************************************************************
36 purpose: Contains information about a emission system
37 size: 160 bits / 20 octets min size
38 *********************************************************************/
42 #include "./DataTypeBase.h"
43 #include "./EmitterSystem.h"
45 #include "./EmitterBeam.h"
51 class KDIS_EXPORT EmissionSystem
: public DataTypeBase
55 KUINT8 m_ui8SystemDataLength
;
57 KUINT8 m_ui8NumberOfBeams
;
59 KUINT16 m_ui16Padding
;
61 EmitterSystem m_EmitterSystemRecord
;
65 std::vector
<EmitterBeam
> m_vEmitterBeams
;
69 static const KUINT16 EMISSION_SYSTEM_SIZE
= 20; // Min Size
73 EmissionSystem( KDataStream
& stream
);
75 EmissionSystem( const EmitterSystem
& ESR
, const Vector
& Location
);
77 virtual ~EmissionSystem();
79 //************************************
80 // FullName: KDIS::DATA_TYPE::EmissionSystem::GetSystemDataLength
81 // Description: Length of the emission system in 32 bit words.
82 // E.G 1 = 32 bits / 4 octets. Calculated automatically.
83 //************************************
84 KUINT8
GetSystemDataLength() const;
86 //************************************
87 // FullName: KDIS::DATA_TYPE::EmissionSystem::SetEmitterSystemRecord
88 // KDIS::DATA_TYPE::EmissionSystem::GetEmitterSystemRecord
89 // Description: Contains information about a particular emitter system
90 // Parameter: const EmitterSystem & ESR
91 //************************************
92 void SetEmitterSystemRecord( const EmitterSystem
& ESR
);
93 EmitterSystem
GetEmitterSystemRecord() const;
95 //************************************
96 // FullName: KDIS::DATA_TYPE::EmissionSystem::SetLocation
97 // KDIS::DATA_TYPE::EmissionSystem::GetLocation
98 // Description: Location of antenna beam source with respect to emitting
99 // entity coordinate system. Represented as Entity Coordinate Vector.
100 // Parameter: const Vector & L
101 //************************************
102 void SetLocation( const Vector
& L
);
103 const Vector
& GetLocation() const;
104 Vector
& GetLocation();
106 //************************************
107 // FullName: KDIS::DATA_TYPE::EmissionSystem::AddEmitterBeam
108 // KDIS::DATA_TYPE::EmissionSystem::SetEmitterBeams
109 // KDIS::DATA_TYPE::EmissionSystem::GetEmitterBeams
110 // Description: The emitter beans attached to this system.
111 // Parameter: const EmitterBeam & EB, const vector<EmitterBeam> & Beams
112 //************************************
113 void AddEmitterBeam( const EmitterBeam
& EB
);
114 void SetEmitterBeams( const std::vector
<EmitterBeam
> & Beams
);
115 const std::vector
<EmitterBeam
> & GetEmitterBeams() const;
116 void ClearEmitterBeams();
118 //************************************
119 // FullName: KDIS::DATA_TYPE::EmissionSystem::GetAsString
120 // Description: Returns a string representation
121 //************************************
122 virtual KString
GetAsString() const;
124 //************************************
125 // FullName: KDIS::DATA_TYPE::EmissionSystem::Decode
126 // Description: Convert From Network Data.
127 // Parameter: KDataStream & stream
128 //************************************
129 virtual void Decode( KDataStream
& stream
) ;
131 //************************************
132 // FullName: KDIS::DATA_TYPE::EmissionSystem::Encode
133 // Description: Convert To Network Data.
134 // Parameter: KDataStream & stream
135 //************************************
136 virtual KDataStream
Encode() const;
137 virtual void Encode( KDataStream
& stream
) const;
139 KBOOL
operator == ( const EmissionSystem
& Value
) const;
140 KBOOL
operator != ( const EmissionSystem
& Value
) const;
143 } // END namespace DATA_TYPES
144 } // END namespace KDIS