Changeset 13041 for OpenSceneGraph/trunk/include/osgGA/EventQueue
- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osgGA/EventQueue (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgGA/EventQueue
r12938 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 26 26 27 27 /** 28 * EventQueue implementation for collecting and adapting windowing events 28 * EventQueue implementation for collecting and adapting windowing events 29 29 */ 30 30 class OSGGA_EXPORT EventQueue : public osg::Referenced … … 35 35 36 36 typedef std::list< osg::ref_ptr<GUIEventAdapter> > Events; 37 37 38 38 /** Set events.*/ 39 39 void setEvents(Events& events); … … 80 80 /** Method for adapting mouse scroll wheel events, placing this event on the back of the event queue. */ 81 81 void mouseScroll(GUIEventAdapter::ScrollingMotion sm) { mouseScroll(sm,getTime()); } 82 82 83 83 /** Method for adapting mouse scroll wheel events, placing this event on the back of the event queue, with specified time. */ 84 84 void mouseScroll(GUIEventAdapter::ScrollingMotion sm, double time); 85 85 86 86 87 87 /** Method for adapting mouse scroll wheel events, placing this event on the back of the event queue. */ … … 90 90 /** Method for adapting mouse scroll wheel events, placing this event on the back of the event queue. */ 91 91 void mouseScroll2D(float x, float y, double time); 92 92 93 93 94 94 /** Method for adapting pen pressure events, placing this event on the back of the event queue.*/ 95 95 void penPressure(float pressure) { penPressure(pressure, getTime()); } 96 96 97 97 /** Method for adapting pen pressure events, placing this event on the back of the event queue, with specified time.*/ 98 98 void penPressure(float pressure, double time); … … 103 103 /** Method for adapting pen orientation events, placing this event on the back of the event queue, with specified time.*/ 104 104 void penOrientation(float tiltX, float tiltY, float rotation, double time); 105 105 106 106 /** Method for adapting pen proximity events, placing this event on the back of the event queue.*/ 107 107 void penProximity(GUIEventAdapter::TabletPointerType pt, bool isEntering) { penProximity(pt, isEntering, getTime()); } … … 134 134 * Button numbering is 1 for left mouse button, 2 for middle, 3 for right. */ 135 135 void mouseDoubleButtonPress(float x, float y, unsigned int button) { mouseDoubleButtonPress(x, y, button, getTime()); } 136 136 137 137 /** Method for adapting mouse button pressed events, placing this event on the back of the event queue, with specified time. 138 138 * Button numbering is 1 for left mouse button, 2 for middle, 3 for right. */ 139 139 void mouseDoubleButtonPress(float x, float y, unsigned int button, double time); 140 140 141 141 142 142 /** Method for adapting mouse button release events, placing this event on the back of the event queue. … … 161 161 /** Method for adapting keyboard press events. Note, special keys such as Ctrl/Function keys should be adapted to GUIEventAdapter::KeySymbol mappings, with specified time.*/ 162 162 void keyRelease(int key, double time, int unmodifiedKey = 0); 163 163 164 164 GUIEventAdapter* touchBegan(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time); 165 165 GUIEventAdapter* touchBegan(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y) { 166 166 return touchBegan(id, phase, x, y, getTime()); 167 167 } 168 168 169 169 GUIEventAdapter* touchMoved(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time); 170 170 GUIEventAdapter* touchMoved(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y) { 171 171 return touchMoved(id, phase, x, y, getTime()); 172 172 } 173 173 174 174 GUIEventAdapter* touchEnded(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count, double time); 175 175 GUIEventAdapter* touchEnded(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count) { 176 176 return touchEnded(id, phase, x, y, tap_count, getTime()); 177 177 } 178 178 179 179 180 180 … … 195 195 /** Method for adapting frame events.*/ 196 196 void frame(double time); 197 197 198 198 199 199 void setStartTick(osg::Timer_t tick) { _startTick = tick; clear(); } … … 207 207 /** convenience method for create an event ready to fill in. Clones the getCurrentEventState() to produce a up to date event state. */ 208 208 GUIEventAdapter* createEvent(); 209 210 209 210 211 211 void setCurrentEventState(GUIEventAdapter* ea) { _accumulateEventState = ea; } 212 212 GUIEventAdapter* getCurrentEventState() { return _accumulateEventState.get(); } … … 228 228 /** Prevent unwanted copy operator.*/ 229 229 EventQueue& operator = (const EventQueue&) { return *this; } 230 230 231 231 osg::ref_ptr<GUIEventAdapter> _accumulateEventState; 232 232 … … 237 237 Events _eventQueue; 238 238 bool _firstTouchEmulatesMouse; 239 239 240 240 }; 241 241
