Gazebo Common

API Reference

4.7.0
gz/common/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 <gz/math/Matrix4.hh>
24 #include <gz/math/Pose3.hh>
25 
26 #include <ignition/utils/ImplPtr.hh>
27 
28 #include <gz/common/config.hh>
29 #include <gz/common/graphics/Export.hh>
30 
31 namespace ignition
32 {
33  namespace common
34  {
37  class IGNITION_COMMON_GRAPHICS_VISIBLE NodeAnimation
38  {
41  public: explicit NodeAnimation(const std::string &_name);
42 
44  public: ~NodeAnimation();
45 
48  public: void SetName(const std::string &_name);
49 
52  public: std::string Name() const;
53 
57  public: void AddKeyFrame(const double _time,
58  const math::Matrix4d &_trans);
59 
63  public: void AddKeyFrame(const double _time, const math::Pose3d &_pose);
64 
67  public: unsigned int FrameCount() const;
68 
75  public: void KeyFrame(const unsigned int _i, double &_time,
76  math::Matrix4d &_trans) const;
77 
84  const unsigned int _i) const;
85 
88  public: double Length() const;
89 
96  public: ignition::math::Matrix4d FrameAt(const double _time,
97  const bool _loop = true) const;
98 
102  public: void Scale(const double _scale);
103 
110  public: double TimeAtX(const double _x) const;
111 
113  IGN_UTILS_IMPL_PTR(dataPtr)
114  };
115  }
116 }
117 
118 #endif
Forward declarations for the common classes.
STL class.
Node animation.
Definition: gz/common/NodeAnimation.hh:37
A key frame in an animation.
Definition: gz/common/KeyFrame.hh:35