]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actiondrawspline.h
Last checkin before major refactor...
[architektonas] / src / actions / rs_actiondrawspline.h
1 #ifndef RS_ACTIONDRAWSPLINE_H
2 #define RS_ACTIONDRAWSPLINE_H
3
4 #include <QtCore>
5 #include "rs_previewactioninterface.h"
6 #include "rs_spline.h"
7
8 /**
9  * This action class can handle user events to draw splines.
10  *
11  * @author Andrew Mustun
12  */
13 class RS_ActionDrawSpline: public RS_PreviewActionInterface
14 {
15         public:
16                 /**
17                  * Action States.
18                  */
19                 enum Status {
20                         SetStartpoint,   /**< Setting the startpoint.  */
21                         SetNextPoint      /**< Setting the next point. */
22                 };
23
24         public:
25                 RS_ActionDrawSpline(RS_EntityContainer & container, GraphicView & graphicView);
26                 virtual ~RS_ActionDrawSpline();
27
28                 virtual RS2::ActionType rtti();
29                 //static QAction * createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/);
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(RS_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 close();
45                 void undo();
46                 void setDegree(int deg);
47                 int getDegree();
48                 void setClosed(bool c);
49                 bool isClosed();
50
51         protected:
52                 /**
53                  * Spline data defined so far.
54                  */
55                 RS_SplineData data;
56
57                 /**
58                  * Polyline entity we're working on.
59                  */
60                 RS_Spline * spline;
61
62                 /**
63                  * Point history (for undo)
64                  */
65                 QList<Vector *> history;
66 };
67
68 #endif