QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RDimOrdinateData.h
Go to the documentation of this file.
1 
20 #ifndef RDIMORDINATEDATA_H
21 #define RDIMORDINATEDATA_H
22 
23 #include "entity_global.h"
24 
25 #include "RDocument.h"
26 #include "RDimLinearData.h"
27 #include "RVector.h"
28 
36  friend class RDimOrdinateEntity;
37 
38 protected:
40 
41 public:
43  RDimOrdinateData(const RDimensionData& dimData,
44  const RVector& leaderEndPoint,
45  const RVector& definingPoint);
46 
47  virtual bool isValid() const;
48 
49  void setLeaderEndPoint(const RVector& p) {
50  leaderEndPoint = p;
51  }
52 
54  return leaderEndPoint;
55  }
56 
57  void setOrigin(const RVector& p) {
59  }
60 
61  RVector getOrigin() const {
62  return getDefinitionPoint();
63  }
64 
65  void setDefiningPoint(const RVector& p) {
66  definingPoint = p;
67  }
68 
70  return definingPoint;
71  }
72 
74  xType = true;
75  }
76 
78  xType = false;
79  }
80 
81  bool isMeasuringXAxis() const {
82  return xType;
83  }
84 
85  virtual QList<RVector> getReferencePoints(
87 
88  virtual bool moveReferencePoint(const RVector& referencePoint,
89  const RVector& targetPoint);
90 
91  virtual bool move(const RVector& offset);
92  virtual bool rotate(double rotation, const RVector& center);
93  virtual bool scale(const RVector& scaleFactors, const RVector& center);
94  virtual bool mirror(const RLine& axis);
95  virtual bool stretch(const RPolyline& area, const RVector& offset);
96 
97  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false) const;
98  virtual double getMeasuredValue() const;
99  virtual QString getAutoLabel() const;
100 
101 private:
104 
107 
109  bool xType;
110 };
111 
114 Q_DECLARE_METATYPE(QSharedPointer<RDimOrdinateData>)
115 
116 #endif