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

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

#include <Geometry.hh>

Public Member Functions

 Geometry ()
 Default constructor. More...
 
 Geometry (const Geometry &_geometry)
 Copy constructor. More...
 
 Geometry (Geometry &&_geometry) noexcept
 Move constructor. More...
 
virtual ~Geometry ()
 Destructor. More...
 
const BoxBoxShape () const
 Get the box geometry, or nullptr if the contained geometry is not a box. 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...
 
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...
 
Geometryoperator= (const Geometry &_geometry)
 Assignment operator. More...
 
Geometryoperator= (Geometry &&_geometry)
 Move assignment operator. 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 SetCylinderShape (const Cylinder &_cylinder)
 Set the cylinder 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() [1/3]

sdf::v10::Geometry::Geometry ( )

Default constructor.

◆ Geometry() [2/3]

sdf::v10::Geometry::Geometry ( const Geometry _geometry)

Copy constructor.

Parameters
[in]_geometryGeometry to copy.

◆ Geometry() [3/3]

sdf::v10::Geometry::Geometry ( Geometry &&  _geometry)
noexcept

Move constructor.

Parameters
[in]_geometryGeometry to move.

◆ ~Geometry()

virtual sdf::v10::Geometry::~Geometry ( )
virtual

Destructor.

Member Function Documentation

◆ BoxShape()

const Box* sdf::v10::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

◆ CylinderShape()

const Cylinder* sdf::v10::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::v10::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.

◆ Load()

Errors sdf::v10::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::v10::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

◆ operator=() [1/2]

Geometry& sdf::v10::Geometry::operator= ( const Geometry _geometry)

Assignment operator.

Parameters
[in]_geometryThe geometry to set values from.
Returns
*this

◆ operator=() [2/2]

Geometry& sdf::v10::Geometry::operator= ( Geometry &&  _geometry)

Move assignment operator.

Parameters
[in]_geometryThe geometry to move from.
Returns
*this

◆ PlaneShape()

const Plane* sdf::v10::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::v10::Geometry::SetBoxShape ( const Box _box)

Set the box shape.

Parameters
[in]_boxThe box shape.

◆ SetCylinderShape()

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

Set the cylinder shape.

Parameters
[in]_cylinderThe cylinder shape.

◆ SetMeshShape()

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

Set the mesh shape.

Parameters
[in]_meshThe mesh shape.

◆ SetPlaneShape()

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

Set the plane shape.

Parameters
[in]_planeThe plane shape.

◆ SetSphereShape()

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

Set the sphere shape.

Parameters
[in]_sphereThe sphere shape.

◆ SetType()

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

Set the type of geometry.

Parameters
[in]_typeThe geometry type.

◆ SphereShape()

const Sphere* sdf::v10::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::v10::Geometry::Type ( ) const

Get the type of geometry.

Returns
The geometry type.

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