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  arrowHead = on;
55  }
56 
57  bool hasArrowHead() const {
58  return arrowHead;
59  }
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  QList<QSharedPointer<RShape> > getExploded() const {
92  return RPolyline::getExploded();
93  }
94 
95  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false) const {
96  Q_UNUSED(queryBox)
97 
98  QList<QSharedPointer<RShape> > ret;
99  ret << QSharedPointer<RShape>(new RPolyline(*this));
100  if (arrowHead) {
101  ret << QSharedPointer<RShape>(new RTriangle(getArrowShape()));
102  }
103  return ret;
104  }
105 
106  RTriangle getArrowShape() const;
107 
108 private:
110  bool arrowHead;
111 };
112 
115 Q_DECLARE_METATYPE(QSharedPointer<RLeaderData>)
116 
117 #endif