Ignition Rendering

API Reference

5.0.0
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 IGNITION_RENDERING_VISUAL_HH_
18 #define IGNITION_RENDERING_VISUAL_HH_
19 
20 #include <variant>
21 #include <string>
23 #include "ignition/rendering/config.hh"
25 
26 namespace ignition
27 {
28  namespace rendering
29  {
30  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
31  //
32  using Variant = std::variant<int, float, double, std::string>;
33 
37  class IGNITION_RENDERING_VISIBLE Visual :
38  public virtual Node
39  {
41  public: virtual ~Visual() { }
42 
45  public: virtual unsigned int GeometryCount() const = 0;
46 
50  public: virtual bool HasGeometry(ConstGeometryPtr _geometry) const = 0;
51 
56  public: virtual GeometryPtr GeometryByIndex(
57  unsigned int _index) const = 0;
58 
62  public: virtual void AddGeometry(GeometryPtr _geometry) = 0;
63 
68  public: virtual GeometryPtr RemoveGeometry(GeometryPtr _geometry) = 0;
69 
74  public: virtual GeometryPtr RemoveGeometryByIndex(
75  unsigned int _index) = 0;
76 
78  public: virtual void RemoveGeometries() = 0;
79 
86  public: virtual void SetMaterial(const std::string &_name,
87  bool unique = true) = 0;
88 
92  public: virtual void SetMaterial(MaterialPtr _material,
93  bool unique = true) = 0;
94 
98  public: virtual void SetChildMaterial(MaterialPtr _material,
99  bool unique = true) = 0;
100 
104  public: virtual void SetGeometryMaterial(MaterialPtr _material,
105  bool unique = true) = 0;
106 
111  public: virtual MaterialPtr Material() = 0;
112 
115  public: virtual void SetVisible(bool _visible) = 0;
116 
119  public: virtual void SetVisibilityFlags(uint32_t _flags) = 0;
120 
123  public: virtual uint32_t VisibilityFlags() const = 0;
124 
127  public: virtual void AddVisibilityFlags(uint32_t _flags) = 0;
128 
131  public: virtual void RemoveVisibilityFlags(uint32_t _flags) = 0;
132 
136  public: virtual void SetUserData(const std::string &_key,
137  Variant _value) = 0;
138 
142  public: virtual Variant UserData(const std::string &_key) const = 0;
143 
146  public: virtual ignition::math::AxisAlignedBox BoundingBox() const = 0;
147 
150  public: virtual ignition::math::AxisAlignedBox LocalBoundingBox()
151  const = 0;
152  };
153  }
154  }
155 }
156 #endif
virtual ~Visual()
Destructor.
Definition: Visual.hh:41
Represents a single posable node in the scene graph.
Definition: Node.hh:37
STL class.
Represents a visual node in a scene graph. A Visual is the only node that can have Geometry and other...
Definition: Visual.hh:37
std::variant< int, float, double, std::string > Variant
Definition: Visual.hh:32
Represents a surface material of a Geometry.
Definition: Material.hh:47