Go to the documentation of this file.
16 #ifndef SURGSIM_PARTICLES_EMITTER_H
17 #define SURGSIM_PARTICLES_EMITTER_H
58 SURGSIM_STATIC_REGISTRATION(Emitter);
73 void update(
double dt)
override;
79 void setTarget(
const std::shared_ptr<SurgSim::Framework::Component> target);
83 const std::shared_ptr<SurgSim::Framework::Component>
getTarget();
87 void setShape(std::shared_ptr<SurgSim::Math::Shape> shape);
91 std::shared_ptr<SurgSim::Math::Shape>
getShape()
const;
121 void setVelocityRange(
const std::pair<SurgSim::Math::Vector3d, SurgSim::Math::Vector3d>& range);
124 const std::pair<SurgSim::Math::Vector3d, SurgSim::Math::Vector3d>&
getVelocityRange()
const;
167 std::shared_ptr<SurgSim::Math::Shape>
m_shape;
170 std::shared_ptr<SurgSim::Particles::Representation>
m_target;
176 std::shared_ptr<SurgSim::Framework::Logger>
m_logger;
182 #endif // SURGSIM_PARTICLES_EMITTER_H
virtual SurgSim::Math::RigidTransform3d getPose() const
Get the pose of the Emitter in world coordinates.
Definition: Emitter.cpp:199
std::shared_ptr< SurgSim::Framework::Logger > m_logger
Logger used by the Emitter.
Definition: Emitter.h:176
@ EMIT_MODE_SURFACE
Emit particles only from the surface.
Definition: Emitter.h:53
Definitions of small fixed-size vector types.
std::pair< SurgSim::Math::Vector3d, SurgSim::Math::Vector3d > m_velocityRange
The range of velocities of the emitted particles.
Definition: Emitter.h:155
@ EMIT_MODE_VOLUME
Emit particles from within the shapes volume.
Definition: Emitter.h:51
void setTarget(const std::shared_ptr< SurgSim::Framework::Component > target)
Set the target to emit to.
Definition: Emitter.cpp:138
std::shared_ptr< SurgSim::Particles::Representation > m_target
Representation to emit to.
Definition: Emitter.h:170
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
virtual ~Emitter()
Destructor.
Definition: Emitter.cpp:67
Behaviors perform actions.
Definition: Behavior.h:41
SurgSim::Math::RigidTransform3d m_localPose
Local Pose of the Representation with respect to the SceneElement.
Definition: Emitter.h:173
std::uniform_real_distribution< double > m_zeroOneDistribution
Definition: Emitter.h:163
int getTargetManagerType() const override
Specifies which manger will handle this behavior.
Definition: Emitter.cpp:123
SURGSIM_CLASSNAME(SurgSim::Particles::Emitter)
bool doInitialize() override
Interface to be implemented by derived classes.
Definition: Emitter.cpp:71
bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: Emitter.cpp:76
std::shared_ptr< SurgSim::Math::Shape > getShape() const
Get the shape of this emitter.
Definition: Emitter.cpp:133
Emitter(const std::string &name)
Constructor.
Definition: Emitter.cpp:38
RandomPointGenerator will generate points based on the shape passed.
Definition: RandomPointGenerator.h:36
Definition: CompoundShapeToGraphics.cpp:30
void setLifetimeRange(const std::pair< double, double > &range)
Set the range of lifetimes of emitted particles.
Definition: Emitter.cpp:171
double m_rate
The emit rate of this emitter.
Definition: Emitter.h:149
std::pair< double, double > getLifetimeRange() const
Get the range of lifetimes of emitted particles.
Definition: Emitter.cpp:178
std::shared_ptr< SurgSim::Math::Shape > m_shape
Shape of emitter.
Definition: Emitter.h:167
double m_particlesNotAdded
Number of particles not added during last update.
Definition: Emitter.h:158
std::mt19937 m_generator
Definition: Emitter.h:162
double getRate() const
Get the emit rate of this emitter.
Definition: Emitter.cpp:166
void setVelocityRange(const std::pair< SurgSim::Math::Vector3d, SurgSim::Math::Vector3d > &range)
Set the range of velocities of the emitted particles.
Definition: Emitter.cpp:183
EmitMode
Emitting modes of the Emitter.
Definition: Emitter.h:49
@ EMIT_MODE_COUNT
The number of EmitModes.
Definition: Emitter.h:55
virtual SurgSim::Math::RigidTransform3d getLocalPose() const
Get the pose of the Emitter with respect to the Scene Element.
Definition: Emitter.cpp:211
void update(double dt) override
Update the behavior.
Definition: Emitter.cpp:91
void setRate(double rate)
Set the emit rate of this emitter.
Definition: Emitter.cpp:160
void setMode(int mode)
Set the emit mode of this emitter.
Definition: Emitter.cpp:149
void setShape(std::shared_ptr< SurgSim::Math::Shape > shape)
Set the shape of this emitter.
Definition: Emitter.cpp:128
const std::pair< SurgSim::Math::Vector3d, SurgSim::Math::Vector3d > & getVelocityRange() const
Get the range of velocities of the emitted particles.
Definition: Emitter.cpp:189
RandomPointGenerator m_pointGenerator
PointGenerator for generating random points within or on the emitter shape.
Definition: Emitter.h:143
std::pair< double, double > m_lifetimeRange
The range of lifetimes of emitted particles.
Definition: Emitter.h:152
int getMode() const
Get the emit mode of this emitter.
Definition: Emitter.cpp:155
virtual void setLocalPose(const SurgSim::Math::RigidTransform3d &pose)
Set the pose of the Emitter with respect to the Scene Element.
Definition: Emitter.cpp:194
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
int m_mode
The emit mode of this emitter.
Definition: Emitter.h:146
DataStructures::Vertices< ParticleData > Particles
Definition: Particles.h:53
Emitter emits particles into a ParticleSystem.
Definition: Emitter.h:62
const std::shared_ptr< SurgSim::Framework::Component > getTarget()
Get the target to emit to.
Definition: Emitter.cpp:144