QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RDimensionEntity.h
Go to the documentation of this file.
1 #ifndef RDIMENSIONENTITY_H
2 #define RDIMENSIONENTITY_H
3 
4 #include "REntity.h"
5 #include "RDimensionData.h"
6 
7 class RDocument;
8 class RExporter;
9 
17 class RDimensionEntity: public REntity {
18 
19  Q_DECLARE_TR_FUNCTIONS(RDimensionEntity)
20 
21 public:
31 
41  //static RPropertyTypeId PropertyFontName;
42  //static RPropertyTypeId PropertyHeight;
43  //static RPropertyTypeId PropertyAngle;
44  //static RPropertyTypeId PropertyLineSpacingFactor;
45  //static RPropertyTypeId PropertyHAlign;
46  //static RPropertyTypeId PropertyVAlign;
47 
49 
50 public:
52  virtual ~RDimensionEntity();
53 
54  static void init();
55 
56  virtual RS::EntityType getType() const {
57  return RS::EntityDimension;
58  }
59 
60  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value);
61  QPair<QVariant, RPropertyAttributes> getProperty(
62  RPropertyTypeId propertyTypeId,
63  bool humanReadable = false, bool noAttributes = false);
64 
65  virtual void exportEntity(RExporter& e, bool preview=false) const;
66 
67  virtual RDimensionData& getData() = 0;
68 
69  virtual const RDimensionData& getData() const = 0;
70 
71  virtual bool isValid() const {
72  return getData().isValid();
73  }
74 
75  void setDefinitionPoint(const RVector& p) {
77  }
78 
80  return getData().getDefinitionPoint();
81  }
82 
83  void setText(const QString& t) {
84  getData().setText(t);
85  }
86 
87  QString getText() const {
88  return getData().getText();
89  }
90 
92  return getData().getTextData();
93  }
94 
95  void setMiddleOfText(const RVector& p) {
97  }
98 
100  return getData().getTextPosition();
101  }
102 
103  void setFontName(const QString& fn) {
104  getData().setFontName(fn);
105  }
106 
107  QString getFontName() const {
108  return getData().getFontName();
109  }
110 
111  bool hasCustomTextPosition() const {
112  return getData().hasCustomTextPosition();
113  }
114 
115  void setCustomTextPosition(bool on) {
117  }
118 
119 protected:
120  virtual void print(QDebug dbg) const;
121 };
122 
124 Q_DECLARE_METATYPE(QSharedPointer<RDimensionEntity>)
125 Q_DECLARE_METATYPE(QSharedPointer<RDimensionEntity>*)
126 
127 #endif