QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RLine.h
Go to the documentation of this file.
1 #ifndef RLINE_H
2 #define RLINE_H
3 
4 #include "RDirected.h"
5 #include "RS.h"
6 #include "RShape.h"
7 #include "RVector.h"
8 
9 class RBox;
10 class RPolyline;
11 
21 class RLine: public RShape, public RDirected {
22 public:
23  RLine();
24  RLine(const RVector& startPoint, const RVector& endPoint);
25  virtual ~RLine();
26 
27  virtual RLine* clone() const {
28  return new RLine(*this);
29  }
30 
31  virtual void to2D();
32 
33  bool isValid() const;
34 
35  virtual RBox getBoundingBox() const;
36 
37  virtual QList<RVector> getEndPoints() const;
38  virtual QList<RVector> getMiddlePoints() const;
39  virtual QList<RVector> getCenterPoints() const;
40  virtual QList<RVector> getPointsWithDistanceToEnd(
41  double distance, RS::From from = RS::FromAny) const;
42 
43  virtual RVector getVectorTo(const RVector& point,
44  bool limited = true) const;
45 
46  virtual RVector getStartPoint() const;
47  void setStartPoint(const RVector& vector);
48  virtual RVector getEndPoint() const;
49  void setEndPoint(const RVector& vector);
50 
51  RVector getMiddlePoint() const;
52 
53  double getLength() const;
54  double getAngle() const;
55 
56  void setLength(double l);
57  void setAngle(double a);
58 
59  virtual double getDirection1() const;
60  virtual double getDirection2() const;
61 
62  RS::Side getSideOfPoint(const RVector& point) const;
63 
64  void clipToXY(const RBox& box);
65 
66  virtual bool move(const RVector& offset);
67  virtual bool rotate(double rotation, const RVector& center = RDEFAULT_RVECTOR);
68  virtual bool scale(const RVector& scaleFactors, const RVector& center = RDEFAULT_RVECTOR);
69  virtual bool mirror(const RLine& axis);
70  virtual bool flipHorizontal();
71  virtual bool flipVertical();
72  virtual bool reverse();
73  virtual bool stretch(const RPolyline& area, const RVector& offset);
74 
75  virtual RS::Ending getTrimEnd(const RVector& coord, const RVector& trimPoint);
76  virtual void trimStartPoint(const RVector& p);
77  virtual void trimEndPoint(const RVector& p);
78 
79 protected:
80  virtual void print(QDebug dbg) const;
81 
82 public:
93 };
94 
98 Q_DECLARE_METATYPE(QSharedPointer<RLine>)
99 Q_DECLARE_METATYPE(QSharedPointer<RLine>*)
100 
101 #endif