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

A description of a particle emitter, which can be attached to a link. More...

#include <ParticleEmitter.hh>

Public Member Functions

 ParticleEmitter ()
 Default constructor. More...
 
gz::math::Color ColorEnd () const
 Get the end color for all particles emitted. More...
 
std::string ColorRangeImage () const
 Get the path to the color image used as an affector. More...
 
gz::math::Color ColorStart () const
 Gets the starting color for all particles emitted. More...
 
double Duration () const
 Get the number of seconds the emitter is active. More...
 
sdf::ElementPtr Element () const
 Get a pointer to the SDF element that was used during load. More...
 
bool Emitting () const
 Get whether the particle emitter should run (emit particles). More...
 
const std::string & FilePath () const
 The path to the file where this element was loaded from. More...
 
double Lifetime () const
 Get the number of seconds each particle will 'live' for before being destroyed. More...
 
Errors Load (ElementPtr _sdf)
 Load the particle emitter based on an element pointer. More...
 
const sdf::MaterialMaterial () const
 Get a pointer to the emitter's material properties. More...
 
double MaxVelocity () const
 Get the maximum velocity for each particle. More...
 
double MinVelocity () const
 Get the minimum velocity for each particle. More...
 
std::string Name () const
 Get the name of the particle emitter. More...
 
gz::math::Vector3d ParticleSize () const
 Get the size of a particle in meters. More...
 
const std::string & PoseRelativeTo () const
 Get the name of the coordinate frame relative to which this emitter's pose is expressed. More...
 
double Rate () const
 Get the number of particles per second that should be emitted. More...
 
const gz::math::Pose3d & RawPose () const
 Get the pose of the particle emitter. More...
 
double ScaleRate () const
 Get the amount by which to scale the particles in both x and y direction per second. More...
 
float ScatterRatio () const
 Get the particle scatter ratio. More...
 
sdf::SemanticPose SemanticPose () const
 Get SemanticPose object of this object to aid in resolving poses. More...
 
void SetColorEnd (const gz::math::Color &_colorEnd)
 Set the end color for all particles emitted. More...
 
void SetColorRangeImage (const std::string &_image)
 Set the path to the color image used as an affector. More...
 
void SetColorStart (const gz::math::Color &_colorStart)
 Set the starting color for all particles emitted. More...
 
void SetDuration (double _duration)
 Set the number of seconds the emitter is active. More...
 
void SetEmitting (bool _emitting)
 Set whether the particle emitter is running, emitting particles. More...
 
void SetFilePath (const std::string &_filePath)
 Set the path to the file where this element was loaded from. More...
 
void SetLifetime (double _duration)
 Set the number of seconds each particle will 'live' for. More...
 
void SetMaterial (const sdf::Material &_material)
 Set the emitter's material. More...
 
void SetMaxVelocity (double _vel)
 Set the maximum velocity for each particle. More...
 
void SetMinVelocity (double _vel)
 Set the minimum velocity for each particle. More...
 
void SetName (const std::string &_name)
 Set the name of the particle emitter. More...
 
void SetParticleSize (const gz::math::Vector3d &_size)
 Set the size of a particle in meters. More...
 
void SetPoseRelativeTo (const std::string &_frame)
 Set the name of the coordinate frame relative to which this emitter's pose is expressed. More...
 
void SetRate (double _rate)
 Set the number of particles per second that should be emitted. More...
 
void SetRawPose (const gz::math::Pose3d &_pose)
 Set the pose of the particle emitter object. More...
 
void SetScaleRate (double _scaleRate)
 Set the amount by which to scale the particles in both x and y direction per second. More...
 
void SetScatterRatio (float _ratio)
 Set the particle scatter ratio. More...
 
void SetSize (const gz::math::Vector3d &_size)
 Set the size of the emitter where the particles are sampled. More...
 
void SetTopic (const std::string &_topic)
 Set the topic used to update the particle emitter properties. More...
 
void SetType (const ParticleEmitterType _type)
 Set the type of the particle emitter. More...
 
bool SetType (const std::string &_typeStr)
 Set the type of the particle emitter. More...
 
gz::math::Vector3d Size () const
 Get the size of the emitter where the particles are sampled. More...
 
sdf::ElementPtr ToElement () const
 Create and return an SDF element filled with data from this particle emitter. More...
 
sdf::ElementPtr ToElement (sdf::Errors &_errors) const
 Create and return an SDF element filled with data from this particle emitter. More...
 
std::string Topic () const
 Get the topic used to update the particle emitter properties. More...
 
ParticleEmitterType Type () const
 Get the type of the particle emitter. More...
 
std::string TypeStr () const
 Get the particle emitter type as a string. More...
 

Detailed Description

A description of a particle emitter, which can be attached to a link.

A particle emitter can be used to describe fog, smoke, and dust.

