Skip to content

RPolyline

Class in Math Module
Header: #include <src/core/math/RPolyline.h>
Inherits: RShape, RExplodable
Inherited by: RLeaderData, RPolylineData, RSolidData

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.

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) const
Checks if the given point is inside this closed polygon.
bool containsShape(const RShape &shape) const
Checks 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() const
Reimplement 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) const
Modifies (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 &center=RDEFAULT_RVECTOR)
RPolyline roundAllCorners(double radius, bool inverted=false) const
Rounds all corners of this polyline with the given radius.
virtual bool scale(const RVector &scaleFactors, const RVector &center=RDEFAULT_RVECTOR)
virtual bool scale(double scaleFactor, const RVector &center=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() const
Splits 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 RPolylineProxy * getPolylineProxy()
static bool hasProxy()
static bool isStraight(double bulge)
static void setPolylineProxy(RPolylineProxy *p)
bool isLineSegment(int i) const
virtual void print(QDebug dbg) const
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 RPolylineProxy * polylineProxy

RPolyline::RPolyline()

Creates a polyline object without points.

RPolyline::RPolyline(const QList< QSharedPointer< RShape > > &segments)

Creates a polyline from segments (lines or arcs).

RPolyline::RPolyline(const QList< RVector > &vertices, bool closed)

Creates a polyline object with the given points.

virtual RPolyline::~RPolyline()

virtual

bool RPolyline::appendShape(const RShape &shape, bool prepend=false)

bool RPolyline::appendShapeAuto(const RShape &shape)

Appends the given shape to this polyline.

The shape is reversed if necessary.

bool RPolyline::appendShapeTrim(const RShape &shape)

void RPolyline::appendVertex(const RVector &vertex, double bulge=0.0, double w1=0.0, double w2=0.0)

void RPolyline::appendVertex(double x, double y, double bulge=0.0, double w1=0.0, double w2=0.0)

bool RPolyline::autoClose(double tolerance=RS::PointTolerance)

inline

void RPolyline::clear()

virtual QSharedPointer< RShape > RPolyline::clone() const

virtual inline const

Reimplemented from clone.

QSharedPointer< RPolyline > RPolyline::cloneToPolyline() const

inline const

bool RPolyline::closeTrim()

virtual bool RPolyline::contains(const RVector &point, bool borderIsInside=false, double tolerance=RS::PointTolerance) const

virtual 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.

bool RPolyline::containsShape(const RShape &shape) const

const

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.

RPolyline RPolyline::convertArcToLineSegments(int segments) const

const

RPolyline RPolyline::convertArcToLineSegmentsLength(double segmentLength) const

const

bool RPolyline::convertToClosed()

bool RPolyline::convertToOpen()

int RPolyline::countSegments() const

const

Returns: Number of segments. The number of segments equals the number of vertices for a closed polyline and one less for an open polyline.

int RPolyline::countVertices() const

const

virtual double RPolyline::getAngleAt(double distance, RS::From from=RS::FromStart) const

virtual const

Returns: Angle on the entity at the given distance from the start point.

Reimplemented from getAngleAt.

double RPolyline::getArea() const

const

Returns: Area of (implicitly closed) polyline.

double RPolyline::getBaseAngle() const

const

virtual QList< bool > RPolyline::getBoolProperties() const

virtual const

Reimplemented from getBoolProperties.

virtual RBox RPolyline::getBoundingBox() const

virtual const

Returns: The bounding box of this shape.

Reimplemented from getBoundingBox.

double RPolyline::getBulgeAt(int i) const

const

QList< double > RPolyline::getBulges() const

const

virtual QList< RVector > RPolyline::getCenterPoints() const

virtual const

Returns: The center point(s) of this shape.

Reimplemented from getCenterPoints.

RVector RPolyline::getCentroid() const

const

Returns: Centroid of this polygon or invalid if polyline contains arc segments. The polyline is implicitely considered to be closed.

int RPolyline::getClosestSegment(const RVector &point) const

const

int RPolyline::getClosestVertex(const RVector &point) const

const

QList< RVector > RPolyline::getConcaveVertices() const

const

QList< RVector > RPolyline::getConvexVertices(bool convex=true) const

const

virtual double RPolyline::getDirection1() const

virtual const

Reimplemented from getDirection1.

Reimplemented in getDirection1, getDirection1.

virtual double RPolyline::getDirection2() const

virtual const

Reimplemented from getDirection2.

Reimplemented in getDirection2, getDirection2.

virtual double RPolyline::getDistanceFromStart(const RVector &p) const

virtual 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.

virtual QList< double > RPolyline::getDistancesFromStart(const RVector &p) const

virtual 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.

virtual double RPolyline::getDistanceTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const

virtual const

Returns: Shortest distance from this shape to the given point. Based on getVectorTo.

Reimplemented from getDistanceTo.

virtual QList< double > RPolyline::getDoubleProperties() const

virtual const

Reimplemented from getDoubleProperties.

virtual RVector RPolyline::getEndPoint() const

virtual const

Reimplemented from getEndPoint.

Reimplemented in getEndPoint, getEndPoint, getEndPoint.

virtual QList< RVector > RPolyline::getEndPoints() const

virtual const

Returns: The end point(s) of this shape.

Reimplemented from getEndPoints.

double RPolyline::getEndWidthAt(int i) const

const

QList< double > RPolyline::getEndWidths() const

const

virtual QList< QSharedPointer< RShape > > RPolyline::getExploded(int segments=RDEFAULT_MIN1) const

virtual const

Returns: List of RLines and RArcs describing this polyline.

Reimplemented from getExploded.

Reimplemented in getExploded, getExploded.

QSharedPointer< RShape > RPolyline::getFirstSegment() const

const

double RPolyline::getHeight() const

const

QSharedPointer< RShape > RPolyline::getLastSegment() const

const

RVector RPolyline::getLastVertex() const

const

QList< RPolyline > RPolyline::getLeftOutline() const

inline const

QList< QPair< RPolyline, RPolyline > > RPolyline::getLeftRightOutline() const

const

virtual double RPolyline::getLength() const

virtual const

Returns: The total length of this shape if applicable or NaN if not.

Reimplemented from getLength.

double RPolyline::getLengthTo(const RVector &p, bool limited=true) const

const

Returns: Length along polyline from start point to given point p or the closest point to p on the polyline.

virtual RVector RPolyline::getMiddlePoint() const

virtual const

Reimplemented from getMiddlePoint.

virtual QList< RVector > RPolyline::getMiddlePoints() const

virtual const

Returns: The middle point(s) of this shape.

Reimplemented from getMiddlePoints.

RS::Orientation RPolyline::getOrientation(bool implicitelyClosed=false) const

const

QList< RPolyline > RPolyline::getOutline() const

const

virtual RVector RPolyline::getPointAtPercent(double p) const

virtual const

Returns: Point at given percentile.

Reimplemented from getPointAtPercent.

virtual QList< RVector > RPolyline::getPointCloud(double segmentLength) const

virtual const

Reimplemented from getPointCloud.

RVector RPolyline::getPointInside() const

const

Returns: Any point that is inside this polyline.

virtual QList< RVector > RPolyline::getPointsWithDistanceToEnd(double distance, int from=RS::FromAny) const

virtual const

Returns: All points on this shape with the given distance to an endpoint.

Reimplemented from getPointsWithDistanceToEnd.

RPolyline RPolyline::getPolygon(double segmentLength) const

const

RPolyline RPolyline::getPolygonHull(double angle, double tolerance, bool inner=false) const

const

virtual RPolyline RPolyline::getReversed() const

virtual const

QList< RPolyline > RPolyline::getRightOutline() const

inline const

QSharedPointer< RShape > RPolyline::getSegmentAt(int i) const

const

Returns: Shape of segment at given position.

int RPolyline::getSegmentAtDist(double dist)

QList< QSharedPointer< RShape > > RPolyline::getSegments() const

const

double RPolyline::getSegmentsLength(int fromIndex, int toIndex) const

const

Returns: Length of all segments from first index (fromIndex) to last index (toIndex), excluding toIndex.

virtual QList< RVector > RPolyline::getSelfIntersectionPoints(double tolerance=RS::PointTolerance) const

virtual const

Reimplemented from getSelfIntersectionPoints.

virtual RShape::Type RPolyline::getShapeType() const

virtual inline const

Reimplemented from getShapeType.

virtual RS::Side RPolyline::getSideOfPoint(const RVector &point) const

virtual const

Reimplemented from getSideOfPoint.

virtual RVector RPolyline::getStartPoint() const

virtual const

Reimplemented from getStartPoint.

Reimplemented in getStartPoint, getStartPoint, getStartPoint.

double RPolyline::getStartWidthAt(int i) const

const

QList< double > RPolyline::getStartWidths() const

const

virtual QSharedPointer< RShape > RPolyline::getTransformed(const QTransform &transform) const

virtual const

Reimplemented from getTransformed.

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.

virtual QList< RVector > RPolyline::getVectorProperties() const

virtual const

Reimplemented from getVectorProperties.

virtual RVector RPolyline::getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const

virtual const

Returns: Shortest vector from this shape to the given point.

Parameters:

  • point: the given point
  • limited: 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.

double RPolyline::getVertexAngle(int i, RS::Orientation orientation=RS::UnknownOrientation) const

const

QList< double > RPolyline::getVertexAngles() const

const

RVector RPolyline::getVertexAt(int i) const

const

int RPolyline::getVertexIndex(const RVector &v, double tolerance=RS::PointTolerance) const

const

QList< RVector > RPolyline::getVertices() const

const

double RPolyline::getWidth() const

const

bool RPolyline::hasArcSegments() const

const

bool RPolyline::hasWidths() const

const

void RPolyline::insertVertex(int index, const RVector &vertex, double bulgeBefore=0.0, double bulgeAfter=0.0)

void RPolyline::insertVertexAt(const RVector &point)

Inserts a vertex at the point on the polyline closest to the given position.

RVector RPolyline::insertVertexAtDistance(double dist)

bool RPolyline::insertVerticesAtSelfIntersections()

bool RPolyline::isArcSegmentAt(int i) const

const

bool RPolyline::isClosed() const

const

Returns: True if this polyline is logically marked as closed.

bool RPolyline::isConcave() const

const

virtual bool RPolyline::isDirected() const

virtual inline const

Reimplemented from isDirected.

bool RPolyline::isEmpty() const

inline const

bool RPolyline::isFlat() const

const

bool RPolyline::isGeometricallyClosed(double tolerance=RS::PointTolerance) const

const

Returns: True is this polyline is geometrically closed. If this polyline is logically closed it is implicitly also geometrically closed.

virtual bool RPolyline::isInterpolated() const

virtual 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.

virtual bool RPolyline::mirror(const RLine &axis)

virtual

Reimplemented from mirror.

Reimplemented in mirror, mirror, mirror.

RPolyline RPolyline::modifyPolylineCorner(const RShape &trimmedShape1, RS::Ending ending1, int segmentIndex1, const RShape &trimmedShape2, RS::Ending ending2, int segmentIndex2, const RShape *cornerShape=NULL) const

const

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) const

