Skip to content

RXLine

Class in Math Module
Header: #include <src/core/math/RXLine.h>
Inherits: RShape
Inherited by: RRay, RXLineData

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.

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 &center=RDEFAULT_RVECTOR)
virtual bool scale(const RVector &scaleFactors, const RVector &center=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)
RVector basePoint
Getter function for this property: getBasePoint.
RVector directionVector
Getter function for this property: getDirectionVector.
virtual void print(QDebug dbg) const

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::RXLine(const RLine &line)

RXLine::RXLine(const RVector &basePoint, const RVector &directionVector)

Creates an xline object with the given base point and direction.

RXLine::RXLine(const RVector &basePoint, double angle, double distance)

virtual RXLine::~RXLine()

virtual

virtual QSharedPointer< RShape > RXLine::clone() const

virtual inline const

Reimplemented from clone.

Reimplemented in clone.

QSharedPointer< RXLine > RXLine::cloneToXLine() const

inline const

double RXLine::getAngle() const

const

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

virtual const

Returns: Angle on the entity at the given distance from the start point.

Reimplemented from getAngleAt.

RVector RXLine::getBasePoint() const

const

virtual RBox RXLine::getBoundingBox() const

virtual const

Returns: The bounding box of this shape.

Reimplemented from getBoundingBox.

virtual QList< RVector > RXLine::getCenterPoints() const

virtual const

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

Reimplemented from getCenterPoints.

virtual RLine RXLine::getClippedLine(const RBox &box) const

virtual const

Reimplemented in getClippedLine.

virtual double RXLine::getDirection1() const

virtual const

Reimplemented from getDirection1.

virtual double RXLine::getDirection2() const

virtual const

Reimplemented from getDirection2.

RVector RXLine::getDirectionVector() const

const

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

virtual const

Returns: Distance of given point to start point of shape along shape.

Parameters:

  • p: Point (assumed to be on shape).

Reimplemented from getDistanceFromStart.

virtual RVector RXLine::getEndPoint() const

virtual const

Reimplemented from getEndPoint.

virtual QList< RVector > RXLine::getEndPoints() const

virtual const

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

Reimplemented from getEndPoints.

virtual double RXLine::getLength() const

virtual const

Returns: The total length of this shape if applicable or NaN if not.

Reimplemented from getLength.

RLine RXLine::getLineShape() const

inline const

virtual RVector RXLine::getMiddlePoint() const

virtual const

Reimplemented from getMiddlePoint.

virtual QList< RVector > RXLine::getMiddlePoints() const

virtual const

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

Reimplemented from getMiddlePoints.

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.

virtual QList< RVector > RXLine::getPointCloud(double segmentLength) const

virtual const

Reimplemented from getPointCloud.

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

virtual const

Returns: All points on this shape with the given distance to an endpoint.

Reimplemented from getPointsWithDistanceToEnd.

Reimplemented in getPointsWithDistanceToEnd.

RVector RXLine::getSecondPoint() const

const

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

virtual inline const

Reimplemented from getShapeType.

Reimplemented in getShapeType.

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

virtual const

Reimplemented from getSideOfPoint.

Reimplemented in getSideOfPoint, getSideOfPoint.

virtual RVector RXLine::getStartPoint() const

virtual const

Reimplemented from getStartPoint.

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

virtual const

Reimplemented from getTransformed.

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.

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

virtual const

Reimplemented from getVectorProperties.

Reimplemented in getVectorProperties.

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

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 from getVectorTo.

Reimplemented in getVectorTo, getVectorTo, getVectorTo.

virtual bool RXLine::isDirected() const

virtual inline const

Reimplemented from isDirected.

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.

Reimplemented in move, move.

virtual bool RXLine::reverse()

virtual

Reimplemented from reverse.

Reimplemented in reverse, reverse, reverse.

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

virtual

Reimplemented from rotate.

Reimplemented in rotate, rotate.

virtual bool RXLine::scale(const RVector &scaleFactors, const RVector &center=RDEFAULT_RVECTOR)

virtual

Reimplemented from scale.

Reimplemented in scale, scale.

void RXLine::setAngle(double a)

void RXLine::setBasePoint(const RVector &vector)

void RXLine::setDirectionVector(const RVector &vector)

void RXLine::setLength(double l)

void RXLine::setSecondPoint(const RVector &vector)

virtual void RXLine::setZ(double z)

virtual

Reimplemented from setZ.

Reimplemented in setZ, setZ.

virtual QList< QSharedPointer< RShape > > RXLine::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 from splitAt.

Reimplemented in splitAt.

virtual bool RXLine::stretch(const RPolyline &area, const RVector &offset)

virtual

Reimplemented from stretch.

Reimplemented in stretch, stretch, stretch.

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.

virtual bool RXLine::trimEndPoint(double trimDist)

virtual inline

Reimplemented from trimEndPoint.

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.

virtual bool RXLine::trimStartPoint(double trimDist)

virtual inline

Reimplemented from trimStartPoint.

RVector RXLine::basePoint

Getter function for this property: getBasePoint.

Setter function for this property: setBasePoint

RVector RXLine::directionVector

Getter function for this property: getDirectionVector.

Setter function for this property: setDirectionVector

virtual void RXLine::print(QDebug dbg) const

virtual const protected

Reimplemented from print.

Reimplemented in print.