Panda3D
Loading...
Searching...
No Matches
pointerData.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 pointerData.h
10 * @author drose
11 * @date 1999-02-08
12 */
13
14#ifndef POINTERDATA_H
15#define POINTERDATA_H
16
17#include "pandabase.h"
18
19#include "modifierButtons.h"
20
21BEGIN_PUBLISH
22/**
23 * Contains the types of pointer device.
24 */
25enum class PointerType {
26 unknown,
27 mouse,
28 finger,
29 stylus,
30 eraser,
31};
32END_PUBLISH
33
34/**
35 * Holds the data that might be generated by a 2-d pointer input device, such
36 * as the mouse in the GraphicsWindow.
37 */
38class EXPCL_PANDA_PUTIL PointerData {
39PUBLISHED:
40 INLINE double get_x() const;
41 INLINE double get_y() const;
42 INLINE bool get_in_window() const;
43
44public:
45 INLINE int get_id() const;
46 INLINE PointerType get_type() const;
47 INLINE double get_pressure() const;
48
49 void output(std::ostream &out) const;
50
51PUBLISHED:
52 MAKE_PROPERTY(x, get_x);
53 MAKE_PROPERTY(y, get_y);
54 MAKE_PROPERTY(type, get_type);
55 MAKE_PROPERTY(id, get_id);
56 MAKE_PROPERTY(in_window, get_in_window);
57 MAKE_PROPERTY(pressure, get_pressure);
58
59public:
60 bool _in_window = false;
61 double _xpos = 0.0;
62 double _ypos = 0.0;
63 double _pressure = 0.0;
64 PointerType _type = PointerType::unknown;
65 int _id = 0;
66};
67
68INLINE std::ostream &operator << (std::ostream &out, const PointerData &md);
69
70#include "pointerData.I"
71
72#endif
Holds the data that might be generated by a 2-d pointer input device, such as the mouse in the Graphi...
Definition pointerData.h:38
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