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 
54  //virtual RBox getBoundingBox() const;
55 
57  return RLine::getStartPoint();
58  }
59  RVector getEndPoint() const {
60  return RLine::getEndPoint();
61  }
62  double getAngle() const {
63  return RLine::getAngle();
64  }
65  double getDirection1() const {
66  return RLine::getDirection1();
67  }
68  double getDirection2() const {
69  return RLine::getDirection2();
70  }
71  bool reverse() {
72  return RLine::reverse();
73  }
74 
75  RS::Ending getTrimEnd(const RVector& coord, const RVector& trimPoint) {
76  return RLine::getTrimEnd(coord, trimPoint);
77  }
78  void trimStartPoint(const RVector& p) {
79  return RLine::trimStartPoint(p);
80  }
81  void trimEndPoint(const RVector& p) {
82  return RLine::trimEndPoint(p);
83  }
84 
85  RS::Side getSideOfPoint(const RVector& point) const {
86  return RLine::getSideOfPoint(point);
87  }
88 
89  virtual QList<RVector> getReferencePoints(
91 
92  virtual bool moveReferencePoint(const RVector& referencePoint,
93  const RVector& targetPoint);
94 
95  virtual RShape* castToShape() {
96  return this;
97  }
98 
99  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX) const {
100  Q_UNUSED(queryBox)
101 
102  return QList<QSharedPointer<RShape> >() <<
103  QSharedPointer<RShape>(new RLine(*this));
104  }
105 
107  return *this;
108  }
109 };
110 
113 Q_DECLARE_METATYPE(QSharedPointer<RLineData>)
114 
115 #endif