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