QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RLineData.h
Go to the documentation of this file.
1 
20 #ifndef RLINEDATA_H
21 #define RLINEDATA_H
22 
23 #include "entity_global.h"
24 
25 #include "RBox.h"
26 #include "RDocument.h"
27 #include "REntity.h"
28 #include "RLine.h"
29 #include "RVector.h"
30 
38 class QCADENTITY_EXPORT RLineData: public REntityData, protected RLine {
39 
40  friend class RLineEntity;
41 
42 protected:
44 
45 public:
46  RLineData();
47  RLineData(const RLine& line);
48  RLineData(const RVector& startPoint, const RVector& endPoint);
49 
51  return *this;
52  }
53 
55  return RLine::getStartPoint();
56  }
57  RVector getEndPoint() const {
58  return RLine::getEndPoint();
59  }
60  double getAngle() const {
61  return RLine::getAngle();
62  }
63  double getDirection1() const {
64  return RLine::getDirection1();
65  }
66  double getDirection2() const {
67  return RLine::getDirection2();
68  }
69  bool reverse() {
70  return RLine::reverse();
71  }
72 
73  RS::Ending getTrimEnd(const RVector& coord, const RVector& trimPoint) {
74  return RLine::getTrimEnd(coord, trimPoint);
75  }
76  void trimStartPoint(const RVector& p) {
77  return RLine::trimStartPoint(p);
78  }
79  void trimEndPoint(const RVector& p) {
80  return RLine::trimEndPoint(p);
81  }
82 
83  RS::Side getSideOfPoint(const RVector& point) const {
84  return RLine::getSideOfPoint(point);
85  }
86 
87  virtual QList<RVector> getReferencePoints(
89 
90  virtual bool moveReferencePoint(const RVector& referencePoint,
91  const RVector& targetPoint);
92 
93  virtual RShape* castToShape() {
94  return this;
95  }
96 
97  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX) const {
98  Q_UNUSED(queryBox)
99 
100  return QList<QSharedPointer<RShape> >() <<
101  QSharedPointer<RShape>(new RLine(*this));
102  }
103 };
104 
107 Q_DECLARE_METATYPE(QSharedPointer<RLineData>)
108 
109 #endif