Skip to content

RPolylineData

Class in Entity Module
Header: #include <src/entity/RPolylineData.h>
Inherits: REntityData, RPolyline
Inherited by: RWipeoutData

Stores and manages all data that defines the geometry and appearance of a polyline entity.

Scriptable: This class is available in script environments.

Copyable: Objects are cleaned up automatically by the garbage collector of the script engine.

RPolylineData()
RPolylineData(const RPolyline &polyline)
RPolylineData(RDocument *document)
void appendVertex(const RVector &vertex, double bulge=0.0, double w1=0.0, double w2=0.0)
bool autoClose()
virtual RShape * castToShape()
void clear()
int countSegments() const
virtual bool flipHorizontal()
virtual bool flipVertical()
virtual QList< RVector > getArcReferencePoints(const RBox &queryBox=RDEFAULT_RBOX) const
virtual RBox getBoundingBox(bool ignoreEmpty=false) const
virtual QList< RBox > getBoundingBoxes(bool ignoreEmpty=false) const
double getBulgeAt(int i) const
virtual QList< RVector > getCenterPoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const
virtual double getDirection1() const
virtual double getDirection2() const
virtual double getDistanceTo(const RVector &point, bool limited=true, double range=0.0, bool draft=false, double strictRange=RMAXDOUBLE) const
double getElevation() const
virtual RVector getEndPoint() const
virtual QList< RVector > getEndPoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const
double getEndWidthAt(int i) const
QList< double > getEndWidths() const
virtual QList< QSharedPointer< RShape > > getExploded(int segments=RDEFAULT_MIN1) const
virtual QList< RVector > getIntersectionPoints(const REntityData &other, bool limited=true, bool same=false, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true) const
virtual QList< RVector > getIntersectionPoints(const RShape &shape, bool limited=true, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true) const
virtual QList< RVector > getMiddlePoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const
RS::Orientation getOrientation(bool implicitelyClosed=false) const
virtual QList< RVector > getPointsWithDistanceToEnd(double distance, int from=RS::FromAny, const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const
bool getPolylineGen() const
RPolyline getPolylineShape() const
virtual QList< RRefPoint > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const
QSharedPointer< RShape > getSegmentAt(int i) const
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false, QList< RObject::Id > *entityIds=NULL) const
virtual RVector getStartPoint() const
double getStartWidthAt(int i) const
QList< double > getStartWidths() const
virtual RS::EntityType getType() const
virtual RVector getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const
double getVertexAngle(int i, RS::Orientation orientation=RS::UnknownOrientation) const
RVector getVertexAt(int i) const
QList< RVector > getVertices() const
bool hasWidths() const
void insertVertex(int index, const RVector &vertex)
virtual bool intersectsWith(const RShape &shape) const
bool isClosed() const
bool isGeometricallyClosed(double tolerance=RS::PointTolerance) const
virtual bool isValid() const
virtual bool mirror(const RLine &axis)
virtual bool mirror(const RVector &axis1, const RVector &axis2)
virtual bool move(const RVector &offset)
Moves this entity by the given offset.
virtual bool moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
Moves the given reference point to the given target point or does nothing if this entity has no reference point as the given location.
void normalize(double tolerance=RS::PointTolerance)
void prependVertex(const RVector &vertex, double bulge=0.0, double w1=0.0, double w2=0.0)
bool relocateStartPoint(const RVector &p)
bool relocateStartPoint(double dist)
void removeLastVertex()
void removeVertex(int index)
virtual bool reverse()
virtual bool rotate(double rotation, const RVector &center=RDEFAULT_RVECTOR)
RPolyline roundAllCorners(double radius, bool inverted=false)
virtual bool scale(const RVector &scaleFactors, const RVector &center=RDEFAULT_RVECTOR)
void setBulgeAt(int i, double b)
void setClosed(bool on)
void setElevation(double v)
void setEndWidthAt(int i, double w)
void setEndWidths(const QList< double > &ew)
void setGlobalWidth(double w)
void setPolylineGen(bool on)
void setStartWidthAt(int i, double w)
void setStartWidths(const QList< double > &sw)
void setVertexAt(int i, const RVector &v)
virtual void setZ(double z)
void simplify(double angleTolerance)
virtual bool stretch(const RPolyline &area, const RVector &offset)
Stretches the end points of this entity that are inside area by offset.
virtual void to2D()
bool toLogicallyClosed(double tolerance=RS::PointTolerance)
bool toLogicallyOpen()
RPainterPath toPainterPath() const
QList< RVector > verifyTangency(double toleranceMin=RS::AngleTolerance, double toleranceMax=M_PI_4)
RPolylineData(RDocument *document, const RPolylineData &data)
bool polylineGen
class RPolylineEntity

