Panda3D
pointerEventList.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file pointerEventList.I
10  * @author jyelon
11  * @date 2007-09-20
12  */
13 
14 /**
15  *
16  */
17 INLINE PointerEventList::
18 PointerEventList() {
19 }
20 
21 /**
22  *
23  */
24 INLINE PointerEventList::
25 PointerEventList(const PointerEventList &copy) :
26  _events(copy._events)
27 {
28 }
29 
30 /**
31  *
32  */
33 INLINE void PointerEventList::
34 operator = (const PointerEventList &copy) {
35  _events = copy._events;
36 }
37 
38 /**
39  * Returns the number of events in the list.
40  */
41 INLINE size_t PointerEventList::
42 get_num_events() const {
43  return _events.size();
44 }
45 
46 /**
47  * Returns true if the list is empty.
48  */
49 INLINE bool PointerEventList::
50 empty() const {
51  return _events.empty();
52 }
53 
54 /**
55  * Returns the nth event in the list.
56  */
57 INLINE const PointerEvent &PointerEventList::
58 get_event(size_t n) const {
59  return _events[n];
60 }
61 
62 /**
63  * Get the in-window flag of the nth event.
64  */
65 INLINE bool PointerEventList::
66 get_in_window(size_t n) const {
67  nassertr(n < _events.size(), 0);
68  return _events[n]._in_window;
69 }
70 
71 /**
72  * Get the x-coordinate of the nth event.
73  */
74 INLINE int PointerEventList::
75 get_xpos(size_t n) const {
76  nassertr(n < _events.size(), 0);
77  return _events[n]._xpos;
78 }
79 
80 /**
81  * Get the y-coordinate of the nth event.
82  */
83 INLINE int PointerEventList::
84 get_ypos(size_t n) const {
85  nassertr(n < _events.size(), 0);
86  return _events[n]._ypos;
87 }
88 
89 /**
90  * Get the x-delta of the nth event.
91  */
92 INLINE double PointerEventList::
93 get_dx(size_t n) const {
94  nassertr(n < _events.size(), 0);
95  return _events[n]._dx;
96 }
97 
98 /**
99  * Get the y-delta of the nth event.
100  */
101 INLINE double PointerEventList::
102 get_dy(size_t n) const {
103  nassertr(n < _events.size(), 0);
104  return _events[n]._dy;
105 }
106 
107 /**
108  * Get the length of the nth event.
109  */
110 INLINE double PointerEventList::
111 get_length(size_t n) const {
112  nassertr(n < _events.size(), 0);
113  return _events[n]._length;
114 }
115 
116 /**
117  * Get the direction of the nth event.
118  */
119 INLINE double PointerEventList::
120 get_direction(size_t n) const {
121  nassertr(n < _events.size(), 0);
122  return _events[n]._direction;
123 }
124 
125 /**
126  * Get the rotation of the nth event.
127  */
128 INLINE double PointerEventList::
129 get_rotation(size_t n) const {
130  nassertr(n < _events.size(), 0);
131  return _events[n]._rotation;
132 }
133 
134 /**
135  * Get the sequence number of the nth event.
136  */
137 INLINE int PointerEventList::
138 get_sequence(size_t n) const {
139  nassertr(n < _events.size(), 0);
140  return _events[n]._sequence;
141 }
142 
143 /**
144  * Get the timestamp of the nth event.
145  */
146 INLINE double PointerEventList::
147 get_time(size_t n) const {
148  nassertr(n < _events.size(), 0);
149  return _events[n]._time;
150 }
151 
152 /**
153  * Empties all the events from the list.
154  */
155 INLINE void PointerEventList::
156 clear() {
157  _events.clear();
158 }
159 
160 /**
161  * Discards the first event on the list.
162  */
163 INLINE void PointerEventList::
165  _events.pop_front();
166 }
size_t get_num_events() const
Returns the number of events in the list.
double get_dy(size_t n) const
Get the y-delta of the nth event.
double get_direction(size_t n) const
Get the direction of the nth event.
int get_ypos(size_t n) const
Get the y-coordinate of the nth event.
const PointerEvent & get_event(size_t n) const
Returns the nth event in the list.
int get_xpos(size_t n) const
Get the x-coordinate of the nth event.
void clear()
Empties all the events from the list.
Records a set of pointer events that happened recently.
int get_sequence(size_t n) const
Get the sequence number of the nth event.
double get_time(size_t n) const
Get the timestamp of the nth event.
double get_dx(size_t n) const
Get the x-delta of the nth event.
bool empty() const
Returns true if the list is empty.
double get_rotation(size_t n) const
Get the rotation of the nth event.
double get_length(size_t n) const
Get the length of the nth event.
void pop_front()
Discards the first event on the list.
Records a pointer movement event.
Definition: pointerEvent.h:26
bool get_in_window(size_t n) const
Get the in-window flag of the nth event.