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

ParticleMaterial Class Reference

#include <ParticleMaterial.h>

Inheritance diagram for ParticleMaterial:

Inheritance graph
[legend]
Collaboration diagram for ParticleMaterial:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MAKE_PARTICLESTUFF_NAME ()
 ParticleMaterial (Particles *ps=NULL, std::string name=std::string("ParticleMaterial"))
 Add per particle material properties to a system of particles.

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

void particleAdded (unsigned int i)
 Callback for particle addition.

void particleRemoved (unsigned int i)
 Callback for particle removal.

virtual void setDiffuse (unsigned int i, gmVector4 c)
 Sets diffuse color of particle i (both front and back).

virtual void setDiffuseFront (unsigned int i, gmVector4 c)
 Sets diffuse color of front of particle i.

virtual void setDiffuseBack (unsigned int i, gmVector4 c)
 Sets diffuse color of back of particle i.

virtual gmVector4 getDiffuse (unsigned int i)
 Returns diffuse color of particle i (front color if two sided).

virtual gmVector4 getDiffuseFront (unsigned int i)
 Returns diffuse color of front of particle i.

virtual gmVector4 getDiffuseBack (unsigned int i)
 Returns diffuse color of back of particle i.

int qlenpp ()
 # of parameters per particle

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

void setqpp (double *qppi, int i)
 Set per-particle parameters.

void qnamepp (char **qn)
 Get the names of the per-particle parameters.

virtual void clear ()
 Remove all particles from the vectors.


Public Attributes

std::vector< gmVector4 > color
 per particle diffuse colors

std::vector< gmVector4 > diffuseFront
std::vector< gmVector4 > diffuseBack

Constructor & Destructor Documentation

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

Add per particle material properties to a system of particles.

Parameters:
ps The owning particle system.
name The name of this object.

Definition at line 15 of file ParticleMaterial.cpp.


Member Function Documentation

void ParticleMaterial::clear  )  [virtual]
 

Remove all particles from the vectors.

Reimplemented from ParticleAttribute.

Definition at line 64 of file ParticleMaterial.cpp.

References color, diffuseBack, and diffuseFront.

virtual gmVector4 ParticleMaterial::getDiffuse unsigned int  i  )  [inline, virtual]
 

Returns diffuse color of particle i (front color if two sided).

Definition at line 47 of file ParticleMaterial.h.

References getDiffuseFront().

virtual gmVector4 ParticleMaterial::getDiffuseBack unsigned int  i  )  [inline, virtual]
 

Returns diffuse color of back of particle i.

Definition at line 53 of file ParticleMaterial.h.

References diffuseBack.

Referenced by getqpp(), and ParticleShader::setColor().

virtual gmVector4 ParticleMaterial::getDiffuseFront unsigned int  i  )  [inline, virtual]
 

Returns diffuse color of front of particle i.

Definition at line 50 of file ParticleMaterial.h.

References diffuseFront.

Referenced by getDiffuse(), getqpp(), and ParticleShader::setColor().

void ParticleMaterial::getqpp double *  qppi,
int  i
[inline, virtual]
 

Get the per-particle parameters.

Defaults to no parameters. Second parameter is the particle index

Reimplemented from ParticleStuff.

Definition at line 57 of file ParticleMaterial.h.

References getDiffuseBack(), and getDiffuseFront().

ParticleMaterial::MAKE_PARTICLESTUFF_NAME  ) 
 

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

Callback for particle addition.

Parameters:
i Index of the new particle.

Reimplemented from ParticleStuff.

Definition at line 41 of file ParticleMaterial.cpp.

References color, diffuseBack, and diffuseFront.

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

Callback for particle removal.

Parameters:
i Index of particle to be removed.
See also:
Particles::particleRemoved

Reimplemented from ParticleStuff.

Definition at line 54 of file ParticleMaterial.cpp.

References color, diffuseBack, and diffuseFront.

int ParticleMaterial::qlenpp  )  [inline, virtual]
 

# of parameters per particle

Reimplemented from ParticleStuff.

Definition at line 55 of file ParticleMaterial.h.

void ParticleMaterial::qnamepp char **  qn  )  [inline, virtual]
 

Get the names of the per-particle parameters.

Defaults to no parameters.

Reimplemented from ParticleStuff.

Definition at line 72 of file ParticleMaterial.h.

virtual void ParticleMaterial::setDiffuse unsigned int  i,
gmVector4  c
[inline, virtual]
 

Sets diffuse color of particle i (both front and back).

Definition at line 38 of file ParticleMaterial.h.

References setDiffuseBack(), and setDiffuseFront().

Referenced by CriticalPointInterrogator::cleanup().

virtual void ParticleMaterial::setDiffuseBack unsigned int  i,
gmVector4  c
[inline, virtual]
 

Sets diffuse color of back of particle i.

Definition at line 44 of file ParticleMaterial.h.

References diffuseBack.

Referenced by ParticleShaderCurvature::drawShape(), ParticleShaderConstMaterial::drawShape(), and setDiffuse().

virtual void ParticleMaterial::setDiffuseFront unsigned int  i,
gmVector4  c
[inline, virtual]
 

Sets diffuse color of front of particle i.

Definition at line 41 of file ParticleMaterial.h.

References diffuseFront.

Referenced by ParticleShaderCurvature::drawShape(), ParticleShaderConstMaterial::drawShape(), setDiffuse(), and setqpp().

void ParticleMaterial::setParticleSystem Particles  )  [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 from ParticleStuff.

Definition at line 20 of file ParticleMaterial.cpp.

References color, diffuseBack, diffuseFront, ParticleStuff::ps, ParticleStuff::setParticleSystem(), and Particles::size().

void ParticleMaterial::setqpp double *  qppi,
int  i
[inline, virtual]
 

Set per-particle parameters.

Defaults to no parameters. Second parameter is the particle index

Reimplemented from ParticleStuff.

Definition at line 64 of file ParticleMaterial.h.

References setDiffuseFront().


Member Data Documentation

std::vector<gmVector4> ParticleMaterial::color
 

per particle diffuse colors

Definition at line 22 of file ParticleMaterial.h.

Referenced by clear(), ParticleShaderConstMaterial::drawShape(), particleAdded(), particleRemoved(), ParticleShader::setColor(), and setParticleSystem().

std::vector<gmVector4> ParticleMaterial::diffuseBack
 

Definition at line 24 of file ParticleMaterial.h.

Referenced by clear(), getDiffuseBack(), particleAdded(), particleRemoved(), setDiffuseBack(), and setParticleSystem().

std::vector<gmVector4> ParticleMaterial::diffuseFront
 

Definition at line 23 of file ParticleMaterial.h.

Referenced by clear(), getDiffuseFront(), particleAdded(), particleRemoved(), setDiffuseFront(), and setParticleSystem().


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