OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EventHandler.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_EVENTHANDLER
15 #define OSGGA_EVENTHANDLER 1
16 
17 #include <vector>
18 
19 #include <osg/Drawable>
20 #include <osg/ApplicationUsage>
21 
22 #include <osgGA/Export>
23 #include <osgGA/GUIEventAdapter>
24 #include <osgGA/GUIActionAdapter>
25 
26 
27 namespace osgGA{
28 
34 {
35 public:
36 
39  osg::Object(eh, copyop),
40  osg::Callback(eh, copyop),
41  osg::NodeCallback(eh, copyop),
42  osg::Drawable::EventCallback(eh, copyop) {}
43 
45 
46  virtual bool run(osg::Object* object, osg::Object* data)
47  {
48  osg::Node* node = dynamic_cast<osg::Node*>(object);
49  osg::NodeVisitor* nv = dynamic_cast<osg::NodeVisitor*>(data);
50  operator()(node, nv);
51  return true;
52  }
53 
55  virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
56 
58  virtual void event(osg::NodeVisitor* nv, osg::Drawable* drawable);
59 
61  virtual bool handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv);
62 
64  virtual void getUsage(osg::ApplicationUsage&) const {}
65 
66 protected:
67 
68 };
69 
70 }
71 
72 #endif
#define OSGGA_EXPORT
Definition: Export.h:40
#define META_Object(library, name)
Definition: Object.h:42
virtual void getUsage(osg::ApplicationUsage &) const
Definition: EventHandler.h:64
EventHandler(const EventHandler &eh, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition: EventHandler.h:38
Definition: Node.h:71
Definition: AlphaFunc.h:19
virtual bool run(osg::Object *object, osg::Object *data)
Definition: EventHandler.h:46