]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondimlinear.h
In the middle of major refactoring...
[architektonas] / src / actions / actiondimlinear.h
1 #ifndef __ACTIONDIMLINEAR_H__
2 #define __ACTIONDIMLINEAR_H__
3
4 #include "actiondimension.h"
5 #include "rs_dimlinear.h"
6
7 /**
8  * This action class can handle user events to draw aligned dimensions.
9  *
10  * @author James Hammons
11  * @author Andrew Mustun
12  */
13 class ActionDimLinear: public ActionDimension
14 {
15         public:
16                 /**
17                  * Varitions of this action.
18                  */
19                 enum Variation {
20                         AnyAngle,
21                         Horizontal,
22                         Vertical
23                 };
24
25                 /**
26                  * Action States.
27                  */
28                 enum Status {
29                         SetExtPoint1,    /**< Setting the 1st ext point.  */
30                         SetExtPoint2,    /**< Setting the 2nd ext point. */
31                         SetDefPoint,     /**< Setting the common def point. */
32                         SetText,         /**< Setting the text label in the command line. */
33                         SetAngle         /**< Setting the angle in the command line. */
34                 };
35
36         public:
37                 ActionDimLinear(RS_EntityContainer & container, GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false);
38                 ~ActionDimLinear();
39
40                 virtual RS2::ActionType rtti();
41                 void reset();
42                 virtual void trigger();
43                 void preparePreview();
44                 virtual void mouseMoveEvent(QMouseEvent * e);
45                 virtual void mouseReleaseEvent(QMouseEvent * e);
46                 virtual void coordinateEvent(Vector * e);
47                 virtual void commandEvent(RS_CommandEvent * e);
48                 virtual QStringList getAvailableCommands();
49                 virtual void hideOptions();
50                 virtual void showOptions();
51                 virtual void updateMouseButtonHints();
52                 double getAngle();
53                 void setAngle(double a);
54                 bool hasFixedAngle();
55
56         protected:
57                 /**
58                  * Aligned dimension data.
59                  */
60                 RS_DimLinearData edata;
61                 /**
62                  * Is the angle fixed?
63                  */
64                 bool fixedAngle;
65
66                 /** Last status before entering text or angle. */
67                 Status lastStatus;
68 };
69
70 #endif  // __ACTIONDIMLINEAR_H__