Ignition Common

API Reference

3.5.0
NodeAnimation.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_NODE_ANIMATION_HH_
18 #define IGNITION_COMMON_NODE_ANIMATION_HH_
19 
20 #include <string>
21 #include <utility>
22 
23 #include <ignition/math/Matrix4.hh>
24 #include <ignition/math/Pose3.hh>
25 
26 #include <ignition/common/graphics/Export.hh>
27 
28 namespace ignition
29 {
30  namespace common
31  {
32  class NodeAnimationPrivate;
33 
36  class IGNITION_COMMON_GRAPHICS_VISIBLE NodeAnimation
37  {
40  public: explicit NodeAnimation(const std::string &_name);
41 
43  public: ~NodeAnimation();
44 
47  public: void SetName(const std::string &_name);
48 
51  public: std::string Name() const;
52 
56  public: void AddKeyFrame(const double _time,
57  const math::Matrix4d &_trans);
58 
62  public: void AddKeyFrame(const double _time, const math::Pose3d &_pose);
63 
66  public: unsigned int FrameCount() const;
67 
74  public: void KeyFrame(const unsigned int _i, double &_time,
75  math::Matrix4d &_trans) const;
76 
82  public: std::pair<double, math::Matrix4d> KeyFrame(
83  const unsigned int _i) const;
84 
87  public: double Length() const;
88 
95  public: ignition::math::Matrix4d FrameAt(const double _time,
96  const bool _loop = true) const;
97 
101  public: void Scale(const double _scale);
102 
109  public: double TimeAtX(const double _x) const;
110 
112  private: NodeAnimationPrivate *data;
113  };
114  }
115 }
116 
117 #endif
STL class.
A key frame in an animation.
Definition: KeyFrame.hh:30
Node animation.
Definition: NodeAnimation.hh:36
Forward declarations for the common classes.