KeyFrame.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17#ifndef _KEYFRAME_HH_
18#define _KEYFRAME_HH_
19
20#include <ignition/math/Vector3.hh>
21#include <ignition/math/Quaternion.hh>
22
24#include "gazebo/util/system.hh"
25
26namespace gazebo
27{
28 namespace common
29 {
32
35 class GZ_COMMON_VISIBLE KeyFrame
36 {
39 public: explicit KeyFrame(double _time);
40
42 public: virtual ~KeyFrame();
43
46 public: double GetTime() const;
47
49 protected: double time;
50 };
51
53 class GZ_COMMON_VISIBLE PoseKeyFrame : public KeyFrame
54 {
57 public: explicit PoseKeyFrame(double _time);
58
60 public: virtual ~PoseKeyFrame();
61
64 public: void Translation(const ignition::math::Vector3d &_trans);
65
68 public: ignition::math::Vector3d Translation() const;
69
72 public: void Rotation(const ignition::math::Quaterniond &_rot);
73
76 public: ignition::math::Quaterniond Rotation() const;
77
79 protected: ignition::math::Vector3d translate;
80
82 protected: ignition::math::Quaterniond rotate;
83 };
84
86 class GZ_COMMON_VISIBLE NumericKeyFrame : public KeyFrame
87 {
90 public: explicit NumericKeyFrame(double _time);
91
93 public: virtual ~NumericKeyFrame();
94
97 public: void SetValue(const double &_value);
98
101 public: const double &GetValue() const;
102
104 protected: double value;
105 };
107 }
108}
109#endif
common
Definition FuelModelDatabase.hh:37
A key frame in an animation.
Definition KeyFrame.hh:36
KeyFrame(double _time)
Constructor.
double GetTime() const
Get the time of the keyframe.
virtual ~KeyFrame()
Destructor.
double time
time of key frame
Definition KeyFrame.hh:49
A keyframe for a NumericAnimation.
Definition KeyFrame.hh:87
void SetValue(const double &_value)
Set the value of the keyframe.
NumericKeyFrame(double _time)
Constructor.
virtual ~NumericKeyFrame()
Destructor.
const double & GetValue() const
Get the value of the keyframe.
double value
numeric value
Definition KeyFrame.hh:104
A keyframe for a PoseAnimation.
Definition KeyFrame.hh:54
ignition::math::Vector3d Translation() const
Get the translation of the keyframe.
PoseKeyFrame(double _time)
Constructor.
ignition::math::Quaterniond rotate
the rotation quaternion
Definition KeyFrame.hh:82
ignition::math::Quaterniond Rotation() const
Get the rotation of the keyframe.
ignition::math::Vector3d translate
the translation vector
Definition KeyFrame.hh:79
void Translation(const ignition::math::Vector3d &_trans)
Set the translation for the keyframe.
virtual ~PoseKeyFrame()
Destructor.
void Rotation(const ignition::math::Quaterniond &_rot)
Set the rotation for the keyframe.
Forward declarations for the common classes.
Definition Animation.hh:27