QCAD
Open Source 2D CAD
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 "RS.h"
27 #include "RShape.h"
28 #include "RVector.h"
29 
30 class RBox;
31 class RPolyline;
32 
42 class QCADCORE_EXPORT RRay: public RXLine {
43 public:
44  RRay();
45  RRay(const RLine& line);
46  RRay(const RVector& basePoint, const RVector& directionVector);
47  RRay(const RVector& basePoint, double angle, double distance);
48  virtual ~RRay();
49 
50  virtual RShape::Type getShapeType() const {
51  return Ray;
52  }
53 
54  virtual RRay* clone() const {
55  return new RRay(*this);
56  }
57 
58  virtual QList<RVector> getVectorProperties() const;
59 
60  virtual bool trimEndPoint(const RVector& trimPoint, const RVector& clickPoint = RVector::invalid, bool extend = false);
61  virtual QList<RVector> getPointsWithDistanceToEnd(double distance, int from) const;
62 
63  virtual bool reverse();
64  virtual RLine getClippedLine(const RBox& box) const;
65  virtual RVector getVectorTo(const RVector& point, bool limited = true, double strictRange = RMAXDOUBLE) const;
66 
67  virtual bool stretch(const RPolyline& area, const RVector& offset);
68 
69  virtual QList<QSharedPointer<RShape> > splitAt(const QList<RVector>& points) const;
70 
71 protected:
72  virtual void print(QDebug dbg) const;
73 };
74 
78 Q_DECLARE_METATYPE(QSharedPointer<RRay>)
79 Q_DECLARE_METATYPE(QSharedPointer<RRay>*)
80 
81 #endif
virtual bool stretch(const RPolyline &area, const RVector &offset)
Definition: RXLine.cpp:260
virtual bool trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)
Definition: RXLine.cpp:116
Represents a box e.g.
Definition: RBox.h:43
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
virtual RShape::Type getShapeType() const
Definition: RRay.h:50
#define QCADCORE_EXPORT
Definition: core_global.h:10
Definition: RShape.h:65
virtual QList< RVector > getPointsWithDistanceToEnd(double distance, int from=RS::FromAny) const
Definition: RXLine.cpp:176
virtual RLine getClippedLine(const RBox &box) const
Definition: RXLine.cpp:194
Q_DECLARE_METATYPE(RMath *)
virtual bool reverse()
Definition: RXLine.cpp:252
virtual RRay * clone() const
Definition: RRay.h:54
Type
Definition: RShape.h:54
#define RMAXDOUBLE
Definition: RMath.h:63
virtual QList< QSharedPointer< RShape > > splitAt(const QList< RVector > &points) const
Definition: RXLine.cpp:272
Low-level mathematical representation of an infinite line.
Definition: RXLine.h:42
Low-level mathematical representation of a line.
Definition: RLine.h:41
virtual void print(QDebug dbg) const
Definition: RXLine.cpp:296
virtual QList< RVector > getVectorProperties() const
Definition: RXLine.cpp:64
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition: RPolyline.h:49
static const RVector invalid
invalid vector
Definition: RVector.h:317
Low-level mathematical representation of a ray.
Definition: RRay.h:42
virtual RVector getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const
Definition: RXLine.cpp:189