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

ParticleStuff Class Reference

#include <ParticleStuff.h>

Inheritance diagram for ParticleStuff:

Inheritance graph
[legend]
Collaboration diagram for ParticleStuff:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual const std::string getClass ()
 Just a placeholder.

virtual void setName (std::string &new_name)
 Set the name of the ParticleStuff.

virtual std::string getName ()
 Return the name of the ParticleStuff.

 ParticleStuff (Particles *p=NULL, std::string &new_name=std::string("ParticleStuff"))
 Default constructor Constructor to set particle system and name.

virtual void setParticleSystem (Particles *new_ps)
 Set the particle system the ParticleStuff points to.

virtual void addMeTo (Particles *new_ps)=0
 Add the stuff to a particle system.

virtual void removeMe ()=0
 Remove the stuff from the current particle system.

virtual void particleAdded (unsigned int i)
 Called after particles are added to the system.

virtual void particleRemoved (unsigned int i)
 Called after particle are removed from the system.

virtual void printContent ()
 Print attribute info.

template<class attrclass> void attachAttribute (attrclass *&attr, std::string &name)
 Attach an attribute to the behavior.

Global Parameter Manipulation
virtual int qlen ()
 Returns length of particle stuff parameters.

virtual void getq (double *)
 Get the parameters.

virtual void getq (DoubleVector &q)
 Get the parameters.

virtual void setq (double *)
 Set particle stuff parameters.

virtual void setq (DoubleVector &q)
 Set particle stuff parameters stored in a DoubleVector.

virtual void qname (char **)
 Get the names of the parameters.

virtual void qname (NameVector &q)
 Get the names of the parameters in a name vector.

virtual void qshortname (NameVector &q)
 Get the short names of the parameters in a name vector.

virtual char * qtip (int i)
 Returns a tool-tip for the parameter i.

virtual char * tip ()
 Returns a tool-tip for the ParticleStuff.

Per-Particle Parameter Manipulation
virtual int qlenpp ()
 # of parameters per particle

virtual void getqpp (double *, int)
 Get the per-particle parameters.

virtual void getqpp (DoubleVector &q, int)
virtual void setqpp (double *, int)
 Set per-particle parameters.

virtual void setqpp (DoubleVector &q, int)
virtual void qnamepp (char **)
 Get the names of the per-particle parameters.

virtual void qnamepp (NameVector &q)

Public Attributes

std::string registry_name
 The class name of the object according to the factory.

std::string name
 The name of this object.

Particlesps
 Reference to the owning particle system.


Constructor & Destructor Documentation

ParticleStuff::ParticleStuff Particles p = NULL,
std::string &  new_name = std::string("ParticleStuff")
 

Default constructor Constructor to set particle system and name.

Definition at line 10 of file ParticleStuff.cpp.


Member Function Documentation

virtual void ParticleStuff::addMeTo Particles new_ps  )  [pure virtual]
 

Add the stuff to a particle system.

This should be avoided as it does not set ParticleStuff::ps. Use setParticleSystem(Particles *) instead.

Implemented in ParticleAttribute, ParticleBehavior, and ParticleShader.

Referenced by setParticleSystem().

template<class attrclass>
void ParticleStuff::attachAttribute attrclass *&  attr,
std::string &  name
[inline]
 

Attach an attribute to the behavior.

Templated by attribute.

Parameters:
attr A pointer to a subclass of ParticleAttribute. Set to zero if ps = 0.
name The string name of the attribute in case it is different than the classname.

Definition at line 296 of file ParticleStuff.h.

References Particles::attributes, and ps.

Referenced by TopologyInterrogator::attachAttributes(), SurfacePropagation::attachAttributes(), SurfaceDeformation::attachAttributes(), SurfaceAdhesion::attachAttributes(), SkinMeshShape::attachAttributes(), SingularityInterrogator::attachAttributes(), SingularityAdhesion::attachAttributes(), SilhouetteFate::attachAttributes(), SilhouetteAdhesion::attachAttributes(), RBFPropagation::attachAttributes(), ParticleShaderTriangle::attachAttributes(), ParticleShaderGradientField::attachAttributes(), ParticleShaderDisk::attachAttributes(), ParticleShaderCurvature::attachAttributes(), ParticleShaderCluster::attachAttributes(), ParticleShader::attachAttributes(), ParticleRepulsion::attachAttributes(), ParticleFate::attachAttributes(), ParticleBehavior::attachAttributes(), CriticalPointInterrogator::attachAttributes(), and ClusterMeshInterrogator::attachAttributes().

const std::string ParticleStuff::getClass  )  [virtual]
 

Just a placeholder.

Didn't make pure virtual in case newer development classes haven't yet been entered into the factory. Should be overwritten. Otherwise will return ParticleStuff::registry_name, which will be NULL.

