Panda3D
pointerEvent.h
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 pointerEvent.h
10  * @author jyelon
11  * @date 2007-09-20
12  */
13 
14 #ifndef POINTEREVENT_H
15 #define POINTEREVENT_H
16 
17 #include "pandabase.h"
18 #include "pointerData.h"
19 
20 class Datagram;
21 class DatagramIterator;
22 
23 /**
24  * Records a pointer movement event.
25  */
26 class EXPCL_PANDA_EVENT PointerEvent {
27 public:
28  PointerEvent() = default;
29 
30  INLINE bool operator == (const PointerEvent &other) const;
31  INLINE bool operator != (const PointerEvent &other) const;
32  INLINE bool operator < (const PointerEvent &other) const;
33 
34  void output(std::ostream &out) const;
35 
36  void write_datagram(Datagram &dg) const;
37  void read_datagram(DatagramIterator &scan);
38 
39 public:
40  bool _in_window = false;
41  int _id = 0;
42  PointerType _type = PointerType::unknown;
43  double _xpos = 0.0;
44  double _ypos = 0.0;
45  double _dx = 0.0;
46  double _dy = 0.0;
47  double _length = 0.0;
48  double _direction = 0.0;
49  double _pressure = 0.0;
50  double _rotation = 0.0;
51  int _sequence = 0;
52  double _time = 0.0;
53 };
54 
55 INLINE std::ostream &operator << (std::ostream &out, const PointerEvent &pe) {
56  pe.output(out);
57  return out;
58 }
59 
60 #include "pointerEvent.I"
61 
62 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PointerType
Contains the types of pointer device.
Definition: pointerData.h:25
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 ...
Definition: datagram.h:38
Records a pointer movement event.
Definition: pointerEvent.h:26