KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
LinearSegmentParameter.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: LinearSegmentParameter
32  created: 15/03/2010
33  author: Karl Jones
34 
35  purpose: The specification of an individual segment of a linear
36  segment synthetic environment object.
37  size: 448 bits / 56 octets
38 *********************************************************************/
39 
40 #pragma once
41 
42 #include "./DataTypeBase.h"
44 #include "./WorldCoordinates.h"
45 #include "./EulerAngles.h"
46 
47 namespace KDIS {
48 namespace DATA_TYPE {
49 
51 {
52 protected:
53 
55 
56  union
57  {
58  struct
59  {
60  KUINT8 m_ui8LocBit : 1;
61  KUINT8 m_ui8OriBit : 1;
62  KUINT8 m_ui8Unused : 6;
63  };
64 
66  } m_ModificationUnion;
67 
69 
71 
73 
75 
77 
79 
81 
83 
84 public:
85 
86  static const KUINT16 LINEAR_SEGMENT_PARAMETER_SIZE = 56;
87 
89 
90  LinearSegmentParameter( KDataStream & stream )throw( KException );
91 
93  const WorldCoordinates & Loc, const EulerAngles & Ori,
94  KUINT16 Length, KUINT16 Width, KUINT16 Height, KUINT16 Depth );
95 
96  virtual ~LinearSegmentParameter();
97 
98  //************************************
99  // FullName: KDIS::DATA_TYPE::LinearSegmentParameter::SetLinearSegmentParameterType
100  // KDIS::DATA_TYPE::LinearSegmentParameter::GetLinearSegmentParameterType
101  //!Description: Identifies the individual segment of the linear segment.
102  // Parameter: LinearSegmentParameterType T, void
103  //************************************
104  void SetSegmentNumber( KUINT8 N );
105  KUINT8 GetSegmentNumber() const;
106 
107  //************************************
108  // FullName: KDIS::DATA_TYPE::LinearSegmentParameter::SetModification
109  // KDIS::DATA_TYPE::LinearSegmentParameter::GetModification
110  // KDIS::DATA_TYPE::LinearSegmentParameter::SetModificationLocation
111  // KDIS::DATA_TYPE::LinearSegmentParameter::IsModificationLocation
112  // KDIS::DATA_TYPE::LinearSegmentParameter::SetModificationOrientation
113  // KDIS::DATA_TYPE::LinearSegmentParameter::IsModificationOrientation
114  //!Description: Identifies whether a modification has been made to the segment's
115  //! location or orientation. Modification is represented by a single 8 bit unsigned int, where
116  //! bit 0 is the location modified flag and bit 1 is the orientation flag. A value of 1(true)
117  //! indicates the field has been changed.
118  //! You can also set these values using SetModificationLocation and SetModificationOrientation.
119  //! All values are set to false(0) by default.
120  // Parameter: KUINT8 M, KBOOL M = true
121  //************************************
122  void SetModification( KUINT8 M );
123  KUINT8 GetModification() const;
124  void SetModificationLocation( KBOOL M = true );
125  KBOOL IsModificationLocation() const;
126  void SetModificationOrientation( KBOOL M = true );
127  KBOOL IsModificationOrientation() const;
128 
129  //************************************
130  // FullName: KDIS::DATA_TYPE::LinearSegmentParameter::SetLinearObjectAppearance
131  // KDIS::DATA_TYPE::LinearSegmentParameter::GetLinearObjectAppearance
132  //!Description: The dynamic appearance attributes of the segment.
133  // Parameter: const LinearObjectAppearance & L , void
134  //************************************
135  void SetLinearObjectAppearance( const LinearObjectAppearance & L );
136  const LinearObjectAppearance & GetLinearObjectAppearance() const;
137  LinearObjectAppearance & GetLinearObjectAppearance();
138 
139  //************************************
140  // FullName: KDIS::DATA_TYPE::LinearSegmentParameter::SetLocation
141  // KDIS::DATA_TYPE::LinearSegmentParameter::GetLocation
142  //!Description: The location of the linear segment.
143  // Parameter: const WorldCoordinates & L , void
144  //************************************
145  void SetLocation( const WorldCoordinates & L );
146  const WorldCoordinates & GetLocation() const;
147  WorldCoordinates & GetLocation();
148 
149  //************************************
150  // FullName: KDIS::DATA_TYPE::LinearSegmentParameter::SetLocation
151  // KDIS::DATA_TYPE::LinearSegmentParameter::GetLocation
152  //!Description: The orientation of the linear segment about the segment location.
153  // Parameter: const EulerAngles & O , void
154  //************************************
155  void SetOrientation( const EulerAngles & O );
156  const EulerAngles & GetOrientation() const;
157  EulerAngles & GetOrientation();
158 
159  //************************************
160  // FullName: KDIS::DATA_TYPE::LinearSegmentParameter::SetLength
161  // KDIS::DATA_TYPE::LinearSegmentParameter::GetLength
162  //!Description: The length of the linear segment, in meters, extending in the positive X direction.
163  // Parameter: KUINT16 L , void
164  //************************************
165  void SetLength( KUINT16 L );
166  KUINT16 GetLength() const;
167 
168  //************************************
169  // FullName: KDIS::DATA_TYPE::LinearSegmentParameter::SetWidth
170  // KDIS::DATA_TYPE::LinearSegmentParameter::GetWidth
171  //!Description: The total width of the linear segment, in meters. One-half of the width shall extend
172  //! in the positive Y direction, and one-half of the width shall extend
173  //! in the negative Y direction.
174  // Parameter: KUINT16 W , void
175  //************************************
176  void SetWidth( KUINT16 W );
177  KUINT16 GetWidth() const;
178 
179  //************************************
180  // FullName: KDIS::DATA_TYPE::LinearSegmentParameter::SetHeight
181  // KDIS::DATA_TYPE::LinearSegmentParameter::GetHeight
182  //!Description: The height of the linear segment, in meters, above ground level.
183  // Parameter: KUINT16 H , void
184  //************************************
185  void SetHeight( KUINT16 H );
186  KUINT16 GetHeight() const;
187 
188  //************************************
189  // FullName: KDIS::DATA_TYPE::LinearSegmentParameter::SetDepth
190  // KDIS::DATA_TYPE::LinearSegmentParameter::GetDepth
191  //!Description: The depth of the linear segment, in meters, below ground level.
192  // Parameter: KUINT16 D , void
193  //************************************
194  void SetDepth( KUINT16 D );
195  KUINT16 GetDepth() const;
196 
197  //************************************
198  // FullName: KDIS::DATA_TYPE::LinearSegmentParameter::GetAsString
199  //!Description: Returns a string representation.
200  //************************************
201  virtual KString GetAsString() const;
202 
203  //************************************
204  // FullName: KDIS::DATA_TYPE::LinearSegmentParameter::Decode
205  //!Description: Convert From Network Data.
206  // Parameter: KDataStream & stream
207  //************************************
208  virtual void Decode( KDataStream & stream ) throw( KException );
209 
210  //************************************
211  // FullName: KDIS::DATA_TYPE::LinearSegmentParameter::Encode
212  //!Description: Convert To Network Data.
213  // Parameter: KDataStream & stream
214  //************************************
215  virtual KDataStream Encode() const;
216  virtual void Encode( KDataStream & stream ) const;
217 
218  KBOOL operator == ( const LinearSegmentParameter & Value ) const;
219  KBOOL operator != ( const LinearSegmentParameter & Value ) const;
220 };
221 
222 } // END namespace DATA_TYPES
223 } // END namespace KDIS
KUINT8 m_ui8SegNum
Definition: LinearSegmentParameter.h:54
Definition: LinearObjectAppearance.h:47
unsigned int KUINT32
Definition: KDefines.h:103
KUINT8 m_ui8Modifications
Definition: LinearSegmentParameter.h:65
KUINT16 m_ui16Depth
Definition: LinearSegmentParameter.h:80
KUINT32 m_ui32Padding
Definition: LinearSegmentParameter.h:82
KUINT16 m_ui16Height
Definition: LinearSegmentParameter.h:78
Definition: LinearSegmentParameter.h:50
Definition: EnumBurstDescriptor.h:215
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT16 m_ui16Width
Definition: LinearSegmentParameter.h:76
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
Definition: WorldCoordinates.h:52
bool KBOOL
Definition: KDefines.h:119
Definition: EulerAngles.h:46
KUINT16 m_ui16Length
Definition: LinearSegmentParameter.h:74
std::string KString
Definition: KDefines.h:116
LinearObjectAppearance m_ObjApr
Definition: LinearSegmentParameter.h:68
unsigned char KUINT8
Definition: KDefines.h:99
EulerAngles m_Ori
Definition: LinearSegmentParameter.h:72
#define KDIS_EXPORT
Definition: KDefines.h:82
WorldCoordinates m_Loc
Definition: LinearSegmentParameter.h:70