Panda3D
|
00001 // Filename: pointerEvent.I 00002 // Created by: jyelon (20Sep2007) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: PointerEvent::Default Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE PointerEvent:: 00022 PointerEvent() : 00023 _in_window(false), 00024 _xpos(0), 00025 _ypos(0), 00026 _dx(0), 00027 _dy(0), 00028 _length(0.0), 00029 _direction(0.0), 00030 _rotation(0.0), 00031 _sequence(0), 00032 _time(0.0) 00033 { 00034 } 00035 00036 //////////////////////////////////////////////////////////////////// 00037 // Function: PointerEvent::Copy Constructor 00038 // Access: Public 00039 // Description: 00040 //////////////////////////////////////////////////////////////////// 00041 INLINE PointerEvent:: 00042 PointerEvent(const PointerEvent ©) : 00043 _in_window(copy._in_window), 00044 _xpos(copy._xpos), 00045 _ypos(copy._ypos), 00046 _dx(copy._dx), 00047 _dy(copy._dy), 00048 _length(copy._length), 00049 _direction(copy._direction), 00050 _rotation(copy._rotation), 00051 _sequence(copy._sequence), 00052 _time(copy._time) 00053 { 00054 } 00055 00056 //////////////////////////////////////////////////////////////////// 00057 // Function: PointerEvent::Copy Assignment Operator 00058 // Access: Public 00059 // Description: 00060 //////////////////////////////////////////////////////////////////// 00061 INLINE void PointerEvent:: 00062 operator = (const PointerEvent ©) { 00063 _in_window = copy._in_window; 00064 _xpos = copy._xpos; 00065 _ypos = copy._ypos; 00066 _dx = copy._dx; 00067 _dy = copy._dy; 00068 _sequence = copy._sequence; 00069 _length = copy._length; 00070 _direction = copy._direction; 00071 _rotation = copy._rotation; 00072 _time = copy._time; 00073 } 00074 00075 //////////////////////////////////////////////////////////////////// 00076 // Function: PointerEvent::Equality Operator 00077 // Access: Public 00078 // Description: The equality operator does not consider time 00079 // significant. 00080 //////////////////////////////////////////////////////////////////// 00081 INLINE bool PointerEvent:: 00082 operator == (const PointerEvent &other) const { 00083 return (_in_window == other._in_window && 00084 _xpos == other._xpos && 00085 _ypos == other._ypos && 00086 _dx == other._dx && 00087 _dy == other._dy && 00088 _sequence == other._sequence && 00089 _length == other._length && 00090 _direction == other._direction && 00091 _rotation == other._rotation); 00092 } 00093 00094 //////////////////////////////////////////////////////////////////// 00095 // Function: PointerEvent::Inequality Operator 00096 // Access: Public 00097 // Description: 00098 //////////////////////////////////////////////////////////////////// 00099 INLINE bool PointerEvent:: 00100 operator != (const PointerEvent &other) const { 00101 return !operator == (other); 00102 } 00103 00104 //////////////////////////////////////////////////////////////////// 00105 // Function: PointerEvent::Ordering Operator 00106 // Access: Public 00107 // Description: 00108 //////////////////////////////////////////////////////////////////// 00109 INLINE bool PointerEvent:: 00110 operator < (const PointerEvent &other) const { 00111 if (_sequence != other._sequence) { 00112 return _sequence < other._sequence; 00113 } 00114 if (_xpos != other._xpos) { 00115 return _xpos < other._xpos; 00116 } 00117 if (_ypos != other._ypos) { 00118 return _ypos < other._ypos; 00119 } 00120 if (_dx != other._dx) { 00121 return _dx < other._dx; 00122 } 00123 if (_dy != other._dy) { 00124 return _dy < other._dy; 00125 } 00126 if (_length != other._length) { 00127 return _length < other._length; 00128 } 00129 if (_direction != other._direction) { 00130 return _direction < other._direction; 00131 } 00132 if (_rotation != other._rotation) { 00133 return _rotation < other._rotation; 00134 } 00135 return _in_window < other._in_window; 00136 } 00137