QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RArcData.h
Go to the documentation of this file.
1 #ifndef RARCDATA_H
2 #define RARCDATA_H
3 
4 #include "RBox.h"
5 #include "RDocument.h"
6 #include "REntity.h"
7 #include "RPoint.h"
8 #include "RVector.h"
9 #include "RArc.h"
10 
18 class RArcData: public REntityData, protected RArc {
19 
20  friend class RArcEntity;
21 
22 protected:
24 
25 public:
26  RArcData();
27  RArcData(const RArc& arc);
28  RArcData(const RVector& center, double radius, double startAngle,
29  double endAngle, bool reversed = false);
30 
31  RVector getCenter() const {
32  return RArc::getCenter();
33  }
34  double getRadius() const {
35  return RArc::getRadius();
36  }
37  double getBulge() const {
38  return RArc::getBulge();
39  }
40  double getStartAngle() const {
41  return RArc::getStartAngle();
42  }
43  double getEndAngle() const {
44  return RArc::getEndAngle();
45  }
46  bool isReversed() const {
47  return RArc::isReversed();
48  }
49  double getDirection1() const {
50  return RArc::getDirection1();
51  }
52  double getDirection2() const {
53  return RArc::getDirection2();
54  }
55  bool reverse() {
56  return RArc::reverse();
57  }
58 
60  const RVector& trimPoint) {
61  return RArc::getTrimEnd(coord, trimPoint);
62  }
63  void trimStartPoint(const RVector& p) {
64  return RArc::trimStartPoint(p);
65  }
66  void trimEndPoint(const RVector& p) {
67  return RArc::trimEndPoint(p);
68  }
69 
70  double getLength() const {
71  return RArc::getLength();
72  }
73  double getAngleLength(bool allowForZeroLength = false) const {
74  return RArc::getAngleLength(allowForZeroLength);
75  }
76 
77  virtual QList<RVector> getReferencePoints(
79 
80  virtual bool moveReferencePoint(const RVector& referencePoint,
81  const RVector& targetPoint);
82 
83  RPolyline approximateWithLines(double segmentLength) {
84  return RArc::approximateWithLines(segmentLength);
85  }
86 
87  virtual RShape* castToShape() {
88  return this;
89  }
90 
91  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX) const {
92  Q_UNUSED(queryBox)
93 
94  return QList<QSharedPointer<RShape> >() <<
95  QSharedPointer<RShape>(new RArc(*this));
96  }
97 };
98 
100 Q_DECLARE_METATYPE(QSharedPointer<RArcData>)
101 
102 #endif