Gazebo Rendering

API Reference

6.6.3
gz/rendering/Visual.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_VISUAL_HH_
18 #define GZ_RENDERING_VISUAL_HH_
19 
20 #include <string>
21 #include <gz/math/AxisAlignedBox.hh>
22 #include "gz/rendering/config.hh"
23 #include "gz/rendering/Node.hh"
24 
25 namespace ignition
26 {
27  namespace rendering
28  {
29  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
33  class IGNITION_RENDERING_VISIBLE Visual :
34  public virtual Node
35  {
37  public: virtual ~Visual() { }
38 
41  public: virtual unsigned int GeometryCount() const = 0;
42 
46  public: virtual bool HasGeometry(ConstGeometryPtr _geometry) const = 0;
47 
52  public: virtual GeometryPtr GeometryByIndex(
53  unsigned int _index) const = 0;
54 
58  public: virtual void AddGeometry(GeometryPtr _geometry) = 0;
59 
64  public: virtual GeometryPtr RemoveGeometry(GeometryPtr _geometry) = 0;
65 
70  public: virtual GeometryPtr RemoveGeometryByIndex(
71  unsigned int _index) = 0;
72 
74  public: virtual void RemoveGeometries() = 0;
75 
82  public: virtual void SetMaterial(const std::string &_name,
83  bool _unique = true) = 0;
84 
88  public: virtual void SetMaterial(MaterialPtr _material,
89  bool _unique = true) = 0;
90 
94  public: virtual void SetChildMaterial(MaterialPtr _material,
95  bool _unique = true) = 0;
96 
100  public: virtual void SetGeometryMaterial(MaterialPtr _material,
101  bool _unique = true) = 0;
102 
107  public: virtual MaterialPtr Material() const = 0;
108 
111  public: virtual void SetWireframe(bool _show) = 0;
112 
115  public: virtual bool Wireframe() const = 0;
116 
119  public: virtual void SetVisible(bool _visible) = 0;
120 
123  public: virtual void SetVisibilityFlags(uint32_t _flags) = 0;
124 
127  public: virtual uint32_t VisibilityFlags() const = 0;
128 
131  public: virtual void AddVisibilityFlags(uint32_t _flags) = 0;
132 
135  public: virtual void RemoveVisibilityFlags(uint32_t _flags) = 0;
136 
139  public: virtual ignition::math::AxisAlignedBox BoundingBox() const = 0;
140 
143  public: virtual ignition::math::AxisAlignedBox LocalBoundingBox()
144  const = 0;
145 
152  public: virtual VisualPtr Clone(const std::string &_name,
153  NodePtr _newParent) const = 0;
154  };
155  }
156  }
157 }
158 #endif
virtual unsigned int GeometryCount() const =0
Get the number of geometries attached to this visual.
Represents a single posable node in the scene graph.
Definition: gz/rendering/Node.hh:51
STL class.
STL class.
virtual VisualPtr Clone(const std::string &_name, NodePtr _newParent) const =0
Clone the visual (and its children) with a new name.
virtual void SetMaterial(const std::string &_name, bool _unique=true)=0
Set the material for all attached visuals and geometries. The specified material will be retrieved fr...
2D or 3D Bounding box. It stores the position / orientation / size info of the box and its label
Definition: gz/rendering/BoundingBox.hh:41
virtual ignition::math::AxisAlignedBox BoundingBox() const =0
Get the bounding box in world frame coordinates.
virtual void SetWireframe(bool _show)=0
Enable or disable wireframe.
virtual GeometryPtr RemoveGeometry(GeometryPtr _geometry)=0
Remove the given geometry from this visual. If the given node is not a child of this visual,...
virtual GeometryPtr RemoveGeometryByIndex(unsigned int _index)=0
Remove the geometry at the given index from this visual. If the specified node is not attached this v...
virtual GeometryPtr GeometryByIndex(unsigned int _index) const =0
Get geometry at given index. If no geometry exists at given index, NULL will be returned.
virtual ignition::math::AxisAlignedBox LocalBoundingBox() const =0
Get the local bounding box of the visual.
virtual MaterialPtr Material() const =0
Get the material assigned to attached visuals and geometries.
virtual void AddGeometry(GeometryPtr _geometry)=0
Add the given geometry to this visual. If the given node is already attached, no work will be done.
virtual void AddVisibilityFlags(uint32_t _flags)=0
Add visibility flags.
virtual bool HasGeometry(ConstGeometryPtr _geometry) const =0
Determine if given geometry is attached to this visual.
Represents a visual node in a scene graph. A Visual is the only node that can have Geometry and other...
Definition: gz/rendering/Visual.hh:33
virtual ~Visual()
Deconstructor.
Definition: gz/rendering/Visual.hh:37
virtual void SetVisibilityFlags(uint32_t _flags)=0
Set visibility flags.
virtual bool Wireframe() const =0
Get whether wireframe is enabled for this visual.
virtual void SetVisible(bool _visible)=0
Specify if this visual is visible.
virtual void RemoveVisibilityFlags(uint32_t _flags)=0
Remove visibility flags.
Represents a surface material of a Geometry.
Definition: gz/rendering/Material.hh:47
virtual void RemoveGeometries()=0
Remove all attached geometries from this visual.
virtual uint32_t VisibilityFlags() const =0
Get visibility flags.
virtual void SetGeometryMaterial(MaterialPtr _material, bool _unique=true)=0
Set the material for all attached geometries only.
virtual void SetChildMaterial(MaterialPtr _material, bool _unique=true)=0
Set the material for all attached visuals only.