Welcome to the NetCologne GmbH open source mirroring service!

This machine mirrors various open-source projects. 20 Gbit/s uplink.

If there are any issues or you want another project mirrored, please contact mirror-service -=AT=- netcologne DOT de !

Particle class Reference
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Particle Class Reference

#include <particle.hxx>

Collaboration diagram for Particle:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int get_id ()
void add_force (const Vector2d &force)
void clear_force ()
void set_fixed (bool f)
bool get_fixed ()
float get_mass () const
void update (float delta)
void draw (ZoomGraphicContext *gc)
void draw_highlight (ZoomGraphicContext *gc)
void draw_infos (ZoomGraphicContext *gc)
void draw_velocity_vector (ZoomGraphicContext *gc)
lisp_object_tserialize ()

Public Attributes

Vector2d pos
Vector2d velocity
bool fixed
Vector2d totale_force
int spring_links

Friends

class ParticleFactory

Member Function Documentation

void Particle::add_force const Vector2d   force [inline]
 

Definition at line 61 of file particle.hxx.

void Particle::clear_force   [inline]
 

Definition at line 67 of file particle.hxx.

Referenced by update().

void Particle::draw ZoomGraphicContext   gc
 

Definition at line 86 of file particle.cxx.

References GraphicContext::draw_fill_circle(), get_mass(), ZoomGraphicContext::get_parent_gc(), pos, Math::round(), ZoomGraphicContext::world_to_screen(), and Vector2d::y.

void Particle::draw_highlight ZoomGraphicContext   gc
 

draws the particle in highlight mode (aka if mouse is over it)

Definition at line 63 of file particle.cxx.

References GraphicContext::draw_fill_circle(), get_mass(), ZoomGraphicContext::get_parent_gc(), Math::round(), and ZoomGraphicContext::world_to_screen().

Referenced by WorldViewInsertTool::draw_background().

void Particle::draw_infos ZoomGraphicContext   gc
 

draws additional infos to this stop

Definition at line 71 of file particle.cxx.

References GraphicContext::draw_string(), draw_velocity_vector(), get_mass(), ZoomGraphicContext::get_parent_gc(), and ZoomGraphicContext::world_to_screen().

Referenced by WorldViewInsertTool::draw_foreground().

void Particle::draw_velocity_vector ZoomGraphicContext   gc
 

Definition at line 106 of file particle.cxx.

References ZoomGraphicContext::draw_line(), pos, velocity, Vector2d::x, and Vector2d::y.

Referenced by draw_infos().

bool Particle::get_fixed   [inline]
 

Definition at line 76 of file particle.hxx.

Referenced by WorldViewInsertTool::on_fix_press().

int Particle::get_id   [inline]
 

The id of the particle, used for de/serialisation and copying of the World. The id is uniq only for a single world.

Definition at line 57 of file particle.hxx.

float Particle::get_mass   const [inline]
 

Definition at line 80 of file particle.hxx.

Referenced by draw(), draw_highlight(), and draw_infos().

lisp_object_t * Particle::serialize  
 

Definition at line 51 of file particle.cxx.

References LispWriter::create_lisp(), LispWriter::write_boolean(), LispWriter::write_float(), LispWriter::write_int(), and LispWriter::write_vector().

void Particle::set_fixed bool    f [inline]
 

Definition at line 72 of file particle.hxx.

Referenced by WorldViewInsertTool::on_fix_press().

void Particle::update float    delta
 

Definition at line 114 of file particle.cxx.

References clear_force(), Vector2d::norm(), Vector2d::normalize(), pos, totale_force, velocity, Vector2d::x, and Vector2d::y.


Friends And Related Function Documentation

friend class ParticleFactory [friend]
 

Definition at line 95 of file particle.hxx.


Member Data Documentation

bool Particle::fixed
 

Definition at line 46 of file particle.hxx.

Vector2d Particle::pos
 

position of the particle

Definition at line 37 of file particle.hxx.

Referenced by draw(), WorldViewSelectTool::draw_foreground(), WorldViewInsertTool::draw_foreground(), draw_velocity_vector(), Selection::duplicate(), Selection::scale(), Spring::Spring(), and update().

int Particle::spring_links
 

Number of connection this particle has to other springs

Definition at line 53 of file particle.hxx.

Referenced by particle_obsolete::operator()(), and Spring::Spring().

Vector2d Particle::totale_force
 

totale force acting on particle (used as temp-var in update() to collect the forces)

Definition at line 50 of file particle.hxx.

Referenced by update().

Vector2d Particle::velocity
 

velocity of the particle

Definition at line 40 of file particle.hxx.

Referenced by draw_velocity_vector(), particle_obsolete::operator()(), and update().


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