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