Gazebo Rendering

API Reference

3.7.2
gz/rendering/Node.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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_RENDERING_NODE_HH_
18 #define GZ_RENDERING_NODE_HH_
19 
20 #include <string>
21 #include <gz/math/Pose3.hh>
22 #include <gz/math/Quaternion.hh>
23 
24 #include "gz/rendering/config.hh"
26 #include "gz/rendering/Object.hh"
27 #include "gz/rendering/Export.hh"
28 
29 namespace ignition
30 {
31  namespace rendering
32  {
33  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
34  //
37  class IGNITION_RENDERING_VISIBLE Node :
38  public virtual Object
39  {
41  public: virtual ~Node() { }
42 
45  public: virtual bool HasParent() const = 0;
46 
49  public: virtual NodePtr Parent() const = 0;
50 
53  public: virtual void RemoveParent() = 0;
54 
57  public: virtual math::Pose3d LocalPose() const = 0;
58 
61  public: virtual void SetLocalPose(const math::Pose3d &_pose) = 0;
62 
65  public: virtual math::Vector3d LocalPosition() const = 0;
66 
71  public: virtual void SetLocalPosition(double _x, double _y,
72  double _z) = 0;
73 
76  public: virtual void SetLocalPosition(
77  const math::Vector3d &_position) = 0;
78 
81  public: virtual math::Quaterniond LocalRotation() const = 0;
82 
87  public: virtual void SetLocalRotation(double _r, double _p,
88  double _y) = 0;
89 
95  public: virtual void SetLocalRotation(double _w, double _x, double _y,
96  double _z) = 0;
97 
100  public: virtual void SetLocalRotation(
101  const math::Quaterniond &_rotation) = 0;
102 
105  public: virtual math::Pose3d WorldPose() const = 0;
106 
109  public: virtual void SetWorldPose(const math::Pose3d &_pose) = 0;
110 
113  public: virtual math::Vector3d WorldPosition() const = 0;
114 
119  public: virtual void SetWorldPosition(double _x, double _y,
120  double _z) = 0;
121 
124  public: virtual void SetWorldPosition(
125  const math::Vector3d &_position) = 0;
126 
129  public: virtual math::Quaterniond WorldRotation() const = 0;
130 
135  public: virtual void SetWorldRotation(double _r, double _p,
136  double _y) = 0;
137 
143  public: virtual void SetWorldRotation(double _w, double _x, double _y,
144  double _z) = 0;
145 
148  public: virtual void SetWorldRotation(
149  const math::Quaterniond &_rotation) = 0;
150 
153  public: virtual math::Pose3d WorldToLocal(
154  const math::Pose3d &_pose) const = 0;
155 
158  public: virtual math::Vector3d Origin() const = 0;
159 
165  public: virtual void SetOrigin(double _x, double _y, double _z) = 0;
166 
170  public: virtual void SetOrigin(const math::Vector3d &_origin) = 0;
171 
174  public: virtual math::Vector3d LocalScale() const = 0;
175 
179  public: virtual void SetLocalScale(double _scale) = 0;
180 
185  public: virtual void SetLocalScale(double _x, double _y, double _z) = 0;
186 
189  public: virtual void SetLocalScale(const math::Vector3d &_scale) = 0;
190 
193  public: virtual math::Vector3d WorldScale() const = 0;
194 
198  public: virtual void SetWorldScale(double _scale) = 0;
199 
204  public: virtual void SetWorldScale(double _x, double _y, double _z) = 0;
205 
208  public: virtual void SetWorldScale(const math::Vector3d &_scale) = 0;
209 
213  public: virtual void Scale(double _scale) = 0;
214 
219  public: virtual void Scale(double _x, double _y, double _z) = 0;
220 
223  public: virtual void Scale(const math::Vector3d &_scale) = 0;
224 
227  public: virtual bool InheritScale() const = 0;
228 
231  public: virtual void SetInheritScale(bool _inherit) = 0;
232 
235  public: virtual unsigned int ChildCount() const = 0;
236 
239  public: virtual bool HasChild(ConstNodePtr _child) const = 0;
240 
244  public: virtual bool HasChildId(unsigned int _id) const = 0;
245 
249  public: virtual bool HasChildName(const std::string &_name) const = 0;
250 
255  public: virtual NodePtr ChildById(unsigned int _id) const = 0;
256 
261  public: virtual NodePtr ChildByName(
262  const std::string &_name) const = 0;
263 
268  public: virtual NodePtr ChildByIndex(unsigned int _index) const = 0;
269 
273  public: virtual void AddChild(NodePtr _child) = 0;
274 
279  public: virtual NodePtr RemoveChild(NodePtr _child) = 0;
280 
286  public: virtual NodePtr RemoveChildById(unsigned int _id) = 0;
287 
293  public: virtual NodePtr RemoveChildByName(const std::string &_name) = 0;
294 
300  public: virtual NodePtr RemoveChildByIndex(unsigned int _index) = 0;
301 
304  public: virtual void RemoveChildren() = 0;
305  };
306  }
307  }
308 }
309 #endif
virtual bool HasParent() const =0
Determine if this Node is attached to another Node.
virtual math::Pose3d WorldPose() const =0
Get the world pose.
virtual bool HasChildId(unsigned int _id) const =0
Determine if node with given ID is an attached child.
virtual void AddChild(NodePtr _child)=0
Add the given node to this node. If the given node is already a child, no work will be done.
Represents a single posable node in the scene graph.
Definition: gz/rendering/Node.hh:37
virtual math::Pose3d LocalPose() const =0
Get the local pose.
STL class.
virtual void SetLocalPosition(double _x, double _y, double _z)=0
Set the local position.
STL class.
virtual math::Vector3d WorldPosition() const =0
Get the world position.
virtual NodePtr RemoveChildById(unsigned int _id)=0
Remove (detach) the node with the given ID from this node. If the specified node is not a child of th...
virtual NodePtr ChildByIndex(unsigned int _index) const =0
Get node at given index. If no child exists at given index, NULL will be returned.
virtual NodePtr ChildByName(const std::string &_name) const =0
Get node with given name. If no child exists with given name, NULL will be returned.
virtual math::Vector3d LocalPosition() const =0
Get the local position.
virtual void SetLocalScale(double _scale)=0
Set the local scale. The given scale will be assigned to the x, y, and z coordinates.
virtual void RemoveParent()=0
Detach this Node from its parent. If this Node does not have a parent, no work will be done.
virtual NodePtr RemoveChild(NodePtr _child)=0
Remove (detach) the given node from this node. If the given node is not a child of this node,...
virtual void RemoveChildren()=0
Remove all child nodes from this node This detaches all the child nodes but does not destroy them.
virtual NodePtr ChildById(unsigned int _id) const =0
Get node with given ID. If no child exists with given ID, NULL will be returned.
virtual ~Node()
Deconstructor.
Definition: gz/rendering/Node.hh:41
virtual void SetWorldPose(const math::Pose3d &_pose)=0
Set the world pose.
virtual unsigned int ChildCount() const =0
Get number of child nodes.
virtual math::Vector3d WorldScale() const =0
Get the world scale.
virtual bool InheritScale() const =0
Determine if this visual inherits scale from this parent.
virtual void SetLocalRotation(double _r, double _p, double _y)=0
Set the local rotation.
virtual NodePtr Parent() const =0
Get the parent Node.
virtual void SetLocalPose(const math::Pose3d &_pose)=0
Set the local pose.
virtual void SetWorldRotation(double _r, double _p, double _y)=0
Set the world rotation.
virtual void SetWorldScale(double _scale)=0
Set the world scale. The given scale will be assigned to the x, y, and z coordinates.
virtual math::Vector3d LocalScale() const =0
Get the local scale.
virtual bool HasChild(ConstNodePtr _child) const =0
Determine if given node is an attached child.
virtual math::Pose3d WorldToLocal(const math::Pose3d &_pose) const =0
Convert given world pose to local pose.
virtual void SetWorldPosition(double _x, double _y, double _z)=0
Set the world position.
virtual bool HasChildName(const std::string &_name) const =0
Determine if node with given name is an attached child.
virtual math::Quaterniond LocalRotation() const =0
Get the local rotation.
virtual math::Quaterniond WorldRotation() const =0
Get the world rotation.
virtual NodePtr RemoveChildByIndex(unsigned int _index)=0
Remove (detach) the node at the given index from this node. If the specified node is not a child of t...
Represents an object present in the scene graph. This includes sub-meshes, materials,...
Definition: gz/rendering/Object.hh:34
virtual void SetOrigin(double _x, double _y, double _z)=0
Set position of origin. The position should be relative to the original origin of the geometry.
virtual NodePtr RemoveChildByName(const std::string &_name)=0
Remove (detach) the node with the given name from this node. If the specified node is not a child of ...
virtual math::Vector3d Origin() const =0
Get position of origin.
virtual void Scale(double _scale)=0
Scale the current scale by the given scalar. The given scalar will be assigned to the x,...
virtual void SetInheritScale(bool _inherit)=0
Specify if this visual inherits scale from its parent.