]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawspline.h
Bugfixes related to removing Snapper class.
[architektonas] / src / actions / actiondrawspline.h
1 #ifndef __ACTIONDRAWSPLINE_H__
2 #define __ACTIONDRAWSPLINE_H__
3
4 #include <QtCore>
5 #include "actioninterface.h"
6 #include "spline.h"
7
8 /**
9  * This action class can handle user events to draw splines.
10  *
11  * @author James Hammons
12  * @author Andrew Mustun
13  */
14 class ActionDrawSpline: public ActionInterface
15 {
16         public:
17                 /**
18                  * Action States.
19                  */
20                 enum Status {
21                         SetStartpoint,   /**< Setting the startpoint.  */
22                         SetNextPoint      /**< Setting the next point. */
23                 };
24
25         public:
26                 ActionDrawSpline(EntityContainer & container, GraphicView & graphicView);
27                 virtual ~ActionDrawSpline();
28
29                 virtual RS2::ActionType rtti();
30                 void reset();
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(CommandEvent * e);
37                 virtual QStringList getAvailableCommands();
38                 virtual void showOptions();
39                 virtual void hideOptions();
40                 virtual void updateMouseButtonHints();
41                 virtual void updateMouseCursor();
42                 virtual void updateToolBar();
43
44                 void undo();
45                 void setDegree(int deg);
46                 int getDegree();
47                 void setClosed(bool c);
48                 bool isClosed();
49
50         protected:
51                 /**
52                  * Spline data defined so far.
53                  */
54                 SplineData data;
55
56                 /**
57                  * Polyline entity we're working on.
58                  */
59                 Spline * spline;
60
61                 /**
62                  * Point history (for undo)
63                  */
64                 QList<Vector *> history;
65 };
66
67 #endif  // __ACTIONDRAWSPLINE_H__