Refactored Callback system in osg::Node, osg::Drawable, osg::StateSet and osg::StateAttribute to use a new osg::Callback base class.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14244 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-06-05 16:26:13 +00:00
parent 35d6cb812f
commit 977ec20751
64 changed files with 590 additions and 471 deletions

View File

@@ -16,7 +16,6 @@
#include <vector>
#include <osg/NodeCallback>
#include <osg/Drawable>
#include <osg/ApplicationUsage>
@@ -37,12 +36,20 @@ public:
EventHandler() {}
EventHandler(const EventHandler& eh,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
osg::Object(eh,copyop),
osg::Callback(eh,copyop),
osg::NodeCallback(eh, copyop),
osg::Drawable::EventCallback(eh, copyop) {}
META_Object(osgGA, EventHandler);
virtual bool run(osg::Object* object, osg::Object* data)
{
osg::Node* node = dynamic_cast<osg::Node*>(object);
osg::NodeVisitor* nv = dynamic_cast<osg::NodeVisitor*>(data);
operator()(node, nv);
return true;
}
/** Event traversal node callback method. There is no need to override this method in subclasses of EventHandler as this implementation calls handle(..) for you. */
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);