Visual.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2018 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 SDF_VISUAL_HH_
18 #define SDF_VISUAL_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <gz/math/Pose3.hh>
23 #include <gz/utils/ImplPtr.hh>
24 #include "sdf/Box.hh"
25 #include "sdf/Cylinder.hh"
26 #include "sdf/Element.hh"
27 #include "sdf/Material.hh"
28 #include "sdf/Plane.hh"
29 #include "sdf/Plugin.hh"
30 #include "sdf/SemanticPose.hh"
31 #include "sdf/Sphere.hh"
32 #include "sdf/Types.hh"
33 #include "sdf/sdf_config.h"
34 #include "sdf/system_util.hh"
35 
36 namespace sdf
37 {
38  // Inline bracket to help doxygen filtering.
39  inline namespace SDF_VERSION_NAMESPACE {
40  //
41 
42  // Forward declarations.
43  class Geometry;
44  class ParserConfig;
45  struct PoseRelativeToGraph;
46  template <typename T> class ScopedGraph;
47 
49  {
51  public: Visual();
52 
59  public: Errors Load(ElementPtr _sdf);
60 
68  public: Errors Load(ElementPtr _sdf, const ParserConfig &_config);
69 
73  public: std::string Name() const;
74 
78  public: void SetName(const std::string &_name);
79 
82  public: bool CastShadows() const;
83 
86  public: void SetCastShadows(bool _castShadows);
87 
90  public: float Transparency() const;
91 
94  public: void SetTransparency(float _transparency);
95 
98  public: const Geometry *Geom() const;
99 
102  public: void SetGeom(const Geometry &_geom);
103 
108  public: const gz::math::Pose3d &RawPose() const;
109 
113  public: void SetRawPose(const gz::math::Pose3d &_pose);
114 
119  public: const std::string &PoseRelativeTo() const;
120 
125  public: void SetPoseRelativeTo(const std::string &_frame);
126 
130  public: sdf::SemanticPose SemanticPose() const;
131 
136  public: sdf::ElementPtr Element() const;
137 
142  public: const sdf::Material *Material() const;
143 
146  public: void SetMaterial(const sdf::Material &_material);
147 
150  public: uint32_t VisibilityFlags() const;
151 
154  public: void SetVisibilityFlags(uint32_t _flags);
155 
160  public: void SetHasLaserRetro(bool _laserRetro);
161 
164  public: bool HasLaserRetro() const;
165 
168  public: double LaserRetro() const;
169 
172  public: void SetLaserRetro(double _laserRetro);
173 
179  public: sdf::ElementPtr ToElement() const;
180 
184  public: const sdf::Plugins &Plugins() const;
185 
189  public: sdf::Plugins &Plugins();
190 
192  public: void ClearPlugins();
193 
196  public: void AddPlugin(const Plugin &_plugin);
197 
202  private: void SetXmlParentName(const std::string &_xmlParentName);
203 
208  private: void SetPoseRelativeToGraph(
210 
214  friend class Link;
215 
217  GZ_UTILS_IMPL_PTR(dataPtr)
218  };
219  }
220 }
221 #endif
Material.hh
Plane.hh
sdf
namespace for Simulation Description Format parser
Definition: Actor.hh:34
Cylinder.hh
Box.hh
sdf::SDF_VERSION_NAMESPACE::Material
This class contains visual material properties.
Definition: Material.hh:46
Types.hh
SemanticPose.hh
sdf_config.h
SDFORMAT_VISIBLE
#define SDFORMAT_VISIBLE
Definition: system_util.hh:25
sdf::SDF_VERSION_NAMESPACE::Geometry
Geometry provides access to a shape, such as a Box.
Definition: Geometry.hh:84
sdf::SDF_VERSION_NAMESPACE::ParserConfig
This class contains configuration options for the libsdformat parser.
Definition: ParserConfig.hh:84
sdf::SDF_VERSION_NAMESPACE::Plugin
Definition: Plugin.hh:45
Sphere.hh
sdf::SDF_VERSION_NAMESPACE::Element
class GZ_SDFORMAT_VISIBLE Element
Definition: Element.hh:50
sdf::SDF_VERSION_NAMESPACE::SemanticPose
SemanticPose is a data structure that can be used by different DOM objects to resolve poses on a Pose...
Definition: SemanticPose.hh:54
sdf::SDF_VERSION_NAMESPACE::Errors
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:80
sdf::SDF_VERSION_NAMESPACE::ScopedGraph
Definition: Collision.hh:40
sdf::SDF_VERSION_NAMESPACE::Visual
Definition: Visual.hh:48
system_util.hh
Plugin.hh
sdf::SDF_VERSION_NAMESPACE::Plugins
std::vector< Plugin > Plugins
A vector of Plugin.
Definition: Plugin.hh:196
sdf::SDF_VERSION_NAMESPACE::ElementPtr
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:54
Element.hh