Skip to content

RShape

Class in Math Module
Header: #include <src/core/math/RShape.h>
Inherited by: RArc, RCircle, REllipse, RLine, RPoint, RPolyline, RSpline, RTriangle, RXLine

Interface for geometrical shape classes.

Scriptable: This class is available in script environments.

Shared Pointer Support: Objects can be used in QSharedPointer.

enum Type { Unknown, Point, Line, Arc, Circle, Ellipse, Polyline, Spline, Triangle, XLine, Ray }
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() const
Reimplement 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 &center=RDEFAULT_RVECTOR)=0 = 0
virtual bool scale(const RVector &scaleFactors, const RVector &center=RVector())=0 = 0
virtual bool scale(double scaleFactor, const RVector &center=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 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 &center=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)
virtual void print(QDebug dbg) const
static int errorCode
static double ellipse2tr(double x, double y, double AA, double BB, double CC, double DD, double EE, double FF)
static double epsTolerance
static RShapeProxy * shapeProxy
static double twopi
QCADCORE_EXPORT QDebug operator<<(QDebug dbg, const RShape &s)

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::RShape()

virtual RShape::~RShape()

virtual

virtual QSharedPointer< RShape > RShape::clone() const =0 = 0

pure virtual const

Reimplemented in clone, clone, clone, clone, clone, clone, clone, clone, clone, clone, clone.

void RShape::dump() const

const

virtual bool RShape::equals(const RShape &other, double tolerance=RS::PointTolerance) const

virtual const

virtual QList< RVector > RShape::filterOnShape(const QList< RVector > &pointList, bool limited=true, double tolerance=RDEFAULT_TOLERANCE_1E_MIN4) const

virtual const

Returns: List of those points in pointList which are on this shape.

virtual bool RShape::flipHorizontal()

virtual

Reimplemented in flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal, flipHorizontal.

virtual bool RShape::flipVertical()

virtual

Reimplemented in flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical, flipVertical.

virtual double RShape::getAngleAt(double distance, RS::From from=RS::FromStart) const

virtual 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.

virtual double RShape::getAngleAtPercent(double p) const

virtual const

Returns: Angle at given percentile.

virtual double RShape::getAngleAtPoint(const RVector &pos) const

virtual inline const

Reimplemented in getAngleAtPoint.

virtual QList< RVector > RShape::getArcReferencePoints() const

virtual inline const

Returns: The reference point(s) of this shape.

Reimplemented in getArcReferencePoints, getArcReferencePoints.

virtual QList< bool > RShape::getBoolProperties() const

virtual inline const

Reimplemented in getBoolProperties, getBoolProperties, getBoolProperties, getBoolProperties.

virtual RBox RShape::getBoundingBox() const =0 = 0

pure virtual const

Returns: The bounding box of this shape.

Reimplemented in getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox, getBoundingBox.

virtual QList< RVector > RShape::getCenterPoints() const =0 = 0

pure virtual const

Returns: The center point(s) of this shape.

Reimplemented in getCenterPoints, getCenterPoints, getCenterPoints, getCenterPoints, getCenterPoints, getCenterPoints, getCenterPoints, getCenterPoints, getCenterPoints.

virtual RVector RShape::getClosestPointOnShape(const RVector &p, bool limited=true, double strictRange=RMAXDOUBLE) const

virtual const

Returns: Point on this shape that is closest to p. Based on getVectorTo.

virtual double RShape::getDirection1() const

virtual inline const

Reimplemented in getDirection1, getDirection1, getDirection1, getDirection1, getDirection1, getDirection1, getDirection1, getDirection1, getDirection1, getDirection1, getDirection1.

virtual double RShape::getDirection2() const

virtual inline const

Reimplemented in getDirection2, getDirection2, getDirection2, getDirection2, getDirection2, getDirection2, getDirection2, getDirection2, getDirection2, getDirection2, getDirection2.

virtual double RShape::getDistanceFromStart(const RVector &p) const

virtual 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.

virtual QList< double > RShape::getDistancesFromStart(const RVector &p) const

virtual 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.

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

virtual const

Returns: Shortest distance from this shape to the given point. Based on getVectorTo.

Reimplemented in getDistanceTo, getDistanceTo, getDistanceTo.

