Projector.hh
Go to the documentation of this file.
1/*
2 * Copyright 2023 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_PROJECTOR_HH_
18#define SDF_PROJECTOR_HH_
19
20#include <memory>
21#include <string>
22
23#include <gz/math/Angle.hh>
24#include <gz/math/Pose3.hh>
25#include <gz/math/Vector3.hh>
26
27#include "sdf/Plugin.hh"
28#include "sdf/SemanticPose.hh"
29#include "sdf/Types.hh"
30#include "sdf/sdf_config.h"
31#include "sdf/system_util.hh"
32
33namespace sdf
34{
35 // Inline bracket to help doxygen filtering.
36 inline namespace SDF_VERSION_NAMESPACE {
37 // Forward declarations.
38 struct PoseRelativeToGraph;
39
44 {
46 public: Projector();
47
54 public: Errors Load(ElementPtr _sdf);
55
60 public: std::string Name() const;
61
66 public: void SetName(const std::string &_name);
67
70 public: double NearClip() const;
71
74 public: void SetNearClip(double _near);
75
78 public: double FarClip() const;
79
82 public: void SetFarClip(double _far);
83
86 public: gz::math::Angle HorizontalFov() const;
87
90 public: void SetHorizontalFov(const gz::math::Angle &_hfov);
91
94 public: uint32_t VisibilityFlags() const;
95
98 public: void SetVisibilityFlags(uint32_t _flags);
99
104 public: std::string Texture() const;
105
108 public: void SetTexture(const std::string &_map);
109
113 public: const sdf::Plugins &Plugins() const;
114
119
121 public: void ClearPlugins();
122
125 public: void AddPlugin(const Plugin &_plugin);
126
131 public: const gz::math::Pose3d &RawPose() const;
132
136 public: void SetRawPose(const gz::math::Pose3d &_pose);
137
142 public: const std::string &PoseRelativeTo() const;
143
148 public: void SetPoseRelativeTo(const std::string &_frame);
149
153
157 public: sdf::ElementPtr Element() const;
158
161 public: const std::string &FilePath() const;
162
165 public: void SetFilePath(const std::string &_filePath);
166
172 public: sdf::ElementPtr ToElement() const;
173
178 private: void SetXmlParentName(const std::string &_xmlParentName);
179
184 private: void SetPoseRelativeToGraph(
186
190 friend class Link;
191
193 GZ_UTILS_IMPL_PTR(dataPtr)
194 };
195 }
196}
197#endif
Definition: Plugin.hh:46
A description of a projector, which can be attached to a link.
Definition: Projector.hh:44
void SetNearClip(double _near)
Set the near clip distance.
sdf::ElementPtr Element() const
Get a pointer to the SDF element that was used during load.
const sdf::Plugins & Plugins() const
Get the plugins attached to this projector.
std::string Name() const
Get the name of the projector.
Errors Load(ElementPtr _sdf)
Load the projector based on an element pointer.
const gz::math::Pose3d & RawPose() const
Get the pose of the projector.
double NearClip() const
Get the near clip distance.
void AddPlugin(const Plugin &_plugin)
Add a plugin to this projector.
void ClearPlugins()
Remove all plugins.
void SetRawPose(const gz::math::Pose3d &_pose)
Set the pose of the projector object.
void SetFarClip(double _far)
Set the far clip distance.
void SetHorizontalFov(const gz::math::Angle &_hfov)
Set the horizontal field of view in radians.
gz::math::Angle HorizontalFov() const
Get the horizontal field of view in radians.
void SetPoseRelativeTo(const std::string &_frame)
Set the name of the coordinate frame relative to which this projector's pose is expressed.
void SetVisibilityFlags(uint32_t _flags)
Set the visibility flags of a projector.
sdf::ElementPtr ToElement() const
Create and return an SDF element filled with data from this projector.
sdf::SemanticPose SemanticPose() const
Get SemanticPose object of this object to aid in resolving poses.
sdf::Plugins & Plugins()
Get a mutable vector of plugins attached to this projector.
const std::string & FilePath() const
The path to the file where this element was loaded from.
uint32_t VisibilityFlags() const
Get the visibility flags of a projector.
double FarClip() const
Get the far clip distance.
void SetName(const std::string &_name)
Set the name of the projector.
void SetFilePath(const std::string &_filePath)
Set the path to the file where this element was loaded from.
const std::string & PoseRelativeTo() const
Get the name of the coordinate frame relative to which this projector's pose is expressed.
void SetTexture(const std::string &_map)
Set the texture filename.
std::string Texture() const
Get the texture filename.
Definition: Collision.hh:43
SemanticPose is a data structure that can be used by different DOM objects to resolve poses on a Pose...
Definition: SemanticPose.hh:55
std::vector< Plugin > Plugins
A vector of Plugin.
Definition: Plugin.hh:245
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:95
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:55
namespace for Simulation Description Format parser
Definition: Actor.hh:35
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:25