1 //////////////////////////////////////////////////////////////////////////////
2 // Name:        SVGPathSegList.cpp
3 // Author:      Alex Thuering
4 // Created:     2005/09/27
5 // RCS-ID:      $Id: SVGPathSegList.cpp,v 1.11 2013/03/17 15:10:14 ntalex Exp $
6 // Copyright:   (c) 2005 Alex Thuering
7 // Licence:     wxWindows licence
8 // Notes:       generated by genList.py
9 //////////////////////////////////////////////////////////////////////////////
10 
11 #include "SVGPathSegList.h"
12 #include "SVGPathSegClosePath.h"
13 #include "SVGPathSegMovetoAbs.h"
14 #include "SVGPathSegMovetoRel.h"
15 #include "SVGPathSegLinetoAbs.h"
16 #include "SVGPathSegLinetoRel.h"
17 #include "SVGPathSegCurvetoCubicAbs.h"
18 #include "SVGPathSegCurvetoCubicRel.h"
19 #include "SVGPathSegCurvetoQuadraticAbs.h"
20 #include "SVGPathSegCurvetoQuadraticRel.h"
21 #include "SVGPathSegArcAbs.h"
22 #include "SVGPathSegArcRel.h"
23 #include "SVGPathSegLinetoHorizontalAbs.h"
24 #include "SVGPathSegLinetoHorizontalRel.h"
25 #include "SVGPathSegLinetoVerticalAbs.h"
26 #include "SVGPathSegLinetoVerticalRel.h"
27 #include "SVGPathSegCurvetoCubicSmoothAbs.h"
28 #include "SVGPathSegCurvetoCubicSmoothRel.h"
29 #include "SVGPathSegCurvetoQuadraticSmoothAbs.h"
30 #include "SVGPathSegCurvetoQuadraticSmoothRel.h"
31 
32 #include "SVGNumberList.h"
33 #include <wx/log.h>
34 
35 #include <wx/arrimpl.cpp>
36 WX_DEFINE_OBJARRAY(wxSVGPathSegListBase);
37 
DoCopy(const wxSVGPathSegList & src)38 void wxSVGPathSegList::DoCopy(const wxSVGPathSegList& src)
39 {
40   for (int i=0; i<(int)src.Count(); i++)
41   {
42     switch (src[i].GetPathSegType())
43 	{
44 	  case wxPATHSEG_MOVETO_ABS:
45         Add(new wxSVGPathSegMovetoAbs((const wxSVGPathSegMovetoAbs&)src[i]));
46         break;
47 	  case wxPATHSEG_MOVETO_REL:
48         Add(new wxSVGPathSegMovetoRel((const wxSVGPathSegMovetoRel&)src[i]));
49         break;
50 	  case wxPATHSEG_LINETO_ABS:
51         Add(new wxSVGPathSegLinetoAbs((const wxSVGPathSegLinetoAbs&)src[i]));
52         break;
53 	  case wxPATHSEG_LINETO_REL:
54         Add(new wxSVGPathSegLinetoRel((const wxSVGPathSegLinetoRel&)src[i]));
55         break;
56 	  case wxPATHSEG_LINETO_HORIZONTAL_ABS:
57         Add(new wxSVGPathSegLinetoHorizontalAbs((const wxSVGPathSegLinetoHorizontalAbs&)src[i]));
58         break;
59 	  case wxPATHSEG_LINETO_HORIZONTAL_REL:
60         Add(new wxSVGPathSegLinetoHorizontalRel((const wxSVGPathSegLinetoHorizontalRel&)src[i]));
61         break;
62 	  case wxPATHSEG_LINETO_VERTICAL_ABS:
63         Add(new wxSVGPathSegLinetoVerticalAbs((const wxSVGPathSegLinetoVerticalAbs&)src[i]));
64         break;
65 	  case wxPATHSEG_LINETO_VERTICAL_REL:
66         Add(new wxSVGPathSegLinetoVerticalRel((const wxSVGPathSegLinetoVerticalRel&)src[i]));
67         break;
68 	  case wxPATHSEG_CURVETO_CUBIC_ABS:
69         Add(new wxSVGPathSegCurvetoCubicAbs((const wxSVGPathSegCurvetoCubicAbs&)src[i]));
70         break;
71 	  case wxPATHSEG_CURVETO_CUBIC_REL:
72         Add(new wxSVGPathSegCurvetoCubicRel((const wxSVGPathSegCurvetoCubicRel&)src[i]));
73         break;
74 	  case wxPATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
75         Add(new wxSVGPathSegCurvetoCubicSmoothAbs((const wxSVGPathSegCurvetoCubicSmoothAbs&)src[i]));
76         break;
77 	  case wxPATHSEG_CURVETO_CUBIC_SMOOTH_REL:
78         Add(new wxSVGPathSegCurvetoCubicSmoothRel((const wxSVGPathSegCurvetoCubicSmoothRel&)src[i]));
79         break;
80 	  case wxPATHSEG_CURVETO_QUADRATIC_ABS:
81         Add(new wxSVGPathSegCurvetoQuadraticAbs((const wxSVGPathSegCurvetoQuadraticAbs&)src[i]));
82         break;
83 	  case wxPATHSEG_CURVETO_QUADRATIC_REL:
84         Add(new wxSVGPathSegCurvetoQuadraticRel((const wxSVGPathSegCurvetoQuadraticRel&)src[i]));
85         break;
86 	  case wxPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
87         Add(new wxSVGPathSegCurvetoQuadraticSmoothAbs((const wxSVGPathSegCurvetoQuadraticSmoothAbs&)src[i]));
88         break;
89 	  case wxPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
90         Add(new wxSVGPathSegCurvetoQuadraticSmoothRel((const wxSVGPathSegCurvetoQuadraticSmoothRel&)src[i]));
91         break;
92 	  case wxPATHSEG_ARC_ABS:
93         Add(new wxSVGPathSegArcAbs((const wxSVGPathSegArcAbs&)src[i]));
94         break;
95 	  case wxPATHSEG_ARC_REL:
96         Add(new wxSVGPathSegArcRel((const wxSVGPathSegArcRel&)src[i]));
97         break;
98 	  case wxPATHSEG_CLOSEPATH:
99         Add(new wxSVGPathSegClosePath((const wxSVGPathSegClosePath&)src[i]));
100 		break;
101 	  case wxPATHSEG_UNKNOWN:
102 		break;
103 	}
104   }
105 }
106 
GetValueAsString() const107 wxString wxSVGPathSegList::GetValueAsString() const
108 {
109   wxString value;
110   for (int i=0; i<(int)GetCount(); i++)
111   {
112     value += i==0 ? wxT("") : wxT(" ");
113 
114     wxSVGPathSeg& pathSeg = Item(i);
115 
116     switch (pathSeg.GetPathSegType())
117     {
118       case wxPATHSEG_UNKNOWN:
119         break;
120       case wxPATHSEG_CLOSEPATH:
121         value += wxT("z");
122         break;
123 
124       case wxPATHSEG_MOVETO_ABS:
125         value += wxString::Format(wxT("M%g,%g"),
126                     ((wxSVGPathSegMovetoAbs&)pathSeg).GetX(),
127                     ((wxSVGPathSegMovetoAbs&)pathSeg).GetY());
128         break;
129       case wxPATHSEG_MOVETO_REL:
130         value += wxString::Format(wxT("m%g,%g"),
131                     ((wxSVGPathSegMovetoRel&)pathSeg).GetX(),
132                     ((wxSVGPathSegMovetoRel&)pathSeg).GetY());
133         break;
134       case wxPATHSEG_LINETO_ABS:
135         value += wxString::Format(wxT("L%g,%g"),
136                     ((wxSVGPathSegLinetoAbs&)pathSeg).GetX(),
137                     ((wxSVGPathSegLinetoAbs&)pathSeg).GetY());
138         break;
139       case wxPATHSEG_LINETO_REL:
140         value += wxString::Format(wxT("l%g,%g"),
141                     ((wxSVGPathSegLinetoRel&)pathSeg).GetX(),
142                     ((wxSVGPathSegLinetoRel&)pathSeg).GetY());
143         break;
144       case wxPATHSEG_LINETO_HORIZONTAL_ABS:
145         value += wxString::Format(wxT("H%g"),
146                     ((wxSVGPathSegLinetoHorizontalAbs&)pathSeg).GetX());
147         break;
148       case wxPATHSEG_LINETO_HORIZONTAL_REL:
149         value += wxString::Format(wxT("h%g"),
150                     ((wxSVGPathSegLinetoHorizontalRel&)pathSeg).GetX());
151         break;
152       case wxPATHSEG_LINETO_VERTICAL_ABS:
153         value += wxString::Format(wxT("V%g"),
154                     ((wxSVGPathSegLinetoVerticalAbs&)pathSeg).GetY());
155         break;
156       case wxPATHSEG_LINETO_VERTICAL_REL:
157         value += wxString::Format(wxT("v%g"),
158                     ((wxSVGPathSegLinetoVerticalRel&)pathSeg).GetY());
159         break;
160       case wxPATHSEG_CURVETO_CUBIC_ABS:
161         value += wxString::Format(wxT("C%g,%g,%g,%g,%g,%g"),
162                     ((wxSVGPathSegCurvetoCubicAbs&)pathSeg).GetX1(),
163                     ((wxSVGPathSegCurvetoCubicAbs&)pathSeg).GetY1(),
164                     ((wxSVGPathSegCurvetoCubicAbs&)pathSeg).GetX2(),
165                     ((wxSVGPathSegCurvetoCubicAbs&)pathSeg).GetY2(),
166                     ((wxSVGPathSegCurvetoCubicAbs&)pathSeg).GetX(),
167                     ((wxSVGPathSegCurvetoCubicAbs&)pathSeg).GetY());
168         break;
169       case wxPATHSEG_CURVETO_CUBIC_REL:
170         value += wxString::Format(wxT("c%g,%g,%g,%g,%g,%g"),
171                     ((wxSVGPathSegCurvetoCubicRel&)pathSeg).GetX1(),
172                     ((wxSVGPathSegCurvetoCubicRel&)pathSeg).GetY1(),
173                     ((wxSVGPathSegCurvetoCubicRel&)pathSeg).GetX2(),
174                     ((wxSVGPathSegCurvetoCubicRel&)pathSeg).GetY2(),
175                     ((wxSVGPathSegCurvetoCubicRel&)pathSeg).GetX(),
176                     ((wxSVGPathSegCurvetoCubicRel&)pathSeg).GetY());
177         break;
178       case wxPATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
179         value += wxString::Format(wxT("S%g,%g,%g,%g"),
180                     ((wxSVGPathSegCurvetoCubicSmoothAbs&)pathSeg).GetX2(),
181                     ((wxSVGPathSegCurvetoCubicSmoothAbs&)pathSeg).GetY2(),
182                     ((wxSVGPathSegCurvetoCubicSmoothAbs&)pathSeg).GetX(),
183                     ((wxSVGPathSegCurvetoCubicSmoothAbs&)pathSeg).GetY());
184         break;
185       case wxPATHSEG_CURVETO_CUBIC_SMOOTH_REL:
186         value += wxString::Format(wxT("s%g,%g,%g,%g"),
187                     ((wxSVGPathSegCurvetoCubicSmoothRel&)pathSeg).GetX2(),
188                     ((wxSVGPathSegCurvetoCubicSmoothRel&)pathSeg).GetY2(),
189                     ((wxSVGPathSegCurvetoCubicSmoothRel&)pathSeg).GetX(),
190                     ((wxSVGPathSegCurvetoCubicSmoothRel&)pathSeg).GetY());
191         break;
192       case wxPATHSEG_CURVETO_QUADRATIC_ABS:
193         value += wxString::Format(wxT("Q%g,%g,%g,%g"),
194                     ((wxSVGPathSegCurvetoQuadraticAbs&)pathSeg).GetX1(),
195                     ((wxSVGPathSegCurvetoQuadraticAbs&)pathSeg).GetY1(),
196                     ((wxSVGPathSegCurvetoQuadraticAbs&)pathSeg).GetX(),
197                     ((wxSVGPathSegCurvetoQuadraticAbs&)pathSeg).GetY());
198         break;
199       case wxPATHSEG_CURVETO_QUADRATIC_REL:
200         value += wxString::Format(wxT("q%g,%g,%g,%g"),
201                     ((wxSVGPathSegCurvetoQuadraticRel&)pathSeg).GetX1(),
202                     ((wxSVGPathSegCurvetoQuadraticRel&)pathSeg).GetY1(),
203                     ((wxSVGPathSegCurvetoQuadraticRel&)pathSeg).GetX(),
204                     ((wxSVGPathSegCurvetoQuadraticRel&)pathSeg).GetY());
205         break;
206       case wxPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
207         value += wxString::Format(wxT("T%g,%g"),
208                     ((wxSVGPathSegCurvetoQuadraticSmoothAbs&)pathSeg).GetX(),
209                     ((wxSVGPathSegCurvetoQuadraticSmoothAbs&)pathSeg).GetY());
210         break;
211       case wxPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
212         value += wxString::Format(wxT("t%g,%g"),
213                     ((wxSVGPathSegCurvetoQuadraticSmoothRel&)pathSeg).GetX(),
214                     ((wxSVGPathSegCurvetoQuadraticSmoothRel&)pathSeg).GetY());
215         break;
216       case wxPATHSEG_ARC_ABS:
217         value += wxString::Format(wxT("A%g,%g,%g,%d,%d,%g,%g"),
218                     ((wxSVGPathSegArcAbs&)pathSeg).GetR1(),
219                     ((wxSVGPathSegArcAbs&)pathSeg).GetR2(),
220                     ((wxSVGPathSegArcAbs&)pathSeg).GetAngle(),
221                     ((wxSVGPathSegArcAbs&)pathSeg).GetLargeArcFlag(),
222                     ((wxSVGPathSegArcAbs&)pathSeg).GetSweepFlag(),
223                     ((wxSVGPathSegArcAbs&)pathSeg).GetX(),
224                     ((wxSVGPathSegArcAbs&)pathSeg).GetY());
225         break;
226       case wxPATHSEG_ARC_REL:
227         value += wxString::Format(wxT("a%g,%g,%g,%d,%d,%g,%g"),
228                     ((wxSVGPathSegArcRel&)pathSeg).GetR1(),
229                     ((wxSVGPathSegArcRel&)pathSeg).GetR2(),
230                     ((wxSVGPathSegArcRel&)pathSeg).GetAngle(),
231                     ((wxSVGPathSegArcRel&)pathSeg).GetLargeArcFlag(),
232                     ((wxSVGPathSegArcRel&)pathSeg).GetSweepFlag(),
233                     ((wxSVGPathSegArcRel&)pathSeg).GetX(),
234                     ((wxSVGPathSegArcRel&)pathSeg).GetY());
235         break;
236     }
237   }
238   return value;
239 }
240 
isNumericFirst(wxChar ch)241 inline bool isNumericFirst(wxChar ch) {
242 	return ch == wxT('+') || ch == wxT('-') || ch == wxT('.') || (ch >= wxT('0') && ch <= wxT('9'));
243 }
244 
isNumeric(wxChar ch,wxChar ch2)245 inline bool isNumeric(wxChar ch, wxChar ch2) {
246 	return ch == wxT('.') || ch == wxT('E') || ch == wxT('e') || (ch >= wxT('0') && ch <= wxT('9'))
247 		|| ((ch == wxT('+') || ch == wxT('-')) && (ch2 == wxT('E') || ch2 == wxT('e')));
248 }
249 
SetValueAsString(const wxString & value)250 void wxSVGPathSegList::SetValueAsString(const wxString& value) {
251 	const wxString s_commands = wxT("MmZzLlHhVvCcSsQqTtAa");
252 	const wxString s_separators = wxT(" ,\t\n\r");
253 	wxChar type = 0;
254 	double number;
255 	wxSVGNumberList numbers;
256 	wxString val = value;
257 	while (val.Length() && s_separators.Find(val[0]) != wxNOT_FOUND)
258 		val.Remove(0, 1);
259 	while (val.Length()) {
260 		if (s_commands.Find(val[0]) == wxNOT_FOUND)
261 			break;
262 		type = val.GetChar(0);
263 		val.Remove(0, 1);
264 
265 		while (val.Length()) {
266 			while (val.Length() && s_separators.Find(val[0]) != wxNOT_FOUND)
267 				val.Remove(0, 1);
268 
269 			unsigned int pos;
270 			if (val.Length() > 0 && isNumericFirst(val[0])) {
271 				pos = 1;
272 				while (val.Length() > pos && isNumeric(val[pos], val[pos - 1]))
273 					pos++;
274 				val.Mid(0, pos).ToDouble(&number);
275 				numbers.Add(number);
276 				val.Remove(0, pos);
277 			} else
278 				break;
279 		}
280 
281 		// new path segement
282 		if (type == wxT('Z') || type == wxT('z'))
283 			Add(new wxSVGPathSegClosePath);
284 		else if (type == wxT('M')) {
285 			int pos = 0;
286 			while (numbers.Count() - pos >= 2) {
287 				if (pos == 0) {
288 					wxSVGPathSegMovetoAbs* pathSeg = new wxSVGPathSegMovetoAbs;
289 					pathSeg->SetX(numbers[pos++]);
290 					pathSeg->SetY(numbers[pos++]);
291 					Add(pathSeg);
292 				} else {
293 					wxSVGPathSegLinetoAbs* pathSeg = new wxSVGPathSegLinetoAbs;
294 					pathSeg->SetX(numbers[pos++]);
295 					pathSeg->SetY(numbers[pos++]);
296 					Add(pathSeg);
297 				}
298 			}
299 		} else if (type == wxT('m')) {
300 			int pos = 0;
301 			while (numbers.Count() - pos >= 2) {
302 				if (pos == 0) {
303 					wxSVGPathSegMovetoRel* pathSeg = new wxSVGPathSegMovetoRel;
304 					pathSeg->SetX(numbers[pos++]);
305 					pathSeg->SetY(numbers[pos++]);
306 					Add(pathSeg);
307 				} else {
308 					wxSVGPathSegLinetoRel* pathSeg = new wxSVGPathSegLinetoRel;
309 					pathSeg->SetX(numbers[pos++]);
310 					pathSeg->SetY(numbers[pos++]);
311 					Add(pathSeg);
312 				}
313 			}
314 		} else if (type == wxT('L')) {
315 			int pos = 0;
316 			while (numbers.Count() - pos >= 2) {
317 				wxSVGPathSegLinetoAbs* pathSeg = new wxSVGPathSegLinetoAbs;
318 				pathSeg->SetX(numbers[pos++]);
319 				pathSeg->SetY(numbers[pos++]);
320 				Add(pathSeg);
321 			}
322 		} else if (type == wxT('l')) {
323 			int pos = 0;
324 			while (numbers.Count() - pos >= 2) {
325 				wxSVGPathSegLinetoRel* pathSeg = new wxSVGPathSegLinetoRel;
326 				pathSeg->SetX(numbers[pos++]);
327 				pathSeg->SetY(numbers[pos++]);
328 				Add(pathSeg);
329 			}
330 		} else if (type == wxT('H')) {
331 			int pos = 0;
332 			while (numbers.Count() - pos >= 1) {
333 				wxSVGPathSegLinetoHorizontalAbs* pathSeg = new wxSVGPathSegLinetoHorizontalAbs;
334 				pathSeg->SetX(numbers[pos++]);
335 				Add(pathSeg);
336 			}
337 		} else if (type == wxT('h')) {
338 			int pos = 0;
339 			while (numbers.Count() - pos >= 1) {
340 				wxSVGPathSegLinetoHorizontalRel* pathSeg = new wxSVGPathSegLinetoHorizontalRel;
341 				pathSeg->SetX(numbers[pos++]);
342 				Add(pathSeg);
343 			}
344 		} else if (type == wxT('V')) {
345 			int pos = 0;
346 			while (numbers.Count() - pos >= 1) {
347 				wxSVGPathSegLinetoVerticalAbs* pathSeg = new wxSVGPathSegLinetoVerticalAbs;
348 				pathSeg->SetY(numbers[pos++]);
349 				Add(pathSeg);
350 			}
351 		} else if (type == wxT('v')) {
352 			int pos = 0;
353 			while (numbers.Count() - pos >= 1) {
354 				wxSVGPathSegLinetoVerticalRel* pathSeg = new wxSVGPathSegLinetoVerticalRel;
355 				pathSeg->SetY(numbers[pos++]);
356 				Add(pathSeg);
357 			}
358 		} else if (type == wxT('C')) {
359 			int pos = 0;
360 			while (numbers.Count() - pos >= 6) {
361 				wxSVGPathSegCurvetoCubicAbs* pathSeg = new wxSVGPathSegCurvetoCubicAbs;
362 				pathSeg->SetX1(numbers[pos++]);
363 				pathSeg->SetY1(numbers[pos++]);
364 				pathSeg->SetX2(numbers[pos++]);
365 				pathSeg->SetY2(numbers[pos++]);
366 				pathSeg->SetX(numbers[pos++]);
367 				pathSeg->SetY(numbers[pos++]);
368 				Add(pathSeg);
369 			}
370 		} else if (type == wxT('c')) {
371 			int pos = 0;
372 			while (numbers.Count() - pos >= 6) {
373 				wxSVGPathSegCurvetoCubicRel* pathSeg = new wxSVGPathSegCurvetoCubicRel;
374 				pathSeg->SetX1(numbers[pos++]);
375 				pathSeg->SetY1(numbers[pos++]);
376 				pathSeg->SetX2(numbers[pos++]);
377 				pathSeg->SetY2(numbers[pos++]);
378 				pathSeg->SetX(numbers[pos++]);
379 				pathSeg->SetY(numbers[pos++]);
380 				Add(pathSeg);
381 			}
382 		} else if (type == wxT('S')) {
383 			int pos = 0;
384 			while (numbers.Count() - pos >= 4) {
385 				wxSVGPathSegCurvetoCubicSmoothAbs* pathSeg = new wxSVGPathSegCurvetoCubicSmoothAbs;
386 				pathSeg->SetX2(numbers[pos++]);
387 				pathSeg->SetY2(numbers[pos++]);
388 				pathSeg->SetX(numbers[pos++]);
389 				pathSeg->SetY(numbers[pos++]);
390 				Add(pathSeg);
391 			}
392 		} else if (type == wxT('s')) {
393 			int pos = 0;
394 			while (numbers.Count() - pos >= 4) {
395 				wxSVGPathSegCurvetoCubicSmoothRel* pathSeg = new wxSVGPathSegCurvetoCubicSmoothRel;
396 				pathSeg->SetX2(numbers[pos++]);
397 				pathSeg->SetY2(numbers[pos++]);
398 				pathSeg->SetX(numbers[pos++]);
399 				pathSeg->SetY(numbers[pos++]);
400 				Add(pathSeg);
401 			}
402 		} else if (type == wxT('Q')) {
403 			int pos = 0;
404 			while (numbers.Count() - pos >= 4) {
405 				wxSVGPathSegCurvetoQuadraticAbs* pathSeg = new wxSVGPathSegCurvetoQuadraticAbs;
406 				pathSeg->SetX1(numbers[pos++]);
407 				pathSeg->SetY1(numbers[pos++]);
408 				pathSeg->SetX(numbers[pos++]);
409 				pathSeg->SetY(numbers[pos++]);
410 				Add(pathSeg);
411 			}
412 		} else if (type == wxT('q')) {
413 			int pos = 0;
414 			while (numbers.Count() - pos >= 4) {
415 				wxSVGPathSegCurvetoQuadraticRel* pathSeg = new wxSVGPathSegCurvetoQuadraticRel;
416 				pathSeg->SetX1(numbers[pos++]);
417 				pathSeg->SetY1(numbers[pos++]);
418 				pathSeg->SetX(numbers[pos++]);
419 				pathSeg->SetY(numbers[pos++]);
420 				Add(pathSeg);
421 			}
422 		} else if (type == wxT('T')) {
423 			int pos = 0;
424 			while (numbers.Count() - pos >= 2) {
425 				wxSVGPathSegCurvetoQuadraticSmoothAbs* pathSeg = new wxSVGPathSegCurvetoQuadraticSmoothAbs;
426 				pathSeg->SetX(numbers[pos++]);
427 				pathSeg->SetY(numbers[pos++]);
428 				Add(pathSeg);
429 			}
430 		} else if (type == wxT('t')) {
431 			int pos = 0;
432 			while (numbers.Count() - pos >= 2) {
433 				wxSVGPathSegCurvetoQuadraticSmoothRel* pathSeg = new wxSVGPathSegCurvetoQuadraticSmoothRel;
434 				pathSeg->SetX(numbers[pos++]);
435 				pathSeg->SetY(numbers[pos++]);
436 				Add(pathSeg);
437 			}
438 		} else if (type == wxT('A')) {
439 			int pos = 0;
440 			while (numbers.Count() - pos >= 7) {
441 				wxSVGPathSegArcAbs* pathSeg = new wxSVGPathSegArcAbs;
442 				pathSeg->SetR1(numbers[pos++]);
443 				pathSeg->SetR2(numbers[pos++]);
444 				pathSeg->SetAngle(numbers[pos++]);
445 				pathSeg->SetLargeArcFlag(numbers[pos++]);
446 				pathSeg->SetSweepFlag(numbers[pos++]);
447 				pathSeg->SetX(numbers[pos++]);
448 				pathSeg->SetY(numbers[pos++]);
449 				Add(pathSeg);
450 			}
451 		} else if (type == wxT('a')) {
452 			int pos = 0;
453 			while (numbers.Count() - pos >= 7) {
454 				wxSVGPathSegArcRel* pathSeg = new wxSVGPathSegArcRel;
455 				pathSeg->SetR1(numbers[pos++]);
456 				pathSeg->SetR2(numbers[pos++]);
457 				pathSeg->SetAngle(numbers[pos++]);
458 				pathSeg->SetLargeArcFlag(numbers[pos++]);
459 				pathSeg->SetSweepFlag(numbers[pos++]);
460 				pathSeg->SetX(numbers[pos++]);
461 				pathSeg->SetY(numbers[pos++]);
462 				Add(pathSeg);
463 			}
464 		}
465 		type = 0;
466 		numbers.Clear();
467 	}
468 }
469 
470