virtual QList< double > RShape::getDoubleProperties() const

virtual inline const

Reimplemented in getDoubleProperties, getDoubleProperties, getDoubleProperties, getDoubleProperties, getDoubleProperties.

virtual RVector RShape::getEndPoint() const

virtual inline const

Reimplemented in getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint, getEndPoint.

virtual QList< RVector > RShape::getEndPoints() const =0 = 0

pure virtual const

Returns: The end point(s) of this shape.

Reimplemented in getEndPoints, getEndPoints, getEndPoints, getEndPoints, getEndPoints, getEndPoints, getEndPoints, getEndPoints, getEndPoints.

QList< RVector > RShape::getIntersectionPoints(const RShape &other, bool limited=true, bool same=false, bool force=false) const

const

Returns: The intersection point(s) between this shape and the given other shape.

virtual QList< int > RShape::getIntProperties() const

virtual inline const

Reimplemented in getIntProperties.

virtual double RShape::getLength() const =0 = 0

pure 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.

virtual double RShape::getMaxDistanceTo(const QList< RVector > &points, bool limited=true, double strictRange=RMAXDOUBLE) const

virtual const

Returns: Maximum shortest distance from this shape to any of the given points.

virtual RVector RShape::getMiddlePoint() const

virtual inline const

Reimplemented in getMiddlePoint, getMiddlePoint, getMiddlePoint, getMiddlePoint, getMiddlePoint, getMiddlePoint.

virtual QList< RVector > RShape::getMiddlePoints() const =0 = 0

pure virtual const

Returns: The middle point(s) of this shape.

Reimplemented in getMiddlePoints, getMiddlePoints, getMiddlePoints, getMiddlePoints, getMiddlePoints, getMiddlePoints, getMiddlePoints, getMiddlePoints, getMiddlePoints.

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.

virtual RVector RShape::getPointAtPercent(double p) const

virtual const

Returns: Point at given percentile.

Reimplemented in getPointAtPercent.

virtual QList< RVector > RShape::getPointCloud(double segmentLength) const =0 = 0

pure virtual const

Reimplemented in getPointCloud, getPointCloud, getPointCloud, getPointCloud, getPointCloud, getPointCloud, getPointCloud, getPointCloud, getPointCloud.

virtual RVector RShape::getPointOnShape() const

virtual const

Reimplemented in getPointOnShape, getPointOnShape.

virtual QList< RVector > RShape::getPointsWithDistanceToEnd(double distance, int from=RS::FromAny) const =0 = 0

pure 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.

virtual RVector RShape::getPointWithDistanceToEnd(double distance) const

virtual inline const

virtual RVector RShape::getPointWithDistanceToStart(double distance) const

virtual inline const

virtual QList< RVector > RShape::getSelfIntersectionPoints(double tolerance=RS::PointTolerance) const

virtual inline const

Reimplemented in getSelfIntersectionPoints, getSelfIntersectionPoints.

virtual RShape::Type RShape::getShapeType() const

virtual inline const

Reimplemented in getShapeType, getShapeType, getShapeType, getShapeType, getShapeType, getShapeType, getShapeType, getShapeType, getShapeType, getShapeType.

virtual RS::Side RShape::getSideOfPoint(const RVector &point) const

virtual inline const

Reimplemented in getSideOfPoint, getSideOfPoint, getSideOfPoint, getSideOfPoint, getSideOfPoint, getSideOfPoint, getSideOfPoint, getSideOfPoint, getSideOfPoint.

virtual RVector RShape::getStartPoint() const

virtual inline const

Reimplemented in getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint, getStartPoint.

virtual QSharedPointer< RShape > RShape::getTransformed(const QTransform &transform) const =0 = 0

pure virtual const

Reimplemented in getTransformed, getTransformed, getTransformed, getTransformed, getTransformed, getTransformed, getTransformed, getTransformed, getTransformed.

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.

virtual RVector RShape::getVectorFromEndpointTo(const RVector &point) const

virtual const

Returns: Shortest vector from any end point of this shape to the given point.

virtual QList< RVector > RShape::getVectorProperties() const

virtual inline const

Reimplemented in getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties, getVectorProperties.

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

pure virtual const

