19 #ifndef OSGANIMATION_CHANNEL
20 #define OSGANIMATION_CHANNEL 1
22 #include <osgAnimation/Export>
23 #include <osgAnimation/Sampler>
24 #include <osgAnimation/Target>
25 #include <osg/Referenced>
40 virtual void update(
double time,
float weight,
int priority) = 0;
41 virtual void reset() = 0;
42 virtual Target* getTarget() = 0;
43 virtual bool setTarget(
Target*) = 0;
45 const std::string& getName()
const;
46 void setName(
const std::string& name);
48 virtual double getStartTime()
const = 0;
49 virtual double getEndTime()
const = 0;
51 const std::string& getTargetName()
const;
52 void setTargetName(
const std::string& name);
54 virtual Sampler* getSampler() = 0;
55 virtual const Sampler* getSampler()
const = 0;
60 virtual bool createKeyframeContainerFromTargetValue() = 0;
69 template <
typename SamplerType>
111 _sampler->getKeyframeContainerTyped()->push_back(key);
116 virtual void update(
double time,
float weight,
int priority)
121 typename SamplerType::UsingType value;
123 _target->update(weight, value, priority);
129 _target =
dynamic_cast<TargetType*
>(target);
130 return _target.get() == target;
160 typedef std::vector<osg::ref_ptr<osgAnimation::Channel> >
ChannelList;
SamplerType::UsingType UsingType
#define OSGANIMATION_EXPORT
virtual ~TemplateChannel()
TemplateChannel< FloatCubicBezierSampler > FloatCubicBezierChannel
void setSampler(SamplerType *sampler)
virtual Target * getTarget()
TemplateKeyframeContainer< typename SamplerType::KeyframeType > KeyframeContainerType
TemplateChannel< DoubleStepSampler > DoubleStepChannel
virtual bool setTarget(Target *target)
TemplateChannel< MatrixLinearSampler > MatrixLinearChannel
TemplateChannel< FloatStepSampler > FloatStepChannel
TemplateChannel(const TemplateChannel &channel)
const Sampler * getSampler() const
TemplateTarget< UsingType > TargetType
T * clone(const T *t, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
TemplateChannel< Vec4CubicBezierSampler > Vec4CubicBezierChannel
TemplateChannel(SamplerType *s=0, TargetType *target=0)
TemplateChannel< Vec2CubicBezierSampler > Vec2CubicBezierChannel
const SamplerType * getSamplerTyped() const
SamplerType * getSamplerTyped()
TemplateChannel< Vec3StepSampler > Vec3StepChannel
osg::ref_ptr< SamplerType > _sampler
TemplateChannel< DoubleCubicBezierSampler > DoubleCubicBezierChannel
SamplerType * getOrCreateSampler()
const TargetType * getTargetTyped() const
TargetType * getTargetTyped()
TemplateChannel< Vec2LinearSampler > Vec2LinearChannel
virtual double getStartTime() const
TemplateChannel< FloatLinearSampler > FloatLinearChannel
std::vector< osg::ref_ptr< osgAnimation::Channel > > ChannelList
TemplateChannel< Vec2StepSampler > Vec2StepChannel
TemplateChannel< DoubleLinearSampler > DoubleLinearChannel
void setTarget(TargetType *target)
TemplateChannel< Vec4LinearSampler > Vec4LinearChannel
TemplateChannel< Vec3CubicBezierSampler > Vec3CubicBezierChannel
virtual double getEndTime() const
TemplateChannel< QuatStepSampler > QuatStepChannel
osg::ref_ptr< TargetType > _target
virtual void update(double time, float weight, int priority)
TemplateChannel< Vec3LinearSampler > Vec3LinearChannel
TemplateChannel< Vec4StepSampler > Vec4StepChannel
TemplateChannel< QuatSphericalLinearSampler > QuatSphericalLinearChannel
virtual bool createKeyframeContainerFromTargetValue()