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