]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actiondrawarc.h
Major refactoring of actions: Moved implementation from header files
[architektonas] / src / actions / rs_actiondrawarc.h
1 #ifndef RS_ACTIONDRAWARC_H
2 #define RS_ACTIONDRAWARC_H
3
4 #include "rs_previewactioninterface.h"
5 #include "rs_arc.h"
6
7 /**
8  * This action class can handle user events to draw
9  * simple arcs with the center, radius, start- and endangle given.
10  *
11  * @author Andrew Mustun
12  */
13 class RS_ActionDrawArc: public RS_PreviewActionInterface
14 {
15         public:
16                 /**
17                  * Action States.
18                  */
19                 enum Status {
20                         SetCenter,       /**< Setting the center point. */
21                         SetRadius,       /**< Setting the radius. */
22                         SetAngle1,       /**< Setting the startpoint.  */
23                         SetAngle2,       /**< Setting the endpoint. */
24                         SetIncAngle,     /**< Setting the included angle. */
25                         SetChordLength   /**< Setting carc chord length. */
26                 };
27
28         public:
29                 RS_ActionDrawArc(RS_EntityContainer & container, RS_GraphicView & graphicView);
30                 ~RS_ActionDrawArc();
31
32                 virtual RS2::ActionType rtti();
33                 void reset();
34                 virtual void init(int status = 0);
35                 virtual void trigger();
36                 virtual void mouseMoveEvent(QMouseEvent * e);
37                 virtual void mouseReleaseEvent(QMouseEvent * e);
38                 virtual void coordinateEvent(Vector * e);
39                 virtual void commandEvent(RS_CommandEvent * e);
40                 virtual QStringList getAvailableCommands();
41                 virtual void hideOptions();
42                 virtual void showOptions();
43                 virtual void updateMouseButtonHints();
44                 virtual void updateMouseCursor();
45                 virtual void updateToolBar();
46                 bool isReversed();
47                 void setReversed(bool r);
48
49         protected:
50                 /**
51                  * Arc data defined so far.
52                  */
53                 RS_ArcData data;
54 };
55
56 #endif