OpenSceneGraph 3.6.5
AnimationManagerBase
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
20#include <osgAnimation/Export>
21#include <osg/FrameStamp>
22#include <osg/Group>
23
24
25
26namespace osgAnimation
27{
29 {
30 public:
31 typedef std::set<osg::ref_ptr<Target> > TargetSet;
32
36 virtual void buildTargetReference();
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;}
44
45 //uniformisation of the API
46 inline Animation * getRegisteredAnimation(unsigned int i) { return _animations[i].get();}
47 inline unsigned int getNumRegisteredAnimations() const { return _animations.size();}
48 inline void addRegisteredAnimation(Animation* animation)
49 {
50 _needToLink = true;
51 _animations.push_back(animation);
53 }
55
57 virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
58
62
65
67 void setAutomaticLink(bool);
68 bool getAutomaticLink() const;
69 bool isAutomaticLink() const { return getAutomaticLink(); }
70 void dirty();
71
72 protected:
73
79 };
80}
81#endif
The osgAnimation library provides general purpose utility classes for animation.
Definition Action:34
std::vector< osg::ref_ptr< osgAnimation::Animation > > AnimationList
Definition Animation:100
Deprecated.
Definition Callback:215
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Base class for all internal nodes in the scene graph.
Definition Node:72
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Definition Animation:29
Animation * getRegisteredAnimation(unsigned int i)
Definition AnimationManagerBase:46
std::set< osg::ref_ptr< Target > > TargetSet
Definition AnimationManagerBase:31
AnimationList _animations
Definition AnimationManagerBase:75
virtual void update(double t)=0
void setAutomaticLink(bool)
set a flag to define the behaviour
const AnimationList & getAnimationList() const
Definition AnimationManagerBase:42
TargetSet _targets
Definition AnimationManagerBase:76
osg::ref_ptr< LinkVisitor > _linker
Definition AnimationManagerBase:74
virtual bool needToLink() const
AnimationList & getAnimationList()
Definition AnimationManagerBase:43
void setLinkVisitor(LinkVisitor *)
virtual void link(osg::Node *subgraph)
virtual void unregisterAnimation(Animation *)
unsigned int getNumRegisteredAnimations() const
Definition AnimationManagerBase:47
bool _needToLink
Definition AnimationManagerBase:77
bool isAutomaticLink() const
Definition AnimationManagerBase:69
void removeRegisteredAnimation(Animation *animation)
virtual void registerAnimation(Animation *)
virtual void operator()(osg::Node *node, osg::NodeVisitor *nv)
Callback method called by the NodeVisitor when visiting a node.
void addRegisteredAnimation(Animation *animation)
Definition AnimationManagerBase:48
void clearTargets()
Reset the value of targets this Operation must be done each frame.
bool _automaticLink
Definition AnimationManagerBase:78
AnimationManagerBase(const AnimationManagerBase &b, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
This class is instancied by the AnimationManagerBase, it will link animation target to updatecallback...
Definition LinkVisitor:29
#define OSGANIMATION_EXPORT
Definition Export:40

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.