]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actiondrawlineparallel.h
Initial import
[architektonas] / src / actions / rs_actiondrawlineparallel.h
1 #ifndef RS_ACTIONDRAWLINEPARALLEL_H
2 #define RS_ACTIONDRAWLINEPARALLEL_H
3
4 #include "rs_previewactioninterface.h"
5
6
7 /**
8  * This action class can handle user events to draw parallel
9  * lines, arcs and circles.
10  *
11  * @author Andrew Mustun
12  */
13 class RS_ActionDrawLineParallel : public RS_PreviewActionInterface {
14         //Q_OBJECT
15 private:
16     enum Status {
17         SetEntity,    /**< Choose original entity. */
18                 //SetDistance,  /**< Setting distance in the command line. */
19                 SetNumber     /**< Setting number in the command line. */
20                 //SetThrough     /**< Setting a point for the parallel to go through. */
21         };
22
23 public:
24     RS_ActionDrawLineParallel(RS_EntityContainer& container,
25                               RS_GraphicView& graphicView);
26     ~RS_ActionDrawLineParallel() {}
27
28         static QAction* createGUIAction(RS2::ActionType type, QObject* /*parent*/);
29
30         virtual RS2::ActionType rtti() {
31                 return RS2::ActionDrawLineParallel;
32         }
33
34     virtual void trigger();
35
36     virtual void mouseMoveEvent(QMouseEvent* e);
37     virtual void mouseReleaseEvent(QMouseEvent* e);
38     virtual void updateMouseButtonHints();
39
40     virtual void commandEvent(RS_CommandEvent* e);
41         virtual QStringList getAvailableCommands();
42
43     virtual void hideOptions();
44     virtual void showOptions();
45
46     virtual void updateMouseCursor();
47     virtual void updateToolBar();
48
49         double getDistance() {
50                 return distance;
51         }
52
53         void setDistance(double d) {
54                 distance = d;
55         }
56
57         int getNumber() {
58                 return number;
59         }
60
61         void setNumber(int n) {
62                 number = n;
63         }
64
65 private:
66     /** Closest parallel. */
67     RS_Entity* parallel;
68     /** Data of new line */
69     RS_LineData data;
70     /** Distance of the parallel. */
71     double distance;
72         /** Number of parallels. */
73         int number;
74         /** Coordinate of the mouse. */
75         Vector coord;
76         /** Original entity. */
77         RS_Entity* entity;
78         /**
79          * Commands
80          */
81         /*
82         QString cmdDistance;
83         QString cmdDistance2;
84         QString cmdDistance3;
85
86         QString cmdNumber;
87         QString cmdNumber2;
88         QString cmdNumber3;
89         */
90 };
91
92 #endif