# PointerEventList

from pandac.PandaModules import PointerEventList

Class : PointerEventList
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.

## Inheritance:

PointerEventList: EventStoreValueBase
EventStoreValueBase: TypedWritableReferenceCount
TypedWritableReferenceCount: TypedWritable ReferenceCount
TypedWritable: TypedObject
TypedObject: MemoryBase
MemoryBase:
ReferenceCount: MemoryBase

## Methods of PointerEventList:

PointerEventList (Constructor)
addEvent
clear
encircles
getClassType
getDirection
getDx
getDy
getInWindow
getLength
getNumEvents
getRotation
getSequence
getTime
getXpos
getYpos
matchPattern
popFront
totalTurns

## Methods of EventStoreValueBase:

getClassType
output

## Methods of TypedWritableReferenceCount:

getClassType

## Methods of TypedWritable:

getClassType

## Methods of TypedObject:

getClassType
getType
getTypeIndex
isExactType
isOfType

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
testRefCountNonzero
unref

PointerEventList PointerEventList::PointerEventList(void); Filename: pointerEventList.I Created by: jyelon (20Sep2007) PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. All rights reserved. All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE." Description:

addEvent void PointerEventList::add_event(bool in_win, int xpos, int ypos, int seq, double time); Description: 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 void PointerEventList::clear(void); Description: Empties all the events from the list.

encircles bool PointerEventList::encircles(int x, int y) const; Description: Returns true if the trail loops around the specified point.

getClassType static TypeHandle PointerEventList::get_class_type(void); Undocumented function.

getDirection double PointerEventList::get_direction(int n) const; Description: Get the direction of the nth event.

getDx int PointerEventList::get_dx(int n) const; Description: Get the x-coordinate of the nth event.

getDy int PointerEventList::get_dy(int n) const; Description: Get the y-coordinate of the nth event.

getInWindow bool PointerEventList::get_in_window(int n) const; Description: Get the in-window flag of the nth event.

getLength double PointerEventList::get_length(int n) const; Description: Get the length of the nth event.

getNumEvents int PointerEventList::get_num_events(void) const; Description: Returns the number of events in the list.

getRotation double PointerEventList::get_rotation(int n) const; Description: Get the rotation of the nth event.

getSequence int PointerEventList::get_sequence(int n) const; Description: Get the sequence number of the nth event.

getTime double PointerEventList::get_time(int n) const; Description: Get the timestamp of the nth event.

getXpos int PointerEventList::get_xpos(int n) const; Description: Get the x-coordinate of the nth event.

getYpos int PointerEventList::get_ypos(int n) const; Description: Get the y-coordinate of the nth event.

matchPattern double PointerEventList::match_pattern(string const &pattern, double rot, double seglen); Description: 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 void PointerEventList::pop_front(void); Description: Discards the first event on the list.

totalTurns double PointerEventList::total_turns(double sec) const; Description: 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.

getClassType static TypeHandle EventStoreValueBase::get_class_type(void); Undocumented function.

output virtual void EventStoreValueBase::output(ostream &out) const = 0; Undocumented function.

getClassType static TypeHandle TypedWritableReferenceCount::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedWritable::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedObject::get_class_type(void); Undocumented function.

getType virtual TypeHandle TypedObject::get_type(void) const = 0; Derived classes should override this function to return get_class_type().

getTypeIndex int TypedObject::get_type_index(void) const; Description: Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index().

isExactType bool TypedObject::is_exact_type(TypeHandle handle) const; Description: Returns true if the current object is the indicated type exactly.

isOfType bool TypedObject::is_of_type(TypeHandle handle) const; Description: Returns true if the current object is or derives from the indicated type.

getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function.

getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count.

ref void ReferenceCount::ref(void) const; Description: Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

testRefCountNonzero bool ReferenceCount::test_ref_count_nonzero(void) const; Description: Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise.

unref bool ReferenceCount::unref(void) const; Description: Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is true if the new reference count is nonzero, false if it is zero.