Panda3D
Loading...
Searching...
No Matches
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 */
17INLINE PointerEventList::
18PointerEventList() {
19}
20
21/**
22 *
23 */
24INLINE PointerEventList::
25PointerEventList(const PointerEventList &copy) :
26 _events(copy._events)
27{
28}
29
30/**
31 *
32 */
33INLINE void PointerEventList::
34operator = (const PointerEventList &copy) {
35 _events = copy._events;
36}
37
38/**
39 * Returns the number of events in the list.
40 */
41INLINE size_t PointerEventList::
42get_num_events() const {
43 return _events.size();
44}
45
46/**
47 * Returns true if the list is empty.
48 */
50empty() const {
51 return _events.empty();
52}
53
54/**
55 * Returns the nth event in the list.
56 */
58get_event(size_t n) const {
59 return _events[n];
60}
61
62/**
63 * Get the in-window flag of the nth event.
64 */
66get_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 */
75get_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 */
84get_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 */
92INLINE double PointerEventList::
93get_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 */
102get_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 */
111get_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 */
120get_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 */
129get_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 */
138get_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 */
147get_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 */
156clear() {
157 _events.clear();
158}
159
160/**
161 * Discards the first event on the list.
162 */
164pop_front() {
165 _events.pop_front();
166}
Records a set of pointer events that happened recently.
int get_xpos(size_t n) const
Get the x-coordinate of the nth event.
double get_length(size_t n) const
Get the length of the nth event.
double get_dy(size_t n) const
Get the y-delta of the nth event.
void pop_front()
Discards the first event on the list.
int get_sequence(size_t n) const
Get the sequence number of the nth event.
double get_rotation(size_t n) const
Get the rotation of the nth event.
const PointerEvent & get_event(size_t n) const
Returns the nth event in the list.
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.
void clear()
Empties all the events from the list.
size_t get_num_events() const
Returns the number of events in the list.
int get_ypos(size_t n) const
Get the y-coordinate of the nth event.
bool get_in_window(size_t n) const
Get the in-window flag of the nth event.
double get_direction(size_t n) const
Get the direction of the nth event.
bool empty() const
Returns true if the list is empty.
Records a pointer movement event.