Public Member Functions | List of all members
sdf::v11::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...
 
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...
 
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 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...
 
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::v11::Geometry::Geometry ( )

Default constructor.

Member Function Documentation

◆ BoxShape()

const Box* sdf::v11::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::v11::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::v11::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::v11::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::v11::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::v11::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()

Errors sdf::v11::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.

◆ MeshShape()

const Mesh* sdf::v11::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::v11::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

◆ SetBoxShape()

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

Set the box shape.

Parameters
[in]_boxThe box shape.

◆ SetCapsuleShape()

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

Set the capsule shape.

Parameters
[in]_capsuleThe capsule shape.

◆ SetCylinderShape()

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

Set the cylinder shape.

Parameters
[in]_cylinderThe cylinder shape.

◆ SetEllipsoidShape()

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

Set the ellipsoid shape.

Parameters
[in]_ellipsoidThe ellipsoid shape.

◆ SetHeightmapShape()

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

Set the heightmap shape.

Parameters
[in]_heightmapThe heightmap shape.

◆ SetMeshShape()

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

Set the mesh shape.

Parameters
[in]_meshThe mesh shape.

◆ SetPlaneShape()

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

Set the plane shape.

Parameters
[in]_planeThe plane shape.

◆ SetSphereShape()

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

Set the sphere shape.

Parameters
[in]_sphereThe sphere shape.

◆ SetType()

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

Set the type of geometry.

Parameters
[in]_typeThe geometry type.

◆ SphereShape()

const Sphere* sdf::v11::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

◆ Type()

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

Get the type of geometry.

Returns
The geometry type.

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