00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 #ifndef HEADER_CONSTRUO_SELECTION_HXX
00021 #define HEADER_CONSTRUO_SELECTION_HXX
00022 
00023 #include <vector>
00024 #include "vector2d.hxx"
00025 
00026 class Particle;
00027 class World;
00028 
00030 class Selection
00031 {
00032 private:
00033   typedef std::vector<Particle*> SelectionLst;
00035   SelectionLst selection;
00036 
00040   World* world;
00041 
00042 public:
00043   Selection ();
00044 
00048   Vector2d get_center ();
00049 
00052   void select_particles (Vector2d p1, Vector2d p2);
00053 
00055   void scale (float factor);
00056 
00057   void flip();
00058 
00060   void set_velocity (const Vector2d vel);
00061 
00063   void duplicate ();
00064 
00066   void clear ();
00067   
00069   bool empty() const;
00070 
00072   void validate();
00073 
00074   void rotate(float rot_angle, Vector2d rotate_center);
00075 
00076   SelectionLst::size_type size() { return selection.size(); }
00077   SelectionLst::iterator begin() { return selection.begin(); };
00078   SelectionLst::iterator end()   { return selection.end(); };
00079 
00080   typedef SelectionLst::iterator iterator;
00081 private:
00082   Selection (const Selection&);
00083   Selection& operator= (const Selection&);
00084 };
00085 
00086 #endif
00087 
00088