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

Particles Class Reference

#include <Particles.h>

Collaboration diagram for Particles:

Collaboration graph
[legend]
List of all members.

Detailed Description

Particles in an object describing a particle system.

The particle system consists of

The motion of the particle system is simulated by repeatedly calling fullUpdate(). This function calls all of the behaviors' ParticleBehavior::applyForce(), then all of the ParticleBehavior::applyConstraint(), then all of the\ ParticleBehavior::integrate() (plus integration of x and v), and finally all of the ParticleBehavior::cleanup() members.

Definition at line 61 of file Particles.h.

Public Member Functions

 Particles (ParticleSystem *ps=NULL)
 Constructor with default without particles to display just a simple implicit.

 Particles (std::string n, ParticleSystem *ps=NULL)
 Constructor with name (preferred).

 Particles (Implicit *surface, ParticleSystem *ps=NULL)
 Constructor with default without particles to display just a simple implicit.

virtual void clear ()
int findBehavior (std::string &name)
int findShader (std::string &name)
 Searches for the shader based on its name.

template<class attributeType> void findAttribute (attributeType *&attr)
 linear search for anything that can be cast into this type

template<class attributeType> attributeType * getAttribute (std::string &name)
template<class behaviorType> behaviorType * getBehavior (std::string &name)
template<class shaderType> shaderType * getShader (std::string &name)
template<class attrclass> attrclass * createParticleStuff ()
 create a new ParticleStuff and initialize it with setParticleSystem

unsigned int addParticle ()
 Add a new particle to the system.

unsigned int size ()
 Returns the number of particles in the system.

virtual void removeParticle (unsigned int i)
 Remove a particle from the system.

void removeAll ()
 Remove all particles.

void fullUpdate ()
 Processes one entire time step.

void applyForces ()
 Process all forces.

void applyConstraints ()
 Process all constraints.

void integrate ()
 Do all integration. Zeroes the velocity vector.

void cleanup ()
 Clean everything up.

void printContent ()
 Prints the contents of this particle system.

void draw ()
 it calls the shaders to draw itself.

 ~Particles ()
 Desctructor deletes all behaviors and attribute.


Public Attributes

std::string name
 Name of the particle system.

unsigned int particleSize
int selectedParticle
bool draggable
 gui can move the position or not

ParticleSystemparticleSystem
 child particles objects that are spawn by this one

ParticleBehaviors behaviors
 A collection of behaviors.

ParticleAttributes attributes
 A collection of attributes.

ParticleShaders shaders
 A collection of attributes.

double dt
 Timestep.


Constructor & Destructor Documentation

Particles::Particles ParticleSystem ps = NULL  ) 
 

Constructor with default without particles to display just a simple implicit.

Constructor sets default time step.

Definition at line 18 of file Particles.cpp.

References draggable, dt, particleSize, and particleSystem.

Particles::Particles std::string  n,
ParticleSystem ps = NULL
 

Constructor with name (preferred).

Definition at line 26 of file Particles.cpp.

References draggable, dt, particleSize, and particleSystem.

Particles::Particles Implicit surface,
ParticleSystem ps = NULL
 

Constructor with default without particles to display just a simple implicit.

Definition at line 34 of file Particles.cpp.

References draggable, dt, particleSize, and particleSystem.

Particles::~Particles  ) 
 

Desctructor deletes all behaviors and attribute.

Definition at line 104 of file Particles.cpp.

References attributes, behaviors, and shaders.


Member Function Documentation

unsigned int Particles::addParticle  ) 
 

Add a new particle to the system.

Parameters:
x Position of the new particle.
v Velocity of the new particle.
Returns:
Index of the new particle.

Definition at line 50 of file Particles.cpp.

References attributes, behaviors, particleSize, and shaders.

Referenced by SingularityAdhesion::cleanup(), SilhouetteFate::cleanup(), ParticleFate::cleanup(), ParticleCreation::cleanup(), MeshShape::cleanup(), CriticalPointInterrogator::cleanup(), ClusterMeshInterrogator::cleanup(), ParticleMesh::createDiamond(), SkinMeshShape::edgeCollapseAndSplit(), RBFInterpolant::interpolate(), and SurfaceDeformation::loadParticles().

void Particles::applyConstraints  ) 
 

Process all constraints.

Definition at line 155 of file Particles.cpp.

References behaviors.

Referenced by fullUpdate().

void Particles::applyForces  ) 
 

