QCAD
Open Source 2D CAD
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 
40 
41  friend class RPolylineEntity;
42 
43 protected:
45 
46 public:
47  RPolylineData();
48  RPolylineData(const RPolyline& polyline);
49 
50  virtual QList<RBox> getBoundingBoxes(bool ignoreEmpty=false) const;
51 
52  virtual QList<RVector> getReferencePoints(
54 
55  virtual bool moveReferencePoint(const RVector& referencePoint,
56  const RVector& targetPoint);
57 
58  virtual RShape* castToShape() {
59  return this;
60  }
61 
63  return *this;
64  }
65 
66  void clear() {
68  }
69 
70  void normalize() {
72  }
73 
74  QList<RVector> getVertices() const {
75  return RPolyline::getVertices();
76  }
77 
78  RVector getVertexAt(int i) const {
79  return RPolyline::getVertexAt(i);
80  }
81 
82  void appendVertex(const RVector& vertex, double bulge = 0.0) {
83  RPolyline::appendVertex(vertex, bulge);
84  }
85 
86  void prependVertex(const RVector& vertex, double bulge = 0.0) {
87  RPolyline::prependVertex(vertex, bulge);
88  }
89 
90  void insertVertex(int index, const RVector& vertex) {
91  RPolyline::insertVertex(index, vertex);
92  }
93 
96  }
97 
98  void removeVertex(int index) {
100  }
101 
102  int countSegments() const {
103  return RPolyline::countSegments();
104  }
105 
106  QSharedPointer<RShape> getSegmentAt(int i) const {
107  return RPolyline::getSegmentAt(i);
108  }
109 
110  double getBulgeAt(int i) const {
111  return RPolyline::getBulgeAt(i);
112  }
113 
114  void setBulgeAt(int i, double b) {
115  RPolyline::setBulgeAt(i, b);
116  }
117 
118  double getDirection1() const {
119  return RPolyline::getDirection1();
120  }
121 
122  double getDirection2() const {
123  return RPolyline::getDirection2();
124  }
125 
126  bool reverse() {
127  return RPolyline::reverse();
128  }
129 
131  return RPolyline::getEndPoint();
132  }
133 
135  return RPolyline::getStartPoint();
136  }
137 
138  void setClosed(bool on) {
140  }
141 
142  bool isClosed() const {
143  return RPolyline::isClosed();
144  }
145 
146  bool isGeometricallyClosed() const {
148  }
149 
150  QList<QSharedPointer<RShape> > getExploded() const {
151  return RPolyline::getExploded();
152  }
153 
154  void simplify(double angleTolerance) {
155  RPolyline::simplify(angleTolerance);
156  }
157 
158  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false) const;
159 
160  virtual QList<RVector> getIntersectionPoints(
161  const REntityData& other, bool limited = true, bool same = false,
162  const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = true) const;
163 
164  void setPolylineGen(bool on) {
165  polylineGen = on;
166  }
167  bool getPolylineGen() const {
168  return polylineGen;
169  }
170 
171 protected:
173 };
174 
178 Q_DECLARE_METATYPE(QSharedPointer<RPolylineData>)
179 
180 #endif
RVector getVertexAt(int i) const
Definition: RPolyline.cpp:272
double getDirection1() const
Definition: RPolylineData.h:118
bool getPolylineGen() const
Definition: RPolylineData.h:167
Represents a box e.g.
Definition: RBox.h:43
Base class for all entity data classes.
Definition: REntityData.h:64
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RPolylineData.h:39
void removeVertex(int index)
Definition: RPolyline.cpp:254
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
#define RDEFAULT_RBOX
Definition: RBox.h:32
void setBulgeAt(int i, double b)
Definition: RPolylineData.h:114
QList< RVector > getVertices() const
Definition: RPolyline.cpp:268
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
QList< RVector > getVertices() const
Definition: RPolylineData.h:74
virtual QList< RVector > getIntersectionPoints(const REntityData &other, bool limited=true, bool same=false, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true) const
Override to disable intersection point.
Definition: REntityData.cpp:409
bool isGeometricallyClosed() const
Definition: RPolylineData.h:146
virtual QList< RBox > getBoundingBoxes(bool ignoreEmpty=false) const
Definition: REntityData.h:121
void prependVertex(const RVector &vertex, double bulge=0.0)
Definition: RPolylineData.h:86
void appendVertex(const RVector &vertex, double bulge=0.0)
Definition: RPolylineData.h:82
double getBulgeAt(int i) const
Definition: RPolyline.cpp:324
QList< QSharedPointer< RShape > > getExploded() const
Definition: RPolylineData.h:150
RVector getStartPoint() const
Definition: RPolylineData.h:134
void insertVertex(int index, const RVector &vertex)
Definition: RPolylineData.h:90
int countSegments() const
Definition: RPolyline.cpp:504
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:118
Polyline entity.
Definition: RPolylineEntity.h:40
QSharedPointer< RShape > getSegmentAt(int i) const
Definition: RPolylineData.h:106
RVector getEndPoint() const
Definition: RPolylineData.h:130
void clear()
Definition: RPolyline.cpp:78
bool isGeometricallyClosed(double tolerance=RS::PointTolerance) const
Definition: RPolyline.cpp:358
bool simplify(double angleTolerance=RS::AngleTolerance)
Definition: RPolyline.cpp:970
void setBulgeAt(int i, double b)
Definition: RPolyline.cpp:332
virtual RVector getStartPoint() const
Definition: RPolyline.cpp:634
RVector getVertexAt(int i) const
Definition: RPolylineData.h:78
QSharedPointer< RShape > getSegmentAt(int i) const
Definition: RPolyline.cpp:516
virtual QList< RVector > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const =0
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:63
virtual bool moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint)=0
Moves the given reference point to the given target point or does nothing if this entity has no refer...
Q_DECLARE_METATYPE(RMath *)
virtual RVector getEndPoint() const
Definition: RPolyline.cpp:642
virtual bool reverse()
Definition: RPolyline.cpp:902
RPolyline getPolylineShape() const
Definition: RPolylineData.h:62
void clear()
Definition: RPolylineData.h:66
bool polylineGen
Definition: RPolylineData.h:172
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false) const
Definition: REntityData.h:88
void setClosed(bool on)
Definition: RPolyline.cpp:350
RPolylineData data
Definition: RPolylineEntity.h:217
virtual double getDirection1() const
Definition: RPolyline.cpp:650
Definition: RS.h:119
double getBulgeAt(int i) const
Definition: RPolylineData.h:110
bool isClosed() const
Definition: RPolyline.cpp:354
int countSegments() const
Definition: RPolylineData.h:102
void simplify(double angleTolerance)
Definition: RPolylineData.h:154
void normalize()
Definition: RPolyline.cpp:83
void insertVertex(int index, const RVector &vertex)
Definition: RPolyline.cpp:241
void removeLastVertex()
Definition: RPolyline.cpp:249
void appendVertex(const RVector &vertex, double bulge=0.0)
Definition: RPolyline.cpp:231
virtual QList< QSharedPointer< RShape > > getExploded(int segments=RDEFAULT_MIN1) const
Definition: RPolyline.cpp:474
void prependVertex(const RVector &vertex, double bulge=0.0)
Definition: RPolyline.cpp:236
double getDirection2() const
Definition: RPolylineData.h:122
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition: RPolyline.h:49
void setPolylineGen(bool on)
Definition: RPolylineData.h:164
virtual double getDirection2() const
Definition: RPolyline.cpp:664
void removeVertex(int index)
Definition: RPolylineData.h:98
Interface for geometrical shape classes.
Definition: RShape.h:52
void setClosed(bool on)
Definition: RPolylineData.h:138
bool reverse()
Definition: RPolylineData.h:126
void removeLastVertex()
Definition: RPolylineData.h:94
void normalize()
Definition: RPolylineData.h:70
bool isClosed() const
Definition: RPolylineData.h:142
virtual RShape * castToShape()
Definition: RPolylineData.h:58
RDocument * document
Definition: RObject.h:251