OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AnimationManagerBase.h
Go to the documentation of this file.
1 /* -*-c++-*-
2  * Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net>
3  *
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.
8  *
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.
13 */
14 
15 #ifndef OSGANIMATION_ANIMATION_MANAGER_BASE
16 #define OSGANIMATION_ANIMATION_MANAGER_BASE 1
17 
18 #include <osgAnimation/LinkVisitor>
19 #include <osgAnimation/Animation>
20 #include <osgAnimation/Export>
21 #include <osg/FrameStamp>
22 #include <osg/Group>
23 
24 
25 
26 namespace osgAnimation
27 {
29  {
30  public:
31  typedef std::set<osg::ref_ptr<Target> > TargetSet;
32 
35  virtual ~AnimationManagerBase();
36  virtual void buildTargetReference();
37  virtual void registerAnimation (Animation*);
38  virtual void unregisterAnimation (Animation*);
39  virtual void link(osg::Node* subgraph);
40  virtual void update(double t) = 0;
41  virtual bool needToLink() const;
42  const AnimationList& getAnimationList() const { return _animations;}
43 
45  virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
46 
49  void clearTargets();
50 
51 
52  LinkVisitor* getOrCreateLinkVisitor();
53  void setLinkVisitor(LinkVisitor*);
54 
56  void setAutomaticLink(bool);
57  bool getAutomaticLink() const;
58  bool isAutomaticLink() const { return getAutomaticLink(); }
59  void dirty();
60 
61  protected:
62 
65  TargetSet _targets;
68  };
69 }
70 #endif
#define OSGANIMATION_EXPORT
Definition: Export.h:40
osg::ref_ptr< LinkVisitor > _linker
const AnimationList & getAnimationList() const
std::set< osg::ref_ptr< Target > > TargetSet
std::vector< osg::ref_ptr< osgAnimation::Animation > > AnimationList
Definition: Animation.h:98
Definition: Node.h:71