Panda3D
|
00001 // Filename: pointerEvent.h 00002 // Created by: jyelon (20Sep2007) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef POINTEREVENT_H 00016 #define POINTEREVENT_H 00017 00018 #include "pandabase.h" 00019 #include "mouseData.h" 00020 00021 class Datagram; 00022 class DatagramIterator; 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : PointerEvent 00026 // Description : Records a pointer movement event. 00027 //////////////////////////////////////////////////////////////////// 00028 class EXPCL_PANDA_EVENT PointerEvent { 00029 public: 00030 00031 INLINE PointerEvent(); 00032 INLINE PointerEvent(const PointerEvent ©); 00033 INLINE void operator = (const PointerEvent ©); 00034 00035 INLINE bool operator == (const PointerEvent &other) const; 00036 INLINE bool operator != (const PointerEvent &other) const; 00037 INLINE bool operator < (const PointerEvent &other) const; 00038 00039 void output(ostream &out) const; 00040 00041 void write_datagram(Datagram &dg) const; 00042 void read_datagram(DatagramIterator &scan); 00043 00044 public: 00045 bool _in_window; 00046 int _xpos; 00047 int _ypos; 00048 int _dx; 00049 int _dy; 00050 double _length; 00051 double _direction; 00052 double _rotation; 00053 int _sequence; 00054 double _time; 00055 }; 00056 00057 INLINE ostream &operator << (ostream &out, const PointerEvent &pe) { 00058 pe.output(out); 00059 return out; 00060 } 00061 00062 #include "pointerEvent.I" 00063 00064 #endif 00065