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

ParticleLocality Class Reference

#include <ParticleLocality.h>

Inheritance diagram for ParticleLocality:

Inheritance graph
[legend]
Collaboration diagram for ParticleLocality:

Collaboration graph
[legend]
List of all members.

Detailed Description

ParticleLocality is the base class for objects that maintain a notion of the spatial relationship between particles.

Such classes can optimize the finding of particle neighbors.

Definition at line 18 of file ParticleLocality.h.

Public Member Functions

 MAKE_PARTICLESTUFF_NAME ()
 ParticleLocality (Particles *ps=NULL, std::string name=std::string("ParticleLocality"))
 Constructor.

virtual void clear ()
virtual void update ()
 Update callback.

virtual void setQueryRadius (double newr)
 Set the query radius.

virtual double getQueryRadius ()
 Returns the query radius.

virtual void getNeighbors (unsigned int i, std::vector< int > &neighbors)
 Finds possible neighbors of a particle.

void getNeighbors (unsigned int i, double r, std::vector< int > &neighbors)
 Shortcut that calls setQueryRadius, then getNeighbors.


Public Attributes

double r
 Query radius.


Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 16 of file ParticleLocality.cpp.

References r.


Member Function Documentation

virtual void ParticleLocality::clear  )  [inline, virtual]
 

Reimplemented from ParticleAttribute.

Reimplemented in ParticleLocalityGrid.

Definition at line 33 of file ParticleLocality.h.

void ParticleLocality::getNeighbors unsigned int  i,
double  r,
std::vector< int > &  neighbors
[inline]
 

Shortcut that calls setQueryRadius, then getNeighbors.

Definition at line 65 of file ParticleLocality.h.

References getNeighbors(), and setQueryRadius().

void ParticleLocality::getNeighbors unsigned int  i,
std::vector< int > &  neighbors
[virtual]
 

Finds possible neighbors of a particle.

Might use the internally stored query radius to limit the search to nearby particles. Use setQueryRadius to set.

Definition at line 32 of file ParticleLocality.cpp.

References ParticleStuff::ps, and Particles::size().

Referenced by ParticleRepulsion::applyForce(), ParticleShaderLink::draw(), getNeighbors(), and ParticleRendererGL::render().

virtual double ParticleLocality::getQueryRadius  )  [inline, virtual]
 

Returns the query radius.

Definition at line 55 of file ParticleLocality.h.

References r.

ParticleLocality::MAKE_PARTICLESTUFF_NAME  ) 
 

Reimplemented in ParticleLocalityGrid.

virtual void ParticleLocality::setQueryRadius double  newr  )  [inline, virtual]
 

Set the query radius.

Some ParticleLocality subclasses may not care what the query radius is. For example, they may return mesh edge neighbors.

Definition at line 51 of file ParticleLocality.h.

References r.

Referenced by ParticleRepulsion::applyForce(), and getNeighbors().

virtual void ParticleLocality::update void   )  [inline, virtual]
 

Update callback.

Reimplemented in ParticleLocalityGrid.

Definition at line 45 of file ParticleLocality.h.

Referenced by ParticleRepulsion::cleanup().


Member Data Documentation

double ParticleLocality::r
 

Query radius.

Definition at line 24 of file ParticleLocality.h.

Referenced by ParticleLocalityGrid::getNeighbors(), getQueryRadius(), ParticleLocality(), and setQueryRadius().


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