14#ifndef POINTEREVENTLIST_H
15#define POINTEREVENTLIST_H
24class ModifierPointers;
33class EXPCL_PANDA_EVENT PointerEventList :
public ParamValueBase {
35 INLINE PointerEventList();
41 INLINE
double get_dx(
size_t n)
const;
42 INLINE
double get_dy(
size_t n)
const;
47 INLINE
double get_time(
size_t n)
const;
52 void add_event(
bool in_win,
int xpos,
int ypos,
int seq,
double time);
53 void add_event(
bool in_win,
int xpos,
int ypos,
double xdelta,
double ydelta,
54 int seq,
double time);
58 double match_pattern(
const std::string &pattern,
double rot,
double seglen);
61 INLINE PointerEventList(
const PointerEventList ©);
62 INLINE
void operator = (
const PointerEventList ©);
64 INLINE
bool empty()
const;
67 virtual void output(std::ostream &out)
const;
68 void write(std::ostream &out,
int indent_level = 0)
const;
71 void parse_pattern(
const std::string &ascpat, vector_double &pattern);
79 static void init_type() {
80 ParamValueBase::init_type();
82 ParamValueBase::get_class_type());
85 return get_class_type();
87 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
93INLINE std::ostream &operator << (std::ostream &out,
const PointerEventList &pointerlist) {
94 pointerlist.output(out);
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Holds the data that might be generated by a 2-d pointer input device, such as the mouse in the Graphi...
Records a set of pointer events that happened recently.
int get_xpos(size_t n) const
Get the x-coordinate of the nth event.
bool encircles(int x, int y) const
Returns true if the trail loops around the specified point.
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 add_event(const PointerData &data, int seq, double time)
Adds a new event from the given PointerData object.
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 total_turns(double sec) const
returns the total angular deviation that the trail has made in the specified time period.
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.
double match_pattern(const std::string &pattern, double rot, double seglen)
This function is not implemented yet.
Records a pointer movement event.
TypeHandle is the identifier used to differentiate C++ class types.
This is our own Panda specialization on the default STL deque.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.