KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ExplosionDescriptor.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: ExplosionDescriptor
32  created: 22/04/2013
33  author: Karl Jones
34 
35  purpose: Represents the explosion of a non-munition.
36  The exploding object may be an entity for which an Entity State PDU
37  has been issued or may be an articulated or attached part of an entity.
38  If it is necessary to provide more details of the characteristics ofthe explosion,
39  one or more VP records may be developed and included in the VP record section of
40  the Detonation PDU to convey such information.
41 
42  NOTE: Any munition that explodes, whether for its intended purpose or not, is
43  represented by the Munition Descriptor record and not an Explosion Description record.
44 
45  This descriptor is applicable to the Detonation PDU.
46 
47  size: 128 bits / 16 octets
48 *********************************************************************/
49 
50 #pragma once
51 
52 #include "./Descriptor.h"
53 
54 namespace KDIS {
55 namespace DATA_TYPE {
56 
58 {
59 protected:
60 
62 
64 
66 
67 public:
68 
70 
71  ExplosionDescriptor( KDataStream & stream )throw( KException );
72 
74 
75  virtual ~ExplosionDescriptor();
76 
77  //************************************
78  // FullName: KDIS::DATA_TYPE::ExplosionDescriptor::SetExplosiveMaterial
79  // KDIS::DATA_TYPE::ExplosionDescriptor::GetExplosiveMaterial
80  //!Description: Indicates the material that exploded.
81  // Parameter: ExplosiveMaterial EM
82  //************************************
83  void SetExplosiveMaterial( KDIS::DATA_TYPE::ENUMS::ExplosiveMaterial EM );
84  KDIS::DATA_TYPE::ENUMS::ExplosiveMaterial GetExplosiveMaterial() const;
85 
86  //************************************
87  // FullName: KDIS::DATA_TYPE::ExplosionDescriptor::SetExplosiveForce
88  // KDIS::DATA_TYPE::ExplosionDescriptor::GetExplosiveForce
89  //!Description: The explosive force expressed as the equivalent kilograms
90  //! of TNT (4.184 x 106 Joules per kilogram).
91  // Parameter: ExplosiveMaterial EM
92  //************************************
93  void SetExplosiveForce( KFLOAT32 F );
94  KFLOAT32 GetExplosiveForce() const;
95 
96  //************************************
97  // FullName: KDIS::DATA_TYPE::ExplosionDescriptor::GetAsString
98  //!Description: Returns a string representation.
99  //************************************
100  virtual KString GetAsString() const;
101 
102  //************************************
103  // FullName: KDIS::DATA_TYPE::ExplosionDescriptor::Decode
104  //!Description: Convert From Network Data.
105  // Parameter: KDataStream & stream
106  //************************************
107  virtual void Decode( KDataStream & stream ) throw( KException );
108 
109  //************************************
110  // FullName: KDIS::DATA_TYPE::ExplosionDescriptor::Encode
111  //!Description: Convert To Network Data.
112  // Parameter: KDataStream & stream
113  //************************************
114  virtual KDataStream Encode() const;
115  virtual void Encode( KDataStream & stream ) const;
116 
117  KBOOL operator == ( const ExplosionDescriptor & Value ) const;
118  KBOOL operator != ( const ExplosionDescriptor & Value ) const;
119 };
120 
121 } // END namespace DATA_TYPES
122 } // END namespace KDIS
Definition: EntityType.h:46
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT16 m_ui16ExplMat
Definition: ExplosionDescriptor.h:61
ExplosiveMaterial
Definition: EnumBurstDescriptor.h:301
float KFLOAT32
Definition: KDefines.h:113
Definition: KDefines.h:182
Definition: Descriptor.h:70
Definition: KDataStream.h:48
bool KBOOL
Definition: KDefines.h:119
KFLOAT32 m_f32ExplForce
Definition: ExplosionDescriptor.h:65
std::string KString
Definition: KDefines.h:116
#define KDIS_EXPORT
Definition: KDefines.h:82
KUINT16 m_ui16Padding
Definition: ExplosionDescriptor.h:63
Definition: ExplosionDescriptor.h:57