]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actiondrawlineparallelthrough.h
Refactoring: Moved RS_GraphicView to GraphicView.
[architektonas] / src / actions / rs_actiondrawlineparallelthrough.h
1 #ifndef RS_ACTIONDRAWLINEPARALLELTHROUGH_H
2 #define RS_ACTIONDRAWLINEPARALLELTHROUGH_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_ActionDrawLineParallelThrough: public RS_PreviewActionInterface
17 {
18         private:
19                 enum Status {
20                         SetEntity,    /**< Choose original entity. */
21                         SetPos,       /**< Setting point for this parallel to go through. */
22                         SetNumber     /**< Setting number in the command line. */
23                 };
24
25         public:
26                 RS_ActionDrawLineParallelThrough(RS_EntityContainer & container, GraphicView & graphicView);
27                 ~RS_ActionDrawLineParallelThrough();
28
29                 virtual RS2::ActionType rtti();
30                 virtual void trigger();
31                 virtual void mouseMoveEvent(QMouseEvent * e);
32                 virtual void mouseReleaseEvent(QMouseEvent * e);
33                 virtual void updateMouseButtonHints();
34                 virtual void coordinateEvent(Vector * e);
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                 int getNumber();
42                 void setNumber(int n);
43
44         private:
45                 /** Closest parallel. */
46                 RS_Entity * parallel;
47                 /** Data of new line */
48                 RS_LineData data;
49                 /** Number of parallels. */
50                 int number;
51                 /** Coordinate of the mouse. */
52                 Vector coord;
53                 /** Original entity. */
54                 RS_Entity * entity;
55                 /** Last status before entering length or number. */
56                 Status lastStatus;
57 };
58
59 #endif