Definition at line 4 of file ParticleStuff.cpp.

References registry_name.

Referenced by ParFileManager::writeParticles().

std::string ParticleStuff::getName  )  [virtual]
 

Return the name of the ParticleStuff.

Definition at line 8 of file ParticleStuff.cpp.

References name.

void ParticleStuff::getq DoubleVector q  )  [virtual]
 

Get the parameters.

Defaults to no parameters.

Definition at line 91 of file ParticleStuff.cpp.

References DoubleVector, getq(), and qlen().

void ParticleStuff::getq double *   )  [virtual]
 

Get the parameters.

Defaults to no parameters.

Reimplemented in AdaptiveRepulsionData, ClusterMeshInterrogator, CriticalPointInterrogator, ImplicitInterrogator, MeshShape, ParticleBoundingBox, ParticleCreation, ParticleFate, ParticleOrientation, ParticleRepulsion, ParticleShaderChain, ParticleShaderCluster, ParticleShaderConstMaterial, ParticleShaderCurvature, ParticleShaderCylinder, ParticleShaderDisk, ParticleShaderGradientField, ParticleShaderSphere, ParticleShaderStroke, ParticleShaderTeapot, ParticleShaderTriangle, RBFPropagation, SilhouetteAdhesion, SilhouetteFate, SingularityAdhesion, SingularityInterrogator, SingularityRepulsion, SkinMeshShape, SurfaceAdhesion, SurfaceDeformation, SurfaceInterrogator, SurfacePropagation, and TopologyInterrogator.

Definition at line 22 of file ParticleStuff.cpp.

Referenced by getq(), ParFileManager::readParticles(), and ParFileManager::writeParticles().

void ParticleStuff::getqpp DoubleVector q,
int 
[virtual]
 

Definition at line 102 of file ParticleStuff.cpp.

References DoubleVector, getqpp(), and qlenpp().

void ParticleStuff::getqpp double *  ,
int 
[virtual]
 

Get the per-particle parameters.

Defaults to no parameters. Second parameter is the particle index

Reimplemented in AdaptiveRepulsionData, GeneAttribute, ParticleAge, ParticleMaterial, ParticleOrientation, ParticlePosition, ParticleVelocity, and SingularityAdhesion.

Definition at line 34 of file ParticleStuff.cpp.

Referenced by getqpp().

void ParticleStuff::particleAdded unsigned int  i  )  [virtual]
 

Called after particles are added to the system.

Reimplemented in AdaptiveRepulsionData, ParticleAge, ParticleEigen, ParticleLocalityGrid, ParticleMaterial, ParticleOrientation, ParticlePosition, ParticleVelocity, SingularityAdhesion, SurfaceAdhesion, and SurfaceDeformation.

Definition at line 14 of file ParticleStuff.cpp.

void ParticleStuff::particleRemoved unsigned int  i  )  [virtual]
 

Called after particle are removed from the system.

Reimplemented in AdaptiveRepulsionData, ParticleAge, ParticleEigen, ParticleLocalityGrid, ParticleMaterial, ParticleOrientation, ParticlePosition, ParticleVelocity, SingularityAdhesion, and SurfaceDeformation.

Definition at line 16 of file ParticleStuff.cpp.

void ParticleStuff::printContent  )  [virtual]
 

Print attribute info.

Definition at line 18 of file ParticleStuff.cpp.

References name.

int ParticleStuff::qlen  )  [virtual]
 

Returns length of particle stuff parameters.

Defaults to no parameters.

Reimplemented in AdaptiveRepulsionData, ClusterMeshInterrogator, CriticalPointInterrogator, ImplicitInterrogator, MeshShape, ParticleBoundingBox, ParticleCreation, ParticleFate, ParticleOrientation, ParticleRepulsion, ParticleShaderChain, ParticleShaderCluster, ParticleShaderConstMaterial, ParticleShaderCurvature, ParticleShaderCylinder, ParticleShaderDisk, ParticleShaderGradientField, ParticleShaderSphere, ParticleShaderStroke, ParticleShaderTeapot, ParticleShaderTriangle, RBFPropagation, SilhouetteAdhesion, SilhouetteFate, SingularityAdhesion, SingularityInterrogator, SingularityRepulsion, SkinMeshShape, SurfaceAdhesion, SurfaceDeformation, SurfaceInterrogator, SurfacePropagation, and TopologyInterrogator.

Definition at line 20 of file ParticleStuff.cpp.

Referenced by getq(), qname(), qshortname(), setq(), setqpp(), and ParFileManager::writeParticles().

int ParticleStuff::qlenpp  )  [virtual]
 

# of parameters per particle

Reimplemented in AdaptiveRepulsionData, GeneAttribute, ParticleAge, ParticleMaterial, ParticleOrientation, ParticlePosition, ParticleVelocity, and SingularityAdhesion.

