2 * Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net>
4 * This library is open source and may be redistributed and/or modified under
5 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
6 * (at your option) any later version. The full license is in LICENSE file
7 * included with this distribution, and on the openscenegraph.org website.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * OpenSceneGraph Public License for more details.
15#ifndef OSGANIMATION_NODE_VISITOR_H
16#define OSGANIMATION_NODE_VISITOR_H
18#include <osg/NodeVisitor>
19#include <osg/StateSet>
20#include <osgAnimation/Animation>
24 class AnimationUpdateCallbackBase;
26 /** This class is instancied by the AnimationManagerBase, it will link animation target to updatecallback that have the same name
28 class OSGANIMATION_EXPORT LinkVisitor : public osg::NodeVisitor
33 META_NodeVisitor(osgAnimation, LinkVisitor);
35 void apply(osg::Node& node);
36 void apply(osg::Geode& node);
38 AnimationList& getAnimationList();
40 unsigned int getNbLinkedTarget() const { return _nbLinkedTarget; }
44 void handle_stateset(osg::StateSet* stateset);
45 void link(osgAnimation::AnimationUpdateCallbackBase* cb);
47 // animation list to link
48 AnimationList _animations;
50 // number of success link done
51 unsigned int _nbLinkedTarget;