const

virtual bool RPolyline::move(const RVector &offset)

virtual

Reimplemented from move.

Reimplemented in move, move, move.

void RPolyline::moveEndPoint(const RVector &pos)

void RPolyline::moveSegmentAt(int i, const RVector &offset)

void RPolyline::moveStartPoint(const RVector &pos)

void RPolyline::moveVertexAt(int i, const RVector &offset)

void RPolyline::normalize(double tolerance=RS::PointTolerance)

Removes duplicate vertices.

bool RPolyline::prependShape(const RShape &shape)

void RPolyline::prependVertex(const RVector &vertex, double bulge=0.0, double w1=0.0, double w2=0.0)

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.

bool RPolyline::relocateStartPoint(double dist)

void RPolyline::removeFirstVertex()

void RPolyline::removeLastVertex()

void RPolyline::removeVertex(int index)

void RPolyline::removeVerticesAfter(int index)

void RPolyline::removeVerticesBefore(int index)

virtual bool RPolyline::reverse()

virtual

Reimplemented from reverse.

Reimplemented in reverse, reverse, reverse.

virtual bool RPolyline::rotate(double rotation, const RVector &center=RDEFAULT_RVECTOR)

virtual

Reimplemented from rotate.

Reimplemented in rotate, rotate, rotate.

RPolyline RPolyline::roundAllCorners(double radius, bool inverted=false) const

const

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 &center=RDEFAULT_RVECTOR)

virtual

Reimplemented from scale.

Reimplemented in scale, scale, scale.

virtual bool RPolyline::scale(double scaleFactor, const RVector &center=RDEFAULT_RVECTOR)

virtual

Reimplemented from scale.

void RPolyline::setBulgeAt(int i, double b)

void RPolyline::setBulges(const QList< double > &b)

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.

void RPolyline::setEndWidthAt(int i, double w)

void RPolyline::setEndWidths(const QList< double > &ew)

void RPolyline::setGlobalWidth(double w)

bool RPolyline::setHeight(double v)

void RPolyline::setMinimumWidth(double w)

bool RPolyline::setOrientation(RS::Orientation orientation)

void RPolyline::setStartWidthAt(int i, double w)

void RPolyline::setStartWidths(const QList< double > &sw)

void RPolyline::setVertexAt(int i, const RVector &v)

void RPolyline::setVertices(const QList< RVector > &vertices)

bool RPolyline::setWidth(double v)

virtual void RPolyline::setZ(double z)

virtual

Reimplemented from setZ.

Reimplemented in setZ, setZ, setZ.

bool RPolyline::simplify(double tolerance=RS::PointTolerance)

