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 <ignition/math/Pose3.hh>
23 #include <ignition/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/SemanticPose.hh"
30 #include "sdf/Sphere.hh"
31 #include "sdf/Types.hh"
32 #include "sdf/sdf_config.h"
33 #include "sdf/system_util.hh"
34 
35 namespace sdf
36 {
37  // Inline bracket to help doxygen filtering.
38  inline namespace SDF_VERSION_NAMESPACE {
39  //
40 
41  // Forward declarations.
42  class Geometry;
43  struct PoseRelativeToGraph;
44  template <typename T> class ScopedGraph;
45 
47  {
49  public: Visual();
50 
57  public: Errors Load(ElementPtr _sdf);
58 
62  public: std::string Name() const;
63 
67  public: void SetName(const std::string &_name);
68 
71  public: bool CastShadows() const;
72 
75  public: void SetCastShadows(bool _castShadows);
76 
79  public: float Transparency() const;
80 
83  public: void SetTransparency(float _transparency);
84 
87  public: const Geometry *Geom() const;
88 
91  public: void SetGeom(const Geometry &_geom);
92 
97  public: const ignition::math::Pose3d &RawPose() const;
98 
102  public: void SetRawPose(const ignition::math::Pose3d &_pose);
103 
108  public: const std::string &PoseRelativeTo() const;
109 
114  public: void SetPoseRelativeTo(const std::string &_frame);
115 
119  public: sdf::SemanticPose SemanticPose() const;
120 
125  public: sdf::ElementPtr Element() const;
126 
131  public: const sdf::Material *Material() const;
132 
135  public: void SetMaterial(const sdf::Material &_material);
136 
139  public: uint32_t VisibilityFlags() const;
140 
143  public: void SetVisibilityFlags(uint32_t _flags);
144 
149  public: void SetHasLaserRetro(bool _laserRetro);
150 
153  public: bool HasLaserRetro() const;
154 
157  public: double LaserRetro() const;
158 
161  public: void SetLaserRetro(double _laserRetro);
162 
167  private: void SetXmlParentName(const std::string &_xmlParentName);
168 
173  private: void SetPoseRelativeToGraph(
174  sdf::ScopedGraph<PoseRelativeToGraph> _graph);
175 
179  friend class Link;
180 
182  IGN_UTILS_IMPL_PTR(dataPtr)
183  };
184  }
185 }
186 #endif
This class contains visual material properties.
Definition: Material.hh:45
Geometry provides access to a shape, such as a Box.
Definition: Geometry.hh:77
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:98
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:41
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:53
class SDFORMAT_VISIBLE Element
Definition: Element.hh:49
SemanticPose is a data structure that can be used by different DOM objects to resolve poses on a Pose...
Definition: SemanticPose.hh:54
namespace for Simulation Description Format parser
Definition: Actor.hh:33
Definition: Visual.hh:46