From a858b2a2cd3ac0a50f5fea598b4596fc8ed4402a Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 3 Feb 2017 17:39:56 +0100 Subject: [PATCH] Add a comment explaining some confusing code in UpdateVisitor and EventVisitor --- include/osgGA/EventVisitor | 4 ++-- include/osgUtil/UpdateVisitor | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/osgGA/EventVisitor b/include/osgGA/EventVisitor index 2eb15a633..ff3deece5 100644 --- a/include/osgGA/EventVisitor +++ b/include/osgGA/EventVisitor @@ -106,11 +106,11 @@ class OSGGA_EXPORT EventVisitor : public osg::NodeVisitor handle_callbacks(drawable.getStateSet()); } + // The following overrides are technically redundant as the default implementation would eventually trickle down to + // apply(osg::Node&); - however defining these explicitely should save a couple of virtual function calls virtual void apply(osg::Geode& node) { handle_callbacks_and_traverse(node); } virtual void apply(osg::Billboard& node) { handle_callbacks_and_traverse(node); } - virtual void apply(osg::LightSource& node) { handle_callbacks_and_traverse(node); } - virtual void apply(osg::Group& node) { handle_callbacks_and_traverse(node); } virtual void apply(osg::Transform& node) { handle_callbacks_and_traverse(node); } virtual void apply(osg::Projection& node) { handle_callbacks_and_traverse(node); } diff --git a/include/osgUtil/UpdateVisitor b/include/osgUtil/UpdateVisitor index 011d0022e..1e16a2b1f 100644 --- a/include/osgUtil/UpdateVisitor +++ b/include/osgUtil/UpdateVisitor @@ -73,11 +73,11 @@ class OSGUTIL_EXPORT UpdateVisitor : public osg::NodeVisitor handle_callbacks(drawable.getStateSet()); } + // The following overrides are technically redundant as the default implementation would eventually trickle down to + // apply(osg::Node&); - however defining these explicitely should save a couple of virtual function calls virtual void apply(osg::Geode& node) { handle_callbacks_and_traverse(node); } virtual void apply(osg::Billboard& node) { handle_callbacks_and_traverse(node); } - virtual void apply(osg::LightSource& node) { handle_callbacks_and_traverse(node); } - virtual void apply(osg::Group& node) { handle_callbacks_and_traverse(node); } virtual void apply(osg::Transform& node) { handle_callbacks_and_traverse(node); } virtual void apply(osg::Projection& node) { handle_callbacks_and_traverse(node); }