Developer documentation | Axl-2.5.1

axlSurfaceRevolutionParametric.cpp
Go to the documentation of this file.
1 //Author: Hung NGUYEN 9:17 AM 25/08/2014
2 
3 
4 
6 #include "axlLine.h"
7 #include "axlCircleArc.h"
9 
10 
11 #include <dtkCoreSupport/dtkGlobal.h>
12 
13 
14 
15 class axlSurfaceRevolutionParametricPrivate
16 
17 {
18 
19 public:
20 
21  axlLine *axe;
22 
23  axlAbstractCurve *curve;
24 
25  double theta1;
26 
27  double theta2;
28 
29 /*axlPoint *referencePoint;*/
30 
31 };
32 
33 axlSurfaceRevolutionParametric::axlSurfaceRevolutionParametric(QObject *parent) : axlAbstractSurfaceParametric(), d(new axlSurfaceRevolutionParametricPrivate)
34 {
35 
36  /*this->setObjectName(this->identifier());
37 
38 
39 
40  d->axe = new axlLine(new axlLine);
41 
42  d->p2 = new axlPoint(1.0, 0.0, 0.0);
43 
44  d->radius = 1.0;*/
45 
46 };
47 axlSurfaceRevolutionParametric::axlSurfaceRevolutionParametric(axlLine *axe,axlAbstractCurve *curve,double theta1, double theta2, QObject *parent) : axlAbstractSurfaceParametric(), d(new axlSurfaceRevolutionParametricPrivate)
48 {
49  qDebug()<<curve->description();
50  this->setObjectName(this->identifier());
51 
52  d->axe = new axlLine(*axe);
53  if(curve)
54  d->curve = curve;
55  else
56  qDebug()<<"No curve for axlSurfaceRevolution.";
57  d->theta1 = theta1;
58  d->theta2 = theta2;
59  if(d->curve)
60  {
61  qDebug()<<"STILL NULL";
62  qDebug()<<d->curve->description();
63  }
64 }
65 
67 
68 {
69 
70  delete d;
71 
72 d = NULL;
73 
74 }
75 
76 
77 
79 
80 {
81 
82  this->setObjectName(this->identifier());
83 
84  this->setParent(other.parent());
85 
86  d->axe = other.d->axe;
87 
88  d->curve = other.d->curve;
89 
90  /*d->referencePoint = other.d->referencePoint;*/
91 
92  d->theta1 = other.d->theta1;
93 
94  d->theta2 = other.d->theta2;
95 
96  return (*this);
97 
98 }
99 
100 
101 
103 
104 {
105 
106  QString result = "axlSurfaceRevolutionParametric";
107 
108  result.append("\nAxe : "+d->axe->description() + "\nCurve : "+d->curve->identifier() + "\nStart Angle : "+ QString::number(d->theta1)+"\nEnd Angle : "+ QString::number(d->theta2) /*+ "\nReference Point : "+ d->referencePoint->description()*/);
109 
110  return result;
111 
112 }
113 
114 
115 
117 
118 {
119 
120  return "axlSurfaceRevolutionParametric";
121 
122 }
123 
124 
125 
127 
128 {
129 
130  return d->axe;
131 
132 }
133 
134 
135 
137 
138 {
139 
140  return d->curve;
141 
142 }
143 
145 
146 {
147 
148  return d->theta1;
149 
150 }
151 
153 
154 {
155 
156  return d->theta2;
157 
158 }
159 
160 
161 
162 
163 
165 
166 {
167 
168  d->axe = new axlLine(*line);
169 
170 }
171 
173 
174 {
175 
176  d->axe = new axlLine(point1,point2);
177 
178 }
179 
180 
181 
183 
184 {
185 
186  d->curve = curve;
187 
188 }
189 
190 
191 
193 
194 {
195 
196  d->theta1 = ang;
197 
198 }
199 
200 
201 
203 
204 {
205 
206 d->theta2 = ang;
207 
208 }
209 
210 
211 
212 void axlSurfaceRevolutionParametric::setAngle(double startAngle,double endAngle)
213 
214 {
215 
216 d->theta1 = startAngle;
217 
218 d->theta2 = endAngle;
219 
220 }
221 
222 
223 
224 //void axlSurfaceRevolution::setReferencePoint(axlPoint *point)
225 
226 //{
227 
228 // *(d->referencePoint)=*point;
229 
230 //}
231 
232 //
233 
234 //void axlSurfaceRevolution::setReferencePoint(double x, double y, double z)
235 
236 //{
237 
238 // d->referencePoint = new axlPoint(x,y,z);
239 
240 //}
241 
242 
243 
244 //QVariantList axlSurfaceRevolution::convertDataToQVariant(void) const
245 
246 //{
247 
248 // QVariantList list;
249 
250 // QVariant id = QVariant::fromValue(identifier());
251 
252 // /*QVariant axe = QVariant::fromValue(d->axe);*/
253 
254 // QVariantList axe = d->axe->convertDataToQVariant();
255 
256 // QVariantList curve = d->curve->convertDataToQVariant();
257 
258 // QVariantList referencePoint = d->referencePoint->convertDataToQVariant();
259 
260 // QVariant theta1 = QVariant::fromValue(d->theta1);
261 
262 // QVariant theta2 = QVariant::fromValue(d->theta2);
263 
264 // list.append(id);
265 
266 // list.append(radius);
267 
268 // list.append(p1);
269 
270 // list.append(p2);
271 
272 // QVariant name = QVariant::fromValue(objectName());
273 
274 // return list;
275 
276 //}
277 
278 
279 
280 //int axlSurfaceRevolution::convertQVariantToData(const QVariantList &data)
281 
282 //{
283 
284 //}
285 
286 
287 
289 
290 {
291 
293 
294 }
Class axlPoint defines 3D points.
Definition: axlPoint.h:34
Class axlLine defines 3D lines.
Definition: axlLine.h:35
dtkAbstractData * createaxlSurfaceRevolutionParametric(void)
void setAngle(double startAngle, double endAngle)
axlSurfaceRevolutionParametric & operator=(const axlSurfaceRevolutionParametric &other)