-class RS_ActionDimension : public RS_PreviewActionInterface {
- //Q_OBJECT
-public:
- RS_ActionDimension(const char* name,
- RS_EntityContainer& container,
- RS_GraphicView& graphicView);
- ~RS_ActionDimension();
-
- virtual void reset();
-
- virtual void init(int status=0);
-
- virtual void hideOptions();
- virtual void showOptions();
-
- virtual void updateMouseCursor();
- virtual void updateToolBar();
-
- QString getText() {
- if (!data.text.isEmpty()) {
- return data.text;
- }
-
- QString l = label;
-
- if (l.isEmpty() &&
- (diameter==true || !tol1.isEmpty() || !tol2.isEmpty())) {
- l = "<>";
- }
-
- if (diameter==true) {
- l = QChar(0x2205) + l;
- }
-
- if (!tol1.isEmpty() || !tol2.isEmpty()) {
- l += QString("\\S%1\\%2;").arg(tol1).arg(tol2);
- }
-
- return l;
- }
-
- void setText(const QString& t) {
- data.text = t;
- }
-
- QString getLabel() {
- return label;
- }
- void setLabel(const QString& t) {
- //data.text = t;
- label = t;
- }
- QString getTol1() {
- return tol1;
- }
- void setTol1(const QString& t) {
- tol1 = t;
- }
- QString getTol2() {
- return tol2;
- }
- void setTol2(const QString& t) {
- tol2 = t;
- }
- bool getDiameter() {
- return diameter;
- }
- void setDiameter(bool d) {
- diameter = d;
- }
-
- static bool isDimensionAction(RS2::ActionType type) {
- return (type==RS2::ActionDimAligned ||
- type==RS2::ActionDimLinear ||
- type==RS2::ActionDimAngular ||
- type==RS2::ActionDimDiametric ||
- type==RS2::ActionDimRadial);
- }
-
-protected:
- /**
- * Generic dimension data.
- */
- RS_DimensionData data;
-
- QString label;
- QString tol1;
- QString tol2;
- bool diameter;
-
-
- /**
- * Commands.
- */
- /*
- QString cmdText;
- QString cmdText2;
- */
+class RS_ActionDimension: public RS_PreviewActionInterface
+{
+ public:
+ RS_ActionDimension(const char * name, RS_EntityContainer & container, GraphicView & graphicView);
+ ~RS_ActionDimension();
+
+ virtual void reset();
+ virtual void init(int status = 0);
+ virtual void hideOptions();
+ virtual void showOptions();
+ virtual void updateMouseCursor();
+ virtual void updateToolBar();
+ QString getText();
+ void setText(const QString & t);
+ QString getLabel();
+ void setLabel(const QString & t);
+ QString getTol1();
+ void setTol1(const QString & t);
+ QString getTol2();
+ void setTol2(const QString & t);
+ bool getDiameter();
+ void setDiameter(bool d);
+ static bool isDimensionAction(RS2::ActionType type);
+
+ protected:
+ /**
+ * Generic dimension data.
+ */
+ RS_DimensionData data;
+
+ QString label;
+ QString tol1;
+ QString tol2;
+ bool diameter;