Definition at line 32 of file ParticleStuff.cpp.

Referenced by getqpp(), qnamepp(), and setqpp().

void ParticleStuff::qname NameVector q  )  [virtual]
 

Get the names of the parameters in a name vector.

Definition at line 55 of file ParticleStuff.cpp.

References NameVector, qlen(), and qname().

void ParticleStuff::qname char **   )  [virtual]
 

Get the names of the parameters.

Defaults to no parameters.

Reimplemented in AdaptiveRepulsionData, ClusterMeshInterrogator, CriticalPointInterrogator, ImplicitInterrogator, MeshShape, ParticleBoundingBox, ParticleCreation, ParticleFate, ParticleOrientation, ParticleRepulsion, ParticleShaderChain, ParticleShaderCluster, ParticleShaderConstMaterial, ParticleShaderCurvature, ParticleShaderCylinder, ParticleShaderDisk, ParticleShaderGradientField, ParticleShaderSphere, ParticleShaderStroke, ParticleShaderTeapot, ParticleShaderTriangle, RBFPropagation, SilhouetteAdhesion, SilhouetteFate, SingularityAdhesion, SingularityInterrogator, SingularityRepulsion, SkinMeshShape, SurfaceAdhesion, SurfaceDeformation, SurfaceInterrogator, SurfacePropagation, and TopologyInterrogator.

Definition at line 26 of file ParticleStuff.cpp.

Referenced by qname().

void ParticleStuff::qnamepp NameVector q  )  [virtual]
 

Definition at line 74 of file ParticleStuff.cpp.

References NameVector, qlenpp(), and qnamepp().

void ParticleStuff::qnamepp char **   )  [virtual]
 

Get the names of the per-particle parameters.

Defaults to no parameters.

Reimplemented in AdaptiveRepulsionData, GeneAttribute, ParticleAge, ParticleMaterial, ParticleOrientation, ParticlePosition, ParticleVelocity, and SingularityAdhesion.

Definition at line 38 of file ParticleStuff.cpp.

Referenced by qnamepp().

void ParticleStuff::qshortname NameVector q  )  [virtual]
 

Get the short names of the parameters in a name vector.

Definition at line 131 of file ParticleStuff.cpp.

References NameVector, and qlen().

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

char * ParticleStuff::qtip int  i  )  [virtual]
 

Returns a tool-tip for the parameter i.

Reimplemented in AdaptiveRepulsionData, ParticleFate, ParticleRepulsion, and ParticleShaderCurvature.

Definition at line 28 of file ParticleStuff.cpp.

virtual void ParticleStuff::removeMe  )  [pure virtual]
 

Remove the stuff from the current particle system.

Does not destroy stuff. Just unlinks it from the current particle system.

Implemented in ParticleAttribute, ParticleBehavior, and ParticleShader.

void ParticleStuff::setName std::string &  new_name  )  [virtual]
 

Set the name of the ParticleStuff.

Definition at line 6 of file ParticleStuff.cpp.

References name.

void ParticleStuff::setParticleSystem Particles new_ps  )  [virtual]
 

Set the particle system the ParticleStuff points to.

Also adds the ParticleStuff to the particle system. If this is a new particle system, this deletes the ParticleStuff from the existing particle system.

2002-10-26 Wen Pure virtual function at the ParticleStuff level. Made concrete in ParticleAttribute, ParticleBehavior, etc. Not pure any more, since all the children do the same thing, it is easier just to inherent this one.

2003-11-05 Wen Very important, every one MUST call this before using this class. This is used to initialize the system. Since the factory can create a ParticleStuff with a ps=NULL, we must handle initialization step as a separate function, in order to not calling the same code twice I decided not to call this function in all the constructors.

Reimplemented in AdaptiveRepulsionData, ParticleMaterial, ParticleOrientation, and ParticleShader.

Definition at line 47 of file ParticleStuff.cpp.

References addMeTo(), and ps.

Referenced by SingularityAdhesion::createSingularPS(), ParFileManager::readParticles(), ParticleOrientation::setParticleSystem(), ParticleMaterial::setParticleSystem(), and AdaptiveRepulsionData::setParticleSystem().

void ParticleStuff::setq DoubleVector q  )  [virtual]
 

Set particle stuff parameters stored in a DoubleVector.

Definition at line 113 of file ParticleStuff.cpp.

References DoubleVector, qlen(), and setq().

void ParticleStuff::setq double *   )  [virtual]
 

Set particle stuff parameters.

Defaults to no parameters.

