Public Member Functions | List of all members
sdf::v9::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...
 
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...
 
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...
 
const std::vector< Polyline > & PolylineShape () const
 Get the polyline geometry. More...
 
void SetBoxShape (const Box &_box)
 Set the box shape. More...
 
void SetCylinderShape (const Cylinder &_cylinder)
 Set the cylinder 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...
 
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::v9::Geometry::Geometry ( )

Default constructor.

◆ Geometry() [2/3]

sdf::v9::Geometry::Geometry ( const Geometry _geometry)

Copy constructor.

Parameters
[in]_geometryGeometry to copy.

◆ Geometry() [3/3]

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

Move constructor.

Parameters
[in]_geometryGeometry to move.

◆ ~Geometry()

virtual sdf::v9::Geometry::~Geometry ( )
virtual

Destructor.

Member Function Documentation

◆ BoxShape()

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

◆ HeightmapShape()

const Heightmap* sdf::v9::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::v9::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::v9::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::v9::Geometry::operator= ( const Geometry _geometry)

Assignment operator.

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

◆ operator=() [2/2]

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

Move assignment operator.

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

◆ PlaneShape()

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

Set the box shape.

Parameters
[in]_boxThe box shape.

◆ SetCylinderShape()

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

Set the cylinder shape.

Parameters
[in]_cylinderThe cylinder shape.

◆ SetHeightmapShape()

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

Set the heightmap shape.

Parameters
[in]_heightmapThe heightmap shape.

◆ SetMeshShape()

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

Set the mesh shape.

Parameters
[in]_meshThe mesh shape.

◆ SetPlaneShape()

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

Set the plane shape.

Parameters
[in]_planeThe plane shape.

◆ SetPolylineShape()

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

Set the polyline shape.

Parameters
[in]_polylineThe polyline shape.

◆ SetSphereShape()

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

Set the sphere shape.

Parameters
[in]_sphereThe sphere shape.

◆ SetType()

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

Set the type of geometry.

Parameters
[in]_typeThe geometry type.

◆ SphereShape()

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

Get the type of geometry.

Returns
The geometry type.

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