Process all forces.

Definition at line 148 of file Particles.cpp.

References behaviors.

Referenced by fullUpdate().

void Particles::cleanup  ) 
 

Clean everything up.

Definition at line 168 of file Particles.cpp.

References behaviors.

Referenced by fullUpdate().

void Particles::clear  )  [virtual]
 

Clears out the particles.

Definition at line 174 of file Particles.cpp.

References attributes, and particleSize.

Referenced by CriticalPointInterrogator::cleanup(), ClusterMeshInterrogator::cleanup(), and SingularityAdhesion::resetSingularities().

template<class attrclass>
attrclass* Particles::createParticleStuff  )  [inline]
 

create a new ParticleStuff and initialize it with setParticleSystem

Definition at line 158 of file Particles.h.

Referenced by SingularityAdhesion::createSingularPS().

void Particles::draw  ) 
 

it calls the shaders to draw itself.

Definition at line 197 of file Particles.cpp.

References shaders.

template<class attributeType>
void Particles::findAttribute attributeType *&  attr  )  [inline]
 

linear search for anything that can be cast into this type

Definition at line 118 of file Particles.h.

References attributes.

Referenced by ParticleRepulsion::attachAttributes(), and ParticleShaderLink::draw().

int Particles::findBehavior std::string &  name  ) 
 

Searches for the behavior based on its name.

Returns:
The index of the behavior in the vector.

Definition at line 118 of file Particles.cpp.

References behaviors.

Referenced by ParticleBehavior::addMeTo(), and getBehavior().

int Particles::findShader std::string &  name  ) 
 

Searches for the shader based on its name.

Definition at line 129 of file Particles.cpp.

References shaders.

Referenced by getShader().

void Particles::fullUpdate  ) 
 

Processes one entire time step.

Definition at line 140 of file Particles.cpp.

References applyConstraints(), applyForces(), cleanup(), and integrate().

template<class attributeType>
attributeType* Particles::getAttribute std::string &  name  )  [inline]
 

Definition at line 129 of file Particles.h.

References attributes.

Referenced by RBFPropagation::adaptivity(), SurfacePropagation::applyConstraint(), ParticleShader::attachAttributes(), ParticleRepulsion::attachAttributes(), ParticleBehavior::attachAttributes(), SingularityAdhesion::cleanup(), CriticalPointInterrogator::cleanup(), RBFInterpolant::interpolate(), RBF::interpolate(), Implicit::interpolate(), ParticleRendererGL::render(), SingularityRepulsion::repelTarget(), SurfacePropagation::speed(), RBFPropagation::tune(), and ParFileManager::writePerParticle().

template<class behaviorType>
behaviorType* Particles::getBehavior std::string &  name  )  [inline]
 

Definition at line 138 of file Particles.h.

References behaviors, and findBehavior().

Referenced by SilhouetteFate::attachAttributes(), ParticleCreation::attachAttributes(), SingularityAdhesion::createSingularPS(), ParticleShaderStroke::draw(), ParticleShaderGradientField::draw(), CriticalPointInterrogator::findCriticalPoints(), RBFInterpolant::interpolate(), RBF::interpolate(), and SingularityRepulsion::SingularityRepulsion().

template<class shaderType>
shaderType* Particles::getShader std::string &  name  )  [inline]
 

Definition at line 147 of file Particles.h.

References findShader(), and shaders.

void Particles::integrate  ) 
 

Do all integration. Zeroes the velocity vector.

Definition at line 161 of file Particles.cpp.

References behaviors.

Referenced by fullUpdate().

void Particles::printContent  ) 
 

Prints the contents of this particle system.

Definition at line 185 of file Particles.cpp.

References attributes, and behaviors.

void Particles::removeAll  ) 
 

Remove all particles.

Definition at line 95 of file Particles.cpp.

References attributes, and particleSize.

Referenced by TopologyInterrogator::cleanup(), and ParticleCreation::setq().

void Particles::removeParticle unsigned int  i  )  [virtual]
 

Remove a particle from the system.

We remove particle i by copying particle n's data into particle i's elements and then removing particle n. This change of index must be observed in all other objects which maintain references by index.

Parameters:
i Index of the particle to remove.

Definition at line 76 of file Particles.cpp.

References attributes, behaviors, particleSize, and shaders.

Referenced by SilhouetteFate::cleanup(), ParticleFate::cleanup(), MeshShape::cleanup(), and SkinMeshShape::edgeCollapseAndSplit().

