QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RSplineEntity.h
Go to the documentation of this file.
1 #ifndef RSPLINEENTITY_H
2 #define RSPLINEENTITY_H
3 
4 #include "REntity.h"
5 #include "RSplineData.h"
6 
7 class RDocument;
8 class RExporter;
9 
17 class RSplineEntity: public REntity {
18 
19 public:
29 
38 
39 public:
42  virtual ~RSplineEntity();
43 
44  static void init();
45 
46  virtual RSplineEntity* clone() const {
47  return new RSplineEntity(*this);
48  }
49 
50  virtual RS::EntityType getType() const {
51  return RS::EntitySpline;
52  }
53 
54  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value);
55  QPair<QVariant, RPropertyAttributes> getProperty(
56  RPropertyTypeId propertyTypeId,
57  bool humanReadable = false, bool noAttributes = false);
58 
59  virtual void exportEntity(RExporter& e, bool preview=false) const;
60 
61  virtual void setUndone(bool on) {
64  }
65 
66  virtual RSplineData& getData() {
67  return data;
68  }
69 
70  virtual const RSplineData& getData() const {
71  return data;
72  }
73 
74  bool isValid() const {
75  return data.isValid();
76  }
77 
78  double getDegree() const {
79  return data.getDegree();
80  }
81 
82  double getDirection1() const {
83  return data.getDirection1();
84  }
85 
86  double getDirection2() const {
87  return data.getDirection2();
88  }
89 
91  return data.getTangentAtStart();
92  }
93 
95  return data.getTangentAtEnd();
96  }
97 
98  bool isClosed() const {
99  return data.isClosed();
100  }
101 
102  bool isPeriodic() const {
103  return data.isPeriodic();
104  }
105 
106  QList<RVector> getControlPoints() const {
107  return data.getControlPoints();
108  }
109 
110  QList<RVector> getControlPointsWrapped() const {
111  return data.getControlPointsWrapped();
112  }
113 
114  QList<RVector> getFitPoints() const {
115  return data.getFitPoints();
116  }
117 
118  QList<double> getKnotVector() const {
119  return data.getKnotVector();
120  }
121 
122  QList<double> getWeights() const {
123  return data.getWeights();
124  }
125 
126  //RSpline getSubSpline(double d1, double d2) const {
127  // return data.getSubSpline(d1, d2);
128  //}
129 
130  double getLength() const {
131  return data.getLength();
132  }
133 
135  return data.getStartPoint();
136  }
137 
139  return data.getEndPoint();
140  }
141 
142  bool reverse() {
143  return data.reverse();
144  }
145 
146  virtual int getComplexity() const {
147  return getData().getExploded().count();
148  }
149 
150  QList<QSharedPointer<RShape> > getExploded() const {
151  return data.getExploded();
152  }
153 
154  /*
155  double getAngle() const {
156  return data.getAngle();
157  }
158 
159  double getDirection1() const {
160  return data.getDirection1();
161  }
162 
163  double getDirection2() const {
164  return data.getDirection2();
165  }
166 
167  RS::Side getSideOfPoint(const RVector& point) const {
168  return data.getSideOfPoint(point);
169  }
170  */
171 
172 protected:
173  virtual void print(QDebug dbg) const;
174 
175 protected:
177 };
178 
180 Q_DECLARE_METATYPE(QSharedPointer<RSplineEntity>)
181 Q_DECLARE_METATYPE(QSharedPointer<RSplineEntity>*)
182 
183 #endif