Gazebo Common

API Reference

5.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 GZ_COMMON_NODE_ANIMATION_HH_
18 #define GZ_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 <gz/utils/ImplPtr.hh>
27 
28 #include <gz/common/graphics/Export.hh>
29 
30 namespace gz
31 {
32  namespace common
33  {
36  class GZ_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 
83  const unsigned int _i) const;
84 
87  public: double Length() const;
88 
95  public: gz::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  GZ_UTILS_IMPL_PTR(dataPtr)
113  };
114  }
115 }
116 
117 #endif