unsigned int Particles::size  )  [inline]
 

Returns the number of particles in the system.

Definition at line 169 of file Particles.h.

References particleSize.

Referenced by RBFPropagation::adaptivity(), TopologyInterrogator::applyConstraint(), SurfacePropagation::applyConstraint(), SurfaceDeformation::applyConstraint(), SurfaceAdhesion::applyConstraint(), SingularityAdhesion::applyConstraint(), ParticleBoundingBox::applyConstraint(), SingularityInterrogator::applyForce(), SingularityAdhesion::applyForce(), SilhouetteAdhesion::applyForce(), ParticleRepulsion::applyForce(), SingularityAdhesion::cleanup(), SilhouetteFate::cleanup(), ParticleFate::cleanup(), ParticleCreation::cleanup(), CriticalPointInterrogator::cleanup(), ClusterMeshInterrogator::cleanup(), ParticleShaderStroke::draw(), ParticleShaderLink::draw(), ParticleShaderChain::draw(), ParticleShader::draw(), SilhouetteFate::fiftyPercent(), ParticleShaderStroke::findChains(), ParticleShaderChain::findChains(), ParticleLocality::getNeighbors(), ParticleCreation::getq(), VelocityIntegrator::integrate(), RBFInterpolant::interpolate(), RBF::interpolate(), Implicit::interpolate(), ParticleEigen::ParticleEigen(), ParticlePosition::ParticlePosition(), ParticleVelocity::ParticleVelocity(), ParticleRendererGL::render(), SingularityRepulsion::repelSelf(), SingularityRepulsion::repelTarget(), ParticleOrientation::setParticleSystem(), ParticleMaterial::setParticleSystem(), AdaptiveRepulsionData::setParticleSystem(), SurfacePropagation::solveCholesky(), SurfaceDeformation::solveCholesky(), RBFPropagation::tune(), SingularityAdhesion::updateHistorySize(), and ParFileManager::writePerParticle().


Member Data Documentation

ParticleAttributes Particles::attributes
 

A collection of attributes.

Definition at line 86 of file Particles.h.

Referenced by ParticleAttribute::addMeTo(), addParticle(), ParticleStuff::attachAttribute(), clear(), findAttribute(), getAttribute(), printContent(), removeAll(), ParticleAttribute::removeMe(), removeParticle(), ParticleRendererGL::render(), ParFileManager::writeParticles(), and ~Particles().

ParticleBehaviors Particles::behaviors
 

A collection of behaviors.

Definition at line 83 of file Particles.h.

Referenced by ParticleBehavior::addMeTo(), addParticle(), applyConstraints(), applyForces(), cleanup(), findBehavior(), getBehavior(), integrate(), printContent(), ParticleBehavior::removeMe(), removeParticle(), ParticleRendererGL::render(), ParFileManager::writeParticles(), and ~Particles().

bool Particles::draggable
 

gui can move the position or not

Definition at line 75 of file Particles.h.

Referenced by Particles().

double Particles::dt
 

Timestep.

Definition at line 92 of file Particles.h.

Referenced by SurfacePropagation::applyConstraint(), SilhouetteFate::cleanup(), VelocityIntegrator::integrate(), ParticleRepulsion::integrate(), Implicit::interpolate(), and Particles().

std::string Particles::name
 

Name of the particle system.

For example: "floaters" or "controllers"

Definition at line 68 of file Particles.h.

Referenced by ParFileManager::writeParticles(), and ParFileManager::writePerParticle().

unsigned int Particles::particleSize
 

Definition at line 70 of file Particles.h.

Referenced by addParticle(), clear(), Particles(), removeAll(), removeParticle(), and size().

ParticleSystem* Particles::particleSystem
 

child particles objects that are spawn by this one

Definition at line 80 of file Particles.h.

Referenced by CriticalPointInterrogator::createCriticalPointPS(), SingularityAdhesion::createSingularPS(), and Particles().

int Particles::selectedParticle
 

Definition at line 72 of file Particles.h.

Referenced by ParticleShader::drawParticle().

ParticleShaders Particles::shaders
 

A collection of attributes.

Definition at line 89 of file Particles.h.

Referenced by ParticleShader::addMeTo(), addParticle(), draw(), findShader(), getShader(), ParticleShader::removeMe(), removeParticle(), ParFileManager::writeParticles(), and ~Particles().


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