2 * Copyright 2005, Stephan Aßmus <superstippi@gmx.de>. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Simple BShape to agg::path_storage converter, implemented as BShapeIterator.
10 #include "ShapeConverter.h"
13 ShapeConverter::ShapeConverter()
21 ShapeConverter::ShapeConverter(agg::path_storage
* path
)
30 ShapeConverter::SetPath(agg::path_storage
* path
)
37 ShapeConverter::IterateMoveTo(BPoint
* point
)
50 ShapeConverter::IterateLineTo(int32 lineCount
, BPoint
* linePts
)
54 double x
= linePts
->x
;
55 double y
= linePts
->y
;
67 ShapeConverter::IterateBezierTo(int32 bezierCount
, BPoint
* bezierPts
)
70 while (bezierCount
--) {
72 double x1
= bezierPts
[0].x
;
73 double y1
= bezierPts
[0].y
;
75 double x2
= bezierPts
[1].x
;
76 double y2
= bezierPts
[1].y
;
78 double x3
= bezierPts
[2].x
;
79 double y3
= bezierPts
[2].y
;
85 fPath
->curve4(x1
, y1
, x2
, y2
, x3
, y3
);
94 ShapeConverter::IterateClose()
96 fPath
->close_polygon();