Public Member Functions | List of all members
sdf::SDF_VERSION_NAMESPACE::Geometry Class Reference

Geometry provides access to a shape, such as a Box. More...

#include <Geometry.hh>

Public Member Functions

 Geometry ()
 Default constructor. More...
 
const BoxBoxShape () const
 Get the box geometry, or nullptr if the contained geometry is not a box. More...
 
const CapsuleCapsuleShape () const
 Get the capsule geometry, or nullptr if the contained geometry is not a capsule. More...
 
const CylinderCylinderShape () const
 Get the cylinder geometry, or nullptr if the contained geometry is not a cylinder. More...
 
sdf::ElementPtr Element () const
 Get a pointer to the SDF element that was used during load. More...
 
const EllipsoidEllipsoidShape () const
 Get the ellipsoid geometry, or nullptr if the contained geometry is not an ellipsoid. More...
 
const HeightmapHeightmapShape () const
 Get the heightmap geometry, or nullptr if the contained geometry is not a heightmap. More...
 
Errors Load (ElementPtr _sdf)
 Load the geometry based on a element pointer. More...
 
Errors Load (sdf::ElementPtr _sdf, const ParserConfig &_config)
 Load the geometry based on a element pointer. More...
 
const MeshMeshShape () const
 Get the mesh geometry, or nullptr if the contained geometry is not a mesh. More...
 
const PlanePlaneShape () const
 Get the plane geometry, or nullptr if the contained geometry is not a plane. More...
 
const std::vector< Polyline > & PolylineShape () const
 Get the polyline geometry. More...
 
void SetBoxShape (const Box &_box)
 Set the box shape. More...
 
void SetCapsuleShape (const Capsule &_capsule)
 Set the capsule shape. More...
 
void SetCylinderShape (const Cylinder &_cylinder)
 Set the cylinder shape. More...
 
void SetEllipsoidShape (const Ellipsoid &_ellipsoid)
 Set the ellipsoid shape. More...
 
void SetHeightmapShape (const Heightmap &_heightmap)
 Set the heightmap shape. More...
 
void SetMeshShape (const Mesh &_mesh)
 Set the mesh shape. More...
 
void SetPlaneShape (const Plane &_plane)
 Set the plane shape. More...
 
void SetPolylineShape (const std::vector< Polyline > &_polyline)
 Set the polyline shape. More...
 
void SetSphereShape (const Sphere &_sphere)
 Set the sphere shape. More...
 
void SetType (const GeometryType _type)
 Set the type of geometry. More...
 
const SphereSphereShape () const
 Get the sphere geometry, or nullptr if the contained geometry is not a sphere. More...
 
sdf::ElementPtr ToElement () const
 Create and return an SDF element filled with data from this geometry. More...
 
sdf::ElementPtr ToElement (sdf::Errors &_errors) const
 Create and return an SDF element filled with data from this geometry. More...
 
GeometryType Type () const
 Get the type of geometry. More...
 

Detailed Description

Geometry provides access to a shape, such as a Box.

Use the Type function to determine the type of shape contained within a Geometry. Access to shape data, such as a box's size, is achieved through the shape accessors, such as const Box *BoxShape() const.

Constructor & Destructor Documentation

◆ Geometry()

sdf::SDF_VERSION_NAMESPACE::Geometry::Geometry ( )

Default constructor.

Member Function Documentation

◆ BoxShape()

const Box* sdf::SDF_VERSION_NAMESPACE::Geometry::BoxShape ( ) const

Get the box geometry, or nullptr if the contained geometry is not a box.

Returns
Pointer to the visual's box geometry, or nullptr if the geometry is not a box.
See also
GeometryType Type() const

◆ CapsuleShape()

const Capsule* sdf::SDF_VERSION_NAMESPACE::Geometry::CapsuleShape ( ) const

Get the capsule geometry, or nullptr if the contained geometry is not a capsule.

Returns
Pointer to the capsule geometry, or nullptr if the geometry is not a capsule.
See also
GeometryType Type() const

◆ CylinderShape()

const Cylinder* sdf::SDF_VERSION_NAMESPACE::Geometry::CylinderShape ( ) const

Get the cylinder geometry, or nullptr if the contained geometry is not a cylinder.

Returns
Pointer to the visual's cylinder geometry, or nullptr if the geometry is not a cylinder.
See also
GeometryType Type() const

◆ Element()

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Geometry::Element ( ) const

Get a pointer to the SDF element that was used during load.

Returns
SDF element pointer. The value will be nullptr if Load has not been called.

◆ EllipsoidShape()

const Ellipsoid* sdf::SDF_VERSION_NAMESPACE::Geometry::EllipsoidShape ( ) const

Get the ellipsoid geometry, or nullptr if the contained geometry is not an ellipsoid.

Returns
Pointer to the ellipsoid geometry, or nullptr if the geometry is not an ellipsoid.
See also
GeometryType Type() const

◆ HeightmapShape()

const Heightmap* sdf::SDF_VERSION_NAMESPACE::Geometry::HeightmapShape ( ) const

Get the heightmap geometry, or nullptr if the contained geometry is not a heightmap.

Returns
Pointer to the heightmap geometry, or nullptr if the geometry is not a heightmap.
See also
GeometryType Type() const

◆ Load() [1/2]