Reimplemented in AdaptiveRepulsionData, ClusterMeshInterrogator, CriticalPointInterrogator, ImplicitInterrogator, MeshShape, ParticleBoundingBox, ParticleCreation, ParticleFate, ParticleOrientation, ParticleRepulsion, ParticleShaderChain, ParticleShaderCluster, ParticleShaderConstMaterial, ParticleShaderCurvature, ParticleShaderCylinder, ParticleShaderDisk, ParticleShaderGradientField, ParticleShaderSphere, ParticleShaderStroke, ParticleShaderTeapot, ParticleShaderTriangle, RBFPropagation, SilhouetteAdhesion, SilhouetteFate, SingularityAdhesion, SingularityInterrogator, SingularityRepulsion, SkinMeshShape, SurfaceAdhesion, SurfaceDeformation, SurfaceInterrogator, SurfacePropagation, and TopologyInterrogator.

Definition at line 24 of file ParticleStuff.cpp.

Referenced by ParFileManager::readParticles(), and setq().

void ParticleStuff::setqpp DoubleVector q,
int 
[virtual]
 

Definition at line 122 of file ParticleStuff.cpp.

References DoubleVector, qlen(), qlenpp(), and setqpp().

void ParticleStuff::setqpp double *  ,
int 
[virtual]
 

Set per-particle parameters.

Defaults to no parameters. Second parameter is the particle index

Reimplemented in AdaptiveRepulsionData, GeneAttribute, ParticleAge, ParticleMaterial, ParticleOrientation, ParticlePosition, ParticleVelocity, and SingularityAdhesion.

Definition at line 36 of file ParticleStuff.cpp.

Referenced by setqpp().

char * ParticleStuff::tip  )  [virtual]
 

Returns a tool-tip for the ParticleStuff.

Reimplemented in AdaptiveRepulsionData, ParticleBoundingBox, ParticleFate, ParticleRepulsion, and ParticleShaderCurvature.

Definition at line 30 of file ParticleStuff.cpp.


Member Data Documentation

std::string ParticleStuff::name
 

The name of this object.

Definition at line 146 of file ParticleStuff.h.

Referenced by ParticleBehavior::addMeTo(), ParticleAttribute::addMeTo(), getName(), printContent(), ParticleShader::removeMe(), ParticleBehavior::removeMe(), ParticleAttribute::removeMe(), and setName().

Particles* ParticleStuff::ps
 

Reference to the owning particle system.

Definition at line 157 of file ParticleStuff.h.

Referenced by RBFPropagation::adaptivity(), TopologyInterrogator::applyConstraint(), SurfacePropagation::applyConstraint(), SurfaceDeformation::applyConstraint(), SurfaceAdhesion::applyConstraint(), SingularityAdhesion::applyConstraint(), ParticleBoundingBox::applyConstraint(), SingularityInterrogator::applyForce(), SingularityAdhesion::applyForce(), SilhouetteAdhesion::applyForce(), ParticleRepulsion::applyForce(), attachAttribute(), SilhouetteFate::attachAttributes(), ParticleShader::attachAttributes(), ParticleRepulsion::attachAttributes(), ParticleCreation::attachAttributes(), ParticleBehavior::attachAttributes(), TopologyInterrogator::cleanup(), SingularityAdhesion::cleanup(), SilhouetteFate::cleanup(), ParticleFate::cleanup(), ParticleCreation::cleanup(), MeshShape::cleanup(), CriticalPointInterrogator::cleanup(), ClusterMeshInterrogator::cleanup(), ParticleMesh::createDiamond(), ParticleShaderStroke::draw(), ParticleShaderLink::draw(), ParticleShaderGradientField::draw(), ParticleShaderChain::draw(), ParticleShader::draw(), ParticleShader::drawParticle(), SkinMeshShape::edgeCollapseAndSplit(), SilhouetteFate::fiftyPercent(), ParticleShaderStroke::findChains(), ParticleShaderChain::findChains(), CriticalPointInterrogator::findCriticalPoints(), ParticleLocality::getNeighbors(), ParticleCreation::getq(), VelocityIntegrator::integrate(), ParticleRepulsion::integrate(), SurfaceDeformation::loadParticles(), ParticleShader::removeMe(), ParticleBehavior::removeMe(), ParticleAttribute::removeMe(), SingularityRepulsion::repelSelf(), SingularityRepulsion::repelTarget(), setParticleSystem(), ParticleShader::setParticleSystem(), ParticleOrientation::setParticleSystem(), ParticleMaterial::setParticleSystem(), AdaptiveRepulsionData::setParticleSystem(), ParticleCreation::setq(), SurfacePropagation::solveCholesky(), SurfaceDeformation::solveCholesky(), SurfacePropagation::speed(), RBFPropagation::tune(), and SingularityAdhesion::updateHistorySize().

std::string ParticleStuff::registry_name
 

The class name of the object according to the factory.

Definition at line 136 of file ParticleStuff.h.

Referenced by getClass().


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