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

Selection Class Reference

#include <selection.hxx>

Collaboration diagram for Selection:

Collaboration graph
[legend]
List of all members.

Public Types

typedef SelectionLst::iterator iterator

Public Member Functions

 Selection ()
Vector2d get_center ()
void select_particles (Vector2d p1, Vector2d p2)
void scale (float factor)
void flip ()
void set_velocity (const Vector2d vel)
void duplicate ()
void clear ()
bool empty () const
void validate ()
void rotate (float rot_angle, Vector2d rotate_center)
SelectionLst::size_type size ()
SelectionLst::iterator begin ()
SelectionLst::iterator end ()

Detailed Description

A class to keep track of a group of selected particles

Definition at line 30 of file selection.hxx.


Member Typedef Documentation

typedef SelectionLst::iterator Selection::iterator
 

Definition at line 80 of file selection.hxx.

Referenced by WorldViewSelectTool::draw_background(), WorldViewSelectTool::draw_foreground(), get_center(), WorldViewSelectTool::on_delete_press(), WorldViewSelectTool::on_fix_press(), WorldViewSelectTool::on_mouse_move(), and WorldViewSelectTool::on_primary_button_press().


Constructor & Destructor Documentation

Selection::Selection  
 

Definition at line 30 of file selection.cxx.


Member Function Documentation

SelectionLst::iterator Selection::begin   [inline]
 

Definition at line 77 of file selection.hxx.

Referenced by WorldViewSelectTool::draw_background(), WorldViewSelectTool::draw_foreground(), WorldViewSelectTool::on_delete_press(), WorldViewSelectTool::on_fix_press(), WorldViewSelectTool::on_mouse_move(), and WorldViewSelectTool::on_primary_button_press().

void Selection::clear  
 

clears the selection

Definition at line 168 of file selection.cxx.

Referenced by WorldViewSelectTool::deactivate(), WorldViewSelectTool::on_delete_press(), WorldViewSelectTool::on_primary_button_press(), and validate().

void Selection::duplicate  
 

duplicates all selected objects

Definition at line 122 of file selection.cxx.

References ParticleFactory::add_particle(), World::add_spring(), World::get_particle_mgr(), World::get_spring_mgr(), Controller::instance(), Particle::pos, Controller::push_undo(), and validate().

Referenced by WorldViewSelectTool::on_duplicate_press().

bool Selection::empty   const
 

Returns:
true if no particle is in the selection

Definition at line 162 of file selection.cxx.

Referenced by WorldViewSelectTool::draw_foreground(), and WorldViewSelectTool::on_secondary_button_press().

SelectionLst::iterator Selection::end   [inline]
 

Definition at line 78 of file selection.hxx.

Referenced by WorldViewSelectTool::draw_background(), WorldViewSelectTool::draw_foreground(), WorldViewSelectTool::on_delete_press(), WorldViewSelectTool::on_fix_press(), WorldViewSelectTool::on_mouse_move(), and WorldViewSelectTool::on_primary_button_press().

void Selection::flip  
 

Definition at line 92 of file selection.cxx.

References validate().

Referenced by WorldViewSelectTool::on_button_press().

Vector2d Selection::get_center  
 

Returns:
Center point of the selection, aka the center of its bounding box, result is undefined if called on a empty selection

Definition at line 36 of file selection.cxx.

References Rect< T >::get_center(), iterator, Math::max(), Math::min(), validate(), Rect< T >::x1, Rect< T >::x2, Rect< T >::y1, and Rect< T >::y2.

Referenced by WorldViewSelectTool::draw_foreground(), WorldViewSelectTool::on_button_press(), and WorldViewSelectTool::on_secondary_button_press().

void Selection::rotate float    rot_angle,
Vector2d    rotate_center
 

Definition at line 175 of file selection.cxx.

References Vector2d::norm(), validate(), Vector2d::x, and Vector2d::y.

Referenced by WorldViewSelectTool::on_mouse_move().

void Selection::scale float    factor
 

scales the selection by the given factor

Definition at line 58 of file selection.cxx.

References Rect< T >::get_center(), Math::max(), Math::min(), Particle::pos, validate(), Vector2d::x, Rect< T >::x1, Rect< T >::x2, Vector2d::y, Rect< T >::y1, and Rect< T >::y2.

void Selection::select_particles Vector2d    p1,
Vector2d    p2
 

Select the particles between p1 (upper/left) and p2 (bottom/right)

Definition at line 113 of file selection.cxx.

References World::get_particles(), Controller::get_world(), Controller::instance(), Vector2d::x, and Vector2d::y.

Referenced by WorldViewSelectTool::on_primary_button_release().

void Selection::set_velocity const Vector2d    vel
 

sets the velocity of all particles to the given one

Definition at line 85 of file selection.cxx.

Referenced by WorldViewSelectTool::on_button_press().

SelectionLst::size_type Selection::size   [inline]
 

Definition at line 76 of file selection.hxx.

void Selection::validate  
 

Check if the world has changed, if so clear selecetion

Definition at line 195 of file selection.cxx.

References clear(), Controller::get_world(), and Controller::instance().

Referenced by duplicate(), flip(), get_center(), rotate(), and scale().


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