RArcData
Class in Entity Module
Header: #include <src/entity/RArcData.h>
Inherits: REntityData, RArc
Description
Section titled “Description”Stores and manages all data that defines the geometry and appearance of an arc 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”RArcData() |
|
RArcData(const RArc &arc) |
|
RArcData(const RVector ¢er, double radius, double startAngle, double endAngle, bool reversed=false) |
|
| RPolyline | approximateWithLines(double segmentLength) |
| virtual RShape * | castToShape() |
| virtual bool | flipHorizontal() |
| virtual bool | flipVertical() |
| double | getAngleLength(bool allowForZeroLength=false) const |
| RArc | getArc() |
| virtual QList< RVector > | getArcReferencePoints(const RBox &queryBox=RDEFAULT_RBOX) const |
| virtual RBox | getBoundingBox(bool ignoreEmpty=false) const |
| double | getBulge() const |
| RVector | getCenter() 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 | getEndAngle() const |
| virtual QList< RVector > | getEndPoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const |
| virtual QList< RVector > | getIntersectionPoints(const REntityData &other, bool limited=true, bool same=false, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true, QList< QPair< RObject::Id, RObject::Id > > *entityIds=NULL) const |
| virtual QList< RVector > | getIntersectionPoints(const RShape &shape, bool limited=true, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true) const |
| virtual double | getLength() const |
| virtual QList< RVector > | getMiddlePoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const |
| virtual QList< RVector > | getPointsWithDistanceToEnd(double distance, int from=RS::FromAny, const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const |
| double | getRadius() const |
| virtual QList< RRefPoint > | getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const |
| virtual QList< QSharedPointer< RShape > > | getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false, QList< RObject::Id > *entityIds=NULL) const |
| double | getStartAngle() const |
| virtual RS::Ending | getTrimEnd(const RVector &trimPoint, const RVector &clickPoint) |
| virtual RS::EntityType | getType() const |
| virtual RVector | getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const |
| virtual bool | intersectsWith(const RShape &shape) const |
| bool | isReversed() 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. |
| virtual bool | reverse()Reverses the arc direction by swapping start/end angles and toggling the reversed flag. |
| virtual bool | rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR) |
| virtual bool | scale(const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR) |
| virtual void | setZ(double z) |
| 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() |
| virtual bool | trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)Trims the end of the arc to the angle corresponding to trimPoint. |
| virtual bool | trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)Trims the start of the arc to the angle corresponding to trimPoint. |
Protected Functions
Section titled “Protected Functions”RArcData(RDocument *document, const RArcData &data) |
Friends
Section titled “Friends”| class | RArcEntity |
Member Documentation
Section titled “Member Documentation”RArcData
Section titled “RArcData”RArcData::RArcData()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.
RArcData
Section titled “RArcData”RArcData::RArcData(const RArc &arc)RArcData
Section titled “RArcData”RArcData::RArcData(const RVector ¢er, double radius, double startAngle, double endAngle, bool reversed=false)approximateWithLines
Section titled “approximateWithLines”RPolyline RArcData::approximateWithLines(double segmentLength)inline
castToShape
Section titled “castToShape”virtual RShape * RArcData::castToShape()virtual inline
Reimplemented from castToShape.
flipHorizontal
Section titled “flipHorizontal”virtual bool RArcData::flipHorizontal()virtual inline
Reimplemented from flipHorizontal.
flipVertical
Section titled “flipVertical”virtual bool RArcData::flipVertical()virtual inline
Reimplemented from flipVertical.
getAngleLength
Section titled “getAngleLength”double RArcData::getAngleLength(bool allowForZeroLength=false) constinline const
getArc
Section titled “getArc”RArc RArcData::getArc()inline
getArcReferencePoints
Section titled “getArcReferencePoints”virtual QList< RVector > RArcData::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 RArcData::getBoundingBox(bool ignoreEmpty=false) constvirtual inline const
Returns: The bounding box that contains this entity.
Reimplemented from getBoundingBox.
getBulge
Section titled “getBulge”double RArcData::getBulge() constinline const
getCenter
Section titled “getCenter”RVector RArcData::getCenter() constinline const
getCenterPoints
Section titled “getCenterPoints”virtual QList< RVector > RArcData::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 RArcData::getDirection1() constvirtual inline const
Returns: Tangent direction at the start point (in rad): perpendicular to the radius, pointing in the direction of travel.
Reimplemented from getDirection1.
getDirection2
Section titled “getDirection2”virtual double RArcData::getDirection2() constvirtual inline const
Returns: Tangent direction at the end point (in rad), pointing away from the arc.
Reimplemented from getDirection2.
getDistanceTo
Section titled “getDistanceTo”virtual double RArcData::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.
getEndAngle
Section titled “getEndAngle”double RArcData::getEndAngle() constinline const
getEndPoints
Section titled “getEndPoints”virtual QList< RVector > RArcData::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.
getIntersectionPoints
Section titled “getIntersectionPoints”virtual QList< RVector > RArcData::getIntersectionPoints(const REntityData &other, bool limited=true, bool same=false, const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=true, QList< QPair< RObject::Id, RObject::Id > > *entityIds=NULL) constvirtual inline 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.
Reimplemented from getIntersectionPoints.
getIntersectionPoints
Section titled “getIntersectionPoints”virtual QList< RVector > RArcData::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.
getLength
Section titled “getLength”virtual double RArcData::getLength() constvirtual inline const
Returns: Arc length (angle length * radius).
Reimplemented from getLength.
getMiddlePoints
Section titled “getMiddlePoints”virtual QList< RVector > RArcData::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.
getPointsWithDistanceToEnd
Section titled “getPointsWithDistanceToEnd”virtual QList< RVector > RArcData::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.
getRadius
Section titled “getRadius”double RArcData::getRadius() constinline const
getReferencePoints
Section titled “getReferencePoints”virtual QList< RRefPoint > RArcData::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.
getShapes
Section titled “getShapes”virtual QList< QSharedPointer< RShape > > RArcData::getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false, QList< RObject::Id > *entityIds=NULL) constvirtual inline 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.
getStartAngle
Section titled “getStartAngle”double RArcData::getStartAngle() constinline const
getTrimEnd
Section titled “getTrimEnd”virtual RS::Ending RArcData::getTrimEnd(const RVector &trimPoint, const RVector &clickPoint)virtual inline
Returns: Which end of the arc is closer to clickPoint relative to trimPoint. Used to decide which end to trim when the user clicks near a trim point.
Reimplemented from getTrimEnd.
getType
Section titled “getType”virtual RS::EntityType RArcData::getType() constvirtual inline const
Reimplemented from getType.
getVectorTo
Section titled “getVectorTo”virtual RVector RArcData::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.
intersectsWith
Section titled “intersectsWith”virtual bool RArcData::intersectsWith(const RShape &shape) constvirtual inline const
Returns: True if this entity intersects with the given shape, false otherwise.
Reimplemented from intersectsWith.
isReversed
Section titled “isReversed”bool RArcData::isReversed() constinline const
isValid
Section titled “isValid”virtual bool RArcData::isValid() constvirtual inline const
Reimplemented from isValid.
mirror
Section titled “mirror”virtual bool RArcData::mirror(const RLine &axis)virtual inline
Reimplemented from mirror.
mirror
Section titled “mirror”virtual bool RArcData::mirror(const RVector &axis1, const RVector &axis2)virtual inline
Reimplemented from mirror.
virtual bool RArcData::move(const RVector &offset)virtual inline
Moves this entity by the given offset.
Reimplemented from move.
moveReferencePoint
Section titled “moveReferencePoint”virtual bool RArcData::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.
reverse
Section titled “reverse”virtual bool RArcData::reverse()virtual inline
Reverses the arc direction by swapping start/end angles and toggling the reversed flag.
Reimplemented from reverse.
rotate
Section titled “rotate”virtual bool RArcData::rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR)virtual inline
Reimplemented from rotate.
virtual bool RArcData::scale(const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR)virtual inline
Reimplemented from scale.
virtual void RArcData::setZ(double z)virtual inline
Reimplemented from setZ.
stretch
Section titled “stretch”virtual bool RArcData::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 RArcData::to2D()virtual inline
Reimplemented from to2D.
trimEndPoint
Section titled “trimEndPoint”virtual bool RArcData::trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)virtual inline
Trims the end of the arc to the angle corresponding to trimPoint.
Reimplemented from trimEndPoint.
trimStartPoint
Section titled “trimStartPoint”virtual bool RArcData::trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)virtual inline
Trims the start of the arc to the angle corresponding to trimPoint.
Reimplemented from trimStartPoint.
RArcData
Section titled “RArcData”RArcData::RArcData(RDocument *document, const RArcData &data)protected
RArcEntity
Section titled “RArcEntity”friend class RArcEntityprivate