OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Device.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
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
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSGGA_EVENTSOURCE
15 #define OSGGA_EVENTSOURCE 1
16 
17 #include <osgGA/EventQueue>
18 
19 namespace osgGA {
20 
25 {
26  public:
27  enum {
28  UNKNOWN = 0,
29  RECEIVE_EVENTS = 1,
30  SEND_EVENTS = 2
31  } Capabilities;
32 
33  Device();
34  Device(const Device& es, const osg::CopyOp& copyop);
35 
37 
38  int getCapabilities() const { return _capabilities; }
39 
40  virtual bool checkEvents() { return _eventQueue.valid() ? !(getEventQueue()->empty()) : false; }
41  virtual void sendEvent(const Event& ea);
42  virtual void sendEvents(const EventQueue::Events& events);
43 
44  void setEventQueue(osgGA::EventQueue* eventQueue) { _eventQueue = eventQueue; }
45  osgGA::EventQueue* getEventQueue() { return _eventQueue.get(); }
46  const osgGA::EventQueue* getEventQueue() const { return _eventQueue.get(); }
47 
48  protected:
49  void setCapabilities(int capabilities) { _capabilities = capabilities; }
50 
51  virtual ~Device();
52 
54  Device& operator = (const Device&) { return *this; }
55 
57 
58  private:
59  int _capabilities;
60 
61 };
62 
63 }
64 
65 #endif
std::list< osg::ref_ptr< Event > > Events
Definition: EventQueue.h:36
#define OSGGA_EXPORT
Definition: Export.h:40
#define META_Object(library, name)
Definition: Object.h:42
const osgGA::EventQueue * getEventQueue() const
Definition: Device.h:46
void setEventQueue(osgGA::EventQueue *eventQueue)
Definition: Device.h:44
void setCapabilities(int capabilities)
Definition: Device.h:49
virtual bool checkEvents()
Definition: Device.h:40
int getCapabilities() const
Definition: Device.h:38
osg::ref_ptr< osgGA::EventQueue > _eventQueue
Definition: Device.h:56
osgGA::EventQueue * getEventQueue()
Definition: Device.h:45