RPolylineData::RPolylineData()

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.

RPolylineData::RPolylineData(const RPolyline &polyline)

RPolylineData::RPolylineData(RDocument *document)

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

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

inline

bool RPolylineData::autoClose()

inline

virtual RShape * RPolylineData::castToShape()

virtual inline

Reimplemented from castToShape.

void RPolylineData::clear()

inline

int RPolylineData::countSegments() const

inline const

virtual bool RPolylineData::flipHorizontal()

virtual inline

Reimplemented from flipHorizontal.

virtual bool RPolylineData::flipVertical()

virtual inline

Reimplemented from flipVertical.

virtual QList< RVector > RPolylineData::getArcReferencePoints(const RBox &queryBox=RDEFAULT_RBOX) const

virtual inline const

Returns: Vector of reference points of this entity. Used for snap to reference points.

Reimplemented from getArcReferencePoints.

virtual RBox RPolylineData::getBoundingBox(bool ignoreEmpty=false) const

virtual inline const

Returns: The bounding box that contains this entity.

Reimplemented from getBoundingBox.

virtual QList< RBox > RPolylineData::getBoundingBoxes(bool ignoreEmpty=false) const

virtual const

Returns: List of bounding boxes that contain this entity. This is used for complex entities such as block references to further optimize algorithms that depend on bounding boxes (e.g. spatial index algorithms). The default implementation returns the bounding box that contains the whole entity.

Reimplemented from getBoundingBoxes.

Reimplemented in getBoundingBoxes.

double RPolylineData::getBulgeAt(int i) const

inline const

virtual QList< RVector > RPolylineData::getCenterPoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const

virtual inline const

Returns: Vector of center points of this entity. Used for snap to center points.

Reimplemented from getCenterPoints.

virtual double RPolylineData::getDirection1() const

virtual inline const

Reimplemented from getDirection1.

virtual double RPolylineData::getDirection2() const

virtual inline const

Reimplemented from getDirection2.

virtual double RPolylineData::getDistanceTo(const RVector &point, bool limited=true, double range=0.0, bool draft=false, double strictRange=RMAXDOUBLE) const

virtual inline const

Returns: The shortest distance from this entity to the given point.

Parameters:

  • limited: Limit lines, arcs at end points, otherwise the orthogonal distance to the unlimited line / circle is returned.
  • range: This is returned for solid filled entities (solid filled or dense hatches, text entities) if the point is on the entity and the distance would be zero.
  • draft: Calculate based on draft mode representation of the entity.
  • strictRange: If limited, this is the maximum range from either end point of the entity. Zero to only return distances that are strictly orthogonal to the entity.

Reimplemented from getDistanceTo.

Reimplemented in getDistanceTo.

double RPolylineData::getElevation() const

const

virtual RVector RPolylineData::getEndPoint() const

virtual inline const

Reimplemented from getEndPoint.

virtual QList< RVector > RPolylineData::getEndPoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const

virtual inline const

Returns: Vector of end points of this entity. Used for snap to end points.

Reimplemented from getEndPoints.

double RPolylineData::getEndWidthAt(int i) const

inline const

QList< double > RPolylineData::getEndWidths() const

inline const

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

virtual inline const

Returns: List of RLines and RArcs describing this polyline.

Reimplemented from getExploded.

virtual QList< RVector > RPolylineData::getIntersectionPoints(const REntityData &other, bool limited=true, bool same=false, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true) const

virtual const

Returns: Points on entity which are intersection points with the given other entity. If same is true, the two datas originate from the same entity.

virtual QList< RVector > RPolylineData::getIntersectionPoints(const RShape &shape, bool limited=true, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true) const

virtual inline const

Returns: Points on entity which are intersection points with the given shape.

Reimplemented from getIntersectionPoints.

virtual QList< RVector > RPolylineData::getMiddlePoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const

virtual inline const

Returns: Vector of middle points of this entity. Used for snap to middle points.

Reimplemented from getMiddlePoints.

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

inline const