Errors sdf::SDF_VERSION_NAMESPACE::Geometry::Load ( ElementPtr  _sdf)

Load the geometry based on a element pointer.

This is not the usual entry point. Typical usage of the SDF DOM is through the Root object.

Parameters
[in]_sdfThe SDF Element pointer
Returns
Errors, which is a vector of Error objects. Each Error includes an error code and message. An empty vector indicates no error.

◆ Load() [2/2]

Errors sdf::SDF_VERSION_NAMESPACE::Geometry::Load ( sdf::ElementPtr  _sdf,
const ParserConfig _config 
)

Load the geometry based on a element pointer.

This is not the usual entry point. Typical usage of the SDF DOM is through the Root object.

Parameters
[in]_sdfThe SDF Element pointer
[in]_configParser configuration
Returns
Errors, which is a vector of Error objects. Each Error includes an error code and message. An empty vector indicates no error.

◆ MeshShape()

const Mesh* sdf::SDF_VERSION_NAMESPACE::Geometry::MeshShape ( ) const

Get the mesh geometry, or nullptr if the contained geometry is not a mesh.

Returns
Pointer to the visual's mesh geometry, or nullptr if the geometry is not a mesh.
See also
GeometryType Type() const

◆ PlaneShape()

const Plane* sdf::SDF_VERSION_NAMESPACE::Geometry::PlaneShape ( ) const

Get the plane geometry, or nullptr if the contained geometry is not a plane.

Returns
Pointer to the visual's plane geometry, or nullptr if the geometry is not a plane.
See also
GeometryType Type() const

◆ PolylineShape()

const std::vector<Polyline>& sdf::SDF_VERSION_NAMESPACE::Geometry::PolylineShape ( ) const

Get the polyline geometry.

Vector is empty if the contained geometry is not a polyline.

Returns
The visual's polyline geometries.
See also
GeometryType Type() const

◆ SetBoxShape()

void sdf::SDF_VERSION_NAMESPACE::Geometry::SetBoxShape ( const Box _box)

Set the box shape.

Parameters
[in]_boxThe box shape.

◆ SetCapsuleShape()

void sdf::SDF_VERSION_NAMESPACE::Geometry::SetCapsuleShape ( const Capsule _capsule)

Set the capsule shape.

Parameters
[in]_capsuleThe capsule shape.

◆ SetCylinderShape()

void sdf::SDF_VERSION_NAMESPACE::Geometry::SetCylinderShape ( const Cylinder _cylinder)

Set the cylinder shape.

Parameters
[in]_cylinderThe cylinder shape.

◆ SetEllipsoidShape()

void sdf::SDF_VERSION_NAMESPACE::Geometry::SetEllipsoidShape ( const Ellipsoid _ellipsoid)

Set the ellipsoid shape.

Parameters
[in]_ellipsoidThe ellipsoid shape.

◆ SetHeightmapShape()

void sdf::SDF_VERSION_NAMESPACE::Geometry::SetHeightmapShape ( const Heightmap _heightmap)

Set the heightmap shape.

Parameters
[in]_heightmapThe heightmap shape.

◆ SetMeshShape()

void sdf::SDF_VERSION_NAMESPACE::Geometry::SetMeshShape ( const Mesh _mesh)

Set the mesh shape.

Parameters
[in]_meshThe mesh shape.

◆ SetPlaneShape()

void sdf::SDF_VERSION_NAMESPACE::Geometry::SetPlaneShape ( const Plane _plane)

Set the plane shape.

Parameters
[in]_planeThe plane shape.

◆ SetPolylineShape()

void sdf::SDF_VERSION_NAMESPACE::Geometry::SetPolylineShape ( const std::vector< Polyline > &  _polyline)

Set the polyline shape.

Parameters
[in]_polylineThe polyline shape.

◆ SetSphereShape()

void sdf::SDF_VERSION_NAMESPACE::Geometry::SetSphereShape ( const Sphere _sphere)

Set the sphere shape.

Parameters
[in]_sphereThe sphere shape.

◆ SetType()

void sdf::SDF_VERSION_NAMESPACE::Geometry::SetType ( const GeometryType  _type)

Set the type of geometry.

Parameters
[in]_typeThe geometry type.

◆ SphereShape()

const Sphere* sdf::SDF_VERSION_NAMESPACE::Geometry::SphereShape ( ) const

Get the sphere geometry, or nullptr if the contained geometry is not a sphere.

Returns
Pointer to the visual's sphere geometry, or nullptr if the geometry is not a sphere.
See also
GeometryType Type() const

◆ ToElement() [1/2]

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Geometry::ToElement ( ) const

Create and return an SDF element filled with data from this geometry.

Note that parameter passing functionality is not captured with this function.

Returns
SDF element pointer with updated geometry values.

◆ ToElement() [2/2]

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Geometry::ToElement ( sdf::Errors _errors) const

Create and return an SDF element filled with data from this geometry.

Note that parameter passing functionality is not captured with this function.

Parameters
[out]_errorsVector of errors.
Returns
SDF element pointer with updated geometry values.

◆ Type()

GeometryType sdf::SDF_VERSION_NAMESPACE::Geometry::Type ( ) const

Get the type of geometry.

Returns
The geometry type.

The documentation for this class was generated from the following file: