QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RPolylineData.h
Go to the documentation of this file.
1 
20 #ifndef RPOLYLINEDATA_H
21 #define RPOLYLINEDATA_H
22 
23 #include "entity_global.h"
24 
25 #include "RBox.h"
26 #include "RDocument.h"
27 #include "REntity.h"
28 #include "RPolyline.h"
29 #include "RVector.h"
30 
39 
40  friend class RPolylineEntity;
41 
42 protected:
44 
45 public:
46  RPolylineData();
47  RPolylineData(const RPolyline& polyline);
48 
49  virtual QList<RBox> getBoundingBoxes(bool ignoreEmpty=false) const;
50 
51  virtual QList<RVector> getReferencePoints(
53 
54  virtual bool moveReferencePoint(const RVector& referencePoint,
55  const RVector& targetPoint);
56 
57  virtual RShape* castToShape() {
58  return this;
59  }
60 
62  return *this;
63  }
64 
65  void clear() {
67  }
68 
69  void normalize() {
71  }
72 
73  QList<RVector> getVertices() const {
74  return RPolyline::getVertices();
75  }
76 
77  RVector getVertexAt(int i) const {
78  return RPolyline::getVertexAt(i);
79  }
80 
81  void appendVertex(const RVector& vertex, double bulge = 0.0) {
82  RPolyline::appendVertex(vertex, bulge);
83  }
84 
85  void prependVertex(const RVector& vertex, double bulge = 0.0) {
86  RPolyline::prependVertex(vertex, bulge);
87  }
88 
89  void insertVertex(int index, const RVector& vertex) {
90  RPolyline::insertVertex(index, vertex);
91  }
92 
95  }
96 
97  void removeVertex(int index) {
99  }
100 
101  int countSegments() const {
102  return RPolyline::countSegments();
103  }
104 
105  QSharedPointer<RShape> getSegmentAt(int i) const {
106  return RPolyline::getSegmentAt(i);
107  }
108 
109  double getBulgeAt(int i) const {
110  return RPolyline::getBulgeAt(i);
111  }
112 
113  void setBulgeAt(int i, double b) {
114  RPolyline::setBulgeAt(i, b);
115  }
116 
117  double getDirection1() const {
118  return RPolyline::getDirection1();
119  }
120 
121  double getDirection2() const {
122  return RPolyline::getDirection2();
123  }
124 
125  bool reverse() {
126  return RPolyline::reverse();
127  }
128 
130  return RPolyline::getEndPoint();
131  }
132 
134  return RPolyline::getStartPoint();
135  }
136 
137  void setClosed(bool on) {
139  }
140 
141  bool isClosed() const {
142  return RPolyline::isClosed();
143  }
144 
145  bool isLogicallyClosed() const {
147  }
148 
149  QList<QSharedPointer<RShape> > getExploded() const {
150  return RPolyline::getExploded();
151  }
152 
153  void simplify(double angleTolerance) {
154  RPolyline::simplify(angleTolerance);
155  }
156 
157  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false) const {
158  Q_UNUSED(queryBox)
159 
160  return QList<QSharedPointer<RShape> >() <<
161  QSharedPointer<RShape>(new RPolyline(*this));
162  }
163 
164  virtual QList<RVector> getIntersectionPoints(
165  const REntityData& other, bool limited = true, bool same = false,
166  const RBox& queryBox = RDEFAULT_RBOX) const;
167 };
168 
171 Q_DECLARE_METATYPE(QSharedPointer<RPolylineData>)
172 
173 #endif