virtual QList< RVector > RPolylineData::getPointsWithDistanceToEnd(double distance, int from=RS::FromAny, const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const

virtual inline const

Returns: Points on entity with given distance to either endpoint. Used for snap to points with distance on entity.

Reimplemented from getPointsWithDistanceToEnd.

bool RPolylineData::getPolylineGen() const

inline const

RPolyline RPolylineData::getPolylineShape() const

inline const

virtual QList< RRefPoint > RPolylineData::getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const

virtual const

Returns: Vector of reference points of this entity. Reference points can usually be moved around by the user to change the geometry of the entity.

Reimplemented from getReferencePoints.

Reimplemented in getReferencePoints.

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

inline const

virtual QList< QSharedPointer< RShape > > RPolylineData::getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false, QList< RObject::Id > *entityIds=NULL) const

virtual const

Returns: Shapes that represent the geometry of this entity.

Parameters:

  • queryBox: Limit returned shapes to query box
  • ignoreComplex: Ignore complex shapes and explode those into simple shapes
  • segment: Split up splines into spline segments

Reimplemented from getShapes.

virtual RVector RPolylineData::getStartPoint() const

virtual inline const

Reimplemented from getStartPoint.

double RPolylineData::getStartWidthAt(int i) const

inline const

QList< double > RPolylineData::getStartWidths() const

inline const

virtual RS::EntityType RPolylineData::getType() const

virtual inline const

Reimplemented from getType.

Reimplemented in getType.

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

virtual inline const

Returns: The distance vector from this entity to the given point.

Parameters:

  • point: the point to which the distance was measured
  • limited: If true, an invalid vector is returned if the closest point on the entity is outside of the entity (e.g. in the extension line of a line or outside the start / end angle of an arc).

Reimplemented from getVectorTo.

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

inline const

RVector RPolylineData::getVertexAt(int i) const

inline const

QList< RVector > RPolylineData::getVertices() const

inline const

bool RPolylineData::hasWidths() const

inline const

void RPolylineData::insertVertex(int index, const RVector &vertex)

inline

virtual bool RPolylineData::intersectsWith(const RShape &shape) const

virtual inline const

Returns: True if this entity intersects with the given shape, false otherwise.

Reimplemented from intersectsWith.

bool RPolylineData::isClosed() const

inline const

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

inline const

virtual bool RPolylineData::isValid() const

virtual inline const

Reimplemented from isValid.

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

virtual inline

Reimplemented from mirror.

virtual bool RPolylineData::mirror(const RVector &axis1, const RVector &axis2)

virtual inline

Reimplemented from mirror.

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

virtual inline

Moves this entity by the given offset.

Reimplemented from move.

virtual bool RPolylineData::moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint, Qt::KeyboardModifiers modifiers=Qt::NoModifier)

virtual

Moves the given reference point to the given target point or does nothing if this entity has no reference point as the given location.

Returns: True if a reference point has been moved successfully, false otherwise.

Reimplemented from moveReferencePoint.

Reimplemented in moveReferencePoint.

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

inline

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

inline

bool RPolylineData::relocateStartPoint(const RVector &p)

inline

bool RPolylineData::relocateStartPoint(double dist)

inline

void RPolylineData::removeLastVertex()

inline

void RPolylineData::removeVertex(int index)

inline

virtual bool RPolylineData::reverse()

virtual inline

Reimplemented from reverse.

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

virtual inline

Reimplemented from rotate.

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

inline

virtual bool RPolylineData::scale(const RVector &scaleFactors, const RVector &center=RDEFAULT_RVECTOR)

virtual inline

Reimplemented from scale.

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

inline

void RPolylineData::setClosed(bool on)

inline

void RPolylineData::setElevation(double v)

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

inline

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

inline

void RPolylineData::setGlobalWidth(double w)

inline

void RPolylineData::setPolylineGen(bool on)

inline

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

inline

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

inline

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

inline

virtual void RPolylineData::setZ(double z)

virtual inline

Reimplemented from setZ.

void RPolylineData::simplify(double angleTolerance)

inline

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

virtual inline

Stretches the end points of this entity that are inside area by offset.

Reimplemented from stretch.

virtual void RPolylineData::to2D()

virtual inline

Reimplemented from to2D.

bool RPolylineData::toLogicallyClosed(double tolerance=RS::PointTolerance)

inline

bool RPolylineData::toLogicallyOpen()

inline

RPainterPath RPolylineData::toPainterPath() const

inline const

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

inline

RPolylineData::RPolylineData(RDocument *document, const RPolylineData &data)

protected

bool RPolylineData::polylineGen

protected

friend class RPolylineEntity

private