KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DeadReckoningParameter.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: DeadReckoningParameter
32  created: 2008/09/18
33  author: Karl Jones
34 
35  purpose: Parameters for dead reckoning the position and orientation
36  of the entity.
37  size: 320 bits / 40 octets
38 *********************************************************************/
39 
40 #pragma once
41 
42 #include "./DataTypeBase.h"
43 #include "./Vector.h"
44 
45 namespace KDIS {
46 namespace DATA_TYPE {
47 
49 {
50 protected:
51 
53 
54  KOCTET m_OtherParams[15]; // Undefined
55 
57 
59 
60 public:
61 
62  static const KUINT16 DEAD_RECKONING_PARAMETER_SIZE = 40;
63 
65 
66  DeadReckoningParameter( KDataStream & stream ) throw( KException );
67 
69  const Vector & AngularVelocity );
70 
71  virtual ~DeadReckoningParameter();
72 
73  //************************************
74  // FullName: KDIS::DATA_TYPE::DeadReckoningParameter::SetDeadReckoningAlgorithm
75  // KDIS::DATA_TYPE::DeadReckoningParameter::GetDeadReckoningAlgorithm
76  //!Description: Dead Reckoning Algorithm
77  // Parameter: DeadReckoningAlgorithm DRA
78  //************************************
79  void SetDeadReckoningAlgorithm( KDIS::DATA_TYPE::ENUMS::DeadReckoningAlgorithm DRA );
80  KDIS::DATA_TYPE::ENUMS::DeadReckoningAlgorithm GetDeadReckoningAlgorithm() const;
81 
82  //************************************
83  // FullName: KDIS::DATA_TYPE::DeadReckoningParameter::SetLinearAcceleration
84  // KDIS::DATA_TYPE::DeadReckoningParameter::GetLinearAcceleration
85  //!Description: Linear Acceleration in m/s.
86  // Parameter: const Vector & LA
87  //************************************
88  void SetLinearAcceleration( const Vector & LA );
89  const Vector & GetLinearAcceleration() const;
90  Vector & GetLinearAcceleration();
91 
92  //************************************
93  // FullName: KDIS::DATA_TYPE::DeadReckoningParameter::SetAngularVelocity
94  // KDIS::DATA_TYPE::DeadReckoningParameter::GetAngularVelocity
95  //!Description: Angular Velocity
96  // Parameter: const EulerAngles & AV
97  //************************************
98  void SetAngularVelocity( const Vector & AV );
99  const Vector & GetAngularVelocity() const;
100  Vector & GetAngularVelocity();
101 
102  //************************************
103  // FullName: KDIS::DATA_TYPE::DeadReckoningParameter::SetQuatAxis
104  // KDIS::DATA_TYPE::DeadReckoningParameter::GetQuatAxis
105  //!Description: Updated DIS - Geometric Interpretation of Orientation Dead Reckoning / Quaternion axis
106  // Parameter: const EulerAngles & AV
107  //************************************
108  void SetQuatAxis( const Vector & QA );
109  const Vector GetQuatAxis() const;
110  Vector GetQuatAxis();
111 
112  //************************************
113  // FullName: KDIS::DATA_TYPE::DeadReckoningParameter::GetAsString
114  //!Description: Returns a string representation
115  //************************************
116  virtual KString GetAsString() const;
117 
118  //************************************
119  // FullName: KDIS::DATA_TYPE::DeadReckoningParameter::Decode
120  //!Description: Convert From Network Data.
121  // Parameter: KDataStream & stream
122  //************************************
123  virtual void Decode( KDataStream & stream ) throw( KException );
124 
125  //************************************
126  // FullName: KDIS::DATA_TYPE::DeadReckoningParameter::Encode
127  //!Description: Convert To Network Data.
128  // Parameter: KDataStream & stream
129  //************************************
130  virtual KDataStream Encode() const;
131  virtual void Encode( KDataStream & stream ) const;
132 
133  KBOOL operator == ( const DeadReckoningParameter & Value ) const;
134  KBOOL operator != ( const DeadReckoningParameter & Value ) const;
135 };
136 
137 } // END namespace DATA_TYPES
138 } // END namespace KDIS
Vector m_LinearAcceleration
Definition: DeadReckoningParameter.h:56
unsigned short int KUINT16
Definition: KDefines.h:101
Definition: Vector.h:71
Vector m_AngularVelocity
Definition: DeadReckoningParameter.h:58
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
unsigned char KUINT8
Definition: KDefines.h:99
Definition: DeadReckoningParameter.h:48
char KOCTET
Definition: KDefines.h:108
DeadReckoningAlgorithm
Definition: EnumEntityInfoInteraction.h:841
#define KDIS_EXPORT
Definition: KDefines.h:82
KUINT8 m_ui8DeadRecknoningAlgorithm
Definition: DeadReckoningParameter.h:52