Skip to content

RRay

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

Low-level mathematical representation of a ray.

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.

RRay()
RRay(const RLine &line)
RRay(const RVector &basePoint, const RVector &directionVector)
Creates a ray object with the given base point and direction.
RRay(const RVector &basePoint, double angle, double distance)
virtual ~RRay()
virtual QSharedPointer< RShape > clone() const
QSharedPointer< RRay > cloneToRay() const
virtual RLine getClippedLine(const RBox &box) const
virtual QList< RVector > getPointsWithDistanceToEnd(double distance, int from) const
virtual RShape::Type getShapeType() const
virtual QList< RVector > getVectorProperties() const
virtual RVector getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const
virtual bool reverse()
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 void print(QDebug dbg) const

RRay::RRay()

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 a ray object with invalid start and end points.

RRay::RRay(const RLine &line)

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

Creates a ray object with the given base point and direction.

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

virtual RRay::~RRay()

virtual

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

virtual inline const

Reimplemented from clone.

QSharedPointer< RRay > RRay::cloneToRay() const

inline const

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

virtual const

Reimplemented from getClippedLine.

virtual QList< RVector > RRay::getPointsWithDistanceToEnd(double distance, int from) const

virtual const

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

Reimplemented from getPointsWithDistanceToEnd.

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

virtual inline const

Reimplemented from getShapeType.

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

virtual const

Reimplemented from getVectorProperties.

virtual RVector RRay::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.

virtual bool RRay::reverse()

virtual

Reimplemented from reverse.

Reimplemented in reverse.

virtual QList< QSharedPointer< RShape > > RRay::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.

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

virtual

Reimplemented from stretch.

Reimplemented in stretch.

virtual bool RRay::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.

virtual void RRay::print(QDebug dbg) const

virtual const protected

Reimplemented from print.