00001 // Filename: pointerEventList.I 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 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: PointerEventList::Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE PointerEventList:: 00022 PointerEventList() { 00023 } 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Function: PointerEventList::Copy Constructor 00027 // Access: Public 00028 // Description: 00029 //////////////////////////////////////////////////////////////////// 00030 INLINE PointerEventList:: 00031 PointerEventList(const PointerEventList ©) : 00032 _events(copy._events) 00033 { 00034 } 00035 00036 //////////////////////////////////////////////////////////////////// 00037 // Function: PointerEventList::Copy Assignment Operator 00038 // Access: Public 00039 // Description: 00040 //////////////////////////////////////////////////////////////////// 00041 INLINE void PointerEventList:: 00042 operator = (const PointerEventList ©) { 00043 _events = copy._events; 00044 } 00045 00046 //////////////////////////////////////////////////////////////////// 00047 // Function: PointerEventList::get_num_events 00048 // Access: Published 00049 // Description: Returns the number of events in the list. 00050 //////////////////////////////////////////////////////////////////// 00051 INLINE int PointerEventList:: 00052 get_num_events() const { 00053 return _events.size(); 00054 } 00055 00056 //////////////////////////////////////////////////////////////////// 00057 // Function: PointerEventList::get_in_window 00058 // Access: Published 00059 // Description: Get the in-window flag of the nth event. 00060 //////////////////////////////////////////////////////////////////// 00061 INLINE bool PointerEventList:: 00062 get_in_window(int evt) const { 00063 nassertr((evt >= 0) && (evt < (int)_events.size()), 0); 00064 return _events[evt]._in_window; 00065 } 00066 00067 //////////////////////////////////////////////////////////////////// 00068 // Function: PointerEventList::get_xpos 00069 // Access: Published 00070 // Description: Get the x-coordinate of the nth event. 00071 //////////////////////////////////////////////////////////////////// 00072 INLINE int PointerEventList:: 00073 get_xpos(int evt) const { 00074 nassertr((evt >= 0) && (evt < (int)_events.size()), 0); 00075 return _events[evt]._xpos; 00076 } 00077 00078 //////////////////////////////////////////////////////////////////// 00079 // Function: PointerEventList::get_ypos 00080 // Access: Published 00081 // Description: Get the y-coordinate of the nth event. 00082 //////////////////////////////////////////////////////////////////// 00083 INLINE int PointerEventList:: 00084 get_ypos(int evt) const { 00085 nassertr((evt >= 0) && (evt < (int)_events.size()), 0); 00086 return _events[evt]._ypos; 00087 } 00088 00089 //////////////////////////////////////////////////////////////////// 00090 // Function: PointerEventList::get_dx 00091 // Access: Published 00092 // Description: Get the x-coordinate of the nth event. 00093 //////////////////////////////////////////////////////////////////// 00094 INLINE int PointerEventList:: 00095 get_dx(int evt) const { 00096 nassertr((evt >= 0) && (evt < (int)_events.size()), 0); 00097 return _events[evt]._dx; 00098 } 00099 00100 //////////////////////////////////////////////////////////////////// 00101 // Function: PointerEventList::get_dy 00102 // Access: Published 00103 // Description: Get the y-coordinate of the nth event. 00104 //////////////////////////////////////////////////////////////////// 00105 INLINE int PointerEventList:: 00106 get_dy(int evt) const { 00107 nassertr((evt >= 0) && (evt < (int)_events.size()), 0); 00108 return _events[evt]._dy; 00109 } 00110 00111 //////////////////////////////////////////////////////////////////// 00112 // Function: PointerEventList::get_length 00113 // Access: Published 00114 // Description: Get the length of the nth event. 00115 //////////////////////////////////////////////////////////////////// 00116 INLINE double PointerEventList:: 00117 get_length(int evt) const { 00118 nassertr((evt >= 0) && (evt < (int)_events.size()), 0); 00119 return _events[evt]._length; 00120 } 00121 00122 //////////////////////////////////////////////////////////////////// 00123 // Function: PointerEventList::get_direction 00124 // Access: Published 00125 // Description: Get the direction of the nth event. 00126 //////////////////////////////////////////////////////////////////// 00127 INLINE double PointerEventList:: 00128 get_direction(int evt) const { 00129 nassertr((evt >= 0) && (evt < (int)_events.size()), 0); 00130 return _events[evt]._direction; 00131 } 00132 00133 //////////////////////////////////////////////////////////////////// 00134 // Function: PointerEventList::get_rotation 00135 // Access: Published 00136 // Description: Get the rotation of the nth event. 00137 //////////////////////////////////////////////////////////////////// 00138 INLINE double PointerEventList:: 00139 get_rotation(int evt) const { 00140 nassertr((evt >= 0) && (evt < (int)_events.size()), 0); 00141 return _events[evt]._rotation; 00142 } 00143 00144 //////////////////////////////////////////////////////////////////// 00145 // Function: PointerEventList::get_sequence 00146 // Access: Published 00147 // Description: Get the sequence number of the nth event. 00148 //////////////////////////////////////////////////////////////////// 00149 INLINE int PointerEventList:: 00150 get_sequence(int evt) const { 00151 nassertr((evt >= 0) && (evt < (int)_events.size()), 0); 00152 return _events[evt]._sequence; 00153 } 00154 00155 //////////////////////////////////////////////////////////////////// 00156 // Function: PointerEventList::get_time 00157 // Access: Published 00158 // Description: Get the timestamp of the nth event. 00159 //////////////////////////////////////////////////////////////////// 00160 INLINE double PointerEventList:: 00161 get_time(int evt) const { 00162 nassertr((evt >= 0) && (evt < (int)_events.size()), 0); 00163 return _events[evt]._time; 00164 } 00165 00166 //////////////////////////////////////////////////////////////////// 00167 // Function: PointerEventList::clear 00168 // Access: Public 00169 // Description: Empties all the events from the list. 00170 //////////////////////////////////////////////////////////////////// 00171 INLINE void PointerEventList:: 00172 clear() { 00173 _events.clear(); 00174 } 00175 00176 //////////////////////////////////////////////////////////////////// 00177 // Function: PointerEventList::pop_front 00178 // Access: Public 00179 // Description: Discards the first event on the list. 00180 //////////////////////////////////////////////////////////////////// 00181 INLINE void PointerEventList:: 00182 pop_front() { 00183 _events.pop_front(); 00184 }