Loading...
Searching...
No Matches
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 "sdf/Box.hh"
24#include "sdf/Cylinder.hh"
25#include "sdf/Element.hh"
26#include "sdf/Material.hh"
27#include "sdf/Plane.hh"
28#include "sdf/SemanticPose.hh"
29#include "sdf/Sphere.hh"
30#include "sdf/Types.hh"
31#include "sdf/sdf_config.h"
32#include "sdf/system_util.hh"
33
34namespace sdf
35{
36 // Inline bracket to help doxygen filtering.
37 inline namespace SDF_VERSION_NAMESPACE {
38 //
39
40 // Forward declarations.
41 class VisualPrivate;
42 class Geometry;
43 struct PoseRelativeToGraph;
44
46 {
48 public: Visual();
49
52 public: Visual(const Visual &_visual);
53
56 public: Visual(Visual &&_visual) noexcept;
57
61 public: Visual &operator=(Visual &&_visual);
62
66 public: Visual &operator=(const Visual &_visual);
67
69 public: ~Visual();
70
77 public: Errors Load(ElementPtr _sdf);
78
82 public: std::string Name() const;
83
87 public: void SetName(const std::string &_name) const;
88
91 public: bool CastShadows() const;
92
95 public: void SetCastShadows(bool _castShadows);
96
99 public: float Transparency() const;
100
103 public: void SetTransparency(float _transparency);
104
107 public: const Geometry *Geom() const;
108
111 public: void SetGeom(const Geometry &_geom);
112
118 public: const ignition::math::Pose3d &Pose() const
119 SDF_DEPRECATED(9.0);
120
125 public: void SetPose(const ignition::math::Pose3d &_pose)
126 SDF_DEPRECATED(9.0);
127
132 public: const ignition::math::Pose3d &RawPose() const;
133
137 public: void SetRawPose(const ignition::math::Pose3d &_pose);
138
143 public: const std::string &PoseRelativeTo() const;
144
149 public: void SetPoseRelativeTo(const std::string &_frame);
150
156 public: const std::string &PoseFrame() const
157 SDF_DEPRECATED(9.0);
158
164 public: void SetPoseFrame(const std::string &_frame)
165 SDF_DEPRECATED(9.0);
166
170 public: sdf::SemanticPose SemanticPose() const;
171
176 public: sdf::ElementPtr Element() const;
177
182 public: sdf::Material *Material() const;
183
186 public: void SetMaterial(const sdf::Material &_material);
187
190 public: uint32_t VisibilityFlags() const;
191
194 public: void SetVisibilityFlags(uint32_t _flags);
195
200 public: void SetHasLaserRetro(bool _laserRetro);
201
204 public: bool HasLaserRetro() const;
205
208 public: double LaserRetro() const;
209
212 public: void SetLaserRetro(double _laserRetro);
213
218 private: void SetXmlParentName(const std::string &_xmlParentName);
219
224 private: void SetPoseRelativeToGraph(
225 std::weak_ptr<const PoseRelativeToGraph> _graph);
226
230 friend class Link;
231
233 private: VisualPrivate *dataPtr = nullptr;
234 };
235 }
236}
237#endif
#define SDF_DEPRECATED(version)
Definition Types.hh:38
SDF Element class.
Definition Element.hh:74
Geometry provides access to a shape, such as a Box.
Definition Geometry.hh:70
This class contains visual material properties.
Definition Material.hh:46
SemanticPose is a data structure that can be used by different DOM objects to resolve poses on a Pose...
Definition SemanticPose.hh:54
Definition Visual.hh:46
std::string Name() const
Get the name of the visual.
void SetTransparency(float _transparency)
Set the transparency value for the visual.
~Visual()
Destructor.
Visual()
Default constructor.
float Transparency() const
Get the transparency value of the visual.
Errors Load(ElementPtr _sdf)
Load the visual based on a element pointer.
const Geometry * Geom() const
Get a pointer to the visual's geometry.
void SetCastShadows(bool _castShadows)
Set whether the visual casts shadows.
void SetName(const std::string &_name) const
Set the name of the visual.
const ignition::math::Pose3d & Pose() const SDF_DEPRECATED(9.0)
Get the pose of the visual object.
bool CastShadows() const
Get whether the visual casts shadows.
void SetGeom(const Geometry &_geom)
Set the visual's geometry.
Visual & operator=(Visual &&_visual)
Move assignment operator.
Visual(const Visual &_visual)
Copy constructor.
Visual & operator=(const Visual &_visual)
Copy assignment operator.
Visual(Visual &&_visual) noexcept
Move constructor.
std::vector< Error > Errors
A vector of Error.
Definition Types.hh:89
std::shared_ptr< Element > ElementPtr
Definition Element.hh:53
namespace for Simulation Description Format parser
Definition Actor.hh:33
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition system_util.hh:48