RPolylineData
Class in Entity Module
Header: #include <src/entity/RPolylineData.h>
Inherits: REntityData, RPolyline
Inherited by: RWipeoutData
Description
Section titled “Description”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.
Public Functions
Section titled “Public Functions”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 ¢er=RDEFAULT_RVECTOR) |
| RPolyline | roundAllCorners(double radius, bool inverted=false) |
| virtual bool | scale(const RVector &scaleFactors, const RVector ¢er=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) |
Protected Functions
Section titled “Protected Functions”RPolylineData(RDocument *document, const RPolylineData &data) |
Protected Attributes
Section titled “Protected Attributes”| bool | polylineGen |
Friends
Section titled “Friends”| class | RPolylineEntity |
Member Documentation
Section titled “Member Documentation”RPolylineData
Section titled “RPolylineData”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
Section titled “RPolylineData”RPolylineData::RPolylineData(const RPolyline &polyline)RPolylineData
Section titled “RPolylineData”RPolylineData::RPolylineData(RDocument *document)Non-Scriptable: This function is not available in script environments.
appendVertex
Section titled “appendVertex”void RPolylineData::appendVertex(const RVector &vertex, double bulge=0.0, double w1=0.0, double w2=0.0)inline
autoClose
Section titled “autoClose”bool RPolylineData::autoClose()inline
castToShape
Section titled “castToShape”virtual RShape * RPolylineData::castToShape()virtual inline
Reimplemented from castToShape.
void RPolylineData::clear()inline
countSegments
Section titled “countSegments”int RPolylineData::countSegments() constinline const
flipHorizontal
Section titled “flipHorizontal”virtual bool RPolylineData::flipHorizontal()virtual inline
Reimplemented from flipHorizontal.
flipVertical
Section titled “flipVertical”virtual bool RPolylineData::flipVertical()virtual inline
Reimplemented from flipVertical.
getArcReferencePoints
Section titled “getArcReferencePoints”virtual QList< RVector > RPolylineData::getArcReferencePoints(const RBox &queryBox=RDEFAULT_RBOX) constvirtual inline const
Returns: Vector of reference points of this entity. Used for snap to reference points.
Reimplemented from getArcReferencePoints.
getBoundingBox
Section titled “getBoundingBox”virtual RBox RPolylineData::getBoundingBox(bool ignoreEmpty=false) constvirtual inline const
Returns: The bounding box that contains this entity.
Reimplemented from getBoundingBox.
getBoundingBoxes
Section titled “getBoundingBoxes”virtual QList< RBox > RPolylineData::getBoundingBoxes(bool ignoreEmpty=false) constvirtual 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.
getBulgeAt
Section titled “getBulgeAt”double RPolylineData::getBulgeAt(int i) constinline const
getCenterPoints
Section titled “getCenterPoints”virtual QList< RVector > RPolylineData::getCenterPoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) constvirtual inline const
Returns: Vector of center points of this entity. Used for snap to center points.
Reimplemented from getCenterPoints.
getDirection1
Section titled “getDirection1”virtual double RPolylineData::getDirection1() constvirtual inline const
Reimplemented from getDirection1.
getDirection2
Section titled “getDirection2”virtual double RPolylineData::getDirection2() constvirtual inline const
Reimplemented from getDirection2.
getDistanceTo
Section titled “getDistanceTo”virtual double RPolylineData::getDistanceTo(const RVector &point, bool limited=true, double range=0.0, bool draft=false, double strictRange=RMAXDOUBLE) constvirtual 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.
getElevation
Section titled “getElevation”double RPolylineData::getElevation() constconst
getEndPoint
Section titled “getEndPoint”virtual RVector RPolylineData::getEndPoint() constvirtual inline const
Reimplemented from getEndPoint.
getEndPoints
Section titled “getEndPoints”virtual QList< RVector > RPolylineData::getEndPoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) constvirtual inline const
Returns: Vector of end points of this entity. Used for snap to end points.
Reimplemented from getEndPoints.
getEndWidthAt
Section titled “getEndWidthAt”double RPolylineData::getEndWidthAt(int i) constinline const
getEndWidths
Section titled “getEndWidths”QList< double > RPolylineData::getEndWidths() constinline const
getExploded
Section titled “getExploded”virtual QList< QSharedPointer< RShape > > RPolylineData::getExploded(int segments=RDEFAULT_MIN1) constvirtual inline const
Returns: List of RLines and RArcs describing this polyline.
Reimplemented from getExploded.
getIntersectionPoints
Section titled “getIntersectionPoints”virtual QList< RVector > RPolylineData::getIntersectionPoints(const REntityData &other, bool limited=true, bool same=false, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true) constvirtual 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.
getIntersectionPoints
Section titled “getIntersectionPoints”virtual QList< RVector > RPolylineData::getIntersectionPoints(const RShape &shape, bool limited=true, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true) constvirtual inline const
Returns: Points on entity which are intersection points with the given shape.
Reimplemented from getIntersectionPoints.
getMiddlePoints
Section titled “getMiddlePoints”virtual QList< RVector > RPolylineData::getMiddlePoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) constvirtual inline const
Returns: Vector of middle points of this entity. Used for snap to middle points.
Reimplemented from getMiddlePoints.
getOrientation
Section titled “getOrientation”RS::Orientation RPolylineData::getOrientation(bool implicitelyClosed=false) constinline const
getPointsWithDistanceToEnd
Section titled “getPointsWithDistanceToEnd”virtual QList< RVector > RPolylineData::getPointsWithDistanceToEnd(double distance, int from=RS::FromAny, const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) constvirtual inline const
Returns: Points on entity with given distance to either endpoint. Used for snap to points with distance on entity.
Reimplemented from getPointsWithDistanceToEnd.
getPolylineGen
Section titled “getPolylineGen”bool RPolylineData::getPolylineGen() constinline const
getPolylineShape
Section titled “getPolylineShape”RPolyline RPolylineData::getPolylineShape() constinline const
getReferencePoints
Section titled “getReferencePoints”virtual QList< RRefPoint > RPolylineData::getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) constvirtual 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.
getSegmentAt
Section titled “getSegmentAt”QSharedPointer< RShape > RPolylineData::getSegmentAt(int i) constinline const
getShapes
Section titled “getShapes”virtual QList< QSharedPointer< RShape > > RPolylineData::getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false, QList< RObject::Id > *entityIds=NULL) constvirtual const
Returns: Shapes that represent the geometry of this entity.
Parameters:
queryBox: Limit returned shapes to query boxignoreComplex: Ignore complex shapes and explode those into simple shapessegment: Split up splines into spline segments
Reimplemented from getShapes.
getStartPoint
Section titled “getStartPoint”virtual RVector RPolylineData::getStartPoint() constvirtual inline const
Reimplemented from getStartPoint.
getStartWidthAt
Section titled “getStartWidthAt”double RPolylineData::getStartWidthAt(int i) constinline const
getStartWidths
Section titled “getStartWidths”QList< double > RPolylineData::getStartWidths() constinline const
getType
Section titled “getType”virtual RS::EntityType RPolylineData::getType() constvirtual inline const
Reimplemented from getType.
Reimplemented in getType.
getVectorTo
Section titled “getVectorTo”virtual RVector RPolylineData::getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) constvirtual inline const
Returns: The distance vector from this entity to the given point.
Parameters:
point: the point to which the distance was measuredlimited: 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.
getVertexAngle
Section titled “getVertexAngle”double RPolylineData::getVertexAngle(int i, RS::Orientation orientation=RS::UnknownOrientation) constinline const
getVertexAt
Section titled “getVertexAt”RVector RPolylineData::getVertexAt(int i) constinline const
getVertices
Section titled “getVertices”QList< RVector > RPolylineData::getVertices() constinline const
hasWidths
Section titled “hasWidths”bool RPolylineData::hasWidths() constinline const
insertVertex
Section titled “insertVertex”void RPolylineData::insertVertex(int index, const RVector &vertex)inline
intersectsWith
Section titled “intersectsWith”virtual bool RPolylineData::intersectsWith(const RShape &shape) constvirtual inline const
Returns: True if this entity intersects with the given shape, false otherwise.
Reimplemented from intersectsWith.
isClosed
Section titled “isClosed”bool RPolylineData::isClosed() constinline const
isGeometricallyClosed
Section titled “isGeometricallyClosed”bool RPolylineData::isGeometricallyClosed(double tolerance=RS::PointTolerance) constinline const
isValid
Section titled “isValid”virtual bool RPolylineData::isValid() constvirtual inline const
Reimplemented from isValid.
mirror
Section titled “mirror”virtual bool RPolylineData::mirror(const RLine &axis)virtual inline
Reimplemented from mirror.
mirror
Section titled “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.
moveReferencePoint
Section titled “moveReferencePoint”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.
normalize
Section titled “normalize”void RPolylineData::normalize(double tolerance=RS::PointTolerance)inline
prependVertex
Section titled “prependVertex”void RPolylineData::prependVertex(const RVector &vertex, double bulge=0.0, double w1=0.0, double w2=0.0)inline
relocateStartPoint
Section titled “relocateStartPoint”bool RPolylineData::relocateStartPoint(const RVector &p)inline
relocateStartPoint
Section titled “relocateStartPoint”bool RPolylineData::relocateStartPoint(double dist)inline
removeLastVertex
Section titled “removeLastVertex”void RPolylineData::removeLastVertex()inline
removeVertex
Section titled “removeVertex”void RPolylineData::removeVertex(int index)inline
reverse
Section titled “reverse”virtual bool RPolylineData::reverse()virtual inline
Reimplemented from reverse.
rotate
Section titled “rotate”virtual bool RPolylineData::rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR)virtual inline
Reimplemented from rotate.
roundAllCorners
Section titled “roundAllCorners”RPolyline RPolylineData::roundAllCorners(double radius, bool inverted=false)inline
virtual bool RPolylineData::scale(const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR)virtual inline
Reimplemented from scale.
setBulgeAt
Section titled “setBulgeAt”void RPolylineData::setBulgeAt(int i, double b)inline
setClosed
Section titled “setClosed”void RPolylineData::setClosed(bool on)inline
setElevation
Section titled “setElevation”void RPolylineData::setElevation(double v)setEndWidthAt
Section titled “setEndWidthAt”void RPolylineData::setEndWidthAt(int i, double w)inline
setEndWidths
Section titled “setEndWidths”void RPolylineData::setEndWidths(const QList< double > &ew)inline
setGlobalWidth
Section titled “setGlobalWidth”void RPolylineData::setGlobalWidth(double w)inline
setPolylineGen
Section titled “setPolylineGen”void RPolylineData::setPolylineGen(bool on)inline
setStartWidthAt
Section titled “setStartWidthAt”void RPolylineData::setStartWidthAt(int i, double w)inline
setStartWidths
Section titled “setStartWidths”void RPolylineData::setStartWidths(const QList< double > &sw)inline
setVertexAt
Section titled “setVertexAt”void RPolylineData::setVertexAt(int i, const RVector &v)inline
virtual void RPolylineData::setZ(double z)virtual inline
Reimplemented from setZ.
simplify
Section titled “simplify”void RPolylineData::simplify(double angleTolerance)inline
stretch
Section titled “stretch”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.
toLogicallyClosed
Section titled “toLogicallyClosed”bool RPolylineData::toLogicallyClosed(double tolerance=RS::PointTolerance)inline
toLogicallyOpen
Section titled “toLogicallyOpen”bool RPolylineData::toLogicallyOpen()inline
toPainterPath
Section titled “toPainterPath”RPainterPath RPolylineData::toPainterPath() constinline const
verifyTangency
Section titled “verifyTangency”QList< RVector > RPolylineData::verifyTangency(double toleranceMin=RS::AngleTolerance, double toleranceMax=M_PI_4)inline
RPolylineData
Section titled “RPolylineData”RPolylineData::RPolylineData(RDocument *document, const RPolylineData &data)protected
polylineGen
Section titled “polylineGen”bool RPolylineData::polylineGenprotected
RPolylineEntity
Section titled “RPolylineEntity”friend class RPolylineEntityprivate