KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SphereRecord2.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: SphereRecord2
32  created: 18:08:2009
33  author: Karl Jones
34 
35  purpose: A geometry record representing a moving sphere.
36  size: 512 bits / 64 octets
37 *********************************************************************/
38 
39 #pragma once
40 
41 #include "./SphereRecord1.h"
42 #include "./Vector.h"
43 
44 namespace KDIS {
45 namespace DATA_TYPE {
46 
48 {
49 protected:
50 
52 
54 
56 
57 public:
58 
59  static const KUINT16 SPHERE_RECORD_2_SIZE = 64;
60 
61  SphereRecord2();
62 
63  SphereRecord2( KDataStream & stream ) throw( KException );
64 
65  SphereRecord2( KUINT8 Index, const WorldCoordinates & CentroidLocation, KFLOAT32 Radius,
66  KFLOAT32 DDT, const Vector & Velocity, const Vector & AngularVelocity );
67 
68  virtual ~SphereRecord2();
69 
70  //************************************
71  // FullName: KDIS::DATA_TYPE::SphereRecord2::SetDOverDt
72  // KDIS::DATA_TYPE::SphereRecord2::GetDOverDt
73  //!Description: d(Radius)/dt.
74  // Parameter: KFLOAT32 DDT, void
75  //************************************
76  void SetDOverDt( KFLOAT32 DDT );
77  KFLOAT32 GetDOverDt() const;
78 
79  //************************************
80  // FullName: KDIS::DATA_TYPE::SphereRecord2::SetVelocity
81  // KDIS::DATA_TYPE::SphereRecord2::GetVelocity
82  //!Description: Specifies the velocity of the sphere.
83  //! Represented as a Linear Velocity Vector.
84  // Parameter: const Vector & V, void
85  //************************************
86  void SetVelocity( const Vector & V );
87  const Vector & GetVelocity() const;
88  Vector & GetVelocity();
89 
90  //************************************
91  // FullName: KDIS::DATA_TYPE::SphereRecord2::SetAngularVelocity
92  // KDIS::DATA_TYPE::SphereRecord2::GetAngularVelocity
93  //!Description: Specifies the angular velocity of the sphere.
94  //! Represented as a Linear Velocity Vector.
95  // Parameter: const Vector & V, void
96  //************************************
97  void SetAngularVelocity( const Vector & V );
98  const Vector & GetAngularVelocity() const;
99  Vector & GetAngularVelocity();
100 
101  //************************************
102  // FullName: KDIS::DATA_TYPE::SphereRecord2::GetAsString
103  //!Description: Returns a string representation
104  //************************************
105  virtual KString GetAsString() const;
106 
107  //************************************
108  // FullName: KDIS::DATA_TYPE::SphereRecord2::Decode
109  //!Description: Convert From Network Data.
110  // Parameter: KDataStream & stream
111  //************************************
112  virtual void Decode( KDataStream & stream ) throw( KException );
113 
114  //************************************
115  // FullName: KDIS::DATA_TYPE::SphereRecord2::Encode
116  //!Description: Convert To Network Data.
117  // Parameter: KDataStream & stream
118  //************************************
119  virtual KDataStream Encode() const;
120  virtual void Encode( KDataStream & stream ) const;
121 
122  KBOOL operator == ( const SphereRecord2 & Value )const;
123  KBOOL operator != ( const SphereRecord2 & Value )const;
124 };
125 
126 } // END namespace DATA_TYPES
127 } // END namespace KDIS
Definition: SphereRecord2.h:47
KFLOAT32 m_f32ddt
Definition: SphereRecord2.h:51
unsigned short int KUINT16
Definition: KDefines.h:101
float KFLOAT32
Definition: KDefines.h:113
Definition: SphereRecord1.h:46
Definition: Vector.h:71
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: WorldCoordinates.h:52
bool KBOOL
Definition: KDefines.h:119
Vector m_Velocity
Definition: SphereRecord2.h:53
std::string KString
Definition: KDefines.h:116
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82
Vector m_AngularVelocity
Definition: SphereRecord2.h:55