Ignition Common

API Reference

3.14.0
KeyFrame.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 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 IGNITION_COMMON_KEYFRAME_HH_
18 #define IGNITION_COMMON_KEYFRAME_HH_
19 
20 #include <ignition/math/Vector3.hh>
22 #include <ignition/common/graphics/Export.hh>
23 
24 namespace ignition
25 {
26  namespace common
27  {
30  class IGNITION_COMMON_GRAPHICS_VISIBLE KeyFrame
31  {
34  public: explicit KeyFrame(const double _time);
35 
37  public: virtual ~KeyFrame();
38 
41  public: double Time() const;
42 
44  protected: double time;
45  };
46 
48  class IGNITION_COMMON_GRAPHICS_VISIBLE PoseKeyFrame : public KeyFrame
49  {
52  public: explicit PoseKeyFrame(const double _time);
53 
55  public: virtual ~PoseKeyFrame();
56 
59  public: void Translation(const math::Vector3d &_trans);
60 
63  public: const math::Vector3d &Translation() const;
64 
67  public: void Rotation(const math::Quaterniond &_rot);
68 
71  public: const math::Quaterniond &Rotation() const;
72 
73 #ifdef _WIN32
74 // Disable warning C4251 which is triggered by
75 // std::unique_ptr
76 #pragma warning(push)
77 #pragma warning(disable: 4251)
78 #endif
81 
84 #ifdef _WIN32
85 #pragma warning(pop)
86 #endif
87  };
88 
90  class IGNITION_COMMON_GRAPHICS_VISIBLE NumericKeyFrame : public KeyFrame
91  {
94  public: explicit NumericKeyFrame(const double _time);
95 
97  public: virtual ~NumericKeyFrame();
98 
101  public: void Value(const double &_value);
102 
105  public: const double &Value() const;
106 
108  protected: double value;
109  };
110  }
111 }
112 #endif
A key frame in an animation.
Definition: KeyFrame.hh:31
virtual ~KeyFrame()
Destructor.
double Time() const
Get the time of the keyframe.
double time
time of key frame
Definition: KeyFrame.hh:44
KeyFrame(const double _time)
Constructor.
A keyframe for a NumericAnimation.
Definition: KeyFrame.hh:91
NumericKeyFrame(const double _time)
Constructor.
virtual ~NumericKeyFrame()
Destructor.
void Value(const double &_value)
Set the value of the keyframe.
double value
numeric value
Definition: KeyFrame.hh:108
const double & Value() const
Get the value of the keyframe.
A keyframe for a PoseAnimation.
Definition: KeyFrame.hh:49
PoseKeyFrame(const double _time)
Constructor.
const math::Quaterniond & Rotation() const
Get the rotation of the keyframe.
void Rotation(const math::Quaterniond &_rot)
Set the rotation for the keyframe.
const math::Vector3d & Translation() const
Get the translation of the keyframe.
math::Quaterniond rotate
the rotation quaternion
Definition: KeyFrame.hh:83
virtual ~PoseKeyFrame()
Destructor.
math::Vector3d translate
the translation vector
Definition: KeyFrame.hh:80
void Translation(const math::Vector3d &_trans)
Set the translation for the keyframe.
Forward declarations for the common classes.