Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

ParticleBehavior Class Reference

#include <ParticleBehavior.h>

Inheritance diagram for ParticleBehavior:

Inheritance graph
[legend]
Collaboration diagram for ParticleBehavior:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ParticleBehavior (Particles *ps=NULL, std::string &name=std::string("ParticleBehavior"))
 Default constructor Attach to a particle system.

virtual void addMeTo (Particles *new_ps)
 Add the behavior to a particle system.

virtual void removeMe ()
 Removes a behavior from these particles.

virtual void attachAttributes ()
 Attach all the attributes needed by the behavior.

Behavior Application Members
virtual void applyForce ()
 Applies forces to all particles.

virtual void applyConstraint ()
 Constrains the current forces on all particles.

virtual void integrate ()
 Applies the forces to all particles.

virtual void cleanup ()
 Manages the number of particles.


Public Attributes

ParticlePositionposition
ParticleVelocityvelocity
int renderme
 Is renderme is true, then this attribute's glyph is rendered.


Constructor & Destructor Documentation

ParticleBehavior::ParticleBehavior Particles ps = NULL,
std::string &  name = std::string("ParticleBehavior")
 

Default constructor Attach to a particle system.

Parameters:
ps The owning Particles object.
name The name of this behavior.

Definition at line 14 of file ParticleBehavior.cpp.

References position, and velocity.


Member Function Documentation

void ParticleBehavior::addMeTo Particles new_ps  )  [virtual]
 

Add the behavior to a particle system.

Clobbers any behavior in new_ps with the same name. Does not update the behaviors particle system pointer. Should use ParticleBehavior::setParticleSystem to integrate a behavior into a particle system.

Implements ParticleStuff.

Definition at line 22 of file ParticleBehavior.cpp.

References attachAttributes(), Particles::behaviors, Particles::findBehavior(), and ParticleStuff::name.

virtual void ParticleBehavior::applyConstraint  )  [inline, virtual]
 

Constrains the current forces on all particles.

Reimplemented in MeshShape, ParticleBoundingBox, RBFPropagation, SingularityAdhesion, SurfaceAdhesion, SurfaceDeformation, SurfacePropagation, and TopologyInterrogator.

Definition at line 59 of file ParticleBehavior.h.

virtual void ParticleBehavior::applyForce  )  [inline, virtual]
 

Applies forces to all particles.

Reimplemented in MeshShape, ParticleRepulsion, SilhouetteAdhesion, SingularityAdhesion, SingularityInterrogator, SingularityRepulsion, SkinMeshShape, and TopologyInterrogator.

Definition at line 55 of file ParticleBehavior.h.

void ParticleBehavior::attachAttributes  )  [virtual]
 

Attach all the attributes needed by the behavior.

Defaults to a nop.

Reimplemented in ClusterMeshInterrogator, CriticalPointInterrogator, ParticleCreation, ParticleFate, ParticleRepulsion, RBFPropagation, SilhouetteAdhesion, SilhouetteFate, SingularityAdhesion, SingularityInterrogator, SkinMeshShape, SurfaceAdhesion, SurfaceDeformation, SurfacePropagation, and TopologyInterrogator.

Definition at line 36 of file ParticleBehavior.cpp.

References ParticleStuff::attachAttribute(), Particles::getAttribute(), position, ParticleStuff::ps, and velocity.

Referenced by addMeTo(), TopologyInterrogator::attachAttributes(), SurfaceDeformation::attachAttributes(), SurfaceAdhesion::attachAttributes(), SkinMeshShape::attachAttributes(), SingularityInterrogator::attachAttributes(), SingularityAdhesion::attachAttributes(), SilhouetteFate::attachAttributes(), SilhouetteAdhesion::attachAttributes(), ParticleRepulsion::attachAttributes(), ParticleFate::attachAttributes(), ParticleCreation::attachAttributes(), CriticalPointInterrogator::attachAttributes(), and ClusterMeshInterrogator::attachAttributes().

virtual void ParticleBehavior::cleanup  )  [inline, virtual]
 

Manages the number of particles.

Reimplemented in ClusterMeshInterrogator, CriticalPointInterrogator, MeshShape, ParticleCreation, ParticleFate, ParticleRepulsion, SilhouetteFate, SingularityAdhesion, SkinMeshShape, and TopologyInterrogator.

Definition at line 67 of file ParticleBehavior.h.

virtual void ParticleBehavior::integrate  )  [inline, virtual]
 

Applies the forces to all particles.

Reimplemented in ParticleRepulsion, RBFPropagation, SurfaceDeformation, SurfacePropagation, and VelocityIntegrator.

Definition at line 63 of file ParticleBehavior.h.

void ParticleBehavior::removeMe  )  [virtual]
 

Removes a behavior from these particles.

Note:
Particles do not own their behaviors, therefore, removed behaviors are not deleted, only removed from the list. You must manually delete any behaviors you remove in order to not leak memory.

Implements ParticleStuff.

Definition at line 48 of file ParticleBehavior.cpp.

References Particles::behaviors, ParticleStuff::name, and ParticleStuff::ps.


Member Data Documentation

ParticlePosition* ParticleBehavior::position
 

Definition at line 24 of file ParticleBehavior.h.

Referenced by TopologyInterrogator::applyConstraint(), SurfaceDeformation::applyConstraint(), SurfaceAdhesion::applyConstraint(), ParticleBoundingBox::applyConstraint(), MeshShape::applyConstraint(), SkinMeshShape::applyForce(), SingularityInterrogator::applyForce(), SilhouetteAdhesion::applyForce(), ParticleRepulsion::applyForce(), MeshShape::applyForce(), attachAttributes(), SkinMeshShape::calculateTargetEdgeLength(), TopologyInterrogator::cleanup(), SkinMeshShape::cleanup(), SingularityAdhesion::cleanup(), SilhouetteFate::cleanup(), ParticleFate::cleanup(), ParticleCreation::cleanup(), MeshShape::cleanup(), ClusterMeshInterrogator::cleanup(), SilhouetteFate::fiftyPercent(), VelocityIntegrator::integrate(), SurfaceDeformation::loadParticles(), SurfaceAdhesion::particleAdded(), ParticleBehavior(), SingularityRepulsion::repelSelf(), and SingularityRepulsion::repelTarget().

int ParticleBehavior::renderme
 

Is renderme is true, then this attribute's glyph is rendered.

Defaults to true.

Definition at line 74 of file ParticleBehavior.h.

ParticleVelocity* ParticleBehavior::velocity
 

Definition at line 26 of file ParticleBehavior.h.

Referenced by TopologyInterrogator::applyConstraint(), SurfaceAdhesion::applyConstraint(), SingularityAdhesion::applyConstraint(), ParticleBoundingBox::applyConstraint(), SkinMeshShape::applyForce(), SingularityInterrogator::applyForce(), SilhouetteAdhesion::applyForce(), ParticleRepulsion::applyForce(), MeshShape::applyForce(), attachAttributes(), SilhouetteFate::cleanup(), ParticleFate::cleanup(), VelocityIntegrator::integrate(), ParticleBehavior(), and SingularityRepulsion::repelSelf().


The documentation for this class was generated from the following files:
Generated on Mon Jun 28 15:02:38 2004 for Advanced Surface Library by doxygen 1.3.4