Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ParticleFactory Class Reference

#include <particle_factory.hxx>

Collaboration diagram for ParticleFactory:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::vector< Particle
* >::const_iterator 
CParticleIter
typedef std::vector< Particle
* >::iterator 
ParticleIter

Public Member Functions

 ParticleFactory (World *)
 ParticleFactory (World *, lisp_object_t *cursor)
 ParticleFactory (World *, const ParticleFactory &)
Particleadd_particle (const Vector2d &arg_pos, const Vector2d &arg_velocity, float m, bool f=false)
Particleadd_particle (const Particle &particle)
void remove_particle (Particle *)
void remove_particle (int id)
int size ()
Particlelookup_particle (int id)
void update (float delta)
void draw (ZoomGraphicContext *gc)
ParticleIter begin ()
ParticleIter end ()
void clear ()
void write_lisp (FILE *out)

Detailed Description

Its really more a particle manager, but lets see

Definition at line 35 of file particle_factory.hxx.


Member Typedef Documentation

typedef std::vector<Particle*>::const_iterator ParticleFactory::CParticleIter
 

Definition at line 73 of file particle_factory.hxx.

Referenced by clear(), draw(), ParticleFactory(), update(), and write_lisp().

typedef std::vector<Particle*>::iterator ParticleFactory::ParticleIter
 

Definition at line 74 of file particle_factory.hxx.

Referenced by RectCollider::bounce(), World::calc_bounding_box(), World::get_particle(), World::get_particles(), lookup_particle(), remove_particle(), World::update(), and World::zero_out_velocity().


Constructor & Destructor Documentation

ParticleFactory::ParticleFactory World  
 

Create an empty particle manager

Definition at line 27 of file particle_factory.cxx.

ParticleFactory::ParticleFactory World  ,
lisp_object_t   cursor
 

Create a particle manager from the data in a .construo file

Definition at line 32 of file particle_factory.cxx.

References World::file_version, lisp_car(), lisp_cdr(), lisp_nil_p, LispReader::read_bool(), LispReader::read_float(), LispReader::read_int(), and LispReader::read_vector().

ParticleFactory::ParticleFactory World  ,
const ParticleFactory &   
 

Copy a particle manager, the id's will be keep

Definition at line 71 of file particle_factory.cxx.

References CParticleIter.


Member Function Documentation

Particle * ParticleFactory::add_particle const Particle   particle
 

Duplicate a particle

Definition at line 103 of file particle_factory.cxx.

References Particle::id.

Particle * ParticleFactory::add_particle const Vector2d   arg_pos,
const Vector2d   arg_velocity,
float    m,
bool    f = false
 

Definition at line 93 of file particle_factory.cxx.

Referenced by Selection::duplicate(), WorldViewInsertTool::on_primary_button_press(), and World::update().

ParticleIter ParticleFactory::begin   [inline]
 

Definition at line 76 of file particle_factory.hxx.

Referenced by RectCollider::bounce(), World::calc_bounding_box(), World::get_particle(), World::get_particles(), World::update(), and World::zero_out_velocity().

void ParticleFactory::clear  
 

Definition at line 166 of file particle_factory.cxx.

References CParticleIter.

Referenced by World::clear().

void ParticleFactory::draw ZoomGraphicContext   gc
 

Definition at line 145 of file particle_factory.cxx.

References CParticleIter.

Referenced by World::draw_particles().

ParticleIter ParticleFactory::end   [inline]
 

Definition at line 77 of file particle_factory.hxx.

Referenced by RectCollider::bounce(), World::calc_bounding_box(), World::get_particle(), World::get_particles(), World::update(), and World::zero_out_velocity().

Particle * ParticleFactory::lookup_particle int    id
 

Definition at line 152 of file particle_factory.cxx.

References ParticleIter.

Referenced by Spring::Spring(), and World::World().

void ParticleFactory::remove_particle int    id
 

Remove a particle by id

void ParticleFactory::remove_particle Particle  
 

Remove a particle by pointer

Definition at line 112 of file particle_factory.cxx.

References ParticleIter.

Referenced by World::remove_particle().

int ParticleFactory::size   [inline]
 

Definition at line 67 of file particle_factory.hxx.

Referenced by World::calc_bounding_box(), World::get_num_particles(), and World::remove_spring().

void ParticleFactory::update float    delta
 

Definition at line 135 of file particle_factory.cxx.

References CParticleIter.

Referenced by World::update().

void ParticleFactory::write_lisp FILE *    out
 

Definition at line 174 of file particle_factory.cxx.

References CParticleIter, lisp_dump(), and lisp_free().

Referenced by World::write_lisp().


The documentation for this class was generated from the following files:
Generated on Thu Jul 24 10:25:23 2003 for Construo by doxygen1.3-rc3