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 /********************************************************************
31 class: PointObjectAppearance
35 purpose: Represents a point objects appearance.
36 size: 48 Bits / 6 Octet
37 *********************************************************************/
41 #include "./ObjectAppearance.h"
46 class KDIS_EXPORT PointObjectAppearance
: public ObjectAppearance
54 KUINT32 m_ui32Breach
: 2;
55 KUINT32 m_ui32Unused
: 30;
56 } m_LogCribAbatisVehicleDefiladeInf
;
60 KUINT32 m_ui32Opacity
: 8;
61 KUINT32 m_ui32Size
: 8;
62 KUINT32 m_ui32Height
: 8;
63 KUINT32 m_ui32NumBurst
: 6;
64 KUINT32 m_ui32Chemical
: 2;
66 } m_AirBurstGroundBurst
;
70 KUINT32 m_ui32Size
: 8;
71 KUINT32 m_ui32Unused
: 24;
77 KUINT32 m_ui32NumSeg
: 8;
78 KUINT32 m_ui32Unused
: 24;
81 KUINT32 m_ui32SpecificAppearance
;
82 } m_SpecificAppearanceUnion
;
86 static const KUINT16 POINT_OBJECT_APPEARANCE_SIZE
= 6;
88 PointObjectAppearance();
90 PointObjectAppearance( KDataStream
& stream
) ;
92 virtual ~PointObjectAppearance();
94 /************************************************************************/
95 /* The following appearance values are only for points of the type: */
96 /* Log crib, Abatis, Vehicle defilade, and Infantry fighting position */
97 /************************************************************************/
99 //************************************
100 // FullName: KDIS::DATA_TYPE::PointObjectAppearance::SetBreach
101 // KDIS::DATA_TYPE::PointObjectAppearance::GetBreach
102 // Description: Describes the breached appearance of the object.
103 // Parameter: Breach2bit B
104 //************************************
105 void SetBreach( KDIS::DATA_TYPE::ENUMS::Breach2bit B
);
106 KDIS::DATA_TYPE::ENUMS::Breach2bit
GetBreach() const;
108 /************************************************************************/
109 /* The following appearance values are only for points of the type: */
110 /* Air burst, Ground burst */
111 /************************************************************************/
113 //************************************
114 // FullName: KDIS::DATA_TYPE::PointObjectAppearance::SetOpacity
115 // KDIS::DATA_TYPE::PointObjectAppearance::GetOpacity
116 // Description: The percent opacity of the smoke, ranging from 0% opacity to 100%.
117 // Acceptable values are 0 - 100 else throws INVALID_DATA exception.
118 // Parameter: KUINT8 O
119 //************************************
120 void SetOpacity( KUINT8 O
) ;
121 KUINT8
GetOpacity() const;
123 //************************************
124 // FullName: KDIS::DATA_TYPE::PointObjectAppearance::SetBurstSize
125 // KDIS::DATA_TYPE::PointObjectAppearance::GetBurstSize
126 // Description: Indicates the radius of the cylinder which approximates
127 // an individual burst. The Point Object Location field
128 // indicates the center of the bottom of the cylinder
129 // for individual bursts. For multiple bursts, the center
130 // bottom of each cylinder is calculated based on the model
131 // used to represent the multiple bursts.
132 // Parameter: KUINT8 S
133 //************************************
134 void SetBurstSize( KUINT8 S
);
135 KUINT8
GetBurstSize() const;
137 //************************************
138 // FullName: KDIS::DATA_TYPE::PointObjectAppearance::SetHeight
139 // KDIS::DATA_TYPE::PointObjectAppearance::GetHeight
140 // Description: The height of the cylinder which approximates an individual burst.
141 // The Point Object Location field indicates the center of the bottom
142 // of the cylinder for individual bursts. For multiple bursts,
143 // the center bottom of each cylinder is calculated based on the
144 // model used to represent the multiple bursts.
145 // Parameter: KUINT8 H
146 //************************************
147 void SetHeight( KUINT8 H
);
148 KUINT8
GetHeight() const;
150 //************************************
151 // FullName: KDIS::DATA_TYPE::PointObjectAppearance::SetNumBursts
152 // KDIS::DATA_TYPE::PointObjectAppearance::GetNumBursts
153 // Description: Number of bursts in the instance of tactical smoke.
154 // Acceptable values are 0 - 63.
155 // Parameter: KUINT8 H
156 //************************************
157 void SetNumBursts( KUINT8 N
);
158 KUINT8
GetNumBursts() const;
160 //************************************
161 // FullName: KDIS::DATA_TYPE::PointObjectAppearance::SetChemical
162 // KDIS::DATA_TYPE::PointObjectAppearance::GetChemical
163 // Description: The chemical content of the smoke.
164 // Parameter: Chemical C
165 //************************************
166 void SetChemical( KDIS::DATA_TYPE::ENUMS::Chemical C
);
167 KDIS::DATA_TYPE::ENUMS::Chemical
GetChemical() const;
169 /************************************************************************/
170 /* The following appearance values are only for points of the type: */
172 /************************************************************************/
174 //************************************
175 // FullName: KDIS::DATA_TYPE::PointObjectAppearance::SetCraterSize
176 // KDIS::DATA_TYPE::PointObjectAppearance::GetCraterSize
177 // Description: The diameter of the crater, where the center of the
178 // crater is at the Point Object Location.
179 // Parameter: KUINT8 S
180 //************************************
181 void SetCraterSize( KUINT8 S
);
182 KUINT8
GetCraterSize() const;
184 /************************************************************************/
185 /* The following appearance values are only for points of the type: */
187 /************************************************************************/
189 //************************************
190 // FullName: KDIS::DATA_TYPE::PointObjectAppearance::SetNumSegments
191 // KDIS::DATA_TYPE::PointObjectAppearance::GetNumSegments
192 // Description: The number of segments composing the ribbon bridge.
193 // Parameter: KUINT8 N
194 //************************************
195 void SetNumSegments( KUINT8 N
);
196 KUINT8
GetNumSegments() const;
198 //************************************
199 // FullName: KDIS::DATA_TYPE::PointObjectAppearance::GetAsString
200 // Description: Returns a string representation of the appearance
201 // Parameter: const EntityType & EntType
202 //************************************
203 virtual KString
GetAsString() const;
205 //************************************
206 // FullName: KDIS::DATA_TYPE::PointObjectAppearance::Decode
207 // Description: Convert From Network Data.
208 // Parameter: KDataStream & stream
209 //************************************
210 virtual void Decode( KDataStream
& stream
) ;
212 //************************************
213 // FullName: KDIS::DATA_TYPE::PointObjectAppearance::Encode
214 // Description: Convert To Network Data.
215 // Parameter: KDataStream & stream
216 //************************************
217 virtual KDataStream
Encode() const;
218 virtual void Encode( KDataStream
& stream
) const;
220 KBOOL
operator == ( const PointObjectAppearance
& Value
) const;
221 KBOOL
operator != ( const PointObjectAppearance
& Value
) const;
224 } // END namespace DATA_TYPES
225 } // END namespace KDIS