Panda3D
mouseData.I
1 // Filename: mouseData.I
2 // Created by: drose (15Jul02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: MouseData::Constructor
18 // Access: Published
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE MouseData::
22 MouseData() {
23  _in_window = false;
24  _xpos = 0;
25  _ypos = 0;
26 }
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: MouseData::Copy Constructor
30 // Access: Published
31 // Description:
32 ////////////////////////////////////////////////////////////////////
33 INLINE MouseData::
34 MouseData(const MouseData &copy) :
35  _in_window(copy._in_window),
36  _xpos(copy._xpos),
37  _ypos(copy._ypos)
38 {
39 }
40 
41 ////////////////////////////////////////////////////////////////////
42 // Function: MouseData::Copy Assignment Operator
43 // Access: Published
44 // Description:
45 ////////////////////////////////////////////////////////////////////
46 INLINE void MouseData::
47 operator = (const MouseData &copy) {
48  _in_window = copy._in_window;
49  _xpos = copy._xpos;
50  _ypos = copy._ypos;
51 }
52 
53 ////////////////////////////////////////////////////////////////////
54 // Function: MouseData::get_x
55 // Access: Published
56 // Description:
57 ////////////////////////////////////////////////////////////////////
58 INLINE double MouseData::
59 get_x() const {
60  return _xpos;
61 }
62 
63 ////////////////////////////////////////////////////////////////////
64 // Function: MouseData::get_y
65 // Access: Published
66 // Description:
67 ////////////////////////////////////////////////////////////////////
68 INLINE double MouseData::
69 get_y() const {
70  return _ypos;
71 }
72 
73 ////////////////////////////////////////////////////////////////////
74 // Function: MouseData::get_in_window
75 // Access: Published
76 // Description:
77 ////////////////////////////////////////////////////////////////////
78 INLINE bool MouseData::
79 get_in_window() const {
80  return _in_window;
81 }
82 
83 
84 INLINE ostream &operator << (ostream &out, const MouseData &md) {
85  md.output(out);
86  return out;
87 }
Holds the data that might be generated by a 2-d pointer input device, such as the mouse in the Graphi...
Definition: mouseData.h:28