QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
REllipseEntity.h
Go to the documentation of this file.
1 #ifndef RELLIPSEENTITY_H
2 #define RELLIPSEENTITY_H
3 
4 #include "REntity.h"
5 #include "REllipseData.h"
6 #include "RLineweight.h"
7 
8 class RDocument;
9 class RExporter;
10 
18 class REllipseEntity: public REntity {
19 
20 public:
30 
43 
50 
52 
53 public:
56  virtual ~REllipseEntity();
57 
58  static void init();
59 
60  virtual REllipseEntity* clone() const {
61  return new REllipseEntity(*this);
62  }
63 
64  virtual RS::EntityType getType() const {
65  return RS::EntityEllipse;
66  }
67 
68  void setShape(const REllipse& e);
69 
70  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value);
71  QPair<QVariant, RPropertyAttributes> getProperty(
72  RPropertyTypeId propertyTypeId,
73  bool humanReadable = false, bool noAttributes = false);
74 
75  virtual void exportEntity(RExporter& e, bool preview=false) const;
76 
77  virtual REllipseData& getData() {
78  return data;
79  }
80 
81  virtual const REllipseData& getData() const {
82  return data;
83  }
84 
85  RVector getCenter() const {
86  return data.getCenter();
87  }
88 
90  return data.getMajorPoint();
91  }
92 
93  double getMajorRadius() const {
94  return data.getMajorRadius();
95  }
96 
97  double getMinorRadius() const {
98  return data.getMinorRadius();
99  }
100 
101  double getRatio() const {
102  return data.getRatio();
103  }
104 
105  double getAngle() const {
106  return data.getAngle();
107  }
108 
109  void setRatio(double ratio) {
110  data.setRatio(ratio);
111  }
112 
113  double getStartAngle() const {
114  return data.getStartAngle();
115  }
116 
117  double getStartParam() const {
118  return data.getStartParam();
119  }
120 
121  void setStartParam(double param) {
122  data.setStartParam(param);
123  }
124 
125  double getEndAngle() const {
126  return data.getEndAngle();
127  }
128 
129  double getEndParam() const {
130  return data.getEndParam();
131  }
132 
133  void setEndParam(double param) {
134  data.setEndParam(param);
135  }
136 
137  double getAngleLength() const {
138  return data.getAngleLength();
139  }
140 
141  bool isReversed() const {
142  return data.isReversed();
143  }
144 
145  void setRevered(bool reversed) {
146  data.setReversed(reversed);
147  }
148 
150  return data.getStartPoint();
151  }
152 
154  return data.getEndPoint();
155  }
156 
157  bool isFullEllipse() const {
158  return data.isFullEllipse();
159  }
160 
161  virtual bool reverse() {
162  return data.reverse();
163  }
164 
165  double getParamTo(const RVector& pos) {
166  return data.getParamTo(pos);
167  }
168 
170  const RVector& trimPoint) {
171  return data.getTrimEnd(coord, trimPoint);
172  }
173 
174  void trimStartPoint(const RVector& p) {
175  return data.trimStartPoint(p);
176  }
177 
178  void trimEndPoint(const RVector& p) {
179  return data.trimEndPoint(p);
180  }
181 
182 protected:
183  virtual void print(QDebug dbg) const;
184 
185 protected:
187 };
188 
190 Q_DECLARE_METATYPE(QSharedPointer<REllipseEntity>)
191 Q_DECLARE_METATYPE(QSharedPointer<REllipseEntity>*)
192 
193 #endif