RShape
Class in Math Module
Header: #include <src/core/math/RShape.h>
Inherited by: RArc, RCircle, REllipse, RLine, RPoint, RPolyline, RSpline, RTriangle, RXLine
Description
Section titled “Description”Interface for geometrical shape classes.
Scriptable: This class is available in script environments.
Shared Pointer Support: Objects can be used in QSharedPointer.
Public Types
Section titled “Public Types”| enum | Type { Unknown, Point, Line, Arc, Circle, Ellipse, Polyline, Spline, Triangle, XLine, Ray } |
Public Functions
Section titled “Public Functions”RShape() |
|
| virtual | ~RShape() |
| virtual QSharedPointer< RShape > | clone() const =0 = 0 |
| void | dump() const |
| virtual bool | equals(const RShape &other, double tolerance=RS::PointTolerance) const |
| virtual QList< RVector > | filterOnShape(const QList< RVector > &pointList, bool limited=true, double tolerance=RDEFAULT_TOLERANCE_1E_MIN4) const |
| virtual bool | flipHorizontal() |
| virtual bool | flipVertical() |
| virtual double | getAngleAt(double distance, RS::From from=RS::FromStart) const |
| virtual double | getAngleAtPercent(double p) const |
| virtual double | getAngleAtPoint(const RVector &pos) const |
| virtual QList< RVector > | getArcReferencePoints() const |
| virtual QList< bool > | getBoolProperties() const |
| virtual RBox | getBoundingBox() const =0 = 0 |
| virtual QList< RVector > | getCenterPoints() const =0 = 0 |
| virtual RVector | getClosestPointOnShape(const RVector &p, bool limited=true, double strictRange=RMAXDOUBLE) 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 =0 = 0 |
| QList< RVector > | getIntersectionPoints(const RShape &other, bool limited=true, bool same=false, bool force=false) const |
| virtual QList< int > | getIntProperties() const |
| virtual double | getLength() const =0 = 0 |
| virtual double | getMaxDistanceTo(const QList< RVector > &points, bool limited=true, double strictRange=RMAXDOUBLE) const |
| virtual RVector | getMiddlePoint() const |
| virtual QList< RVector > | getMiddlePoints() const =0 = 0 |
| virtual QList< QSharedPointer< RShape > > | getOffsetShapes(double distance, int number, RS::Side side, const RVector &position=RVector::invalid) |
| virtual RVector | getPointAtPercent(double p) const |
| virtual QList< RVector > | getPointCloud(double segmentLength) const =0 = 0 |
| virtual RVector | getPointOnShape() const |
| virtual QList< RVector > | getPointsWithDistanceToEnd(double distance, int from=RS::FromAny) const =0 = 0 |
| virtual RVector | getPointWithDistanceToEnd(double distance) const |
| virtual RVector | getPointWithDistanceToStart(double distance) 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 |
| virtual QSharedPointer< RShape > | getTransformed(const QTransform &transform) const =0 = 0 |
| virtual RS::Ending | getTrimEnd(const RVector &trimPoint, const RVector &clickPoint) |
| virtual RVector | getVectorFromEndpointTo(const RVector &point) const |
| virtual QList< RVector > | getVectorProperties() const |
| virtual RVector | getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const =0 = 0 |
| virtual bool | intersectsWith(const RShape &other, bool limited=true) const |
| virtual bool | isDirected() const |
| virtual bool | isInterpolated() constReimplement and return true if this shape relies on interpolation for geometrical operations such as finding intersection points. |
| virtual bool | isOnShape(const RVector &point, bool limited=true, double tolerance=RDEFAULT_TOLERANCE_1E_MIN4) const |
| virtual bool | isValid() const |
| virtual bool | mirror(const RLine &axis)=0 = 0 |
| virtual bool | move(const RVector &offset)=0 = 0 |
| virtual bool | reverse() |
| virtual bool | rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR)=0 = 0 |
| virtual bool | scale(const RVector &scaleFactors, const RVector ¢er=RVector())=0 = 0 |
| virtual bool | scale(double scaleFactor, const RVector ¢er=RVector()) |
| virtual void | setZ(double z)=0 = 0 |
| virtual QList< QSharedPointer< RShape > > | splitAt(const QList< RVector > &points) const |
| virtual bool | stretch(const RBox &area, const RVector &offset) |
| virtual bool | stretch(const RPolyline &area, const RVector &offset) |
| virtual void | to2D()Flattens this shape to the X/Y plane. |
| 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) |
Static Public Functions
Section titled “Static Public Functions”| static const RExplodable * | castToExplodable(const RShape *shape) |
| static QSharedPointer< RShape > | ellipseToArcCircleEllipse(const REllipse &ellipse) |
| static int | getErrorCode() |
| static QList< QSharedPointer< RShape > > | getInnerMostContour(const RVector &position, const QList< QSharedPointer< RShape > > &shapes)Traces the inner most (smallest) closed contour around the given position from the arrangement formed by the given shapes. |
| static QList< RVector > | getIntersectionPoints(const RShape &shape1, const RShape &shape2, bool limited=true, bool same=false, bool force=false) |
| static QList< RVector > | getIntersectionPointsAA(const RArc &arc1, const RArc &arc2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsAC(const RArc &arc1, const RCircle &circle2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsAE(const RArc &arc1, const REllipse &ellipse2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsAS(const RArc &arc1, const RSpline &spline2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsAT(const RArc &arc1, const RTriangle &triangle2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsAX(const RArc &arc1, const RExplodable &explodable2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsCC(const RCircle &circle1, const RCircle &circle2) |
| static QList< RVector > | getIntersectionPointsCE(const RCircle &circle1, const REllipse &ellipse2) |
| static QList< RVector > | getIntersectionPointsCS(const RCircle &circle1, const RSpline &spline2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsCX(const RCircle &circle1, const RExplodable &explodable2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsEE(const REllipse &ellipse1, const REllipse &ellipse2)Based on “Hughes and Chraibi (2011-2012), Calculating Ellipse Overlap Areas”. |
| static QList< RVector > | getIntersectionPointsEE(const REllipse &ellipse1, const REllipse &ellipse2, bool limited) |
| static QList< RVector > | getIntersectionPointsES(const REllipse &ellipse1, const RSpline &spline2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsEX(const REllipse &ellipse1, const RExplodable &explodable2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsLA(const RLine &line1, const RArc &arc2, bool limited1, bool limited2) |
| static QList< RVector > | getIntersectionPointsLA(const RLine &line1, const RArc &arc2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsLC(const RLine &line1, const RCircle &circle2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsLE(const RLine &line1, const REllipse &ellipse2, bool limited1, bool limited2) |
| static QList< RVector > | getIntersectionPointsLE(const RLine &line1, const REllipse &ellipse2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsLL(const RLine &line1, const RLine &line2, bool limited1, bool limited2) |
| static QList< RVector > | getIntersectionPointsLL(const RLine &line1, const RLine &line2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsLS(const RLine &line1, const RSpline &spline2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsLT(const RLine &line1, const RTriangle &triangle2, bool limited1, bool limited2) |
| static QList< RVector > | getIntersectionPointsLT(const RLine &line1, const RTriangle &triangle2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsLX(const RLine &line1, const RExplodable &explodable2, bool limited=true) |
| static QList< RVector > | getIntersectionPointsSS(const RSpline &spline1, const RSpline &spline2, bool limited=true, bool same=false, double tolerance=RS::PointTolerance) |
| static QList< RVector > | getIntersectionPointsSX(const RSpline &spline1, const RExplodable &explodable2, bool limited) |
| static QList< RVector > | getIntersectionPointsXX(const RExplodable &explodable1, const RExplodable &explodable2, bool limited=true, bool same=false) |
| static QList< QSharedPointer< RShape > > | getOffsetArcs(const RShape &shape, double distance, int number, RS::Side side, const RVector &position=RVector::invalid) |
| static QList< QSharedPointer< RShape > > | getOffsetLines(const RShape &shape, double distance, int number, RS::Side side, const RVector &position=RVector::invalid) |
| static QList< QSharedPointer< RShape > > | getOrderedShapes(const QList< QSharedPointer< RShape > > &shapes) |
| static QList< RPolyline > | getPolylines(const QList< QSharedPointer< RShape > > &shapes) |
| static QList< QSharedPointer< RShape > > | getReversedShapeList(const QList< QSharedPointer< RShape > > &shapes) |
| static RShapeProxy * | getShapeProxy() |
| static bool | hasProxy() |
| static bool | isArcShape(const RShape &s) |
| static bool | isCircleShape(const RShape &s) |
| static bool | isEllipseShape(const RShape &s) |
| static bool | isFullEllipseShape(const RShape &s) |
| static bool | isLineShape(const RShape &s) |
| static bool | isPointShape(const RShape &s) |
| static bool | isPolylineShape(const RShape &s) |
| static bool | isRayShape(const RShape &s) |
| static bool | isSplineShape(const RShape &s) |
| static bool | isTriangleShape(const RShape &s) |
| static bool | isXLineShape(const RShape &s) |
| static bool | order(QList< QList< QSharedPointer< RShape > > > &boundary)Orders the given list of loops into a list of closed loops in which all shapes are connected end to start point. |
| static QSharedPointer< RShape > | rayToLine(QSharedPointer< RShape > shape) |
| static QList< QSharedPointer< RShape > > | roundCorners(const QList< QSharedPointer< RShape > > &shapes, double radius, bool inverted=false)Round every corner of the list of given (connected) shapes with the given radius. |
| static QList< QSharedPointer< RShape > > | roundShapes(const QSharedPointer< RShape > shape1, const RVector &clickPos1, const QSharedPointer< RShape > shape2, const RVector &clickPos2, bool trim, bool samePolyline, double radius, const RVector &pos)Rounds the given shape1 against shape2. |
| static QSharedPointer< RShape > | scaleArc(const RShape &shape, const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR) |
| static void | setShapeProxy(RShapeProxy *p) |
| static QSharedPointer< RShape > | transformArc(const RShape &shape, RShapeTransformation &transformation) |
| static QList< QSharedPointer< RShape > > | trim(const RShape &trimShape, const RVector &trimClickPos, const RShape &limitingShape, const RVector &limitingClickPos, bool trimBoth, bool samePolyline)Trims a shape to another or two shapes to each other. |
| static QSharedPointer< RShape > | xLineToRay(QSharedPointer< RShape > shape) |
Protected Functions
Section titled “Protected Functions”| virtual void | print(QDebug dbg) const |
Static Protected Attributes
Section titled “Static Protected Attributes”| static int | errorCode |
Static Private Functions
Section titled “Static Private Functions”| static double | ellipse2tr(double x, double y, double AA, double BB, double CC, double DD, double EE, double FF) |
Static Private Attributes
Section titled “Static Private Attributes”| static double | epsTolerance |
| static RShapeProxy * | shapeProxy |
| static double | twopi |
Friends
Section titled “Friends”| QCADCORE_EXPORT QDebug | operator<<(QDebug dbg, const RShape &s) |
Member Documentation
Section titled “Member Documentation”enum Type| Value | Description |
|---|---|
Unknown = -1 |
|
Point = 0 |
|
Line = 1 |
|
Arc = 2 |
|
Circle = 3 |
|
Ellipse = 4 |
|
Polyline = 5 |
|
Spline = 6 |
|
Triangle = 7 |
|
XLine = 8 |
|
Ray = 9 |
RShape
Section titled “RShape”RShape::RShape()~RShape
Section titled “~RShape”virtual RShape::~RShape()virtual
virtual QSharedPointer< RShape > RShape::clone() const =0 = 0pure virtual const
Reimplemented in clone, clone, clone, clone, clone, clone, clone, clone, clone, clone, clone.
void RShape::dump() constconst
equals
Section titled “equals”virtual bool RShape::equals(const RShape &other, double tolerance=RS::PointTolerance) constvirtual const
filterOnShape
Section titled “filterOnShape”virtual QList< RVector > RShape::filterOnShape(const QList< RVector > &pointList, bool limited=true, double tolerance=RDEFAULT_TOLERANCE_1E_MIN4) constvirtual const
Returns: List of those points in pointList which are on this shape.
flipHorizontal
Section titled “flipHorizontal”virtual bool RShape::flipHorizontal()virtual
Reimplemented in flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal.
flipVertical
Section titled “flipVertical”virtual bool RShape::flipVertical()virtual
Reimplemented in flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical.
getAngleAt
Section titled “getAngleAt”virtual double RShape::getAngleAt(double distance, RS::From from=RS::FromStart) constvirtual inline const
Returns: Angle on the entity at the given distance from the start point.
Reimplemented in getAngleAt, getAngleAt, getAngleAt, getAngleAt, getAngleAt, getAngleAt, getAngleAt, getAngleAt, getAngleAt.
getAngleAtPercent
Section titled “getAngleAtPercent”virtual double RShape::getAngleAtPercent(double p) constvirtual const
Returns: Angle at given percentile.
getAngleAtPoint
Section titled “getAngleAtPoint”virtual double RShape::getAngleAtPoint(const RVector &pos) constvirtual inline const
Reimplemented in getAngleAtPoint.
getArcReferencePoints
Section titled “getArcReferencePoints”virtual QList< RVector > RShape::getArcReferencePoints() constvirtual inline const
Returns: The reference point(s) of this shape.
Reimplemented in getArcReferencePoints, getArcReferencePoints.
getBoolProperties
Section titled “getBoolProperties”virtual QList< bool > RShape::getBoolProperties() constvirtual inline const
Reimplemented in getBoolProperties, getBoolProperties, getBoolProperties, getBoolProperties.
getBoundingBox
Section titled “getBoundingBox”virtual RBox RShape::getBoundingBox() const =0 = 0pure virtual const
Returns: The bounding box of this shape.
Reimplemented in getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox.
getCenterPoints
Section titled “getCenterPoints”virtual QList< RVector > RShape::getCenterPoints() const =0 = 0pure virtual const
Returns: The center point(s) of this shape.
Reimplemented in getCenterPoints, getCenterPoints, getCenterPoints, getCenterPoints, getCenterPoints, getCenterPoints, getCenterPoints, getCenterPoints, getCenterPoints.
getClosestPointOnShape
Section titled “getClosestPointOnShape”virtual RVector RShape::getClosestPointOnShape(const RVector &p, bool limited=true, double strictRange=RMAXDOUBLE) constvirtual const
Returns: Point on this shape that is closest to p. Based on getVectorTo.
getDirection1
Section titled “getDirection1”virtual double RShape::getDirection1() constvirtual inline const
Reimplemented in getDirection1, getDirection1, getDirection1, getDirection1, getDirection1, getDirection1, getDirection1, getDirection1, getDirection1, getDirection1, getDirection1.
getDirection2
Section titled “getDirection2”virtual double RShape::getDirection2() constvirtual inline const
Reimplemented in getDirection2, getDirection2, getDirection2, getDirection2, getDirection2, getDirection2, getDirection2, getDirection2, getDirection2, getDirection2, getDirection2.
getDistanceFromStart
Section titled “getDistanceFromStart”virtual double RShape::getDistanceFromStart(const RVector &p) constvirtual inline const
Returns: Distance of given point to start point of shape along shape.
Parameters:
p: Point (assumed to be on shape).
Reimplemented in getDistanceFromStart, getDistanceFromStart, getDistanceFromStart, getDistanceFromStart, getDistanceFromStart, getDistanceFromStart.
getDistancesFromStart
Section titled “getDistancesFromStart”virtual QList< double > RShape::getDistancesFromStart(const RVector &p) constvirtual inline const
Returns: All possible distances of given point to start point of shape along shape.
Parameters:
p: Point (assumed to be on shape).
Reimplemented in getDistancesFromStart.
getDistanceTo
Section titled “getDistanceTo”virtual double RShape::getDistanceTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) constvirtual const
Returns: Shortest distance from this shape to the given point. Based on getVectorTo.
Reimplemented in getDistanceTo, getDistanceTo, getDistanceTo.
getDoubleProperties
Section titled “getDoubleProperties”virtual QList< double > RShape::getDoubleProperties() constvirtual inline const
Reimplemented in getDoubleProperties, getDoubleProperties, getDoubleProperties, getDoubleProperties, getDoubleProperties.
getEndPoint
Section titled “getEndPoint”virtual RVector RShape::getEndPoint() constvirtual inline const
Reimplemented in getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint.
getEndPoints
Section titled “getEndPoints”virtual QList< RVector > RShape::getEndPoints() const =0 = 0pure virtual const
Returns: The end point(s) of this shape.
Reimplemented in getEndPoints, getEndPoints, getEndPoints, getEndPoints, getEndPoints, getEndPoints, getEndPoints, getEndPoints, getEndPoints.
getIntersectionPoints
Section titled “getIntersectionPoints”QList< RVector > RShape::getIntersectionPoints(const RShape &other, bool limited=true, bool same=false, bool force=false) constconst
Returns: The intersection point(s) between this shape and the given other shape.
getIntProperties
Section titled “getIntProperties”virtual QList< int > RShape::getIntProperties() constvirtual inline const
Reimplemented in getIntProperties.
getLength
Section titled “getLength”virtual double RShape::getLength() const =0 = 0pure virtual const
Returns: The total length of this shape if applicable or NaN if not.
Reimplemented in getLength, getLength, getLength, getLength, getLength, getLength, getLength, getLength, getLength, getLength, getLength, getLength.
getMaxDistanceTo
Section titled “getMaxDistanceTo”virtual double RShape::getMaxDistanceTo(const QList< RVector > &points, bool limited=true, double strictRange=RMAXDOUBLE) constvirtual const
Returns: Maximum shortest distance from this shape to any of the given points.
getMiddlePoint
Section titled “getMiddlePoint”virtual RVector RShape::getMiddlePoint() constvirtual inline const
Reimplemented in getMiddlePoint, getMiddlePoint, getMiddlePoint, getMiddlePoint, getMiddlePoint, getMiddlePoint.
getMiddlePoints
Section titled “getMiddlePoints”virtual QList< RVector > RShape::getMiddlePoints() const =0 = 0pure virtual const
Returns: The middle point(s) of this shape.
Reimplemented in getMiddlePoints, getMiddlePoints, getMiddlePoints, getMiddlePoints, getMiddlePoints, getMiddlePoints, getMiddlePoints, getMiddlePoints, getMiddlePoints.
getOffsetShapes
Section titled “getOffsetShapes”virtual QList< QSharedPointer< RShape > > RShape::getOffsetShapes(double distance, int number, RS::Side side, const RVector &position=RVector::invalid)virtual
Returns: Parallels to this shape.
Parameters:
distance: Distance of first parallel or concentric arc or circle.number: Number of offset shapes to generate.side: Side, should be RS.LeftHand or RS.RightHand or RS.BothSides.sidePosition: Position indicating what side of the shape the parallels should be.
Reimplemented in getOffsetShapes, getOffsetShapes, getOffsetShapes, getOffsetShapes, getOffsetShapes.
getPointAtPercent
Section titled “getPointAtPercent”virtual RVector RShape::getPointAtPercent(double p) constvirtual const
Returns: Point at given percentile.
Reimplemented in getPointAtPercent.
getPointCloud
Section titled “getPointCloud”virtual QList< RVector > RShape::getPointCloud(double segmentLength) const =0 = 0pure virtual const
Reimplemented in getPointCloud, getPointCloud, getPointCloud, getPointCloud, getPointCloud, getPointCloud, getPointCloud, getPointCloud, getPointCloud.
getPointOnShape
Section titled “getPointOnShape”virtual RVector RShape::getPointOnShape() constvirtual const
Reimplemented in getPointOnShape, getPointOnShape.
getPointsWithDistanceToEnd
Section titled “getPointsWithDistanceToEnd”virtual QList< RVector > RShape::getPointsWithDistanceToEnd(double distance, int from=RS::FromAny) const =0 = 0pure virtual const
Returns: All points on this shape with the given distance to an endpoint.
Reimplemented in getPointsWithDistanceToEnd, getPointsWithDistanceToEnd, getPointsWithDistanceToEnd, getPointsWithDistanceToEnd, getPointsWithDistanceToEnd, getPointsWithDistanceToEnd, getPointsWithDistanceToEnd, getPointsWithDistanceToEnd, getPointsWithDistanceToEnd, getPointsWithDistanceToEnd.
getPointWithDistanceToEnd
Section titled “getPointWithDistanceToEnd”virtual RVector RShape::getPointWithDistanceToEnd(double distance) constvirtual inline const
getPointWithDistanceToStart
Section titled “getPointWithDistanceToStart”virtual RVector RShape::getPointWithDistanceToStart(double distance) constvirtual inline const
getSelfIntersectionPoints
Section titled “getSelfIntersectionPoints”virtual QList< RVector > RShape::getSelfIntersectionPoints(double tolerance=RS::PointTolerance) constvirtual inline const
Reimplemented in getSelfIntersectionPoints, getSelfIntersectionPoints.
getShapeType
Section titled “getShapeType”virtual RShape::Type RShape::getShapeType() constvirtual inline const
Reimplemented in getShapeType, getShapeType, getShapeType, getShapeType, getShapeType, getShapeType, getShapeType, getShapeType, getShapeType, getShapeType.
getSideOfPoint
Section titled “getSideOfPoint”virtual RS::Side RShape::getSideOfPoint(const RVector &point) constvirtual inline const
Reimplemented in getSideOfPoint, getSideOfPoint, getSideOfPoint, getSideOfPoint, getSideOfPoint, getSideOfPoint, getSideOfPoint, getSideOfPoint, getSideOfPoint.
getStartPoint
Section titled “getStartPoint”virtual RVector RShape::getStartPoint() constvirtual inline const
Reimplemented in getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint.
getTransformed
Section titled “getTransformed”virtual QSharedPointer< RShape > RShape::getTransformed(const QTransform &transform) const =0 = 0pure virtual const
Reimplemented in getTransformed, getTransformed, getTransformed, getTransformed, getTransformed, getTransformed, getTransformed, getTransformed, getTransformed.
getTrimEnd
Section titled “getTrimEnd”virtual RS::Ending RShape::getTrimEnd(const RVector &trimPoint, const RVector &clickPoint)virtual inline
Parameters:
trimPoint: Trim start point or end point to this coordinate.clickPoint: Point that was clicked by user.
Reimplemented in getTrimEnd, getTrimEnd, getTrimEnd, getTrimEnd, getTrimEnd, getTrimEnd, getTrimEnd, getTrimEnd, getTrimEnd, getTrimEnd, getTrimEnd, getTrimEnd.
getVectorFromEndpointTo
Section titled “getVectorFromEndpointTo”virtual RVector RShape::getVectorFromEndpointTo(const RVector &point) constvirtual const
Returns: Shortest vector from any end point of this shape to the given point.
getVectorProperties
Section titled “getVectorProperties”virtual QList< RVector > RShape::getVectorProperties() constvirtual inline const
Reimplemented in getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties.
getVectorTo
Section titled “getVectorTo”virtual RVector RShape::getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const =0 = 0pure virtual const
Returns: Shortest vector from this shape to the given point.
Parameters:
point: the given pointlimited: 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 in getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo, getVectorTo.
intersectsWith
Section titled “intersectsWith”virtual bool RShape::intersectsWith(const RShape &other, bool limited=true) constvirtual const
Returns: True if this shape intersects with the given shape.
isDirected
Section titled “isDirected”virtual bool RShape::isDirected() constvirtual inline const
Reimplemented in isDirected, isDirected, isDirected, isDirected, isDirected, isDirected.
isInterpolated
Section titled “isInterpolated”virtual bool RShape::isInterpolated() constvirtual inline const
Reimplement and return true if this shape relies on interpolation for geometrical operations such as finding intersection points.
E.g. splines.
Reimplemented in isInterpolated, isInterpolated.
isOnShape
Section titled “isOnShape”virtual bool RShape::isOnShape(const RVector &point, bool limited=true, double tolerance=RDEFAULT_TOLERANCE_1E_MIN4) constvirtual const
Returns: true if the given point is on this shape.
Reimplemented in isOnShape.
isValid
Section titled “isValid”virtual bool RShape::isValid() constvirtual inline const
Reimplemented in isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid.
mirror
Section titled “mirror”virtual bool RShape::mirror(const RLine &axis)=0 = 0pure virtual
Reimplemented in mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror, mirror.
virtual bool RShape::move(const RVector &offset)=0 = 0pure virtual
Reimplemented in move, move, move, move, move, move, move, move, move, move, move, move, move, move, move, move, move, move, move, move, move.
reverse
Section titled “reverse”virtual bool RShape::reverse()virtual inline
Reimplemented in reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse.
rotate
Section titled “rotate”virtual bool RShape::rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR)=0 = 0pure virtual
Reimplemented in rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate, rotate.
virtual bool RShape::scale(const RVector &scaleFactors, const RVector ¢er=RVector())=0 = 0pure virtual
Reimplemented in scale, scale, scale, scale, scale, scale, scale, scale, scale, scale, scale, scale, scale, scale, scale, scale, scale, scale, scale, scale, scale.
virtual bool RShape::scale(double scaleFactor, const RVector ¢er=RVector())virtual
Reimplemented in scale.
virtual void RShape::setZ(double z)=0 = 0pure virtual
Reimplemented in setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ.
splitAt
Section titled “splitAt”virtual QList< QSharedPointer< RShape > > RShape::splitAt(const QList< RVector > &points) constvirtual const
Returns: Array of shapes which represent the given shape split up at the given points.
Parameters:
points: Array of RVector, assumed to be on shape.
Reimplemented in splitAt, splitAt, splitAt, splitAt, splitAt, splitAt, splitAt.
stretch
Section titled “stretch”virtual bool RShape::stretch(const RBox &area, const RVector &offset)virtual
stretch
Section titled “stretch”virtual bool RShape::stretch(const RPolyline &area, const RVector &offset)virtual
Reimplemented in stretch, stretch, stretch, stretch, stretch, stretch, stretch, stretch, stretch, stretch, stretch, stretch, stretch, stretch, stretch, stretch, stretch, stretch.
virtual void RShape::to2D()virtual inline
Flattens this shape to the X/Y plane.
Reimplemented in to2D, to2D, to2D, to2D, to2D, to2D, to2D, to2D, to2D, to2D, to2D, to2D.
trimEndPoint
Section titled “trimEndPoint”virtual bool RShape::trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)virtual inline
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 in trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint.
trimEndPoint
Section titled “trimEndPoint”virtual bool RShape::trimEndPoint(double trimDist)virtual inline
Reimplemented in trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint.
trimStartPoint
Section titled “trimStartPoint”virtual bool RShape::trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)virtual inline
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 in trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint.
trimStartPoint
Section titled “trimStartPoint”virtual bool RShape::trimStartPoint(double trimDist)virtual inline
Reimplemented in trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint.
castToExplodable
Section titled “castToExplodable”static const RExplodable * RShape::castToExplodable(const RShape *shape)static
ellipseToArcCircleEllipse
Section titled “ellipseToArcCircleEllipse”static QSharedPointer< RShape > RShape::ellipseToArcCircleEllipse(const REllipse &ellipse)static
getErrorCode
Section titled “getErrorCode”static int RShape::getErrorCode()static inline
getInnerMostContour
Section titled “getInnerMostContour”static QList< QSharedPointer< RShape > > RShape::getInnerMostContour(const RVector &position, const QList< QSharedPointer< RShape > > &shapes)static
Traces the inner most (smallest) closed contour around the given position from the arrangement formed by the given shapes.
Requires the shape proxy (QCAD Professional).
See also: RShapeProxy::getInnerMostContour
getIntersectionPoints
Section titled “getIntersectionPoints”static QList< RVector > RShape::getIntersectionPoints(const RShape &shape1, const RShape &shape2, bool limited=true, bool same=false, bool force=false)static
Returns: The intersection point(s) between this shape and the given other shape.
getIntersectionPointsAA
Section titled “getIntersectionPointsAA”static QList< RVector > RShape::getIntersectionPointsAA(const RArc &arc1, const RArc &arc2, bool limited=true)static
getIntersectionPointsAC
Section titled “getIntersectionPointsAC”static QList< RVector > RShape::getIntersectionPointsAC(const RArc &arc1, const RCircle &circle2, bool limited=true)static
getIntersectionPointsAE
Section titled “getIntersectionPointsAE”static QList< RVector > RShape::getIntersectionPointsAE(const RArc &arc1, const REllipse &ellipse2, bool limited=true)static
getIntersectionPointsAS
Section titled “getIntersectionPointsAS”static QList< RVector > RShape::getIntersectionPointsAS(const RArc &arc1, const RSpline &spline2, bool limited=true)static
getIntersectionPointsAT
Section titled “getIntersectionPointsAT”static QList< RVector > RShape::getIntersectionPointsAT(const RArc &arc1, const RTriangle &triangle2, bool limited=true)static
getIntersectionPointsAX
Section titled “getIntersectionPointsAX”static QList< RVector > RShape::getIntersectionPointsAX(const RArc &arc1, const RExplodable &explodable2, bool limited=true)static
getIntersectionPointsCC
Section titled “getIntersectionPointsCC”static QList< RVector > RShape::getIntersectionPointsCC(const RCircle &circle1, const RCircle &circle2)static
getIntersectionPointsCE
Section titled “getIntersectionPointsCE”static QList< RVector > RShape::getIntersectionPointsCE(const RCircle &circle1, const REllipse &ellipse2)static
getIntersectionPointsCS
Section titled “getIntersectionPointsCS”static QList< RVector > RShape::getIntersectionPointsCS(const RCircle &circle1, const RSpline &spline2, bool limited=true)static
getIntersectionPointsCX
Section titled “getIntersectionPointsCX”static QList< RVector > RShape::getIntersectionPointsCX(const RCircle &circle1, const RExplodable &explodable2, bool limited=true)static
getIntersectionPointsEE
Section titled “getIntersectionPointsEE”static QList< RVector > RShape::getIntersectionPointsEE(const REllipse &ellipse1, const REllipse &ellipse2)static
Based on “Hughes and Chraibi (2011-2012), Calculating Ellipse Overlap Areas”.
getIntersectionPointsEE
Section titled “getIntersectionPointsEE”static QList< RVector > RShape::getIntersectionPointsEE(const REllipse &ellipse1, const REllipse &ellipse2, bool limited)static
getIntersectionPointsES
Section titled “getIntersectionPointsES”static QList< RVector > RShape::getIntersectionPointsES(const REllipse &ellipse1, const RSpline &spline2, bool limited=true)static
getIntersectionPointsEX
Section titled “getIntersectionPointsEX”static QList< RVector > RShape::getIntersectionPointsEX(const REllipse &ellipse1, const RExplodable &explodable2, bool limited=true)static
getIntersectionPointsLA
Section titled “getIntersectionPointsLA”static QList< RVector > RShape::getIntersectionPointsLA(const RLine &line1, const RArc &arc2, bool limited1, bool limited2)static
getIntersectionPointsLA
Section titled “getIntersectionPointsLA”static QList< RVector > RShape::getIntersectionPointsLA(const RLine &line1, const RArc &arc2, bool limited=true)static inline
getIntersectionPointsLC
Section titled “getIntersectionPointsLC”static QList< RVector > RShape::getIntersectionPointsLC(const RLine &line1, const RCircle &circle2, bool limited=true)static
getIntersectionPointsLE
Section titled “getIntersectionPointsLE”static QList< RVector > RShape::getIntersectionPointsLE(const RLine &line1, const REllipse &ellipse2, bool limited1, bool limited2)static
getIntersectionPointsLE
Section titled “getIntersectionPointsLE”static QList< RVector > RShape::getIntersectionPointsLE(const RLine &line1, const REllipse &ellipse2, bool limited=true)static inline
getIntersectionPointsLL
Section titled “getIntersectionPointsLL”static QList< RVector > RShape::getIntersectionPointsLL(const RLine &line1, const RLine &line2, bool limited1, bool limited2)static
getIntersectionPointsLL
Section titled “getIntersectionPointsLL”static QList< RVector > RShape::getIntersectionPointsLL(const RLine &line1, const RLine &line2, bool limited=true)static inline
getIntersectionPointsLS
Section titled “getIntersectionPointsLS”static QList< RVector > RShape::getIntersectionPointsLS(const RLine &line1, const RSpline &spline2, bool limited=true)static
getIntersectionPointsLT
Section titled “getIntersectionPointsLT”static QList< RVector > RShape::getIntersectionPointsLT(const RLine &line1, const RTriangle &triangle2, bool limited1, bool limited2)static
getIntersectionPointsLT
Section titled “getIntersectionPointsLT”static QList< RVector > RShape::getIntersectionPointsLT(const RLine &line1, const RTriangle &triangle2, bool limited=true)static inline
getIntersectionPointsLX
Section titled “getIntersectionPointsLX”static QList< RVector > RShape::getIntersectionPointsLX(const RLine &line1, const RExplodable &explodable2, bool limited=true)static
getIntersectionPointsSS
Section titled “getIntersectionPointsSS”static QList< RVector > RShape::getIntersectionPointsSS(const RSpline &spline1, const RSpline &spline2, bool limited=true, bool same=false, double tolerance=RS::PointTolerance)static
getIntersectionPointsSX
Section titled “getIntersectionPointsSX”static QList< RVector > RShape::getIntersectionPointsSX(const RSpline &spline1, const RExplodable &explodable2, bool limited)static
getIntersectionPointsXX
Section titled “getIntersectionPointsXX”static QList< RVector > RShape::getIntersectionPointsXX(const RExplodable &explodable1, const RExplodable &explodable2, bool limited=true, bool same=false)static
Parameters:
same: True if the two shapes are identical, from the same interpolated shape (e.g. spline).
getOffsetArcs
Section titled “getOffsetArcs”static QList< QSharedPointer< RShape > > RShape::getOffsetArcs(const RShape &shape, double distance, int number, RS::Side side, const RVector &position=RVector::invalid)static
getOffsetLines
Section titled “getOffsetLines”static QList< QSharedPointer< RShape > > RShape::getOffsetLines(const RShape &shape, double distance, int number, RS::Side side, const RVector &position=RVector::invalid)static
getOrderedShapes
Section titled “getOrderedShapes”static QList< QSharedPointer< RShape > > RShape::getOrderedShapes(const QList< QSharedPointer< RShape > > &shapes)static
getPolylines
Section titled “getPolylines”static QList< RPolyline > RShape::getPolylines(const QList< QSharedPointer< RShape > > &shapes)static
getReversedShapeList
Section titled “getReversedShapeList”static QList< QSharedPointer< RShape > > RShape::getReversedShapeList(const QList< QSharedPointer< RShape > > &shapes)static
getShapeProxy
Section titled “getShapeProxy”static RShapeProxy * RShape::getShapeProxy()static inline
Non-Scriptable: This function is not available in script environments.
hasProxy
Section titled “hasProxy”static bool RShape::hasProxy()static inline
isArcShape
Section titled “isArcShape”static bool RShape::isArcShape(const RShape &s)static inline
isCircleShape
Section titled “isCircleShape”static bool RShape::isCircleShape(const RShape &s)static inline
isEllipseShape
Section titled “isEllipseShape”static bool RShape::isEllipseShape(const RShape &s)static inline
isFullEllipseShape
Section titled “isFullEllipseShape”static bool RShape::isFullEllipseShape(const RShape &s)static
isLineShape
Section titled “isLineShape”static bool RShape::isLineShape(const RShape &s)static inline
isPointShape
Section titled “isPointShape”static bool RShape::isPointShape(const RShape &s)static inline
isPolylineShape
Section titled “isPolylineShape”static bool RShape::isPolylineShape(const RShape &s)static inline
isRayShape
Section titled “isRayShape”static bool RShape::isRayShape(const RShape &s)static inline
isSplineShape
Section titled “isSplineShape”static bool RShape::isSplineShape(const RShape &s)static inline
isTriangleShape
Section titled “isTriangleShape”static bool RShape::isTriangleShape(const RShape &s)static inline
isXLineShape
Section titled “isXLineShape”static bool RShape::isXLineShape(const RShape &s)static inline
static bool RShape::order(QList< QList< QSharedPointer< RShape > > > &boundary)static
Orders the given list of loops into a list of closed loops in which all shapes are connected end to start point.
Empty loops are dropped.
Returns: True if all loops are closed, false otherwise.
rayToLine
Section titled “rayToLine”static QSharedPointer< RShape > RShape::rayToLine(QSharedPointer< RShape > shape)static
roundCorners
Section titled “roundCorners”static QList< QSharedPointer< RShape > > RShape::roundCorners(const QList< QSharedPointer< RShape > > &shapes, double radius, bool inverted=false)static
Round every corner of the list of given (connected) shapes with the given radius.
Parameters:
inverted: True to invert the rounding arcs (concave rounding).
roundShapes
Section titled “roundShapes”static QList< QSharedPointer< RShape > > RShape::roundShapes(const QSharedPointer< RShape > shape1, const RVector &clickPos1, const QSharedPointer< RShape > shape2, const RVector &clickPos2, bool trim, bool samePolyline, double radius, const RVector &pos)static
Rounds the given shape1 against shape2.
Parameters:
shape1: First shape of corner.clickPos1: Coordinate that was clicked when the user selected shape1.shape2: Second shape of corner.clickPos2: Coordinate that was clicked when the user selected shape2.trim: true: Trim both shapes to rounding arc.radius: Radius of rounding.solutionPos: Position that determines which solution to apply (optional, defaults to clickPos1)
Returns: Array of three shapes: shape1 (trimmed), rounding, shape2 (trimmed) or empty array.
scaleArc
Section titled “scaleArc”static QSharedPointer< RShape > RShape::scaleArc(const RShape &shape, const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR)static inline
setShapeProxy
Section titled “setShapeProxy”static void RShape::setShapeProxy(RShapeProxy *p)static inline
Non-Scriptable: This function is not available in script environments.
transformArc
Section titled “transformArc”static QSharedPointer< RShape > RShape::transformArc(const RShape &shape, RShapeTransformation &transformation)static
Non-Scriptable: This function is not available in script environments.
static QList< QSharedPointer< RShape > > RShape::trim(const RShape &trimShape, const RVector &trimClickPos, const RShape &limitingShape, const RVector &limitingClickPos, bool trimBoth, bool samePolyline)static
Trims a shape to another or two shapes to each other.
Parameters:
trimShape: Shape which will always be trimmed.trimClickPos: Coordinate which defines which endpoint of the trim entity to trim.limitingShape: Entity to which the trim entity will be trimmed.limitingClickPos: Coordinate which defines the intersection to which the trim entity will be trimmed.trimBoth: true: Trim both entities. false: trim trimEntity only.
xLineToRay
Section titled “xLineToRay”static QSharedPointer< RShape > RShape::xLineToRay(QSharedPointer< RShape > shape)static
virtual void RShape::print(QDebug dbg) constvirtual const protected
Reimplemented in print, print, print, print, print, print, print, print, print, print, print.
errorCode
Section titled “errorCode”static int RShape::errorCode = 0static protected
ellipse2tr
Section titled “ellipse2tr”static double RShape::ellipse2tr(double x, double y, double AA, double BB, double CC, double DD, double EE, double FF)static private
epsTolerance
Section titled “epsTolerance”static double RShape::epsTolerance = 1.0e-02static private
shapeProxy
Section titled “shapeProxy”static RShapeProxy * RShape::shapeProxy = NULLstatic private
static double RShape::twopi = M_PI*2static 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.
operator<<
Section titled “operator<<”QCADCORE_EXPORT QDebug operator<<(QDebug dbg, const RShape &s)Non-Scriptable: This function is not available in script environments.