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::
42 get_num_events() const {
43 return _events.size();
44}
45
46/**
47 * Returns true if the list is empty.
48 */
49INLINE bool PointerEventList::
50 empty() const {
51 return _events.empty();
52}
53
54/**
55 * Returns the nth event in the list.
56 */
57INLINE 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 */
65INLINE 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 */
74INLINE 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 */
83INLINE 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 */
92INLINE 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 */
101INLINE 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 */
110INLINE 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 */
119INLINE 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 */
128INLINE 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 */
137INLINE 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 */
146INLINE 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 */
155INLINE void PointerEventList::
156 clear() {
157 _events.clear();
158}
159
160/**
161 * Discards the first event on the list.
162 */
163INLINE void PointerEventList::
164 pop_front() {
165 _events.pop_front();
166}
PointerEventList
Records a set of pointer events that happened recently.
Definition pointerEventList.h:33
PointerEventList::get_xpos
int get_xpos(size_t n) const
Get the x-coordinate of the nth event.
Definition pointerEventList.I:75
PointerEventList::get_length
double get_length(size_t n) const
Get the length of the nth event.
Definition pointerEventList.I:111
PointerEventList::get_dy
double get_dy(size_t n) const
Get the y-delta of the nth event.
Definition pointerEventList.I:102
PointerEventList::pop_front
void pop_front()
Discards the first event on the list.
Definition pointerEventList.I:164
PointerEventList::get_sequence
int get_sequence(size_t n) const
Get the sequence number of the nth event.
Definition pointerEventList.I:138
PointerEventList::get_rotation
double get_rotation(size_t n) const
Get the rotation of the nth event.
Definition pointerEventList.I:129
PointerEventList::get_event
const PointerEvent & get_event(size_t n) const
Returns the nth event in the list.
Definition pointerEventList.I:58
PointerEventList::get_time
double get_time(size_t n) const
Get the timestamp of the nth event.
Definition pointerEventList.I:147
PointerEventList::get_dx
double get_dx(size_t n) const
Get the x-delta of the nth event.
Definition pointerEventList.I:93
PointerEventList::clear
void clear()
Empties all the events from the list.
Definition pointerEventList.I:156
PointerEventList::get_num_events
size_t get_num_events() const
Returns the number of events in the list.
Definition pointerEventList.I:42
PointerEventList::get_ypos
int get_ypos(size_t n) const
Get the y-coordinate of the nth event.
Definition pointerEventList.I:84
PointerEventList::get_in_window
bool get_in_window(size_t n) const
Get the in-window flag of the nth event.
Definition pointerEventList.I:66
PointerEventList::get_direction
double get_direction(size_t n) const
Get the direction of the nth event.
Definition pointerEventList.I:120
PointerEventList::empty
bool empty() const
Returns true if the list is empty.
Definition pointerEventList.I:50
PointerEvent
Records a pointer movement event.
Definition pointerEvent.h:26