QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RRay.h
Go to the documentation of this file.
1
20#ifndef RRAY_H
21#define RRAY_H
22
23#include "../core_global.h"
24
25#include "RXLine.h"
26#include "RShape.h"
27#include "RVector.h"
28
29class RBox;
30class RPolyline;
31
42public:
43 RRay();
44 RRay(const RLine& line);
45 RRay(const RVector& basePoint, const RVector& directionVector);
46 RRay(const RVector& basePoint, double angle, double distance);
47 virtual ~RRay();
48
49 virtual RShape::Type getShapeType() const {
50 return Ray;
51 }
52
53 virtual QSharedPointer<RShape> clone() const {
54 return QSharedPointer<RShape>(new RRay(*this));
55 }
56
57 QSharedPointer<RRay> cloneToRay() const {
58 return QSharedPointer<RRay>(new RRay(*this));
59 }
60
61 virtual QList<RVector> getVectorProperties() const;
62
63 virtual bool trimEndPoint(const RVector& trimPoint, const RVector& clickPoint = RVector::invalid, bool extend = false);
64 virtual QList<RVector> getPointsWithDistanceToEnd(double distance, int from) const;
65
66 virtual bool reverse();
67 virtual RLine getClippedLine(const RBox& box) const;
68 virtual RVector getVectorTo(const RVector& point, bool limited = true, double strictRange = RMAXDOUBLE) const;
69
70 virtual bool stretch(const RPolyline& area, const RVector& offset);
71
72 virtual QList<QSharedPointer<RShape> > splitAt(const QList<RVector>& points) const;
73
74#if QT_VERSION >= 0x060000
79 RRay copy() const {
80 return *this;
81 }
82#endif
83
84protected:
85 virtual void print(QDebug dbg) const;
86};
87
91Q_DECLARE_METATYPE(QSharedPointer<RRay>)
92Q_DECLARE_METATYPE(QSharedPointer<RRay>*)
93
94#endif
Q_DECLARE_METATYPE(RMath *)
#define RMAXDOUBLE
Definition RMath.h:66
Represents a box e.g.
Definition RBox.h:46
Low-level mathematical representation of a line.
Definition RLine.h:41
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition RPolyline.h:50
Low-level mathematical representation of a ray.
Definition RRay.h:41
virtual RShape::Type getShapeType() const
Definition RRay.h:49
QSharedPointer< RRay > cloneToRay() const
Definition RRay.h:57
virtual QSharedPointer< RShape > clone() const
Definition RRay.h:53
Type
Definition RShape.h:74
@ Ray
Definition RShape.h:85
Represents a 3d vector (x/y/z).
Definition RVector.h:47
static const RVector invalid
invalid vector
Definition RVector.h:335
Low-level mathematical representation of an infinite line.
Definition RXLine.h:42
virtual RLine getClippedLine(const RBox &box) const
Definition RXLine.cpp:210
virtual QList< RVector > getPointsWithDistanceToEnd(double distance, int from=RS::FromAny) const
Definition RXLine.cpp:187
virtual void print(QDebug dbg) const
Definition RXLine.cpp:312
virtual bool stretch(const RPolyline &area, const RVector &offset)
Definition RXLine.cpp:276
virtual RVector getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const
Definition RXLine.cpp:205
virtual bool reverse()
Definition RXLine.cpp:268
virtual QList< RVector > getVectorProperties() const
Definition RXLine.cpp:66
virtual QList< QSharedPointer< RShape > > splitAt(const QList< RVector > &points) const
Definition RXLine.cpp:288
virtual bool trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition RXLine.cpp:118
#define QCADCORE_EXPORT
Definition core_global.h:10