OpenSceneGraph 3.6.5
ActionVisitor
Go to the documentation of this file.
1/* -*-c++-*-
2 * Copyright (C) 2009 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_ACTIONVISITOR_H
16#define OSGANIMATION_ACTIONVISITOR_H
17
18#include <vector>
19#include <osgAnimation/Export>
20#include <osg/Referenced>
22
23namespace osgAnimation
24{
25
26 class Timeline;
27 class Action;
28 class ActionBlendIn;
29 class ActionBlendOut;
30 class ActionAnimation;
31 class ActionStripAnimation;
32
33#define META_ActionVisitor(library,name) \
34 virtual const char* libraryName() const { return #library; }\
35 virtual const char* className() const { return #name; }
36
37
39 {
40 public:
43 void traverse(Action& visitor);
44
47
50
52 void setCurrentLayer(int layer) { _currentLayer = layer;}
53 int getCurrentLayer() const { return _currentLayer; }
54
55 const std::vector<FrameAction>& getStackedFrameAction() const { return _stackFrameAction; }
56
57 virtual void apply(Action& action);
58 virtual void apply(Timeline& tm);
59 virtual void apply(ActionBlendIn& action);
60 virtual void apply(ActionBlendOut& action);
61 virtual void apply(ActionAnimation& action);
62 virtual void apply(ActionStripAnimation& action);
63
64 protected:
65 std::vector<FrameAction> _stackFrameAction;
66 std::vector<Timeline*> _stackTimeline;
68 };
69
70
72 {
73 protected:
74 unsigned int _frame;
76 public:
79 void setFrame(unsigned int frame) { _frame = frame;}
80
81 bool isActive(Action& action) const;
82 unsigned int getLocalFrame() const;
83
84 void apply(Timeline& action);
85 void apply(Action& action);
86 void apply(ActionBlendIn& action);
87 void apply(ActionBlendOut& action);
88 void apply(ActionAnimation& action);
90
91 };
92
93
95 {
96 public:
101
104 void setFrame(unsigned int frame) { _frame = frame;}
105
106 void apply(Timeline& action);
107 void apply(Action& action);
108
109 protected:
110 unsigned int _frame;
111 std::vector<osg::ref_ptr<Action> > _remove;
113 };
114
115}
116
117#endif
The osgAnimation library provides general purpose utility classes for animation.
Definition Action:34
std::pair< unsigned int, osg::ref_ptr< Action > > FrameAction
Definition FrameAction:24
Base class for providing reference counted objects.
Definition Referenced:44
Definition Action:37
Definition ActionAnimation:26
blend in from 0 to weight in duration
Definition ActionBlendIn:27
blend out from weight to 0 in duration
Definition ActionBlendOut:27
Definition ActionStripAnimation:30
Definition ActionVisitor:39
virtual void apply(Timeline &tm)
virtual void apply(ActionStripAnimation &action)
void pushTimelineOnStack(Timeline *tm)
virtual void apply(ActionBlendOut &action)
void setCurrentLayer(int layer)
Definition ActionVisitor:52
const std::vector< FrameAction > & getStackedFrameAction() const
Definition ActionVisitor:55
virtual void apply(ActionAnimation &action)
std::vector< FrameAction > _stackFrameAction
Definition ActionVisitor:65
int _currentLayer
Definition ActionVisitor:67
void traverse(Action &visitor)
virtual void apply(Action &action)
META_ActionVisitor(osgAnimation, ActionVisitor)
std::vector< Timeline * > _stackTimeline
Definition ActionVisitor:66
int getCurrentLayer() const
Definition ActionVisitor:53
virtual void apply(ActionBlendIn &action)
void pushFrameActionOnStack(const FrameAction &fa)
bool isActive(Action &action) const
void setFrame(unsigned int frame)
Definition ActionVisitor:79
void apply(ActionStripAnimation &action)
void apply(ActionAnimation &action)
META_ActionVisitor(osgAnimation, UpdateActionVisitor)
unsigned int _frame
Definition ActionVisitor:74
unsigned int _currentAnimationPriority
Definition ActionVisitor:75
void apply(ActionBlendOut &action)
unsigned int getLocalFrame() const
void apply(ActionBlendIn &action)
void apply(Timeline &action)
void apply(Action &action)
ClearType _clearType
Definition ActionVisitor:112
std::vector< osg::ref_ptr< Action > > _remove
Definition ActionVisitor:111
unsigned int _frame
Definition ActionVisitor:110
void setFrame(unsigned int frame)
Definition ActionVisitor:104
ClearType
Definition ActionVisitor:97
@ AFTER_FRAME
Definition ActionVisitor:99
@ BEFORE_FRAME
Definition ActionVisitor:98
void apply(Timeline &action)
ClearActionVisitor(ClearType type=BEFORE_FRAME)
META_ActionVisitor(osgAnimation, ClearActionVisitor)
Definition Timeline:32
#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.