Returns: Shortest vector from this shape to the given point.

Parameters:

  • point: the given point
  • limited: 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.

virtual bool RShape::intersectsWith(const RShape &other, bool limited=true) const

virtual const

Returns: True if this shape intersects with the given shape.

virtual bool RShape::isDirected() const

virtual inline const

Reimplemented in isDirected, isDirected, isDirected, isDirected, isDirected, isDirected.

virtual bool RShape::isInterpolated() const

virtual 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.

virtual bool RShape::isOnShape(const RVector &point, bool limited=true, double tolerance=RDEFAULT_TOLERANCE_1E_MIN4) const

virtual const

Returns: true if the given point is on this shape.

Reimplemented in isOnShape.

virtual bool RShape::isValid() const

virtual inline const

Reimplemented in isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid, isValid.

virtual bool RShape::mirror(const RLine &axis)=0 = 0

pure 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 = 0

pure virtual

Reimplemented in move, move, move, move, move, move, move, move, move, move, move, move, move, move, move, move, move, move, move, move, move.

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.

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

pure 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 &center=RVector())=0 = 0

pure 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 &center=RVector())

virtual

Reimplemented in scale.

virtual void RShape::setZ(double z)=0 = 0

pure virtual

Reimplemented in setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ, setZ.

virtual QList< QSharedPointer< RShape > > RShape::splitAt(const QList< RVector > &points) const

virtual 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.

virtual bool RShape::stretch(const RBox &area, const RVector &offset)

virtual

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.

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.

virtual bool RShape::trimEndPoint(double trimDist)

virtual inline

Reimplemented in trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint, trimEndPoint.

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.

virtual bool RShape::trimStartPoint(double trimDist)

virtual inline

Reimplemented in trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint, trimStartPoint.

static const RExplodable * RShape::castToExplodable(const RShape *shape)

static

static QSharedPointer< RShape > RShape::ellipseToArcCircleEllipse(const REllipse &ellipse)

static

static int RShape::getErrorCode()

static inline

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

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.

static QList< RVector > RShape::getIntersectionPointsAA(const RArc &arc1, const RArc &arc2, bool limited=true)

static

static QList< RVector > RShape::getIntersectionPointsAC(const RArc &arc1, const RCircle &circle2, bool limited=true)

static

static QList< RVector > RShape::getIntersectionPointsAE(const RArc &arc1, const REllipse &ellipse2, bool limited=true)

static

static QList< RVector > RShape::getIntersectionPointsAS(const RArc &arc1, const RSpline &spline2, bool limited=true)

static

static QList< RVector > RShape::getIntersectionPointsAT(const RArc &arc1, const RTriangle &triangle2, bool limited=true)

static

static QList< RVector > RShape::getIntersectionPointsAX(const RArc &arc1, const RExplodable &explodable2, bool limited=true)

static

static QList< RVector > RShape::getIntersectionPointsCC(const RCircle &circle1, const RCircle &circle2)

static

static QList< RVector > RShape::getIntersectionPointsCE(const RCircle &circle1, const REllipse &ellipse2)

static

static QList< RVector > RShape::getIntersectionPointsCS(const RCircle &circle1, const RSpline &spline2, bool limited=true)

static

static QList< RVector > RShape::getIntersectionPointsCX(const RCircle &circle1, const RExplodable &explodable2, bool limited=true)

static

static QList< RVector > RShape::getIntersectionPointsEE(const REllipse &ellipse1, const REllipse &ellipse2)

static

Based on “Hughes and Chraibi (2011-2012), Calculating Ellipse Overlap Areas”.

static QList< RVector > RShape::getIntersectionPointsEE(const REllipse &ellipse1, const REllipse &ellipse2, bool limited)

static

static QList< RVector > RShape::getIntersectionPointsES(const REllipse &ellipse1, const RSpline &spline2, bool limited=true)

static

static QList< RVector > RShape::getIntersectionPointsEX(const REllipse &ellipse1, const RExplodable &explodable2, bool limited=true)

static

static QList< RVector > RShape::getIntersectionPointsLA(const RLine &line1, const RArc &arc2, bool limited1, bool limited2)

static

static QList< RVector > RShape::getIntersectionPointsLA(const RLine &line1, const RArc &arc2, bool limited=true)

