QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RLeaderData.h
Go to the documentation of this file.
1 
20 #ifndef RLEADERDATA_H
21 #define RLEADERDATA_H
22 
23 #include "entity_global.h"
24 
25 #include "RDocument.h"
26 #include "RDimLinearData.h"
27 #include "RVector.h"
28 #include "RPolyline.h"
29 
37  friend class RLeaderEntity;
38 
39 protected:
41 
42 public:
43  RLeaderData();
44  RLeaderData(const RPolyline& polyline, bool arrowHead);
45 
46  virtual RShape* castToShape() {
47  return this;
48  }
49 
50  double getDimasz() const;
51  double getDimscale() const;
52 
53  void setArrowHead(bool on);
54  bool hasArrowHead() const {
55  return arrowHead;
56  }
57 
58  bool canHaveArrowHead() const;
59  bool updateArrowHead();
60 
61 // void setPolyline(const RPolyline& polyline) {
62 // *((RPolyline*)this) = polyline;
63 // }
64 
65  RVector getEndPoint() const {
66  return RPolyline::getEndPoint();
67  }
68 
70  return RPolyline::getStartPoint();
71  }
72 
73  int countVertices() const {
74  return RPolyline::countVertices();
75  }
76 
77  int countSegments() const {
78  return RPolyline::countSegments();
79  }
80 
81  void appendVertex(const RVector& vertex) {
83  }
84 
85  virtual QList<RVector> getReferencePoints(
87 
88  virtual bool moveReferencePoint(const RVector& referencePoint,
89  const RVector& targetPoint);
90 
91  virtual bool scale(const RVector& scaleFactors, const RVector& center);
92  virtual bool stretch(const RPolyline& area, const RVector& offset);
93 
94  QList<QSharedPointer<RShape> > getExploded() const {
95  return RPolyline::getExploded();
96  }
97 
98  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false) const {
99  Q_UNUSED(queryBox)
100 
101  QList<QSharedPointer<RShape> > ret;
102  ret << QSharedPointer<RShape>(new RPolyline(*this));
103  if (arrowHead) {
104  ret << QSharedPointer<RShape>(new RTriangle(getArrowShape()));
105  }
106  return ret;
107  }
108 
109  RTriangle getArrowShape() const;
110 
111 private:
113  bool arrowHead;
114 };
115 
118 Q_DECLARE_METATYPE(QSharedPointer<RLeaderData>)
119 
120 #endif