RXLine
Class in Math Module
Header: #include <src/core/math/RXLine.h>
Inherits: RShape
Inherited by: RRay, RXLineData
Description
Section titled “Description”Low-level mathematical representation of an infinite line.
Scriptable: This class is available in script environments.
Shared Pointer Support: Objects can be used in QSharedPointer.
Copyable: Objects are cleaned up automatically by the garbage collector of the script engine.
Stream Operator: Object has a stream operator to present itself as string, for example when using toString() in a script.
Public Functions
Section titled “Public Functions”RXLine() |
|
RXLine(const RLine &line) |
|
RXLine(const RVector &basePoint, const RVector &directionVector)Creates an xline object with the given base point and direction. |
|
RXLine(const RVector &basePoint, double angle, double distance) |
|
| virtual | ~RXLine() |
| virtual QSharedPointer< RShape > | clone() const |
| QSharedPointer< RXLine > | cloneToXLine() const |
| double | getAngle() const |
| virtual double | getAngleAt(double distance, RS::From from=RS::FromStart) const |
| RVector | getBasePoint() const |
| virtual RBox | getBoundingBox() const |
| virtual QList< RVector > | getCenterPoints() const |
| virtual RLine | getClippedLine(const RBox &box) const |
| virtual double | getDirection1() const |
| virtual double | getDirection2() const |
| RVector | getDirectionVector() const |
| virtual double | getDistanceFromStart(const RVector &p) const |
| virtual RVector | getEndPoint() const |
| virtual QList< RVector > | getEndPoints() const |
| virtual double | getLength() const |
| RLine | getLineShape() const |
| virtual RVector | getMiddlePoint() const |
| virtual QList< RVector > | getMiddlePoints() const |
| virtual QList< QSharedPointer< RShape > > | getOffsetShapes(double distance, int number, RS::Side side, const RVector &position=RVector::invalid) |
| virtual QList< RVector > | getPointCloud(double segmentLength) const |
| virtual QList< RVector > | getPointsWithDistanceToEnd(double distance, int from=RS::FromAny) const |
| RVector | getSecondPoint() 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 |
| virtual RS::Ending | getTrimEnd(const RVector &trimPoint, const RVector &clickPoint) |
| virtual QList< RVector > | getVectorProperties() const |
| virtual RVector | getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const |
| virtual bool | isDirected() const |
| virtual bool | mirror(const RLine &axis) |
| virtual bool | move(const RVector &offset) |
| virtual bool | reverse() |
| virtual bool | rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR) |
| virtual bool | scale(const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR) |
| void | setAngle(double a) |
| void | setBasePoint(const RVector &vector) |
| void | setDirectionVector(const RVector &vector) |
| void | setLength(double l) |
| void | setSecondPoint(const RVector &vector) |
| virtual void | setZ(double z) |
| virtual QList< QSharedPointer< RShape > > | splitAt(const QList< RVector > &points) const |
| virtual bool | stretch(const RPolyline &area, const RVector &offset) |
| 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) |
Public Attributes
Section titled “Public Attributes”| RVector | basePoint Getter function for this property: getBasePoint. |
| RVector | directionVector Getter function for this property: getDirectionVector. |
Protected Functions
Section titled “Protected Functions”| virtual void | print(QDebug dbg) const |
Member Documentation
Section titled “Member Documentation”RXLine
Section titled “RXLine”RXLine::RXLine()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. Creates an xline object with invalid base point and direction.
RXLine
Section titled “RXLine”RXLine::RXLine(const RLine &line)RXLine
Section titled “RXLine”RXLine::RXLine(const RVector &basePoint, const RVector &directionVector)Creates an xline object with the given base point and direction.
RXLine
Section titled “RXLine”RXLine::RXLine(const RVector &basePoint, double angle, double distance)~RXLine
Section titled “~RXLine”virtual RXLine::~RXLine()virtual
virtual QSharedPointer< RShape > RXLine::clone() constvirtual inline const
Reimplemented from clone.
Reimplemented in clone.
cloneToXLine
Section titled “cloneToXLine”QSharedPointer< RXLine > RXLine::cloneToXLine() constinline const
getAngle
Section titled “getAngle”double RXLine::getAngle() constconst
getAngleAt
Section titled “getAngleAt”virtual double RXLine::getAngleAt(double distance, RS::From from=RS::FromStart) constvirtual const
Returns: Angle on the entity at the given distance from the start point.
Reimplemented from getAngleAt.
getBasePoint
Section titled “getBasePoint”RVector RXLine::getBasePoint() constconst
getBoundingBox
Section titled “getBoundingBox”virtual RBox RXLine::getBoundingBox() constvirtual const
Returns: The bounding box of this shape.
Reimplemented from getBoundingBox.
getCenterPoints
Section titled “getCenterPoints”virtual QList< RVector > RXLine::getCenterPoints() constvirtual const
Returns: The center point(s) of this shape.
Reimplemented from getCenterPoints.
getClippedLine
Section titled “getClippedLine”virtual RLine RXLine::getClippedLine(const RBox &box) constvirtual const
Reimplemented in getClippedLine.
getDirection1
Section titled “getDirection1”virtual double RXLine::getDirection1() constvirtual const
Reimplemented from getDirection1.
getDirection2
Section titled “getDirection2”virtual double RXLine::getDirection2() constvirtual const
Reimplemented from getDirection2.
getDirectionVector
Section titled “getDirectionVector”RVector RXLine::getDirectionVector() constconst
getDistanceFromStart
Section titled “getDistanceFromStart”virtual double RXLine::getDistanceFromStart(const RVector &p) constvirtual const
Returns: Distance of given point to start point of shape along shape.
Parameters:
p: Point (assumed to be on shape).
Reimplemented from getDistanceFromStart.
getEndPoint
Section titled “getEndPoint”virtual RVector RXLine::getEndPoint() constvirtual const
Reimplemented from getEndPoint.
getEndPoints
Section titled “getEndPoints”virtual QList< RVector > RXLine::getEndPoints() constvirtual const
Returns: The end point(s) of this shape.
Reimplemented from getEndPoints.
getLength
Section titled “getLength”virtual double RXLine::getLength() constvirtual const
Returns: The total length of this shape if applicable or NaN if not.
Reimplemented from getLength.
getLineShape
Section titled “getLineShape”RLine RXLine::getLineShape() constinline const
getMiddlePoint
Section titled “getMiddlePoint”virtual RVector RXLine::getMiddlePoint() constvirtual const
Reimplemented from getMiddlePoint.
getMiddlePoints
Section titled “getMiddlePoints”virtual QList< RVector > RXLine::getMiddlePoints() constvirtual const
Returns: The middle point(s) of this shape.
Reimplemented from getMiddlePoints.
getOffsetShapes
Section titled “getOffsetShapes”virtual QList< QSharedPointer< RShape > > RXLine::getOffsetShapes(double distance, int number, RS::Side side, const RVector &position=RVector::invalid)virtual inline
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 from getOffsetShapes.
getPointCloud
Section titled “getPointCloud”virtual QList< RVector > RXLine::getPointCloud(double segmentLength) constvirtual const
Reimplemented from getPointCloud.
getPointsWithDistanceToEnd
Section titled “getPointsWithDistanceToEnd”virtual QList< RVector > RXLine::getPointsWithDistanceToEnd(double distance, int from=RS::FromAny) constvirtual const
Returns: All points on this shape with the given distance to an endpoint.
Reimplemented from getPointsWithDistanceToEnd.
Reimplemented in getPointsWithDistanceToEnd.
getSecondPoint
Section titled “getSecondPoint”RVector RXLine::getSecondPoint() constconst
getShapeType
Section titled “getShapeType”virtual RShape::Type RXLine::getShapeType() constvirtual inline const
Reimplemented from getShapeType.
Reimplemented in getShapeType.
getSideOfPoint
Section titled “getSideOfPoint”virtual RS::Side RXLine::getSideOfPoint(const RVector &point) constvirtual const
Reimplemented from getSideOfPoint.
Reimplemented in getSideOfPoint, getSideOfPoint.
getStartPoint
Section titled “getStartPoint”virtual RVector RXLine::getStartPoint() constvirtual const
Reimplemented from getStartPoint.
getTransformed
Section titled “getTransformed”virtual QSharedPointer< RShape > RXLine::getTransformed(const QTransform &transform) constvirtual const
Reimplemented from getTransformed.
getTrimEnd
Section titled “getTrimEnd”virtual RS::Ending RXLine::getTrimEnd(const RVector &trimPoint, const RVector &clickPoint)virtual
Parameters:
trimPoint: Trim start point or end point to this coordinate.clickPoint: Point that was clicked by user.
Reimplemented from getTrimEnd.
Reimplemented in getTrimEnd, getTrimEnd.
getVectorProperties
Section titled “getVectorProperties”virtual QList< RVector > RXLine::getVectorProperties() constvirtual const
Reimplemented from getVectorProperties.
Reimplemented in getVectorProperties.
getVectorTo
Section titled “getVectorTo”virtual RVector RXLine::getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) constvirtual 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 from getVectorTo.
Reimplemented in getVectorTo, getVectorTo, getVectorTo.
isDirected
Section titled “isDirected”virtual bool RXLine::isDirected() constvirtual inline const
Reimplemented from isDirected.
mirror
Section titled “mirror”virtual bool RXLine::mirror(const RLine &axis)virtual
Reimplemented from mirror.
Reimplemented in mirror, mirror.
virtual bool RXLine::move(const RVector &offset)virtual
Reimplemented from move.
reverse
Section titled “reverse”virtual bool RXLine::reverse()virtual
Reimplemented from reverse.
Reimplemented in reverse, reverse, reverse.
rotate
Section titled “rotate”virtual bool RXLine::rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR)virtual
Reimplemented from rotate.
Reimplemented in rotate, rotate.
virtual bool RXLine::scale(const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR)virtual
Reimplemented from scale.
Reimplemented in scale, scale.
setAngle
Section titled “setAngle”void RXLine::setAngle(double a)setBasePoint
Section titled “setBasePoint”void RXLine::setBasePoint(const RVector &vector)setDirectionVector
Section titled “setDirectionVector”void RXLine::setDirectionVector(const RVector &vector)setLength
Section titled “setLength”void RXLine::setLength(double l)setSecondPoint
Section titled “setSecondPoint”void RXLine::setSecondPoint(const RVector &vector)virtual void RXLine::setZ(double z)virtual
Reimplemented from setZ.
splitAt
Section titled “splitAt”virtual QList< QSharedPointer< RShape > > RXLine::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 from splitAt.
Reimplemented in splitAt.
stretch
Section titled “stretch”virtual bool RXLine::stretch(const RPolyline &area, const RVector &offset)virtual
Reimplemented from stretch.
Reimplemented in stretch, stretch, stretch.
trimEndPoint
Section titled “trimEndPoint”virtual bool RXLine::trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)virtual
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 from trimEndPoint.
Reimplemented in trimEndPoint, trimEndPoint, trimEndPoint.
trimEndPoint
Section titled “trimEndPoint”virtual bool RXLine::trimEndPoint(double trimDist)virtual inline
Reimplemented from trimEndPoint.
trimStartPoint
Section titled “trimStartPoint”virtual bool RXLine::trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)virtual
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 from trimStartPoint.
Reimplemented in trimStartPoint, trimStartPoint.
trimStartPoint
Section titled “trimStartPoint”virtual bool RXLine::trimStartPoint(double trimDist)virtual inline
Reimplemented from trimStartPoint.
basePoint
Section titled “basePoint”RVector RXLine::basePointGetter function for this property: getBasePoint.
Setter function for this property: setBasePoint
directionVector
Section titled “directionVector”RVector RXLine::directionVectorGetter function for this property: getDirectionVector.
Setter function for this property: setDirectionVector
virtual void RXLine::print(QDebug dbg) constvirtual const protected
Reimplemented from print.
Reimplemented in print.