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 
52  void setArrowHead(bool on) {
53  arrowHead = on;
54  }
55 
56  bool hasArrowHead() const {
57  return arrowHead;
58  }
59 
60 // void setPolyline(const RPolyline& polyline) {
61 // *((RPolyline*)this) = polyline;
62 // }
63 
64  RVector getEndPoint() const {
65  return RPolyline::getEndPoint();
66  }
67 
69  return RPolyline::getStartPoint();
70  }
71 
72  int countVertices() const {
73  return RPolyline::countVertices();
74  }
75 
76  int countSegments() const {
77  return RPolyline::countSegments();
78  }
79 
80  void appendVertex(const RVector& vertex) {
82  }
83 
84  virtual QList<RVector> getReferencePoints(
86 
87  virtual bool moveReferencePoint(const RVector& referencePoint,
88  const RVector& targetPoint);
89 
90  QList<QSharedPointer<RShape> > getExploded() const {
91  return RPolyline::getExploded();
92  }
93 
94  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX) const {
95  Q_UNUSED(queryBox)
96 
97  QList<QSharedPointer<RShape> > ret;
98  ret << QSharedPointer<RShape>(new RPolyline(*this));
99  if (arrowHead) {
100  ret << QSharedPointer<RShape>(new RTriangle(getArrowShape()));
101  }
102  return ret;
103  }
104 
105  RTriangle getArrowShape() const;
106 
107 private:
109  bool arrowHead;
110 };
111 
114 Q_DECLARE_METATYPE(QSharedPointer<RLeaderData>)
115 
116 #endif