KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
EmissionSystem.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: EmissionSystem
32  created: 2008/010/19
33 
34  author: Karl Jones
35 
36  purpose: Contains information about a emission system
37  size: 160 bits / 20 octets min size
38 *********************************************************************/
39 
40 #pragma once
41 
42 #include "./DataTypeBase.h"
43 #include "./EmitterSystem.h"
44 #include "./Vector.h"
45 #include "./EmitterBeam.h"
46 #include <vector>
47 
48 namespace KDIS {
49 namespace DATA_TYPE {
50 
52 {
53 protected:
54 
56 
58 
60 
62 
64 
65  std::vector<EmitterBeam> m_vEmitterBeams;
66 
67 public:
68 
69  static const KUINT16 EMISSION_SYSTEM_SIZE = 20; // Min Size
70 
72 
73  EmissionSystem( KDataStream & stream )throw( KException );
74 
75  EmissionSystem( const EmitterSystem & ESR, const Vector & Location );
76 
77  virtual ~EmissionSystem();
78 
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;
85 
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;
94 
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();
105 
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();
117 
118  //************************************
119  // FullName: KDIS::DATA_TYPE::EmissionSystem::GetAsString
120  //!Description: Returns a string representation
121  //************************************
122  virtual KString GetAsString() const;
123 
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 ) throw( KException );
130 
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;
138 
139  KBOOL operator == ( const EmissionSystem & Value ) const;
140  KBOOL operator != ( const EmissionSystem & Value ) const;
141 };
142 
143 } // END namespace DATA_TYPES
144 } // END namespace KDIS
KUINT16 m_ui16Padding
Definition: EmissionSystem.h:59
Definition: EmitterBeam.h:53
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT8 m_ui8SystemDataLength
Definition: EmissionSystem.h:55
Definition: Vector.h:71
Vector m_Location
Definition: EmissionSystem.h:63
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
Definition: EmitterSystem.h:49
std::string KString
Definition: KDefines.h:116
unsigned char KUINT8
Definition: KDefines.h:99
std::vector< EmitterBeam > m_vEmitterBeams
Definition: EmissionSystem.h:65
KUINT8 m_ui8NumberOfBeams
Definition: EmissionSystem.h:57
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: EmissionSystem.h:51
EmitterSystem m_EmitterSystemRecord
Definition: EmissionSystem.h:61