Simplify by attempting to skip nodes within given tolerance.

Returns: True if nodes have been skipped.

QList< RPolyline > RPolyline::splitAtDiscontinuities(double tolerance) const

const

QList< RPolyline > RPolyline::splitAtSegmentTypeChange() const

const

Splits the polyline into polylines with exclusively line or arc segments.

RPolyline RPolyline::splitMajorArcs() const

const

virtual bool RPolyline::stretch(const RPolyline &area, const RVector &offset)

virtual

Reimplemented from stretch.

Reimplemented in stretch, stretch, stretch.

void RPolyline::stripWidths()

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.

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.

RPainterPath RPolyline::toPainterPath(bool addOriginalShapes=false) const

const

Returns: A QPainterPath object that represents this polyline.

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.

virtual bool RPolyline::trimEndPoint(double trimDist)

virtual

Reimplemented from trimEndPoint.

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.

virtual bool RPolyline::trimStartPoint(double trimDist)

virtual

Reimplemented from trimStartPoint.

QList< RVector > RPolyline::verifyTangency(double toleranceMin=RS::AngleTolerance, double toleranceMax=M_PI_4)

Verifies the tangency of this polyline.

static RPolylineProxy * RPolyline::getPolylineProxy()

static inline

Non-Scriptable: This function is not available in script environments.

static bool RPolyline::hasProxy()

static inline

static bool RPolyline::isStraight(double bulge)

static

Returns: True if the given bulge indicates a straight line segment (i.e. is 0.0).

static void RPolyline::setPolylineProxy(RPolylineProxy *p)

static inline

Non-Scriptable: This function is not available in script environments.

bool RPolyline::isLineSegment(int i) const

const protected

Returns: True if the segment at the given position is a line.

virtual void RPolyline::print(QDebug dbg) const

virtual const protected

Reimplemented from print.

QList<double> RPolyline::bulges

protected

bool RPolyline::closed

protected

Getter function for this property: isClosed.

Setter function for this property: setClosed

QList<double> RPolyline::endWidths

protected

QList<double> RPolyline::startWidths

protected

QList<RVector> RPolyline::vertices

protected

Getter function for this property: getVertices.

Setter function for this property: setVertices

static RPolylineProxy * RPolyline::polylineProxy = NULL

static 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.