Skip to content

RPoint

Class in Math Module
Header: #include <src/core/math/RPoint.h>
Inherits: RShape
Inherited by: RPointData, RTextLabel, RViewportData

Low-level mathematical representation of a point.

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.

RPoint()
RPoint(const RVector &position)
Creates a point object with the given position.
RPoint(double x, double y)
virtual ~RPoint()
virtual QSharedPointer< RShape > clone() const
QSharedPointer< RPoint > cloneToPoint() const
virtual bool flipHorizontal()
virtual bool flipVertical()
virtual double getAngleAt(double distance, RS::From from=RS::FromStart) const
virtual RBox getBoundingBox() const
virtual QList< RVector > getCenterPoints() const
virtual QList< RVector > getEndPoints() const
virtual double getLength() const
virtual QList< RVector > getMiddlePoints() const
virtual QList< RVector > getPointCloud(double segmentLength) const
virtual QList< RVector > getPointsWithDistanceToEnd(double distance, int from=RS::FromAny) const
RVector getPosition() const
virtual RShape::Type getShapeType() const
virtual QSharedPointer< RShape > getTransformed(const QTransform &transform) const
virtual QList< RVector > getVectorProperties() const
virtual RVector getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const
virtual bool mirror(const RLine &axis)
virtual bool move(const RVector &offset)
virtual bool rotate(double rotation, const RVector &center=RDEFAULT_RVECTOR)
virtual bool scale(const RVector &scaleFactors, const RVector &center=RDEFAULT_RVECTOR)
void setPosition(const RVector &p)
virtual void setZ(double z)
RVector position
Getter function for this property: getPosition.
virtual void print(QDebug dbg) const

RPoint::RPoint()

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 point object with an invalid position

RPoint::RPoint(const RVector &position)

Creates a point object with the given position.

Parameters:

  • position: the position

RPoint::RPoint(double x, double y)

virtual RPoint::~RPoint()

virtual

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

virtual inline const

Reimplemented from clone.

Reimplemented in clone.

QSharedPointer< RPoint > RPoint::cloneToPoint() const

inline const

virtual bool RPoint::flipHorizontal()

virtual

Reimplemented from flipHorizontal.

Reimplemented in flipHorizontal, flipHorizontal.

virtual bool RPoint::flipVertical()

virtual

Reimplemented from flipVertical.

Reimplemented in flipVertical, flipVertical.

virtual double RPoint::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.

virtual RBox RPoint::getBoundingBox() const

virtual const

Returns: The bounding box of this shape.

Reimplemented from getBoundingBox.

Reimplemented in getBoundingBox.

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

virtual const

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

Reimplemented from getCenterPoints.

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

virtual const

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

Reimplemented from getEndPoints.

virtual double RPoint::getLength() const

virtual const

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

Reimplemented from getLength.

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

virtual const

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

Reimplemented from getMiddlePoints.

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

virtual const

Reimplemented from getPointCloud.

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

RVector RPoint::getPosition() const

inline const

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

virtual inline const

Reimplemented from getShapeType.

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

virtual const

Reimplemented from getTransformed.

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

virtual const

Reimplemented from getVectorProperties.

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

virtual bool RPoint::mirror(const RLine &axis)

virtual

Reimplemented from mirror.

Reimplemented in mirror, mirror.

virtual bool RPoint::move(const RVector &offset)

virtual

Reimplemented from move.

Reimplemented in move, move.

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

virtual

Reimplemented from rotate.

Reimplemented in rotate, rotate.

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

virtual

Reimplemented from scale.

Reimplemented in scale, scale.

void RPoint::setPosition(const RVector &p)

inline

virtual void RPoint::setZ(double z)

virtual

Reimplemented from setZ.

Reimplemented in setZ, setZ.

RVector RPoint::position

Getter function for this property: getPosition.

Setter function for this property: setPosition

virtual void RPoint::print(QDebug dbg) const

virtual const protected

Reimplemented from print.

Reimplemented in print.