Constructor & Destructor Documentation

◆ ParticleEmitter()

sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::ParticleEmitter ( )

Default constructor.

Member Function Documentation

◆ ColorEnd()

gz::math::Color sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::ColorEnd ( ) const

Get the end color for all particles emitted.

The actual color will be interpolated between this color and the one set under ColorStart(). Color::White is the default color for the particles unless a specific function is used.

Returns
The end color.

◆ ColorRangeImage()

std::string sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::ColorRangeImage ( ) const

Get the path to the color image used as an affector.

This affector modifies the color of particles in flight. The colors are taken from a specified image file. The range of color values begins from the left side of the image and moves to the right over the lifetime of the particle, therefore only the horizontal dimension of the image is used. The ColorRangeImage has higher priority than ColorEnd and ColorStart. If all three are set, ColorRangeImage should be used.

◆ ColorStart()

gz::math::Color sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::ColorStart ( ) const

Gets the starting color for all particles emitted.

The actual color will be interpolated between this color and the one set using ColorEnd(). Color::White is the default color for the particles unless a specific function is used.

Returns
The starting color.

◆ Duration()

double sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Duration ( ) const

Get the number of seconds the emitter is active.

A value less than or equal to zero indicates infinite duration.

Returns
The number of seconds the emitter is active.

◆ Element()

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

◆ Emitting()

bool sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Emitting ( ) const

Get whether the particle emitter should run (emit particles).

Returns
True if particles should be emitted.

◆ FilePath()

const std::string& sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::FilePath ( ) const

The path to the file where this element was loaded from.

Returns
Full path to the file on disk.

◆ Lifetime()

double sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Lifetime ( ) const

Get the number of seconds each particle will 'live' for before being destroyed.

Returns
The lifetime of a particle in seconds.

◆ Load()

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

Load the particle emitter based on an 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.

◆ Material()

const sdf::Material* sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Material ( ) const

Get a pointer to the emitter's material properties.

This can be a nullptr if material properties have not been set.

Returns
Pointer to the emitter's material properties. Nullptr indicates that material properties have not been set.

◆ MaxVelocity()

double sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::MaxVelocity ( ) const

Get the maximum velocity for each particle.

Returns
The maximum velocity for each particle in m/s.

◆ MinVelocity()

double sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::MinVelocity ( ) const

Get the minimum velocity for each particle.

Returns
The minimum velocity for each particle in m/s.

◆ Name()

std::string sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Name ( ) const

Get the name of the particle emitter.

The name of the particle emitter should be unique within the scope of a Link.

Returns
Name of the particle emitter.

◆ ParticleSize()

gz::math::Vector3d sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::ParticleSize ( ) const

Get the size of a particle in meters.

Returns
Size of a particle in meters.

◆ PoseRelativeTo()

const std::string& sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::PoseRelativeTo ( ) const

Get the name of the coordinate frame relative to which this emitter's pose is expressed.

An empty value indicates that the frame is relative to the parent link.

Returns
The name of the pose relative-to frame.

◆ Rate()

double sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Rate ( ) const

Get the number of particles per second that should be emitted.

Returns
The number of particles to emit per second.

◆ RawPose()

const gz::math::Pose3d& sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::RawPose ( ) const

Get the pose of the particle emitter.

This is the pose of the emitter as specified in SDF (<particle_emitter><pose> ... </pose></particle_emitter>).

Returns
The pose of the particle emitter.

◆ ScaleRate()

double sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::ScaleRate ( ) const

Get the amount by which to scale the particles in both x and y direction per second.

Returns
The scaling amount in the x and y directions.

◆ ScatterRatio()

float sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::ScatterRatio ( ) const

Get the particle scatter ratio.

This is used to determine the ratio of particles that will be detected by sensors.

Returns
Particle scatter ratio
See also
SetScatterRatio

◆ SemanticPose()

sdf::SemanticPose sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SemanticPose ( ) const

Get SemanticPose object of this object to aid in resolving poses.

Returns
SemanticPose object for this emitter.

◆ SetColorEnd()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetColorEnd ( const gz::math::Color &  _colorEnd)

Set the end color for all particles emitted.

Parameters
[in]_colorEndThe end color for all particles emitted.
See also
gz::math::Color ColorEnd()

◆ SetColorRangeImage()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetColorRangeImage ( const std::string &  _image)

Set the path to the color image used as an affector.

Parameters
[in]_imageThe path to the color image.
See also
std::String ColorRangeImage()

◆ SetColorStart()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetColorStart ( const gz::math::Color &  _colorStart)

Set the starting color for all particles emitted.

Parameters
[in]_colorStartThe starting color for all particles emitted.
See also
gz::math::Color ColorStart()

◆ SetDuration()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetDuration ( double  _duration)

Set the number of seconds the emitter is active.

Parameters
[in]_durationThe number of seconds the emitter is active. A value less than or equal to zero means infinite duration.

◆ SetEmitting()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetEmitting ( bool  _emitting)

Set whether the particle emitter is running, emitting particles.

Parameters
[in]_emittingTrue if the emitter should produce particles.

◆ SetFilePath()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetFilePath ( const std::string &  _filePath)

Set the path to the file where this element was loaded from.

\paramp[in] _filePath Full path to the file on disk.

◆ SetLifetime()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetLifetime ( double  _duration)

Set the number of seconds each particle will 'live' for.

Parameters
[in]_durationThe number of seconds a particle will 'life' for. If _duration is <= 0, then the value std::numeric_limits<double>::min() will be used.

◆ SetMaterial()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetMaterial ( const sdf::Material _material)

Set the emitter's material.

Parameters
[in]_materialThe material of the particle emitter.

◆ SetMaxVelocity()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetMaxVelocity ( double  _vel)

Set the maximum velocity for each particle.

Parameters
[in]_velThe maximum velocity for each particle in m/s. A value of zero will be used if _vel is negative.

◆ SetMinVelocity()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetMinVelocity ( double  _vel)

Set the minimum velocity for each particle.

Parameters
[in]_velThe minimum velocity for each particle in m/s. A value of zero will be used if _vel is negative.

◆ SetName()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetName ( const std::string &  _name)

Set the name of the particle emitter.

The name of the particle emitter should be unique within the scope of a Link.

Parameters
[in]_nameName of the particle emitter.

◆ SetParticleSize()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetParticleSize ( const gz::math::Vector3d &  _size)

Set the size of a particle in meters.

Parameters
[in]_sizeSize of a particle in meters. Each component of _size must be greater than or equal to zero. Any negative value will be replaced with zero.

◆ SetPoseRelativeTo()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetPoseRelativeTo ( const std::string &  _frame)

Set the name of the coordinate frame relative to which this emitter's pose is expressed.

An empty value indicates that the frame is relative to the parent link.

Parameters
[in]_frameThe name of the pose relative-to frame.

◆ SetRate()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetRate ( double  _rate)

Set the number of particles per second that should be emitted.

Parameters
[in]_rateThe number of particle to emit per second. A value of zero will be used if _rate is negative.

◆ SetRawPose()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetRawPose ( const gz::math::Pose3d &  _pose)

Set the pose of the particle emitter object.

See also
const gz::math::Pose3d &RawPose() const
Parameters
[in]_poseThe pose of the particle emitter.

◆ SetScaleRate()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetScaleRate ( double  _scaleRate)

Set the amount by which to scale the particles in both x and y direction per second.

Parameters
[in]_scaleRateThe caling amount in the x and y directions. A value of zero will be used if _scaleRate is negative.

◆ SetScatterRatio()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetScatterRatio ( float  _ratio)

Set the particle scatter ratio.

This is used to determine the ratio of particles that will be detected by sensors.

Parameters
[in]_ratioScatter ratio.

◆ SetSize()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetSize ( const gz::math::Vector3d &  _size)

Set the size of the emitter where the particles are sampled.

Parameters
[in]_sizeSize of the emitter in meters. Each component of _size must be greater than or equal to zero. Any negative value will be replaced with zero.
See also
gz::math::Vector3d Size()

◆ SetTopic()

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetTopic ( const std::string &  _topic)

Set the topic used to update the particle emitter properties.

Parameters
[in]_topicThe topic used to update the particle emitter.

◆ SetType() [1/2]

void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetType ( const ParticleEmitterType  _type)

Set the type of the particle emitter.

Parameters
[in]_typeType of the particle emitter.

◆ SetType() [2/2]

bool sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetType ( const std::string &  _typeStr)

Set the type of the particle emitter.

The type of the particle emitter should be unique within the scope of a Link.

Parameters
[in]_typeStrType of the particle emitter.
Returns
True if the _typeStr parameter matched a known emitter type. False if the emitter type could not be set.

◆ Size()

gz::math::Vector3d sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Size ( ) const

Get the size of the emitter where the particles are sampled.

Returns
Size of the emitter region in meters.

◆ ToElement() [1/2]

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

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

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

Returns
SDF element pointer with updated particle emitter values.

◆ ToElement() [2/2]

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

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

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

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

◆ Topic()

std::string sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Topic ( ) const

Get the topic used to update the particle emitter properties.

Returns
The topic used to update the particle emitter.

◆ Type()

ParticleEmitterType sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Type ( ) const

Get the type of the particle emitter.

The type of the particle emitter should be unique within the scope of a Link.

Returns
Type of the particle emitter.

◆ TypeStr()

std::string sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::TypeStr ( ) const

Get the particle emitter type as a string.

Returns
The particle emitter type as a string.

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