]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actiondrawellipseaxis.h
Refactoring: Moved RS_GraphicView to GraphicView.
[architektonas] / src / actions / rs_actiondrawellipseaxis.h
1 #ifndef RS_ACTIONDRAWELLIPSEAXIS_H
2 #define RS_ACTIONDRAWELLIPSEAXIS_H
3
4 #include "rs_ellipse.h"
5 #include "rs_previewactioninterface.h"
6
7 /**
8  * This action class can handle user events to draw ellipses
9  * with a center point and the endpoints of minor and major axis.
10  *
11  * @author Andrew Mustun
12  */
13 class RS_ActionDrawEllipseAxis: public RS_PreviewActionInterface
14 {
15         public:
16                 /**
17                  * Action States.
18                  */
19                 enum Status {
20                         SetCenter,   /**< Settinge the center.  */
21                         SetMajor,    /**< Setting endpoint of major axis. */
22                         SetMinor,    /**< Setting minor/major ratio. */
23                         SetAngle1,   /**< Setting start angle. */
24                         SetAngle2    /**< Setting end angle. */
25                 };
26
27         public:
28                 RS_ActionDrawEllipseAxis(RS_EntityContainer & container, GraphicView & graphicView, bool isArc);
29                 ~RS_ActionDrawEllipseAxis();
30
31                 virtual void init(int status = 0);
32                 virtual void trigger();
33                 virtual void mouseMoveEvent(QMouseEvent * e);
34                 virtual void mouseReleaseEvent(QMouseEvent * e);
35                 virtual void coordinateEvent(Vector * e);
36                 virtual void commandEvent(RS_CommandEvent * e);
37                 virtual QStringList getAvailableCommands();
38                 virtual void updateMouseButtonHints();
39                 virtual void updateMouseCursor();
40                 virtual void updateToolBar();
41
42         protected:
43                 /** Center of ellipse */
44                 Vector center;
45                 /** Endpoint of major axis */
46                 Vector major;
47                 /** Ratio major / minor */
48                 double ratio;
49                 /** Start angle */
50                 double angle1;
51                 /** End angle */
52                 double angle2;
53                 /** Do we produce an arc (true) or full ellipse (false) */
54                 bool isArc;
55 };
56
57 #endif