RPolyline
Class in Math Module
Header: #include <src/core/math/RPolyline.h>
Inherits: RShape, RExplodable
Inherited by: RLeaderData, RPolylineData, RSolidData
Description
Section titled “Description”Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Scriptable: This class is available in script environments.
Shared Pointer Support: Objects can be used in QSharedPointer.
Copyable: Objects are cleaned up automatically by the garbage collector of the script engine.
Stream Operator: Object has a stream operator to present itself as string, for example when using toString() in a script.
Public Functions
Section titled “Public Functions”RPolyline()Creates a polyline object without points. |
|
RPolyline(const QList< QSharedPointer< RShape > > &segments)Creates a polyline from segments (lines or arcs). |
|
RPolyline(const QList< RVector > &vertices, bool closed)Creates a polyline object with the given points. |
|
| virtual | ~RPolyline() |
| bool | appendShape(const RShape &shape, bool prepend=false) |
| bool | appendShapeAuto(const RShape &shape)Appends the given shape to this polyline. |
| bool | appendShapeTrim(const RShape &shape) |
| void | appendVertex(const RVector &vertex, double bulge=0.0, double w1=0.0, double w2=0.0) |
| void | appendVertex(double x, double y, double bulge=0.0, double w1=0.0, double w2=0.0) |
| bool | autoClose(double tolerance=RS::PointTolerance) |
| void | clear() |
| virtual QSharedPointer< RShape > | clone() const |
| QSharedPointer< RPolyline > | cloneToPolyline() const |
| bool | closeTrim() |
| virtual bool | contains(const RVector &point, bool borderIsInside=false, double tolerance=RS::PointTolerance) constChecks if the given point is inside this closed polygon. |
| bool | containsShape(const RShape &shape) constChecks if the given shape is completely inside this closed polygon. |
| RPolyline | convertArcToLineSegments(int segments) const |
| RPolyline | convertArcToLineSegmentsLength(double segmentLength) const |
| bool | convertToClosed() |
| bool | convertToOpen() |
| int | countSegments() const |
| int | countVertices() const |
| virtual double | getAngleAt(double distance, RS::From from=RS::FromStart) const |
| double | getArea() const |
| double | getBaseAngle() const |
| virtual QList< bool > | getBoolProperties() const |
| virtual RBox | getBoundingBox() const |
| double | getBulgeAt(int i) const |
| QList< double > | getBulges() const |
| virtual QList< RVector > | getCenterPoints() const |
| RVector | getCentroid() const |
| int | getClosestSegment(const RVector &point) const |
| int | getClosestVertex(const RVector &point) const |
| QList< RVector > | getConcaveVertices() const |
| QList< RVector > | getConvexVertices(bool convex=true) const |
| virtual double | getDirection1() const |
| virtual double | getDirection2() const |
| virtual double | getDistanceFromStart(const RVector &p) const |
| virtual QList< double > | getDistancesFromStart(const RVector &p) const |
| virtual double | getDistanceTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const |
| virtual QList< double > | getDoubleProperties() const |
| virtual RVector | getEndPoint() const |
| virtual QList< RVector > | getEndPoints() const |
| double | getEndWidthAt(int i) const |
| QList< double > | getEndWidths() const |
| virtual QList< QSharedPointer< RShape > > | getExploded(int segments=RDEFAULT_MIN1) const |
| QSharedPointer< RShape > | getFirstSegment() const |
| double | getHeight() const |
| QSharedPointer< RShape > | getLastSegment() const |
| RVector | getLastVertex() const |
| QList< RPolyline > | getLeftOutline() const |
| QList< QPair< RPolyline, RPolyline > > | getLeftRightOutline() const |
| virtual double | getLength() const |
| double | getLengthTo(const RVector &p, bool limited=true) const |
| virtual RVector | getMiddlePoint() const |
| virtual QList< RVector > | getMiddlePoints() const |
| RS::Orientation | getOrientation(bool implicitelyClosed=false) const |
| QList< RPolyline > | getOutline() const |
| virtual RVector | getPointAtPercent(double p) const |
| virtual QList< RVector > | getPointCloud(double segmentLength) const |
| RVector | getPointInside() const |
| virtual QList< RVector > | getPointsWithDistanceToEnd(double distance, int from=RS::FromAny) const |
| RPolyline | getPolygon(double segmentLength) const |
| RPolyline | getPolygonHull(double angle, double tolerance, bool inner=false) const |
| virtual RPolyline | getReversed() const |
| QList< RPolyline > | getRightOutline() const |
| QSharedPointer< RShape > | getSegmentAt(int i) const |
| int | getSegmentAtDist(double dist) |
| QList< QSharedPointer< RShape > > | getSegments() const |
| double | getSegmentsLength(int fromIndex, int toIndex) const |
| virtual QList< RVector > | getSelfIntersectionPoints(double tolerance=RS::PointTolerance) const |
| virtual RShape::Type | getShapeType() const |
| virtual RS::Side | getSideOfPoint(const RVector &point) const |
| virtual RVector | getStartPoint() const |
| double | getStartWidthAt(int i) const |
| QList< double > | getStartWidths() const |
| virtual QSharedPointer< RShape > | getTransformed(const QTransform &transform) const |
| virtual RS::Ending | getTrimEnd(const RVector &trimPoint, const RVector &clickPoint) |
| virtual QList< RVector > | getVectorProperties() const |
| virtual RVector | getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const |
| double | getVertexAngle(int i, RS::Orientation orientation=RS::UnknownOrientation) const |
| QList< double > | getVertexAngles() const |
| RVector | getVertexAt(int i) const |
| int | getVertexIndex(const RVector &v, double tolerance=RS::PointTolerance) const |
| QList< RVector > | getVertices() const |
| double | getWidth() const |
| bool | hasArcSegments() const |
| bool | hasWidths() const |
| void | insertVertex(int index, const RVector &vertex, double bulgeBefore=0.0, double bulgeAfter=0.0) |
| void | insertVertexAt(const RVector &point)Inserts a vertex at the point on the polyline closest to the given position. |
| RVector | insertVertexAtDistance(double dist) |
| bool | insertVerticesAtSelfIntersections() |
| bool | isArcSegmentAt(int i) const |
| bool | isClosed() const |
| bool | isConcave() const |
| virtual bool | isDirected() const |
| bool | isEmpty() const |
| bool | isFlat() const |
| bool | isGeometricallyClosed(double tolerance=RS::PointTolerance) const |
| virtual bool | isInterpolated() constReimplement and return true if this shape relies on interpolation for geometrical operations such as finding intersection points. |
| virtual bool | mirror(const RLine &axis) |
| RPolyline | modifyPolylineCorner(const RShape &trimmedShape1, RS::Ending ending1, int segmentIndex1, const RShape &trimmedShape2, RS::Ending ending2, int segmentIndex2, const RShape *cornerShape=NULL) constModifies (bevels, rounds, trims) the corner of this polyline between segmentIndex1 and segmentIndex2 at the given segment endings. |
| QList< RPolyline > | morph(const RPolyline &target, int steps, RS::Easing easing=RS::Linear, bool zLinear=true, double customFactor=RNANDOUBLE) const |
| virtual bool | move(const RVector &offset) |
| void | moveEndPoint(const RVector &pos) |
| void | moveSegmentAt(int i, const RVector &offset) |
| void | moveStartPoint(const RVector &pos) |
| void | moveVertexAt(int i, const RVector &offset) |
| void | normalize(double tolerance=RS::PointTolerance)Removes duplicate vertices. |
| bool | prependShape(const RShape &shape) |
| void | prependVertex(const RVector &vertex, double bulge=0.0, double w1=0.0, double w2=0.0) |
| bool | relocateStartPoint(const RVector &p)Relocates the start point of this closed polyline to the given point. |
| bool | relocateStartPoint(double dist) |
| void | removeFirstVertex() |
| void | removeLastVertex() |
| void | removeVertex(int index) |
| void | removeVerticesAfter(int index) |
| void | removeVerticesBefore(int index) |
| virtual bool | reverse() |
| virtual bool | rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR) |
| RPolyline | roundAllCorners(double radius, bool inverted=false) constRounds all corners of this polyline with the given radius. |
| virtual bool | scale(const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR) |
| virtual bool | scale(double scaleFactor, const RVector ¢er=RDEFAULT_RVECTOR) |
| void | setBulgeAt(int i, double b) |
| void | setBulges(const QList< double > &b) |
| void | setClosed(bool on)Marks the poyline as logically (explicitly) closed. |
| void | setEndWidthAt(int i, double w) |
| void | setEndWidths(const QList< double > &ew) |
| void | setGlobalWidth(double w) |
| bool | setHeight(double v) |
| void | setMinimumWidth(double w) |
| bool | setOrientation(RS::Orientation orientation) |
| void | setStartWidthAt(int i, double w) |
| void | setStartWidths(const QList< double > &sw) |
| void | setVertexAt(int i, const RVector &v) |
| void | setVertices(const QList< RVector > &vertices) |
| bool | setWidth(double v) |
| virtual void | setZ(double z) |
| bool | simplify(double tolerance=RS::PointTolerance)Simplify by attempting to skip nodes within given tolerance. |
| QList< RPolyline > | splitAtDiscontinuities(double tolerance) const |
| QList< RPolyline > | splitAtSegmentTypeChange() constSplits the polyline into polylines with exclusively line or arc segments. |
| RPolyline | splitMajorArcs() const |
| virtual bool | stretch(const RPolyline &area, const RVector &offset) |
| void | stripWidths() |
| bool | toLogicallyClosed(double tolerance=RS::PointTolerance)Converts this geometrically closed polyline (start == end) to a locically closed polyline. |
| bool | toLogicallyOpen()Converts this logically closed polyline to a locically open, geometrically closed polyline. |
| RPainterPath | toPainterPath(bool addOriginalShapes=false) const |
| virtual bool | trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false) |
| virtual bool | trimEndPoint(double trimDist) |
| virtual bool | trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false) |
| virtual bool | trimStartPoint(double trimDist) |
| QList< RVector > | verifyTangency(double toleranceMin=RS::AngleTolerance, double toleranceMax=M_PI_4)Verifies the tangency of this polyline. |
Static Public Functions
Section titled “Static Public Functions”| static RPolylineProxy * | getPolylineProxy() |
| static bool | hasProxy() |
| static bool | isStraight(double bulge) |
| static void | setPolylineProxy(RPolylineProxy *p) |
Protected Functions
Section titled “Protected Functions”| bool | isLineSegment(int i) const |
| virtual void | print(QDebug dbg) const |
Protected Attributes
Section titled “Protected Attributes”| QList< double > | bulges |
| bool | closed Getter function for this property: isClosed. |
| QList< double > | endWidths |
| QList< double > | startWidths |
| QList< RVector > | vertices Getter function for this property: getVertices. |
Static Private Attributes
Section titled “Static Private Attributes”| static RPolylineProxy * | polylineProxy |
Member Documentation
Section titled “Member Documentation”RPolyline
Section titled “RPolyline”RPolyline::RPolyline()Creates a polyline object without points.
RPolyline
Section titled “RPolyline”RPolyline::RPolyline(const QList< QSharedPointer< RShape > > &segments)Creates a polyline from segments (lines or arcs).
RPolyline
Section titled “RPolyline”RPolyline::RPolyline(const QList< RVector > &vertices, bool closed)Creates a polyline object with the given points.
~RPolyline
Section titled “~RPolyline”virtual RPolyline::~RPolyline()virtual
appendShape
Section titled “appendShape”bool RPolyline::appendShape(const RShape &shape, bool prepend=false)appendShapeAuto
Section titled “appendShapeAuto”bool RPolyline::appendShapeAuto(const RShape &shape)Appends the given shape to this polyline.
The shape is reversed if necessary.
appendShapeTrim
Section titled “appendShapeTrim”bool RPolyline::appendShapeTrim(const RShape &shape)appendVertex
Section titled “appendVertex”void RPolyline::appendVertex(const RVector &vertex, double bulge=0.0, double w1=0.0, double w2=0.0)appendVertex
Section titled “appendVertex”void RPolyline::appendVertex(double x, double y, double bulge=0.0, double w1=0.0, double w2=0.0)autoClose
Section titled “autoClose”bool RPolyline::autoClose(double tolerance=RS::PointTolerance)inline
void RPolyline::clear()virtual QSharedPointer< RShape > RPolyline::clone() constvirtual inline const
Reimplemented from clone.
cloneToPolyline
Section titled “cloneToPolyline”QSharedPointer< RPolyline > RPolyline::cloneToPolyline() constinline const
closeTrim
Section titled “closeTrim”bool RPolyline::closeTrim()contains
Section titled “contains”virtual bool RPolyline::contains(const RVector &point, bool borderIsInside=false, double tolerance=RS::PointTolerance) constvirtual const
Checks if the given point is inside this closed polygon.
If this polyline is not closed, false is returned.
See also: setClosed
Parameters:
borderIsInside: True if a position on the polyline counts as inside.tolerance: Tolerance used to check if point is on polyline.
containsShape
Section titled “containsShape”bool RPolyline::containsShape(const RShape &shape) constconst
Checks if the given shape is completely inside this closed polygon.
If this polyline is not closed, false is returned.
See also: setClosed
If the shape touches the polyline, false is returned.
Parameters:
shape: The shape to check.
convertArcToLineSegments
Section titled “convertArcToLineSegments”RPolyline RPolyline::convertArcToLineSegments(int segments) constconst
convertArcToLineSegmentsLength
Section titled “convertArcToLineSegmentsLength”RPolyline RPolyline::convertArcToLineSegmentsLength(double segmentLength) constconst
convertToClosed
Section titled “convertToClosed”bool RPolyline::convertToClosed()convertToOpen
Section titled “convertToOpen”bool RPolyline::convertToOpen()countSegments
Section titled “countSegments”int RPolyline::countSegments() constconst
Returns: Number of segments. The number of segments equals the number of vertices for a closed polyline and one less for an open polyline.
countVertices
Section titled “countVertices”int RPolyline::countVertices() constconst
getAngleAt
Section titled “getAngleAt”virtual double RPolyline::getAngleAt(double distance, RS::From from=RS::FromStart) constvirtual const
Returns: Angle on the entity at the given distance from the start point.
Reimplemented from getAngleAt.
getArea
Section titled “getArea”double RPolyline::getArea() constconst
Returns: Area of (implicitly closed) polyline.
getBaseAngle
Section titled “getBaseAngle”double RPolyline::getBaseAngle() constconst
getBoolProperties
Section titled “getBoolProperties”virtual QList< bool > RPolyline::getBoolProperties() constvirtual const
Reimplemented from getBoolProperties.
getBoundingBox
Section titled “getBoundingBox”virtual RBox RPolyline::getBoundingBox() constvirtual const
Returns: The bounding box of this shape.
Reimplemented from getBoundingBox.
getBulgeAt
Section titled “getBulgeAt”double RPolyline::getBulgeAt(int i) constconst
getBulges
Section titled “getBulges”QList< double > RPolyline::getBulges() constconst
getCenterPoints
Section titled “getCenterPoints”virtual QList< RVector > RPolyline::getCenterPoints() constvirtual const
Returns: The center point(s) of this shape.
Reimplemented from getCenterPoints.
getCentroid
Section titled “getCentroid”RVector RPolyline::getCentroid() constconst
Returns: Centroid of this polygon or invalid if polyline contains arc segments. The polyline is implicitely considered to be closed.
getClosestSegment
Section titled “getClosestSegment”int RPolyline::getClosestSegment(const RVector &point) constconst
getClosestVertex
Section titled “getClosestVertex”int RPolyline::getClosestVertex(const RVector &point) constconst
getConcaveVertices
Section titled “getConcaveVertices”QList< RVector > RPolyline::getConcaveVertices() constconst
getConvexVertices
Section titled “getConvexVertices”QList< RVector > RPolyline::getConvexVertices(bool convex=true) constconst
getDirection1
Section titled “getDirection1”virtual double RPolyline::getDirection1() constvirtual const
Reimplemented from getDirection1.
Reimplemented in getDirection1, getDirection1.
getDirection2
Section titled “getDirection2”virtual double RPolyline::getDirection2() constvirtual const
Reimplemented from getDirection2.
Reimplemented in getDirection2, getDirection2.
getDistanceFromStart
Section titled “getDistanceFromStart”virtual double RPolyline::getDistanceFromStart(const RVector &p) constvirtual inline const
Returns: Distance of given point to start point of shape along shape.
Parameters:
p: Point (assumed to be on shape).
Reimplemented from getDistanceFromStart.
getDistancesFromStart
Section titled “getDistancesFromStart”virtual QList< double > RPolyline::getDistancesFromStart(const RVector &p) constvirtual const
Returns: All possible distances of given point to start point of shape along shape.
Parameters:
p: Point (assumed to be on shape).
Reimplemented from getDistancesFromStart.
getDistanceTo
Section titled “getDistanceTo”virtual double RPolyline::getDistanceTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) constvirtual const
Returns: Shortest distance from this shape to the given point. Based on getVectorTo.
Reimplemented from getDistanceTo.
getDoubleProperties
Section titled “getDoubleProperties”virtual QList< double > RPolyline::getDoubleProperties() constvirtual const
Reimplemented from getDoubleProperties.
getEndPoint
Section titled “getEndPoint”virtual RVector RPolyline::getEndPoint() constvirtual const
Reimplemented from getEndPoint.
Reimplemented in getEndPoint, getEndPoint, getEndPoint.
getEndPoints
Section titled “getEndPoints”virtual QList< RVector > RPolyline::getEndPoints() constvirtual const
Returns: The end point(s) of this shape.
Reimplemented from getEndPoints.
getEndWidthAt
Section titled “getEndWidthAt”double RPolyline::getEndWidthAt(int i) constconst
getEndWidths
Section titled “getEndWidths”QList< double > RPolyline::getEndWidths() constconst
getExploded
Section titled “getExploded”virtual QList< QSharedPointer< RShape > > RPolyline::getExploded(int segments=RDEFAULT_MIN1) constvirtual const
Returns: List of RLines and RArcs describing this polyline.
Reimplemented from getExploded.
Reimplemented in getExploded, getExploded.
getFirstSegment
Section titled “getFirstSegment”QSharedPointer< RShape > RPolyline::getFirstSegment() constconst
getHeight
Section titled “getHeight”double RPolyline::getHeight() constconst
getLastSegment
Section titled “getLastSegment”QSharedPointer< RShape > RPolyline::getLastSegment() constconst
getLastVertex
Section titled “getLastVertex”RVector RPolyline::getLastVertex() constconst
getLeftOutline
Section titled “getLeftOutline”QList< RPolyline > RPolyline::getLeftOutline() constinline const
getLeftRightOutline
Section titled “getLeftRightOutline”QList< QPair< RPolyline, RPolyline > > RPolyline::getLeftRightOutline() constconst
getLength
Section titled “getLength”virtual double RPolyline::getLength() constvirtual const
Returns: The total length of this shape if applicable or NaN if not.
Reimplemented from getLength.
getLengthTo
Section titled “getLengthTo”double RPolyline::getLengthTo(const RVector &p, bool limited=true) constconst
Returns: Length along polyline from start point to given point p or the closest point to p on the polyline.
getMiddlePoint
Section titled “getMiddlePoint”virtual RVector RPolyline::getMiddlePoint() constvirtual const
Reimplemented from getMiddlePoint.
getMiddlePoints
Section titled “getMiddlePoints”virtual QList< RVector > RPolyline::getMiddlePoints() constvirtual const
Returns: The middle point(s) of this shape.
Reimplemented from getMiddlePoints.
getOrientation
Section titled “getOrientation”RS::Orientation RPolyline::getOrientation(bool implicitelyClosed=false) constconst
getOutline
Section titled “getOutline”QList< RPolyline > RPolyline::getOutline() constconst
getPointAtPercent
Section titled “getPointAtPercent”virtual RVector RPolyline::getPointAtPercent(double p) constvirtual const
Returns: Point at given percentile.
Reimplemented from getPointAtPercent.
getPointCloud
Section titled “getPointCloud”virtual QList< RVector > RPolyline::getPointCloud(double segmentLength) constvirtual const
Reimplemented from getPointCloud.
getPointInside
Section titled “getPointInside”RVector RPolyline::getPointInside() constconst
Returns: Any point that is inside this polyline.
getPointsWithDistanceToEnd
Section titled “getPointsWithDistanceToEnd”virtual QList< RVector > RPolyline::getPointsWithDistanceToEnd(double distance, int from=RS::FromAny) constvirtual const
Returns: All points on this shape with the given distance to an endpoint.
Reimplemented from getPointsWithDistanceToEnd.
getPolygon
Section titled “getPolygon”RPolyline RPolyline::getPolygon(double segmentLength) constconst
getPolygonHull
Section titled “getPolygonHull”RPolyline RPolyline::getPolygonHull(double angle, double tolerance, bool inner=false) constconst
getReversed
Section titled “getReversed”virtual RPolyline RPolyline::getReversed() constvirtual const
getRightOutline
Section titled “getRightOutline”QList< RPolyline > RPolyline::getRightOutline() constinline const
getSegmentAt
Section titled “getSegmentAt”QSharedPointer< RShape > RPolyline::getSegmentAt(int i) constconst
Returns: Shape of segment at given position.
getSegmentAtDist
Section titled “getSegmentAtDist”int RPolyline::getSegmentAtDist(double dist)getSegments
Section titled “getSegments”QList< QSharedPointer< RShape > > RPolyline::getSegments() constconst
getSegmentsLength
Section titled “getSegmentsLength”double RPolyline::getSegmentsLength(int fromIndex, int toIndex) constconst
Returns: Length of all segments from first index (fromIndex) to last index (toIndex), excluding toIndex.
getSelfIntersectionPoints
Section titled “getSelfIntersectionPoints”virtual QList< RVector > RPolyline::getSelfIntersectionPoints(double tolerance=RS::PointTolerance) constvirtual const
Reimplemented from getSelfIntersectionPoints.
getShapeType
Section titled “getShapeType”virtual RShape::Type RPolyline::getShapeType() constvirtual inline const
Reimplemented from getShapeType.
getSideOfPoint
Section titled “getSideOfPoint”virtual RS::Side RPolyline::getSideOfPoint(const RVector &point) constvirtual const
Reimplemented from getSideOfPoint.
getStartPoint
Section titled “getStartPoint”virtual RVector RPolyline::getStartPoint() constvirtual const
Reimplemented from getStartPoint.
Reimplemented in getStartPoint, getStartPoint, getStartPoint.
getStartWidthAt
Section titled “getStartWidthAt”double RPolyline::getStartWidthAt(int i) constconst
getStartWidths
Section titled “getStartWidths”QList< double > RPolyline::getStartWidths() constconst
getTransformed
Section titled “getTransformed”virtual QSharedPointer< RShape > RPolyline::getTransformed(const QTransform &transform) constvirtual const
Reimplemented from getTransformed.
getTrimEnd
Section titled “getTrimEnd”virtual RS::Ending RPolyline::getTrimEnd(const RVector &trimPoint, const RVector &clickPoint)virtual
Parameters:
trimPoint: Trim start point or end point to this coordinate.clickPoint: Point that was clicked by user.
Reimplemented from getTrimEnd.
Reimplemented in getTrimEnd.
getVectorProperties
Section titled “getVectorProperties”virtual QList< RVector > RPolyline::getVectorProperties() constvirtual const
Reimplemented from getVectorProperties.
getVectorTo
Section titled “getVectorTo”virtual RVector RPolyline::getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) constvirtual const
Returns: Shortest vector from this shape to the given point.
Parameters:
point: the given pointlimited: If false, the shape is treated as an unlimited shape that extends in a logical way. For example an unlimited line for a line, full circle for an arc or a plane for a triangle.
Reimplemented from getVectorTo.
Reimplemented in getVectorTo, getVectorTo, getVectorTo.
getVertexAngle
Section titled “getVertexAngle”double RPolyline::getVertexAngle(int i, RS::Orientation orientation=RS::UnknownOrientation) constconst
getVertexAngles
Section titled “getVertexAngles”QList< double > RPolyline::getVertexAngles() constconst
getVertexAt
Section titled “getVertexAt”RVector RPolyline::getVertexAt(int i) constconst
getVertexIndex
Section titled “getVertexIndex”int RPolyline::getVertexIndex(const RVector &v, double tolerance=RS::PointTolerance) constconst
getVertices
Section titled “getVertices”QList< RVector > RPolyline::getVertices() constconst
getWidth
Section titled “getWidth”double RPolyline::getWidth() constconst
hasArcSegments
Section titled “hasArcSegments”bool RPolyline::hasArcSegments() constconst
hasWidths
Section titled “hasWidths”bool RPolyline::hasWidths() constconst
insertVertex
Section titled “insertVertex”void RPolyline::insertVertex(int index, const RVector &vertex, double bulgeBefore=0.0, double bulgeAfter=0.0)insertVertexAt
Section titled “insertVertexAt”void RPolyline::insertVertexAt(const RVector &point)Inserts a vertex at the point on the polyline closest to the given position.
insertVertexAtDistance
Section titled “insertVertexAtDistance”RVector RPolyline::insertVertexAtDistance(double dist)insertVerticesAtSelfIntersections
Section titled “insertVerticesAtSelfIntersections”bool RPolyline::insertVerticesAtSelfIntersections()isArcSegmentAt
Section titled “isArcSegmentAt”bool RPolyline::isArcSegmentAt(int i) constconst
isClosed
Section titled “isClosed”bool RPolyline::isClosed() constconst
Returns: True if this polyline is logically marked as closed.
isConcave
Section titled “isConcave”bool RPolyline::isConcave() constconst
isDirected
Section titled “isDirected”virtual bool RPolyline::isDirected() constvirtual inline const
Reimplemented from isDirected.
isEmpty
Section titled “isEmpty”bool RPolyline::isEmpty() constinline const
isFlat
Section titled “isFlat”bool RPolyline::isFlat() constconst
isGeometricallyClosed
Section titled “isGeometricallyClosed”bool RPolyline::isGeometricallyClosed(double tolerance=RS::PointTolerance) constconst
Returns: True is this polyline is geometrically closed. If this polyline is logically closed it is implicitly also geometrically closed.
isInterpolated
Section titled “isInterpolated”virtual bool RPolyline::isInterpolated() constvirtual inline const
Reimplement and return true if this shape relies on interpolation for geometrical operations such as finding intersection points.
E.g. splines.
Reimplemented from isInterpolated.
mirror
Section titled “mirror”virtual bool RPolyline::mirror(const RLine &axis)virtual
Reimplemented from mirror.
Reimplemented in mirror, mirror, mirror.
modifyPolylineCorner
Section titled “modifyPolylineCorner”RPolyline RPolyline::modifyPolylineCorner(const RShape &trimmedShape1, RS::Ending ending1, int segmentIndex1, const RShape &trimmedShape2, RS::Ending ending2, int segmentIndex2, const RShape *cornerShape=NULL) constconst
Modifies (bevels, rounds, trims) the corner of this polyline between segmentIndex1 and segmentIndex2 at the given segment endings.
The given cornerShape (bevel, rounding) is inserted between.
QList< RPolyline > RPolyline::morph(const RPolyline &target, int steps, RS::Easing easing=RS::Linear, bool zLinear=true, double customFactor=RNANDOUBLE) constconst
virtual bool RPolyline::move(const RVector &offset)virtual
Reimplemented from move.
Reimplemented in move, move, move.
moveEndPoint
Section titled “moveEndPoint”void RPolyline::moveEndPoint(const RVector &pos)moveSegmentAt
Section titled “moveSegmentAt”void RPolyline::moveSegmentAt(int i, const RVector &offset)moveStartPoint
Section titled “moveStartPoint”void RPolyline::moveStartPoint(const RVector &pos)moveVertexAt
Section titled “moveVertexAt”void RPolyline::moveVertexAt(int i, const RVector &offset)normalize
Section titled “normalize”void RPolyline::normalize(double tolerance=RS::PointTolerance)Removes duplicate vertices.
prependShape
Section titled “prependShape”bool RPolyline::prependShape(const RShape &shape)prependVertex
Section titled “prependVertex”void RPolyline::prependVertex(const RVector &vertex, double bulge=0.0, double w1=0.0, double w2=0.0)relocateStartPoint
Section titled “relocateStartPoint”bool RPolyline::relocateStartPoint(const RVector &p)Relocates the start point of this closed polyline to the given point.
The visual appearance of the polyline does not change.
relocateStartPoint
Section titled “relocateStartPoint”bool RPolyline::relocateStartPoint(double dist)removeFirstVertex
Section titled “removeFirstVertex”void RPolyline::removeFirstVertex()removeLastVertex
Section titled “removeLastVertex”void RPolyline::removeLastVertex()removeVertex
Section titled “removeVertex”void RPolyline::removeVertex(int index)removeVerticesAfter
Section titled “removeVerticesAfter”void RPolyline::removeVerticesAfter(int index)removeVerticesBefore
Section titled “removeVerticesBefore”void RPolyline::removeVerticesBefore(int index)reverse
Section titled “reverse”virtual bool RPolyline::reverse()virtual
Reimplemented from reverse.
Reimplemented in reverse, reverse, reverse.
rotate
Section titled “rotate”virtual bool RPolyline::rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR)virtual
Reimplemented from rotate.
Reimplemented in rotate, rotate, rotate.
roundAllCorners
Section titled “roundAllCorners”RPolyline RPolyline::roundAllCorners(double radius, bool inverted=false) constconst
Rounds all corners of this polyline with the given radius.
Parameters:
radius: Radius of the rounding arcs.inverted: True to invert the rounding arcs (concave rounding: the arcs bulge into the corners instead of cutting them off).
virtual bool RPolyline::scale(const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR)virtual
Reimplemented from scale.
Reimplemented in scale, scale, scale.
virtual bool RPolyline::scale(double scaleFactor, const RVector ¢er=RDEFAULT_RVECTOR)virtual
Reimplemented from scale.
setBulgeAt
Section titled “setBulgeAt”void RPolyline::setBulgeAt(int i, double b)setBulges
Section titled “setBulges”void RPolyline::setBulges(const QList< double > &b)setClosed
Section titled “setClosed”void RPolyline::setClosed(bool on)Marks the poyline as logically (explicitly) closed.
The first and last node are usually not identical. Logically closed polylines have an additional segment from start to end point.
setEndWidthAt
Section titled “setEndWidthAt”void RPolyline::setEndWidthAt(int i, double w)setEndWidths
Section titled “setEndWidths”void RPolyline::setEndWidths(const QList< double > &ew)setGlobalWidth
Section titled “setGlobalWidth”void RPolyline::setGlobalWidth(double w)setHeight
Section titled “setHeight”bool RPolyline::setHeight(double v)setMinimumWidth
Section titled “setMinimumWidth”void RPolyline::setMinimumWidth(double w)setOrientation
Section titled “setOrientation”bool RPolyline::setOrientation(RS::Orientation orientation)setStartWidthAt
Section titled “setStartWidthAt”void RPolyline::setStartWidthAt(int i, double w)setStartWidths
Section titled “setStartWidths”void RPolyline::setStartWidths(const QList< double > &sw)setVertexAt
Section titled “setVertexAt”void RPolyline::setVertexAt(int i, const RVector &v)setVertices
Section titled “setVertices”void RPolyline::setVertices(const QList< RVector > &vertices)setWidth
Section titled “setWidth”bool RPolyline::setWidth(double v)virtual void RPolyline::setZ(double z)virtual
Reimplemented from setZ.
Reimplemented in setZ, setZ, setZ.
simplify
Section titled “simplify”bool RPolyline::simplify(double tolerance=RS::PointTolerance)Simplify by attempting to skip nodes within given tolerance.
Returns: True if nodes have been skipped.
splitAtDiscontinuities
Section titled “splitAtDiscontinuities”QList< RPolyline > RPolyline::splitAtDiscontinuities(double tolerance) constconst
splitAtSegmentTypeChange
Section titled “splitAtSegmentTypeChange”QList< RPolyline > RPolyline::splitAtSegmentTypeChange() constconst
Splits the polyline into polylines with exclusively line or arc segments.
splitMajorArcs
Section titled “splitMajorArcs”RPolyline RPolyline::splitMajorArcs() constconst
stretch
Section titled “stretch”virtual bool RPolyline::stretch(const RPolyline &area, const RVector &offset)virtual
Reimplemented from stretch.
Reimplemented in stretch, stretch, stretch.
stripWidths
Section titled “stripWidths”void RPolyline::stripWidths()toLogicallyClosed
Section titled “toLogicallyClosed”bool RPolyline::toLogicallyClosed(double tolerance=RS::PointTolerance)Converts this geometrically closed polyline (start == end) to a locically closed polyline.
Returns: True on success, false if this polyline is already locically closed or is not geometrically closed.
toLogicallyOpen
Section titled “toLogicallyOpen”bool RPolyline::toLogicallyOpen()Converts this logically closed polyline to a locically open, geometrically closed polyline.
An additional node is inserted to make sure start == end.
Returns: True on success, false if this polyline is not locically closed.
toPainterPath
Section titled “toPainterPath”RPainterPath RPolyline::toPainterPath(bool addOriginalShapes=false) constconst
Returns: A QPainterPath object that represents this polyline.
trimEndPoint
Section titled “trimEndPoint”virtual bool RPolyline::trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)virtual
Parameters:
trimPoint: Trim start point or end point to this coordinate.clickPoint: Point that was clicked by user.extend: True if the shape is to be extended. Used for polylines to determine that the last segment has to be trimmed even if another segment was clicked.
Reimplemented from trimEndPoint.
Reimplemented in trimEndPoint.
trimEndPoint
Section titled “trimEndPoint”virtual bool RPolyline::trimEndPoint(double trimDist)virtual
Reimplemented from trimEndPoint.
trimStartPoint
Section titled “trimStartPoint”virtual bool RPolyline::trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)virtual
Parameters:
trimPoint: Trim start point or end point to this coordinate.clickPoint: Point that was clicked by user.extend: True if the shape is to be extended. Used for polylines to determine that the first segment has to be trimmed even if another segment was clicked.
Reimplemented from trimStartPoint.
Reimplemented in trimStartPoint.
trimStartPoint
Section titled “trimStartPoint”virtual bool RPolyline::trimStartPoint(double trimDist)virtual
Reimplemented from trimStartPoint.
verifyTangency
Section titled “verifyTangency”QList< RVector > RPolyline::verifyTangency(double toleranceMin=RS::AngleTolerance, double toleranceMax=M_PI_4)Verifies the tangency of this polyline.
getPolylineProxy
Section titled “getPolylineProxy”static RPolylineProxy * RPolyline::getPolylineProxy()static inline
Non-Scriptable: This function is not available in script environments.
hasProxy
Section titled “hasProxy”static bool RPolyline::hasProxy()static inline
isStraight
Section titled “isStraight”static bool RPolyline::isStraight(double bulge)static
Returns: True if the given bulge indicates a straight line segment (i.e. is 0.0).
setPolylineProxy
Section titled “setPolylineProxy”static void RPolyline::setPolylineProxy(RPolylineProxy *p)static inline
Non-Scriptable: This function is not available in script environments.
isLineSegment
Section titled “isLineSegment”bool RPolyline::isLineSegment(int i) constconst protected
Returns: True if the segment at the given position is a line.
virtual void RPolyline::print(QDebug dbg) constvirtual const protected
Reimplemented from print.
bulges
Section titled “bulges”QList<double> RPolyline::bulgesprotected
closed
Section titled “closed”bool RPolyline::closedprotected
Getter function for this property: isClosed.
Setter function for this property: setClosed
endWidths
Section titled “endWidths”QList<double> RPolyline::endWidthsprotected
startWidths
Section titled “startWidths”QList<double> RPolyline::startWidthsprotected
vertices
Section titled “vertices”QList<RVector> RPolyline::verticesprotected
Getter function for this property: getVertices.
Setter function for this property: setVertices
polylineProxy
Section titled “polylineProxy”static RPolylineProxy * RPolyline::polylineProxy = NULLstatic private
All rights reserved.
This file is part of the QCAD project.
QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with QCAD.