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

ParticleOrientation Class Reference

#include <ParticleOrientation.h>

Inheritance diagram for ParticleOrientation:

Inheritance graph
[legend]
Collaboration diagram for ParticleOrientation:

Collaboration graph
[legend]
List of all members.

Detailed Description

ParticleOrientation is a ParticleAttribute which represents the orientation of particles in a system with a vector of normals.

Definition at line 18 of file ParticleOrientation.h.

Public Member Functions

 MAKE_PARTICLESTUFF_NAME ()
int qlen ()
 Returns length of particle stuff parameters.

void getq (double *q)
 Get the parameters.

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

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

int qlenpp ()
 # of parameters per particle

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

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

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

 ParticleOrientation (Particles *ps=NULL, std::string name=std::string("ParticleOrientation"))
 Add paritcle orientation to a system of particles.

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

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

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


Public Attributes

gmVector3 gravity
double wind
std::vector< gmVector3 > n
 Particle normals.

std::vector< double > gradMag2
 Magnitude of the gradients squared.


Constructor & Destructor Documentation

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

Add paritcle orientation to a system of particles.

If particles exist in the system, default their normals to (0.0,0.0,1.0).

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

Definition at line 18 of file ParticleOrientation.cpp.

References setParticleSystem().


Member Function Documentation

void ParticleOrientation::clear  )  [virtual]
 

Reimplemented from ParticleAttribute.

Definition at line 88 of file ParticleOrientation.cpp.

References gradMag2, and n.

void ParticleOrientation::getq double *  q  )  [virtual]
 

Get the parameters.

Defaults to no parameters.

Reimplemented from ParticleStuff.

Definition at line 44 of file ParticleOrientation.cpp.

References gravity.

void ParticleOrientation::getqpp double *  q,
int  i
[virtual]
 

Get the per-particle parameters.

Defaults to no parameters. Second parameter is the particle index

Reimplemented from ParticleStuff.

Definition at line 69 of file ParticleOrientation.cpp.

References n.

ParticleOrientation::MAKE_PARTICLESTUFF_NAME  ) 
 

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

Callback for particle addition.

Parameters:
i Index of the new particle.

Reimplemented from ParticleStuff.

Definition at line 99 of file ParticleOrientation.cpp.

References gradMag2, and n.

void ParticleOrientation::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 111 of file ParticleOrientation.cpp.

References gradMag2, and n.

int ParticleOrientation::qlen  )  [virtual]
 

Returns length of particle stuff parameters.

Defaults to no parameters.

Reimplemented from ParticleStuff.

Definition at line 39 of file ParticleOrientation.cpp.

int ParticleOrientation::qlenpp  )  [virtual]
 

# of parameters per particle

Reimplemented from ParticleStuff.

Definition at line 65 of file ParticleOrientation.cpp.

void ParticleOrientation::qname char **  qn  )  [virtual]
 

Get the names of the parameters.

Defaults to no parameters.

Reimplemented from ParticleStuff.

Definition at line 58 of file ParticleOrientation.cpp.

void ParticleOrientation::qnamepp char **  qn  )  [virtual]
 

Get the names of the per-particle parameters.

Defaults to no parameters.

Reimplemented from ParticleStuff.

Definition at line 81 of file ParticleOrientation.cpp.

void ParticleOrientation::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 from ParticleStuff.

Definition at line 24 of file ParticleOrientation.cpp.

References gradMag2, n, ParticleStuff::ps, ParticleStuff::setParticleSystem(), and Particles::size().

Referenced by ParticleOrientation().

void ParticleOrientation::setq double *  q  )  [virtual]
 

Set particle stuff parameters.

Defaults to no parameters.

Reimplemented from ParticleStuff.

Definition at line 51 of file ParticleOrientation.cpp.

References gravity.

void ParticleOrientation::setqpp double *  q,
int  i
[virtual]
 

Set per-particle parameters.

Defaults to no parameters. Second parameter is the particle index

Reimplemented from ParticleStuff.

Definition at line 75 of file ParticleOrientation.cpp.

References n.


Member Data Documentation

std::vector<double> ParticleOrientation::gradMag2
 

Magnitude of the gradients squared.

Definition at line 36 of file ParticleOrientation.h.

Referenced by SurfaceDeformation::applyConstraint(), SurfaceAdhesion::applyConstraint(), ParticleFate::cleanup(), clear(), particleAdded(), particleRemoved(), and setParticleSystem().

gmVector3 ParticleOrientation::gravity
 

Definition at line 24 of file ParticleOrientation.h.

Referenced by ParticleShader::applyTransformations(), getq(), and setq().

std::vector<gmVector3> ParticleOrientation::n
 

Particle normals.

Definition at line 33 of file ParticleOrientation.h.

Referenced by SurfaceDeformation::applyConstraint(), SurfaceAdhesion::applyConstraint(), SingularityAdhesion::applyForce(), ParticleShader::applyTransformations(), SingularityAdhesion::cleanup(), SilhouetteFate::cleanup(), ParticleFate::cleanup(), clear(), ParticleShaderStroke::draw(), SilhouetteFate::fiftyPercent(), getqpp(), SurfaceAdhesion::particleAdded(), particleAdded(), particleRemoved(), ParticleRendererGL::render(), setParticleSystem(), setqpp(), and ParFileManager::writePerParticle().

double ParticleOrientation::wind
 

Definition at line 25 of file ParticleOrientation.h.


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