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 
26 namespace 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
A keyframe for a NumericAnimation.
Definition: KeyFrame.hh:86
A keyframe for a PoseAnimation.
Definition: KeyFrame.hh:53
A key frame in an animation.
Definition: KeyFrame.hh:35
double value
numeric value
Definition: KeyFrame.hh:104
ignition::math::Quaterniond rotate
the rotation quaternion
Definition: KeyFrame.hh:82
double time
time of key frame
Definition: KeyFrame.hh:49
ignition::math::Vector3d translate
the translation vector
Definition: KeyFrame.hh:79