Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# PointerEventList Class Reference

Records a set of pointer events that happened recently. More...

Inheritance diagram for PointerEventList:

List of all members.

## Public Member Functions
| PointerEventList ()
| addEvent (bool in_win, int xpos, int ypos, int seq, double time)
| Adds a new event to the end of the list.
| clear ()
| Empties all the events from the list.
bool | encircles (int x, int y)
| Returns true if the trail loops around the specified point.
double | getDirection (int n)
| Get the direction of the nth event.
int | getDx (int n)
| Get the x-coordinate of the nth event.
int | getDy (int n)
| Get the y-coordinate of the nth event.
bool | getInWindow (int n)
| Get the in-window flag of the nth event.
double | getLength (int n)
| Get the length of the nth event.
int | getNumEvents ()
| Returns the number of events in the list.
double | getRotation (int n)
| Get the rotation of the nth event.
int | getSequence (int n)
| Get the sequence number of the nth event.
double | getTime (int n)
| Get the timestamp of the nth event.
int | getXpos (int n)
| Get the x-coordinate of the nth event.
int | getYpos (int n)
| Get the y-coordinate of the nth event.
double | matchPattern (string pattern, double rot, double seglen)
| This function is not implemented yet.
| popFront ()
| Discards the first event on the list.
double | totalTurns (double sec)
| returns the total angular deviation that the trail has made in the specified time period.
## Static Public Member Functions
static TypeHandle | getClassType ()

## Detailed Description

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.

## Constructor & Destructor Documentation

PointerEventList | ( |  | ) |

## Member Function Documentation

addEvent | ( | bool | in_win,
|  | int | xpos,
|  | int | ypos,
|  | int | seq,
|  | double | time
| ) |  |

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.

clear | ( |  | ) |

Empties all the events from the list.

bool encircles | ( | int | x,
|  | int | y
| ) |  |

Returns true if the trail loops around the specified point.

static TypeHandle getClassType | ( |  | ) | `[static]`

Reimplemented from EventStoreValueBase.

double getDirection | ( | int | n | ) |

Get the direction of the nth event.

int getDx | ( | int | n | ) |

Get the x-coordinate of the nth event.

int getDy | ( | int | n | ) |

Get the y-coordinate of the nth event.

bool getInWindow | ( | int | n | ) |

Get the in-window flag of the nth event.

double getLength | ( | int | n | ) |

Get the length of the nth event.

int getNumEvents | ( |  | ) |

Returns the number of events in the list.

double getRotation | ( | int | n | ) |

Get the rotation of the nth event.

int getSequence | ( | int | n | ) |

Get the sequence number of the nth event.

double getTime | ( | int | n | ) |

Get the timestamp of the nth event.

int getXpos | ( | int | n | ) |

Get the x-coordinate of the nth event.

int getYpos | ( | int | n | ) |

Get the y-coordinate of the nth event.

double matchPattern | ( | string | 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.

popFront | ( |  | ) |

Discards the first event on the list.

double totalTurns | ( | double | sec | ) |

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.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties