Public Member Functions | List of all members
sdf::v12::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...
 
ignition::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...
 
ignition::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...
 
ignition::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 ignition::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 ignition::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 ignition::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 ignition::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 ignition::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 ignition::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...
 
ignition::math::Vector3d Size () const
 Get the size of the emitter where the particles are sampled. 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::v12::ParticleEmitter::ParticleEmitter ( )

Default constructor.

Member Function Documentation

◆ ColorEnd()

ignition::math::Color sdf::v12::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::v12::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()

ignition::math::Color sdf::v12::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::v12::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::v12::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::v12::ParticleEmitter::Emitting ( ) const

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

Returns
True if particles should be emitted.

◆ FilePath()

const std::string& sdf::v12::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::v12::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::v12::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::v12::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::v12::ParticleEmitter::MaxVelocity ( ) const

Get the maximum velocity for each particle.

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

◆ MinVelocity()

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

Get the minimum velocity for each particle.

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

◆ Name()

std::string sdf::v12::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()

ignition::math::Vector3d sdf::v12::ParticleEmitter::ParticleSize ( ) const

Get the size of a particle in meters.

Returns
Size of a particle in meters.

◆ PoseRelativeTo()

const std::string& sdf::v12::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::v12::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 ignition::math::Pose3d& sdf::v12::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::v12::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::v12::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::v12::ParticleEmitter::SemanticPose ( ) const

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

Returns
SemanticPose object for this emitter.

◆ SetColorEnd()

void sdf::v12::ParticleEmitter::SetColorEnd ( const ignition::math::Color &  _colorEnd)

Set the end color for all particles emitted.

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

◆ SetColorRangeImage()

void sdf::v12::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::v12::ParticleEmitter::SetColorStart ( const ignition::math::Color &  _colorStart)

Set the starting color for all particles emitted.

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

◆ SetDuration()

void sdf::v12::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::v12::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::v12::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::v12::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::v12::ParticleEmitter::SetMaterial ( const sdf::Material _material)

Set the emitter's material.

Parameters
[in]_materialThe material of the particle emitter.

◆ SetMaxVelocity()

void sdf::v12::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::v12::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::v12::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::v12::ParticleEmitter::SetParticleSize ( const ignition::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::v12::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::v12::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::v12::ParticleEmitter::SetRawPose ( const ignition::math::Pose3d &  _pose)

Set the pose of the particle emitter object.

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

◆ SetScaleRate()

void sdf::v12::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::v12::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::v12::ParticleEmitter::SetSize ( const ignition::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
ignition::math::Vector3d Size()

◆ SetTopic()

void sdf::v12::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::v12::ParticleEmitter::SetType ( const ParticleEmitterType  _type)

Set the type of the particle emitter.

Parameters
[in]_typeType of the particle emitter.

◆ SetType() [2/2]

bool sdf::v12::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()

ignition::math::Vector3d sdf::v12::ParticleEmitter::Size ( ) const

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

Returns
Size of the emitter region in meters.

◆ Topic()

std::string sdf::v12::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::v12::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::v12::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: