20#ifndef RPOLYLINEENTITY_H
21#define RPOLYLINEENTITY_H
34#define RDEFAULT_MIN1 -1
102 virtual QSharedPointer<RObject>
clone()
const {
114 virtual QPair<QVariant, RPropertyAttributes>
getProperty(
116 bool humanReadable =
false,
bool noAttributes =
false,
bool showOnRequest =
false);
129 return data.getPolylineShape();
137 data.normalize(tolerance);
141 return data.countVertices();
145 data.appendVertex(vertex, bulge, w1, w2);
149 data.prependVertex(vertex, bulge, w1, w2);
153 data.insertVertex(index, vertex);
157 data.insertVertexAt(vertex);
161 return data.insertVerticesAtSelfIntersections();
165 return data.getVertexAt(
i);
169 data.setVertexAt(
i, v);
173 data.removeLastVertex();
177 data.removeVertex(index);
181 return data.countSegments();
185 return data.getSegmentAt(
i);
189 return data.isArcSegmentAt(
i);
193 return data.hasArcSegments();
197 return data.getClosestSegment(point);
201 return data.getClosestVertex(point);
205 return data.getBulgeAt(
i);
209 data.setBulgeAt(
i, b);
213 return data.getVertexAngle(
i, orientation);
221 data.setMinimumWidth(w);
225 data.setGlobalWidth(w);
229 data.setStartWidthAt(
i, w);
233 return data.getStartWidthAt(
i);
237 data.setEndWidthAt(
i, w);
241 return data.getEndWidthAt(
i);
245 return data.hasWidths();
249 data.setStartWidths(sw);
253 return data.getStartWidths();
257 data.setEndWidths(ew);
261 return data.getEndWidths();
265 return data.getDirection1();
269 return data.getDirection2();
273 return data.reverse();
277 return data.getSideOfPoint(point);
281 return data.getEndPoint();
285 return data.getStartPoint();
289 data.relocateStartPoint(p);
297 return data.isClosed();
301 return data.isGeometricallyClosed(tolerance);
305 return data.toLogicallyClosed(tolerance);
309 return data.toLogicallyClosed(tolerance);
313 return data.toLogicallyOpen();
317 return data.getSelfIntersectionPoints(tolerance);
321 return data.getOrientation(implicitelyClosed);
325 return data.getArea();
329 return data.getLength();
333 return data.getLengthTo(p, limited);
337 return data.getExploded();
341 return countSegments();
345 return data.toPainterPath();
349 data.simplify(angleTolerance);
353 return data.verifyTangency(toleranceMin, toleranceMax);
357 data.setPolylineGen(on);
360 return data.getPolylineGen();
364 data.setElevation(v);
367 return data.getElevation();
371 return data.isFlat();
375 return data.getTrimEnd(trimPoint, clickPoint);
379 return data.trimStartPoint(trimPoint, clickPoint, extend);
382 return data.trimEndPoint(trimPoint, clickPoint, extend);
386 return data.trimStartPoint(trimDist);
389 return data.trimEndPoint(trimDist);
393 return data.morph(target, steps);
397 return data.contains(point, borderIsInside, tolerance);
400 return data.containsShape(shape);
406 virtual void print(QDebug dbg)
const;
Q_DECLARE_METATYPE(RMath *)
#define M_PI_4
Definition RMath.h:46
int i
Copyright (c) 2011-2018 by Andrew Mustun.
Definition autostart.js:32
Low-level mathematical representation of an arc.
Definition RArc.h:42
A graphics document contains and owns entities, layers, user coordinate systems, variables,...
Definition RDocument.h:78
Base class for all entity classes.
Definition REntity.h:63
virtual QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false, bool showOnRequest=false)
Definition REntity.cpp:236
static void init()
Definition REntity.cpp:89
virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition REntity.cpp:338
virtual void exportEntity(RExporter &e, bool preview=false, bool forceSelected=false) const =0
Exports the entity to the given exporter.
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition REntity.cpp:487
Abstract base class for exporters.
Definition RExporter.h:78
Low-level mathematical representation of a line.
Definition RLine.h:41
virtual bool validate()
Definition RObject.h:291
Extended painter path with a z-level and a pen.
Definition RPainterPath.h:48
Stores and manages all data that defines the geometry and appearance of a polyline entity.
Definition RPolylineData.h:46
Polyline entity.
Definition RPolylineEntity.h:44
RS::Side getSideOfPoint(const RVector &point) const
Definition RPolylineEntity.h:276
void setBulgeAt(int i, double b)
Definition RPolylineEntity.h:208
double getLength() const
Definition RPolylineEntity.h:328
QList< double > getStartWidths() const
Definition RPolylineEntity.h:252
static RPropertyTypeId PropertyBulgeN
Definition RPolylineEntity.h:66
static RPropertyTypeId PropertyElevation
Definition RPolylineEntity.h:82
static RPropertyTypeId PropertyLinetypeScale
Definition RPolylineEntity.h:55
static RPropertyTypeId PropertyVertexNY
Definition RPolylineEntity.h:64
static RS::EntityType getRtti()
Definition RPolylineEntity.h:94
QSharedPointer< RShape > getSegmentAt(int i) const
Definition RPolylineEntity.h:184
void relocateStartPoint(const RVector &p)
Definition RPolylineEntity.h:288
bool autoClose(double tolerance=RS::PointTolerance)
Definition RPolylineEntity.h:304
bool contains(const RVector &point, bool borderIsInside=false, double tolerance=RS::PointTolerance) const
Definition RPolylineEntity.h:396
bool insertVerticesAtSelfIntersections()
Definition RPolylineEntity.h:160
void normalize(double tolerance=RS::PointTolerance)
Definition RPolylineEntity.h:136
static RPropertyTypeId PropertyBlock
Definition RPolylineEntity.h:52
double getEndWidthAt(int i) const
Definition RPolylineEntity.h:240
RVector getEndPoint() const
Definition RPolylineEntity.h:280
void prependVertex(const RVector &vertex, double bulge=0.0, double w1=0.0, double w2=0.0)
Definition RPolylineEntity.h:148
int getClosestVertex(const RVector &point) const
Definition RPolylineEntity.h:200
void setMinimumWidth(double w)
Definition RPolylineEntity.h:220
static RPropertyTypeId PropertyVertexNZ
Definition RPolylineEntity.h:65
void setGlobalWidth(double w)
Definition RPolylineEntity.h:224
bool trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition RPolylineEntity.h:381
RPolyline getPolylineShape() const
Definition RPolylineEntity.h:128
virtual int getComplexity() const
Definition RPolylineEntity.h:340
bool trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition RPolylineEntity.h:378
void insertVertexAt(const RVector &vertex)
Definition RPolylineEntity.h:156
static RPropertyTypeId PropertyArea
Definition RPolylineEntity.h:75
bool toLogicallyOpen()
Definition RPolylineEntity.h:312
static RPropertyTypeId PropertyColor
Definition RPolylineEntity.h:57
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RPolylineEntity.h:47
void setStartWidthAt(int i, double w)
Definition RPolylineEntity.h:228
static RPropertyTypeId PropertyOrientation
Definition RPolylineEntity.h:72
double getElevation() const
Definition RPolylineEntity.h:366
bool trimEndPoint(double trimDist)
Definition RPolylineEntity.h:388
bool isArcSegmentAt(int i) const
Definition RPolylineEntity.h:188
static RPropertyTypeId PropertyLinetype
Definition RPolylineEntity.h:54
RS::Orientation getOrientation(bool implicitelyClosed=false) const
Definition RPolylineEntity.h:320
QList< RVector > verifyTangency(double toleranceMin=RS::AngleTolerance, double toleranceMax=M_PI_4)
Definition RPolylineEntity.h:352
static RPropertyTypeId PropertyBaseAngle
Definition RPolylineEntity.h:78
static RPropertyTypeId PropertyLayer
Definition RPolylineEntity.h:53
void stripWidths()
Definition RPolylineEntity.h:216
double getStartWidthAt(int i) const
Definition RPolylineEntity.h:232
bool isFlat() const
Definition RPolylineEntity.h:370
int countSegments() const
Definition RPolylineEntity.h:180
double getVertexAngle(int i, RS::Orientation orientation=RS::UnknownOrientation) const
Definition RPolylineEntity.h:212
virtual const RPolylineData & getData() const
Definition RPolylineEntity.h:124
static RPropertyTypeId PropertyGlobalWidth
Definition RPolylineEntity.h:70
static RPropertyTypeId PropertyType
Definition RPolylineEntity.h:51
QList< double > getEndWidths() const
Definition RPolylineEntity.h:260
double getBulgeAt(int i) const
Definition RPolylineEntity.h:204
int getClosestSegment(const RVector &point) const
Definition RPolylineEntity.h:196
RPolylineData data
Definition RPolylineEntity.h:409
void clear()
Definition RPolylineEntity.h:132
void setPolylineGen(bool on)
Definition RPolylineEntity.h:356
static RPropertyTypeId PropertyVertexNX
Definition RPolylineEntity.h:63
void removeLastVertex()
Definition RPolylineEntity.h:172
bool reverse()
Definition RPolylineEntity.h:272
QList< QSharedPointer< RShape > > getExploded() const
Definition RPolylineEntity.h:336
static RPropertyTypeId PropertyDrawOrder
Definition RPolylineEntity.h:59
bool containsShape(const RShape &shape) const
Definition RPolylineEntity.h:399
double getArea() const
Definition RPolylineEntity.h:324
static RPropertyTypeId PropertyDisplayedColor
Definition RPolylineEntity.h:58
static RPropertyTypeId PropertyClosed
Definition RPolylineEntity.h:61
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition RPolylineEntity.h:98
RVector getVertexAt(int i) const
Definition RPolylineEntity.h:164
static RPropertyTypeId PropertyLineweight
Definition RPolylineEntity.h:56
void appendVertex(const RVector &vertex, double bulge=0.0, double w1=0.0, double w2=0.0)
Definition RPolylineEntity.h:144
QList< RVector > getSelfIntersectionPoints(double tolerance=RS::PointTolerance) const
Definition RPolylineEntity.h:316
void simplify(double angleTolerance)
Definition RPolylineEntity.h:348
double getDirection2() const
Definition RPolylineEntity.h:268
static RPropertyTypeId PropertyLength
Definition RPolylineEntity.h:73
static RPropertyTypeId PropertyHandle
Definition RPolylineEntity.h:48
static RPropertyTypeId PropertyProtected
Definition RPolylineEntity.h:49
RS::Ending getTrimEnd(const RVector &trimPoint, const RVector &clickPoint)
Definition RPolylineEntity.h:374
bool getPolylineGen() const
Definition RPolylineEntity.h:359
static RPropertyTypeId PropertyStartWidthN
Definition RPolylineEntity.h:68
double getLengthTo(const RVector &p, bool limited=true) const
Definition RPolylineEntity.h:332
void setEndWidths(const QList< double > &ew)
Definition RPolylineEntity.h:256
static RPropertyTypeId PropertyWorkingSet
Definition RPolylineEntity.h:50
static RPropertyTypeId PropertyAngleN
Definition RPolylineEntity.h:67
bool hasWidths() const
Definition RPolylineEntity.h:244
bool isGeometricallyClosed(double tolerance=RS::PointTolerance) const
Definition RPolylineEntity.h:300
void setStartWidths(const QList< double > &sw)
Definition RPolylineEntity.h:248
QSharedPointer< RPolylineEntity > cloneToPolylineEntity() const
Definition RPolylineEntity.h:106
void setElevation(double v)
Definition RPolylineEntity.h:363
bool toLogicallyClosed(double tolerance=RS::PointTolerance)
Definition RPolylineEntity.h:308
void insertVertex(int index, const RVector &vertex)
Definition RPolylineEntity.h:152
void setEndWidthAt(int i, double w)
Definition RPolylineEntity.h:236
void setClosed(bool on)
Definition RPolylineEntity.h:292
bool trimStartPoint(double trimDist)
Definition RPolylineEntity.h:385
bool isClosed() const
Definition RPolylineEntity.h:296
void setVertexAt(int i, const RVector &v)
Definition RPolylineEntity.h:168
bool hasArcSegments() const
Definition RPolylineEntity.h:192
static RPropertyTypeId PropertyPolylineGen
Definition RPolylineEntity.h:62
virtual QSharedPointer< RObject > clone() const
Definition RPolylineEntity.h:102
double getDirection1() const
Definition RPolylineEntity.h:264
virtual RPolylineData & getData()
Definition RPolylineEntity.h:120
RPainterPath toPainterPath() const
Definition RPolylineEntity.h:344
void removeVertex(int index)
Definition RPolylineEntity.h:176
static RPropertyTypeId PropertyEndWidthN
Definition RPolylineEntity.h:69
static RPropertyTypeId PropertySize1
Definition RPolylineEntity.h:79
static RPropertyTypeId PropertyTotalArea
Definition RPolylineEntity.h:76
RVector getStartPoint() const
Definition RPolylineEntity.h:284
static RPropertyTypeId PropertyTotalLength
Definition RPolylineEntity.h:74
int countVertices() const
Definition RPolylineEntity.h:140
static RPropertyTypeId PropertySize2
Definition RPolylineEntity.h:80
QList< RPolyline > morph(const RPolyline &target, int steps) const
Definition RPolylineEntity.h:392
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition RPolyline.h:50
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RPropertyTypeId.h:54
static QSet< RPropertyTypeId > getPropertyTypeIds(RS::EntityType type, RPropertyAttributes::Option=RPropertyAttributes::NoOptions)
Gets all property type IDs that where registered for the given class.
Definition RPropertyTypeId.cpp:283
Orientation
Definition RS.h:700
@ UnknownOrientation
Definition RS.h:701
EntityType
Entity types used for property handling / filtering.
Definition RS.h:227
@ EntityPolyline
Polyline.
Definition RS.h:252
static const double PointTolerance
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RS.h:920
static const double AngleTolerance
Definition RS.h:921
Side
Side used for side of a point relative to an entity (right hand or left hand side)
Definition RS.h:313
Ending
Entity ending.
Definition RS.h:323
Interface for geometrical shape classes.
Definition RShape.h:72
Transaction implementation.
Definition RTransaction.h:73
Represents a 3d vector (x/y/z).
Definition RVector.h:47
static const RVector invalid
invalid vector
Definition RVector.h:335
#define QCADENTITY_EXPORT
Definition entity_global.h:10
#define NULL
Definition opennurbs_system.h:256