]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actiondrawlineparallel.h
Major refactoring of actions: Moved implementation from header files
[architektonas] / src / actions / rs_actiondrawlineparallel.h
1 #ifndef RS_ACTIONDRAWLINEPARALLEL_H
2 #define RS_ACTIONDRAWLINEPARALLEL_H
3
4 #include "rs_line.h"
5 #include "rs_previewactioninterface.h"
6 #include "vector.h"
7
8 class RS_Entity;
9
10 /**
11  * This action class can handle user events to draw parallel
12  * lines, arcs and circles.
13  *
14  * @author Andrew Mustun
15  */
16 class RS_ActionDrawLineParallel: public RS_PreviewActionInterface
17 {
18         private:
19                 enum Status {
20                         SetEntity,    /**< Choose original entity. */
21                         //SetDistance,  /**< Setting distance in the command line. */
22                         SetNumber     /**< Setting number in the command line. */
23                         //SetThrough     /**< Setting a point for the parallel to go through. */
24                 };
25
26         public:
27                 RS_ActionDrawLineParallel(RS_EntityContainer & container, RS_GraphicView & graphicView);
28                 ~RS_ActionDrawLineParallel();
29
30                 virtual RS2::ActionType rtti();
31                 virtual void trigger();
32                 virtual void mouseMoveEvent(QMouseEvent * e);
33                 virtual void mouseReleaseEvent(QMouseEvent * e);
34                 virtual void updateMouseButtonHints();
35                 virtual void commandEvent(RS_CommandEvent * e);
36                 virtual QStringList getAvailableCommands();
37                 virtual void hideOptions();
38                 virtual void showOptions();
39                 virtual void updateMouseCursor();
40                 virtual void updateToolBar();
41                 double getDistance();
42                 void setDistance(double d);
43                 int getNumber();
44                 void setNumber(int n);
45
46         private:
47                 /** Closest parallel. */
48                 RS_Entity * parallel;
49                 /** Data of new line */
50                 RS_LineData data;
51                 /** Distance of the parallel. */
52                 double distance;
53                 /** Number of parallels. */
54                 int number;
55                 /** Coordinate of the mouse. */
56                 Vector coord;
57                 /** Original entity. */
58                 RS_Entity * entity;
59 };
60
61 #endif