]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actionmodifytrim.h
Initial import
[architektonas] / src / actions / rs_actionmodifytrim.h
1 #ifndef RS_ACTIONMODIFYTRIM_H
2 #define RS_ACTIONMODIFYTRIM_H
3
4 #include "rs_previewactioninterface.h"
5 #include "rs_modification.h"
6
7
8 /**
9  * This action class can handle user events to trim entities.
10  *
11  * @author Andrew Mustun
12  */
13 class RS_ActionModifyTrim : public RS_PreviewActionInterface {
14         //Q_OBJECT
15 public:
16     /**
17      * Action States.
18      */
19     enum Status {
20         ChooseLimitEntity,     /**< Choosing the limiting entity. */
21         ChooseTrimEntity       /**< Choosing the entity to trim. */
22     };
23
24 public:
25     RS_ActionModifyTrim(RS_EntityContainer& container,
26                         RS_GraphicView& graphicView,
27                                                 bool both=false);
28     ~RS_ActionModifyTrim() {}
29
30         static QAction* createGUIAction(RS2::ActionType /*type*/, QObject* /*parent*/);
31
32     virtual void init(int status=0);
33     virtual void trigger();
34     virtual void mouseMoveEvent(QMouseEvent* e);
35     virtual void mouseReleaseEvent(QMouseEvent* e);
36     virtual void updateMouseButtonHints();
37     virtual void updateMouseCursor();
38     virtual void updateToolBar();
39
40 private:
41     RS_Entity* limitEntity;
42         Vector limitCoord;
43     RS_Entity* trimEntity;
44         Vector trimCoord;
45         bool both;
46 };
47
48 #endif