]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondimlinear.h
Bugfixes related to removing Snapper class.
[architektonas] / src / actions / actiondimlinear.h
1 #ifndef __ACTIONDIMLINEAR_H__
2 #define __ACTIONDIMLINEAR_H__
3
4 #include "actiondimension.h"
5 #include "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(EntityContainer & container, GraphicView & graphicView,
38                         double angle = 0.0, bool fixedAngle = false);
39                 ~ActionDimLinear();
40
41                 virtual RS2::ActionType rtti();
42                 void reset();
43                 virtual void trigger();
44                 void preparePreview();
45                 virtual void mouseMoveEvent(QMouseEvent * e);
46                 virtual void mouseReleaseEvent(QMouseEvent * e);
47                 virtual void coordinateEvent(Vector * e);
48                 virtual void commandEvent(CommandEvent * e);
49                 virtual QStringList getAvailableCommands();
50                 virtual void hideOptions();
51                 virtual void showOptions();
52                 virtual void updateMouseButtonHints();
53                 double getAngle();
54                 void setAngle(double a);
55                 bool hasFixedAngle();
56
57         protected:
58                 /**
59                  * Aligned dimension data.
60                  */
61                 DimLinearData edata;
62                 /**
63                  * Is the angle fixed?
64                  */
65                 bool fixedAngle;
66                 /** Last status before entering text or angle. */
67                 Status lastStatus;
68 };
69
70 #endif  // __ACTIONDIMLINEAR_H__