17 #ifndef SDF_GEOMETRY_HH_
18 #define SDF_GEOMETRY_HH_
23 #include <gz/utils/ImplPtr.hh>
24 #include <gz/math/Inertial.hh>
34 inline namespace SDF_VERSION_NAMESPACE {
264 GZ_UTILS_IMPL_PTR(dataPtr)
Box represents a box shape, and is usually accessed through a Geometry.
Definition: Box.hh:37
Capsule represents a capsule shape, and is usually accessed through a Geometry.
Definition: Capsule.hh:36
Cone represents a cone shape, and is usually accessed through a Geometry.
Definition: Cone.hh:38
Cylinder represents a cylinder shape, and is usually accessed through a Geometry.
Definition: Cylinder.hh:36
Ellipsoid represents a ellipsoid shape, and is usually accessed through a Geometry.
Definition: Ellipsoid.hh:36
Geometry provides access to a shape, such as a Box.
Definition: Geometry.hh:93
void SetConeShape(const Cone &_cone)
Set the cone shape.
const Sphere * SphereShape() const
Get the sphere geometry, or nullptr if the contained geometry is not a sphere.
const Cone * ConeShape() const
Get the cone geometry, or nullptr if the contained geometry is not a cone.
sdf::ElementPtr Element() const
Get a pointer to the SDF element that was used during load.
const Ellipsoid * EllipsoidShape() const
Get the ellipsoid geometry, or nullptr if the contained geometry is not an ellipsoid.
std::optional< gz::math::Inertiald > CalculateInertial(sdf::Errors &_errors, const ParserConfig &_config, double _density, sdf::ElementPtr _autoInertiaParams)
Calculate and return the Inertial values for the Geometry.
const Plane * PlaneShape() const
Get the plane geometry, or nullptr if the contained geometry is not a plane.
sdf::ElementPtr ToElement() const
Create and return an SDF element filled with data from this geometry.
void SetEllipsoidShape(const Ellipsoid &_ellipsoid)
Set the ellipsoid shape.
sdf::ElementPtr ToElement(sdf::Errors &_errors) const
Create and return an SDF element filled with data from this geometry.
GeometryType Type() const
Get the type of geometry.
Geometry()
Default constructor.
const std::vector< Polyline > & PolylineShape() const
Get the polyline geometry.
void SetPolylineShape(const std::vector< Polyline > &_polyline)
Set the polyline shape.
const Box * BoxShape() const
Get the box geometry, or nullptr if the contained geometry is not a box.
const Cylinder * CylinderShape() const
Get the cylinder geometry, or nullptr if the contained geometry is not a cylinder.
void SetSphereShape(const Sphere &_sphere)
Set the sphere shape.
const Capsule * CapsuleShape() const
Get the capsule geometry, or nullptr if the contained geometry is not a capsule.
const Mesh * MeshShape() const
Get the mesh geometry, or nullptr if the contained geometry is not a mesh.
void SetCapsuleShape(const Capsule &_capsule)
Set the capsule shape.
Errors Load(ElementPtr _sdf)
Load the geometry based on a element pointer.
void SetHeightmapShape(const Heightmap &_heightmap)
Set the heightmap shape.
const Heightmap * HeightmapShape() const
Get the heightmap geometry, or nullptr if the contained geometry is not a heightmap.
Errors Load(sdf::ElementPtr _sdf, const ParserConfig &_config)
Load the geometry based on a element pointer.
void SetPlaneShape(const Plane &_plane)
Set the plane shape.
void SetCylinderShape(const Cylinder &_cylinder)
Set the cylinder shape.
void SetMeshShape(const Mesh &_mesh)
Set the mesh shape.
void SetType(const GeometryType _type)
Set the type of geometry.
void SetBoxShape(const Box &_box)
Set the box shape.
Heightmap represents a shape defined by a 2D field, and is usually accessed through a Geometry.
Definition: Heightmap.hh:134
Mesh represents a mesh shape, and is usually accessed through a Geometry.
Definition: Mesh.hh:96
This class contains configuration options for the libsdformat parser.
Definition: ParserConfig.hh:100
Plane represents a plane shape, and is usually accessed through a Geometry.
Definition: Plane.hh:37
Sphere represents a sphere shape, and is usually accessed through a Geometry.
Definition: Sphere.hh:37
GeometryType
The set of geometry types.
Definition: Geometry.hh:53
@ ELLIPSOID
An ellipsoid geometry.
@ CAPSULE
A capsule geometry.
@ SPHERE
A sphere geometry.
@ EMPTY
Empty geometry. This means no shape has been defined.
@ CONE
A polyline geometry.
@ HEIGHTMAP
A heightmap geometry.
@ CYLINDER
A cylinder geometry.
@ POLYLINE
A polyline geometry.
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