QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RArcData.h
Go to the documentation of this file.
1 
20 #ifndef RARCDATA_H
21 #define RARCDATA_H
22 
23 #include "entity_global.h"
24 
25 #include "RBox.h"
26 #include "RDocument.h"
27 #include "REntity.h"
28 #include "RPoint.h"
29 #include "RVector.h"
30 #include "RArc.h"
31 
39 class QCADENTITY_EXPORT RArcData: public REntityData, protected RArc {
40 
41  friend class RArcEntity;
42 
43 protected:
45 
46 public:
47  RArcData();
48  RArcData(const RArc& arc);
49  RArcData(const RVector& center, double radius, double startAngle,
50  double endAngle, bool reversed = false);
51 
53  return *this;
54  }
55 
56  RVector getCenter() const {
57  return RArc::getCenter();
58  }
59  double getRadius() const {
60  return RArc::getRadius();
61  }
62  double getBulge() const {
63  return RArc::getBulge();
64  }
65  double getStartAngle() const {
66  return RArc::getStartAngle();
67  }
68  double getEndAngle() const {
69  return RArc::getEndAngle();
70  }
71  bool isReversed() const {
72  return RArc::isReversed();
73  }
74  double getDirection1() const {
75  return RArc::getDirection1();
76  }
77  double getDirection2() const {
78  return RArc::getDirection2();
79  }
80  bool reverse() {
81  return RArc::reverse();
82  }
83 
85  const RVector& trimPoint) {
86  return RArc::getTrimEnd(coord, trimPoint);
87  }
88  void trimStartPoint(const RVector& p) {
89  return RArc::trimStartPoint(p);
90  }
91  void trimEndPoint(const RVector& p) {
92  return RArc::trimEndPoint(p);
93  }
94 
95  double getLength() const {
96  return RArc::getLength();
97  }
98  double getAngleLength(bool allowForZeroLength = false) const {
99  return RArc::getAngleLength(allowForZeroLength);
100  }
101 
102  virtual QList<RVector> getReferencePoints(
104 
105  virtual bool moveReferencePoint(const RVector& referencePoint,
106  const RVector& targetPoint);
107 
108  RPolyline approximateWithLines(double segmentLength) {
109  return RArc::approximateWithLines(segmentLength);
110  }
111 
112  virtual RShape* castToShape() {
113  return this;
114  }
115 
116  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX) const {
117  Q_UNUSED(queryBox)
118 
119  return QList<QSharedPointer<RShape> >() <<
120  QSharedPointer<RShape>(new RArc(*this));
121  }
122 };
123 
126 Q_DECLARE_METATYPE(QSharedPointer<RArcData>)
127 
128 #endif