]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actionselectintersected.h
4217c8560daf7c5945c71ee472fa0ca0f9900f91
[architektonas] / src / actions / rs_actionselectintersected.h
1 #ifndef RS_ACTIONSELECTINTERSECTED_H
2 #define RS_ACTIONSELECTINTERSECTED_H
3
4 #include "rs_previewactioninterface.h"
5 #include "vector.h"
6
7
8 /**
9  * This action class can handle user events to select all entities.
10  *
11  * @author Andrew Mustun
12  */
13 class RS_ActionSelectIntersected : public RS_PreviewActionInterface {
14         //Q_OBJECT
15 public:
16     /**
17      * Action States.
18      */
19     enum Status {
20         SetPoint1,     /**< Setting the 1st corner of the window.  */
21         SetPoint2      /**< Setting the 2nd corner of the window. */
22     };
23
24 public:
25     RS_ActionSelectIntersected(RS_EntityContainer& container,
26                          RS_GraphicView& graphicView,
27                          bool select);
28     ~RS_ActionSelectIntersected() {}
29
30         static QAction* createGUIAction(RS2::ActionType type, QObject* /*parent*/);
31
32         virtual RS2::ActionType rtti() {
33                 return RS2::ActionSelectIntersected;
34         }
35
36     virtual void init(int status=0);
37
38     virtual void trigger();
39
40     virtual void mouseMoveEvent(QMouseEvent* e);
41     virtual void mousePressEvent(QMouseEvent* e);
42     virtual void mouseReleaseEvent(QMouseEvent* e);
43
44     virtual void updateMouseButtonHints();
45     virtual void updateMouseCursor();
46     virtual void updateToolBar();
47
48 protected:
49     Vector v1;
50     Vector v2;
51
52     bool select;
53 };
54
55 #endif