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

Cone represents a cone shape, and is usually accessed through a Geometry. More...

#include <Cone.hh>

Public Member Functions

 Cone ()
 Constructor. More...
 
std::optional< gz::math::Inertiald > CalculateInertial (double _density)
 Calculate and return the Inertial values for the cone. More...
 
sdf::ElementPtr Element () const
 Get a pointer to the SDF element that was used during load. More...
 
double Length () const
 Get the cone's length in meters. More...
 
Errors Load (ElementPtr _sdf)
 Load the cone geometry based on a element pointer. More...
 
double Radius () const
 Get the cone's radius in meters. More...
 
void SetLength (double _length)
 Set the cone's length in meters. More...
 
void SetRadius (double _radius)
 Set the cone's radius in meters. More...
 
gz::math::Coned & Shape ()
 Get a mutable Gazebo Math representation of this cone. More...
 
const gz::math::Coned & Shape () const
 Get the Gazebo Math representation of this cone. More...
 
sdf::ElementPtr ToElement () const
 Create and return an SDF element filled with data from this cone. More...
 
sdf::ElementPtr ToElement (sdf::Errors &_errors) const
 Create and return an SDF element filled with data from this cone. More...
 

Detailed Description

Cone represents a cone shape, and is usually accessed through a Geometry.

Constructor & Destructor Documentation

◆ Cone()

sdf::SDF_VERSION_NAMESPACE::Cone::Cone ( )

Constructor.

Member Function Documentation

◆ CalculateInertial()

std::optional<gz::math::Inertiald> sdf::SDF_VERSION_NAMESPACE::Cone::CalculateInertial ( double  _density)

Calculate and return the Inertial values for the cone.

In order to calculate the inertial properties, the function mutates the object by updating its material properties.

Parameters
[in]_densityDensity of the cone in kg/m^3
Returns
A std::optional with gz::math::Inertiald object or std::nullopt

◆ Element()

sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Cone::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.

◆ Length()

double sdf::SDF_VERSION_NAMESPACE::Cone::Length ( ) const

Get the cone's length in meters.

Returns
The length of the cone in meters.

◆ Load()

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

Load the cone 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.

◆ Radius()

double sdf::SDF_VERSION_NAMESPACE::Cone::Radius ( ) const

Get the cone's radius in meters.

Returns
The radius of the cone in meters.

◆ SetLength()

void sdf::SDF_VERSION_NAMESPACE::Cone::SetLength ( double  _length)

Set the cone's length in meters.

Parameters
[in]_lengthThe length of the cone in meters.

◆ SetRadius()

void sdf::SDF_VERSION_NAMESPACE::Cone::SetRadius ( double  _radius)

Set the cone's radius in meters.

Parameters
[in]_radiusThe radius of the cone in meters.

◆ Shape() [1/2]

gz::math::Coned& sdf::SDF_VERSION_NAMESPACE::Cone::Shape ( )

Get a mutable Gazebo Math representation of this cone.

Returns
A reference to a gz::math::Coned object.

◆ Shape() [2/2]

const gz::math::Coned& sdf::SDF_VERSION_NAMESPACE::Cone::Shape ( ) const

Get the Gazebo Math representation of this cone.

Returns
A const reference to a gz::math::Sphered object.

◆ ToElement() [1/2]

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

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

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

Returns
SDF element pointer with updated cone values.

◆ ToElement() [2/2]

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

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

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

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

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