Gazebo Common

API Reference

4.7.0
gz/common/NodeTransform.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_TRANSFORM_HH_
18 #define IGNITION_COMMON_NODE_TRANSFORM_HH_
19 #include <memory>
20 #include <string>
21 
22 #include <gz/math/Matrix4.hh>
23 #include <gz/math/Vector3.hh>
24 
25 #include <ignition/utils/ImplPtr.hh>
26 
27 #include <gz/common/config.hh>
28 #include <gz/common/graphics/Export.hh>
29 #include <gz/common/Util.hh>
30 
31 namespace ignition
32 {
33  namespace common
34  {
37  class IGNITION_COMMON_GRAPHICS_VISIBLE NodeTransform
38  {
41  public: explicit NodeTransform(const NodeTransformType _type = MATRIX);
42 
47  public: NodeTransform(const math::Matrix4d &_mat,
48  const std::string &_sid = "_default_",
49  const NodeTransformType _type = MATRIX);
50 
52  public: ~NodeTransform();
53 
56  public: void Set(const math::Matrix4d &_mat);
57 
60  public: math::Matrix4d Get() const;
61 
64  public: void SetType(const NodeTransformType _type);
65 
68  public: NodeTransformType Type() const;
69 
72  public: void SetSID(const std::string &_sid);
73 
76  public: std::string SID() const;
77 
81  public: void SetComponent(const unsigned int _idx, const double _value);
82 
85  public: void SetSourceValues(const math::Matrix4d &_mat);
86 
89  public: void SetSourceValues(const math::Vector3d &_vec);
90 
94  public: void SetSourceValues(const math::Vector3d &_axis,
95  const double _angle);
96 
98  public: void RecalculateMatrix();
99 
101  public: void PrintSource() const;
102 
105  public: math::Matrix4d operator()() const;
106 
110  public: math::Matrix4d operator*(const NodeTransform &_t) const;
111 
115  public: math::Matrix4d operator*(const math::Matrix4d &_m) const;
116 
118  IGN_UTILS_IMPL_PTR(dataPtr)
119  };
120  }
121 }
122 #endif
NodeTransformType
Enumeration of the transform types.
Definition: include/gz/common/Util.hh:106
Forward declarations for the common classes.
STL class.
@ MATRIX
Definition: include/gz/common/Util.hh:106
A transformation node.
Definition: gz/common/NodeTransform.hh:37