PointerEventList¶
-
class
PointerEventList
¶ Bases:
ParamValueBase
Records a set of pointer events that happened recently. This class is usually used only in the data graph, to transmit the recent pointer presses, but it may be used anywhere a list of PointerEvents is desired.
Inheritance diagram
-
PointerEventList
(void)¶
-
void
add_event
(PointerData const &data, int seq, double time)¶
-
void
add_event
(bool in_win, int xpos, int ypos, int seq, double time)¶
-
void
add_event
(bool in_win, int xpos, int ypos, double xdelta, double ydelta, int seq, double time)¶ Adds a new event from the given
PointerData
object.Adds a new event to the end of the list. Automatically calculates the dx, dy, length, direction, and rotation for all but the first event.
Adds a new event to the end of the list based on the given mouse movement.
-
void
clear
(void)¶ Empties all the events from the list.
-
bool
encircles
(int x, int y) const¶ Returns true if the trail loops around the specified point.
-
static TypeHandle
get_class_type
(void)¶
-
double
get_direction
(std::size_t n) const¶ Get the direction of the nth event.
-
double
get_dx
(std::size_t n) const¶ Get the x-delta of the nth event.
-
double
get_dy
(std::size_t n) const¶ Get the y-delta of the nth event.
-
bool
get_in_window
(std::size_t n) const¶ Get the in-window flag of the nth event.
-
double
get_length
(std::size_t n) const¶ Get the length of the nth event.
-
std::size_t
get_num_events
(void) const¶ Returns the number of events in the list.
-
double
get_rotation
(std::size_t n) const¶ Get the rotation of the nth event.
-
int
get_sequence
(std::size_t n) const¶ Get the sequence number of the nth event.
-
double
get_time
(std::size_t n) const¶ Get the timestamp of the nth event.
-
int
get_xpos
(std::size_t n) const¶ Get the x-coordinate of the nth event.
-
int
get_ypos
(std::size_t n) const¶ Get the y-coordinate of the nth event.
-
double
match_pattern
(std::string const &pattern, double rot, double seglen)¶ This function is not implemented yet. It is a work in progress. The intent is as follows:
Returns a nonzero value if the mouse movements match the specified pattern. The higher the value, the better the match. The pattern is a sequence of compass directions (ie, “E”, “NE”, etc) separated by spaces. If rot is nonzero, then the pattern is rotated counterclockwise by the specified amount before testing. Seglen is the minimum length a mouse movement needs to be in order to be considered significant.
-
void
pop_front
(void)¶ Discards the first event on the list.
-
double
total_turns
(double sec) const¶ returns the total angular deviation that the trail has made in the specified time period. A small number means that the trail is moving in a relatively straight line, a large number means that the trail is zig- zagging or spinning. The result is in degrees.
-