RLeaderData
Class in Entity Module
Header: #include <src/entity/RLeaderData.h>
Inherits: REntityData, RPolyline
Description
Section titled “Description”Leader entity data class.
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”RLeaderData() |
|
RLeaderData(const RPolyline &polyline, bool arrowHead) |
|
| void | appendVertex(const RVector &vertex) |
| bool | canHaveArrowHead() const |
| virtual RShape * | castToShape() |
| void | clearStyleOverrides() |
| int | countSegments() const |
| int | countVertices() const |
| virtual bool | flipHorizontal() |
| virtual bool | flipVertical() |
| virtual QList< RVector > | getArcReferencePoints(const RBox &queryBox=RDEFAULT_RBOX) const |
| RTriangle | getArrowShape() const |
| virtual RBox | getBoundingBox(bool ignoreEmpty=false) const |
| virtual QList< RVector > | getCenterPoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) const |
| double | getDimasz(bool scale=true) const |
| RObject::Id | getDimLeaderBlockId() const |
| double | getDimscale() const |
| virtual double | getDistanceTo(const RVector &point, bool limited=true, double range=0.0, bool draft=false, double strictRange=RMAXDOUBLE) const |
| virtual RVector | getEndPoint() const |
| virtual QList< RVector > | getEndPoints(const RBox &queryBox=RDEFAULT_RBOX, QList< RObject::Id > *subEntityIds=NULL) 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, 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 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 |
| 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 |
| virtual RVector | getStartPoint() const |
| virtual RS::EntityType | getType() const |
| virtual RVector | getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const |
| bool | hasArrowHead() const |
| virtual bool | intersectsWith(const RShape &shape) const |
| bool | isSplineShaped() 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() |
| virtual bool | rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR) |
| virtual bool | scale(const RVector &scaleFactors, const RVector ¢er) |
| virtual void | scaleVisualProperties(double scaleFactor) |
| void | setArrowHead(bool on) |
| void | setDimasz(double v) |
| void | setDimLeaderBlockId(RObject::Id id) |
| void | setDimscale(double f) |
| void | setSplineShaped(bool on) |
| 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 void | update() constEntities can reimplement this function to invalidate any internal cache (mark the entity as dirty). |
| bool | updateArrowHead() const |
Protected Functions
Section titled “Protected Functions”RLeaderData(RDocument *document, const RLeaderData &data) |
Private Attributes
Section titled “Private Attributes”| bool | arrowHead Arrow head on / off. |
| double | dimasz Arrow size. |
| RObject::Id | dimLeaderBlockId Block to use instead of arrow. |
| double | dimscale Dimension scale. |
| bool | splineShaped Spline shaped leader. |
Friends
Section titled “Friends”| class | RLeaderEntity |
Member Documentation
Section titled “Member Documentation”RLeaderData
Section titled “RLeaderData”RLeaderData::RLeaderData()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.
RLeaderData
Section titled “RLeaderData”RLeaderData::RLeaderData(const RPolyline &polyline, bool arrowHead)appendVertex
Section titled “appendVertex”void RLeaderData::appendVertex(const RVector &vertex)inline
canHaveArrowHead
Section titled “canHaveArrowHead”bool RLeaderData::canHaveArrowHead() constconst
Returns: true if this leader can have an arrow head (i.e. first segment is >= DIMASZ * DIMSCALE * 2.
castToShape
Section titled “castToShape”virtual RShape * RLeaderData::castToShape()virtual inline
Reimplemented from castToShape.
clearStyleOverrides
Section titled “clearStyleOverrides”void RLeaderData::clearStyleOverrides()inline
countSegments
Section titled “countSegments”int RLeaderData::countSegments() constinline const
countVertices
Section titled “countVertices”int RLeaderData::countVertices() constinline const
flipHorizontal
Section titled “flipHorizontal”virtual bool RLeaderData::flipHorizontal()virtual inline
Reimplemented from flipHorizontal.
flipVertical
Section titled “flipVertical”virtual bool RLeaderData::flipVertical()virtual inline
Reimplemented from flipVertical.
getArcReferencePoints
Section titled “getArcReferencePoints”virtual QList< RVector > RLeaderData::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.
getArrowShape
Section titled “getArrowShape”RTriangle RLeaderData::getArrowShape() constconst
getBoundingBox
Section titled “getBoundingBox”virtual RBox RLeaderData::getBoundingBox(bool ignoreEmpty=false) constvirtual inline const
Returns: The bounding box that contains this entity.
Reimplemented from getBoundingBox.
getCenterPoints
Section titled “getCenterPoints”virtual QList< RVector > RLeaderData::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.
getDimasz
Section titled “getDimasz”double RLeaderData::getDimasz(bool scale=true) constconst
getDimLeaderBlockId
Section titled “getDimLeaderBlockId”RObject::Id RLeaderData::getDimLeaderBlockId() constconst
getDimscale
Section titled “getDimscale”double RLeaderData::getDimscale() constconst
getDistanceTo
Section titled “getDistanceTo”virtual double RLeaderData::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.
getEndPoint
Section titled “getEndPoint”virtual RVector RLeaderData::getEndPoint() constvirtual inline const
Reimplemented from getEndPoint.
getEndPoints
Section titled “getEndPoints”virtual QList< RVector > RLeaderData::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.
getExploded
Section titled “getExploded”virtual QList< QSharedPointer< RShape > > RLeaderData::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 > RLeaderData::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 > RLeaderData::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 > RLeaderData::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 > RLeaderData::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.
getReferencePoints
Section titled “getReferencePoints”virtual QList< RRefPoint > RLeaderData::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 > > RLeaderData::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 RLeaderData::getStartPoint() constvirtual inline const
Reimplemented from getStartPoint.
getType
Section titled “getType”virtual RS::EntityType RLeaderData::getType() constvirtual inline const
Reimplemented from getType.
getVectorTo
Section titled “getVectorTo”virtual RVector RLeaderData::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.
hasArrowHead
Section titled “hasArrowHead”bool RLeaderData::hasArrowHead() constinline const
intersectsWith
Section titled “intersectsWith”virtual bool RLeaderData::intersectsWith(const RShape &shape) constvirtual inline const
Returns: True if this entity intersects with the given shape, false otherwise.
Reimplemented from intersectsWith.
isSplineShaped
Section titled “isSplineShaped”bool RLeaderData::isSplineShaped() constinline const
isValid
Section titled “isValid”virtual bool RLeaderData::isValid() constvirtual inline const
Reimplemented from isValid.
mirror
Section titled “mirror”virtual bool RLeaderData::mirror(const RLine &axis)virtual inline
Reimplemented from mirror.
mirror
Section titled “mirror”virtual bool RLeaderData::mirror(const RVector &axis1, const RVector &axis2)virtual inline
Reimplemented from mirror.
virtual bool RLeaderData::move(const RVector &offset)virtual inline
Moves this entity by the given offset.
Reimplemented from move.
moveReferencePoint
Section titled “moveReferencePoint”virtual bool RLeaderData::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 RLeaderData::reverse()virtual inline
Reimplemented from reverse.
rotate
Section titled “rotate”virtual bool RLeaderData::rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR)virtual inline
Reimplemented from rotate.
virtual bool RLeaderData::scale(const RVector &scaleFactors, const RVector ¢er)virtual
Reimplemented from scale.
scaleVisualProperties
Section titled “scaleVisualProperties”virtual void RLeaderData::scaleVisualProperties(double scaleFactor)virtual
Reimplemented from scaleVisualProperties.
setArrowHead
Section titled “setArrowHead”void RLeaderData::setArrowHead(bool on)setDimasz
Section titled “setDimasz”void RLeaderData::setDimasz(double v)setDimLeaderBlockId
Section titled “setDimLeaderBlockId”void RLeaderData::setDimLeaderBlockId(RObject::Id id)setDimscale
Section titled “setDimscale”void RLeaderData::setDimscale(double f)setSplineShaped
Section titled “setSplineShaped”void RLeaderData::setSplineShaped(bool on)inline
virtual void RLeaderData::setZ(double z)virtual inline
Reimplemented from setZ.
stretch
Section titled “stretch”virtual bool RLeaderData::stretch(const RPolyline &area, const RVector &offset)virtual
Stretches the end points of this entity that are inside area by offset.
Reimplemented from stretch.
virtual void RLeaderData::to2D()virtual inline
Reimplemented from to2D.
update
Section titled “update”virtual void RLeaderData::update() constvirtual const
Entities can reimplement this function to invalidate any internal cache (mark the entity as dirty).
Reimplemented from update.
updateArrowHead
Section titled “updateArrowHead”bool RLeaderData::updateArrowHead() constconst
RLeaderData
Section titled “RLeaderData”RLeaderData::RLeaderData(RDocument *document, const RLeaderData &data)protected
arrowHead
Section titled “arrowHead”bool RLeaderData::arrowHeadprivate
Arrow head on / off.
dimasz
Section titled “dimasz”double RLeaderData::dimaszprivate
Arrow size.
dimLeaderBlockId
Section titled “dimLeaderBlockId”RObject::Id RLeaderData::dimLeaderBlockIdprivate
Block to use instead of arrow.
dimscale
Section titled “dimscale”double RLeaderData::dimscaleprivate
Dimension scale.
splineShaped
Section titled “splineShaped”bool RLeaderData::splineShapedprivate
Spline shaped leader.
RLeaderEntity
Section titled “RLeaderEntity”friend class RLeaderEntityprivate