static inline

static QList< RVector > RShape::getIntersectionPointsLC(const RLine &line1, const RCircle &circle2, bool limited=true)

static

static QList< RVector > RShape::getIntersectionPointsLE(const RLine &line1, const REllipse &ellipse2, bool limited1, bool limited2)

static

static QList< RVector > RShape::getIntersectionPointsLE(const RLine &line1, const REllipse &ellipse2, bool limited=true)

static inline

static QList< RVector > RShape::getIntersectionPointsLL(const RLine &line1, const RLine &line2, bool limited1, bool limited2)

static

static QList< RVector > RShape::getIntersectionPointsLL(const RLine &line1, const RLine &line2, bool limited=true)

static inline

static QList< RVector > RShape::getIntersectionPointsLS(const RLine &line1, const RSpline &spline2, bool limited=true)

static

static QList< RVector > RShape::getIntersectionPointsLT(const RLine &line1, const RTriangle &triangle2, bool limited1, bool limited2)

static

static QList< RVector > RShape::getIntersectionPointsLT(const RLine &line1, const RTriangle &triangle2, bool limited=true)

static inline

static QList< RVector > RShape::getIntersectionPointsLX(const RLine &line1, const RExplodable &explodable2, bool limited=true)

static

static QList< RVector > RShape::getIntersectionPointsSS(const RSpline &spline1, const RSpline &spline2, bool limited=true, bool same=false, double tolerance=RS::PointTolerance)

static

static QList< RVector > RShape::getIntersectionPointsSX(const RSpline &spline1, const RExplodable &explodable2, bool limited)

static

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).

static QList< QSharedPointer< RShape > > RShape::getOffsetArcs(const RShape &shape, double distance, int number, RS::Side side, const RVector &position=RVector::invalid)

static

static QList< QSharedPointer< RShape > > RShape::getOffsetLines(const RShape &shape, double distance, int number, RS::Side side, const RVector &position=RVector::invalid)

static

static QList< QSharedPointer< RShape > > RShape::getOrderedShapes(const QList< QSharedPointer< RShape > > &shapes)

static

static QList< RPolyline > RShape::getPolylines(const QList< QSharedPointer< RShape > > &shapes)

static

static QList< QSharedPointer< RShape > > RShape::getReversedShapeList(const QList< QSharedPointer< RShape > > &shapes)

static

static RShapeProxy * RShape::getShapeProxy()

static inline

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

static bool RShape::hasProxy()

static inline

static bool RShape::isArcShape(const RShape &s)

static inline

static bool RShape::isCircleShape(const RShape &s)

static inline

static bool RShape::isEllipseShape(const RShape &s)

static inline

static bool RShape::isFullEllipseShape(const RShape &s)

static

static bool RShape::isLineShape(const RShape &s)

static inline

static bool RShape::isPointShape(const RShape &s)

static inline

static bool RShape::isPolylineShape(const RShape &s)

static inline

static bool RShape::isRayShape(const RShape &s)

static inline

static bool RShape::isSplineShape(const RShape &s)

static inline

static bool RShape::isTriangleShape(const RShape &s)

static inline

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.

static QSharedPointer< RShape > RShape::rayToLine(QSharedPointer< RShape > shape)

static

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).

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.

static QSharedPointer< RShape > RShape::scaleArc(const RShape &shape, const RVector &scaleFactors, const RVector &center=RDEFAULT_RVECTOR)

static inline

static void RShape::setShapeProxy(RShapeProxy *p)

static inline

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

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.

static QSharedPointer< RShape > RShape::xLineToRay(QSharedPointer< RShape > shape)

static

virtual void RShape::print(QDebug dbg) const

virtual const protected

Reimplemented in print, print, print, print, print, print, print, print, print, print, print.

static int RShape::errorCode = 0

static protected

static double RShape::ellipse2tr(double x, double y, double AA, double BB, double CC, double DD, double EE, double FF)

static private

static double RShape::epsTolerance = 1.0e-02

static private

static RShapeProxy * RShape::shapeProxy = NULL

static private

static double RShape::twopi = M_PI*2

static 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.

QCADCORE_EXPORT QDebug operator<<(QDebug dbg, const RShape &s)

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