Gazebo Common

API Reference

4.7.0
gz/common/SkeletonAnimation.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_SKELETONANIMATION_HH_
18 #define IGNITION_COMMON_SKELETONANIMATION_HH_
19 
20 #include <map>
21 #include <utility>
22 #include <string>
23 
24 #include <gz/math/Matrix4.hh>
25 #include <gz/math/Pose3.hh>
26 
27 #include <ignition/utils/ImplPtr.hh>
28 
29 #include <gz/common/config.hh>
31 #include <gz/common/graphics/Export.hh>
32 
33 namespace ignition
34 {
35  namespace common
36  {
40  class IGNITION_COMMON_GRAPHICS_VISIBLE SkeletonAnimation
41  {
44  public: explicit SkeletonAnimation(const std::string &_name);
45 
48  public: ~SkeletonAnimation();
49 
52  public: void SetName(const std::string& _name);
53 
56  public: std::string Name() const;
57 
60  public: unsigned int NodeCount() const;
61 
65  public: NodeAnimation *NodeAnimationByName(const std::string &_name)
66  const;
67 
71  public: bool HasNode(const std::string &_node) const;
72 
77  public: void AddKeyFrame(const std::string &_node, const double _time,
78  const math::Matrix4d &_mat);
79 
84  public: void AddKeyFrame(const std::string &_node, const double _time,
85  const math::Pose3d &_pose);
86 
96  public: math::Matrix4d NodePoseAt(const std::string &_node,
97  const double _time, const bool _loop = true) const;
98 
108  const double _time, const bool _loop = true) const;
109 
118  public: std::map<std::string, math::Matrix4d> PoseAtX(const double _x,
119  const std::string &_node, const bool _loop = true) const;
120 
123  public: void Scale(const double _scale);
124 
127  public: double Length() const;
128 
130  IGN_UTILS_IMPL_PTR(dataPtr)
131  };
132  }
133 }
134 #endif
Forward declarations for the common classes.
STL class.
Node animation.
Definition: gz/common/NodeAnimation.hh:37
STL class.
Skeleton animation.
Definition: gz/common/SkeletonAnimation.hh:40