]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawpolyline.h
In the middle of removing Snapper class/fixing snapper rendering...
[architektonas] / src / actions / actiondrawpolyline.h
1 #ifndef __ACTIONDRAWPOLYLINE_H__
2 #define __ACTIONDRAWPOLYLINE_H__
3
4 #include "actioninterface.h"
5 #include "vector.h"
6
7 class Polyline;
8
9 /**
10  * This class handles polyline creation.
11  *
12  * @author James Hammons
13  */
14 class ActionDrawPolyline: public ActionInterface
15 {
16         public:
17                 /** Action States */
18                 enum Status
19                 {
20                         SetFirstPoint = 0,      /**< Setting the first point.  */
21                         SetNextPoint            /**< Setting the next point. */
22                 };
23
24         public:
25                 ActionDrawPolyline(EntityContainer & container, GraphicView & graphicView);
26                 ~ActionDrawPolyline();
27
28                 virtual RS2::ActionType rtti();
29                 virtual void trigger();
30                 virtual void mouseMoveEvent(QMouseEvent *);
31                 virtual void mousePressEvent(QMouseEvent *);
32                 virtual void mouseReleaseEvent(QMouseEvent *);
33                 virtual void coordinateEvent(Vector *);
34                 virtual void updateMouseButtonHints();
35                 virtual void updateMouseCursor();
36                 virtual void updateToolBar();
37                 virtual void showOptions();
38                 virtual void hideOptions();
39                 void close();
40                 void undo();
41
42         protected:
43                 Vector vertex;
44                 Vector startPoint;
45                 Polyline * polyline;
46                 /** Start point of the series of lines. Used for close function. */
47                 Vector start;
48                 /** Point history (for undo) */
49 //This probably won't work, because of arc segments...
50                 QList<Vector *> history;
51 };
52
53 #endif  // __ACTIONDRAWPOLYLINE_H__