Gazebo Common

API Reference

6.0.1
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 GZ_COMMON_NODE_TRANSFORM_HH_
18#define GZ_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 <gz/utils/ImplPtr.hh>
26
27#include <gz/common/graphics/Export.hh>
28#include <gz/common/Util.hh>
29
30namespace gz
31{
32 namespace common
33 {
36 class GZ_COMMON_GRAPHICS_VISIBLE NodeTransform
37 {
40 public: explicit NodeTransform(const NodeTransformType _type = MATRIX);
41
46 public: NodeTransform(const math::Matrix4d &_mat,
47 const std::string &_sid = "_default_",
48 const NodeTransformType _type = MATRIX);
49
51 public: ~NodeTransform();
52
55 public: void Set(const math::Matrix4d &_mat);
56
59 public: math::Matrix4d Get() const;
60
63 public: void SetType(const NodeTransformType _type);
64
67 public: NodeTransformType Type() const;
68
71 public: void SetSID(const std::string &_sid);
72
75 public: std::string SID() const;
76
80 public: void SetComponent(const unsigned int _idx, const double _value);
81
84 public: void SetSourceValues(const math::Matrix4d &_mat);
85
88 public: void SetSourceValues(const math::Vector3d &_vec);
89
93 public: void SetSourceValues(const math::Vector3d &_axis,
94 const double _angle);
95
97 public: void RecalculateMatrix();
98
100 public: void PrintSource() const;
101
104 public: math::Matrix4d operator()() const;
105
109 public: math::Matrix4d operator*(const NodeTransform &_t) const;
110
114 public: math::Matrix4d operator*(const math::Matrix4d &_m) const;
115
117 GZ_UTILS_IMPL_PTR(dataPtr)
118 };
119 }
120}
121#endif