Ignition Common

API Reference

3.5.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
79  protected: math::Vector3d translate;
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 Time class, can be used to hold wall- or sim-time. stored as sec and nano-sec.
Definition: Time.hh:33
double value
numeric value
Definition: KeyFrame.hh:108
A key frame in an animation.
Definition: KeyFrame.hh:30
math::Quaterniond rotate
the rotation quaternion
Definition: KeyFrame.hh:83
double time
time of key frame
Definition: KeyFrame.hh:44
A keyframe for a NumericAnimation.
Definition: KeyFrame.hh:90
Forward declarations for the common classes.
A keyframe for a PoseAnimation.
Definition: KeyFrame.hh:48