Panda3D
pointerEvent.I
1 // Filename: pointerEvent.I
2 // Created by: jyelon (20Sep2007)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: PointerEvent::Default Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE PointerEvent::
22 PointerEvent() :
23  _in_window(false),
24  _xpos(0),
25  _ypos(0),
26  _dx(0),
27  _dy(0),
28  _length(0.0),
29  _direction(0.0),
30  _rotation(0.0),
31  _sequence(0),
32  _time(0.0)
33 {
34 }
35 
36 ////////////////////////////////////////////////////////////////////
37 // Function: PointerEvent::Copy Constructor
38 // Access: Public
39 // Description:
40 ////////////////////////////////////////////////////////////////////
41 INLINE PointerEvent::
42 PointerEvent(const PointerEvent &copy) :
43  _in_window(copy._in_window),
44  _xpos(copy._xpos),
45  _ypos(copy._ypos),
46  _dx(copy._dx),
47  _dy(copy._dy),
48  _length(copy._length),
49  _direction(copy._direction),
50  _rotation(copy._rotation),
51  _sequence(copy._sequence),
52  _time(copy._time)
53 {
54 }
55 
56 ////////////////////////////////////////////////////////////////////
57 // Function: PointerEvent::Copy Assignment Operator
58 // Access: Public
59 // Description:
60 ////////////////////////////////////////////////////////////////////
61 INLINE void PointerEvent::
62 operator = (const PointerEvent &copy) {
63  _in_window = copy._in_window;
64  _xpos = copy._xpos;
65  _ypos = copy._ypos;
66  _dx = copy._dx;
67  _dy = copy._dy;
68  _sequence = copy._sequence;
69  _length = copy._length;
70  _direction = copy._direction;
71  _rotation = copy._rotation;
72  _time = copy._time;
73 }
74 
75 ////////////////////////////////////////////////////////////////////
76 // Function: PointerEvent::Equality Operator
77 // Access: Public
78 // Description: The equality operator does not consider time
79 // significant.
80 ////////////////////////////////////////////////////////////////////
81 INLINE bool PointerEvent::
82 operator == (const PointerEvent &other) const {
83  return (_in_window == other._in_window &&
84  _xpos == other._xpos &&
85  _ypos == other._ypos &&
86  _dx == other._dx &&
87  _dy == other._dy &&
88  _sequence == other._sequence &&
89  _length == other._length &&
90  _direction == other._direction &&
91  _rotation == other._rotation);
92 }
93 
94 ////////////////////////////////////////////////////////////////////
95 // Function: PointerEvent::Inequality Operator
96 // Access: Public
97 // Description:
98 ////////////////////////////////////////////////////////////////////
99 INLINE bool PointerEvent::
100 operator != (const PointerEvent &other) const {
101  return !operator == (other);
102 }
103 
104 ////////////////////////////////////////////////////////////////////
105 // Function: PointerEvent::Ordering Operator
106 // Access: Public
107 // Description:
108 ////////////////////////////////////////////////////////////////////
109 INLINE bool PointerEvent::
110 operator < (const PointerEvent &other) const {
111  if (_sequence != other._sequence) {
112  return _sequence < other._sequence;
113  }
114  if (_xpos != other._xpos) {
115  return _xpos < other._xpos;
116  }
117  if (_ypos != other._ypos) {
118  return _ypos < other._ypos;
119  }
120  if (_dx != other._dx) {
121  return _dx < other._dx;
122  }
123  if (_dy != other._dy) {
124  return _dy < other._dy;
125  }
126  if (_length != other._length) {
127  return _length < other._length;
128  }
129  if (_direction != other._direction) {
130  return _direction < other._direction;
131  }
132  if (_rotation != other._rotation) {
133  return _rotation < other._rotation;
134  }
135  return _in_window < other._in_window;
136 }
137 
bool operator==(const PointerEvent &other) const
The equality operator does not consider time significant.
Definition: pointerEvent.I:82
Records a pointer movement event.
Definition: pointerEvent.h:28