21 #ifndef AGG_BEZIER_ARC_INCLUDED 22 #define AGG_BEZIER_ARC_INCLUDED 24 #include "agg_conv_transform.h" 30 void arc_to_bezier(
double cx,
double cy,
double rx,
double ry,
31 double start_angle,
double sweep_angle,
43 bezier_arc() : m_vertex(26), m_num_vertices(0), m_cmd(path_cmd_line_to) {}
49 init(x, y, rx, ry, start_angle, sweep_angle);
53 void init(
double x,
double y,
65 unsigned vertex(
double* x,
double* y)
67 if(m_vertex >= m_num_vertices)
return path_cmd_stop;
68 *x = m_vertices[m_vertex];
69 *y = m_vertices[m_vertex + 1];
71 return (m_vertex == 2) ? unsigned(path_cmd_move_to) : m_cmd;
77 unsigned num_vertices()
const {
return m_num_vertices; }
78 const double* vertices()
const {
return m_vertices; }
79 double* vertices() {
return m_vertices; }
83 unsigned m_num_vertices;
84 double m_vertices[26];
108 double rx,
double ry,
112 double x2,
double y2) :
113 m_arc(), m_radii_ok(
false)
115 init(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2);
119 void init(
double x1,
double y1,
120 double rx,
double ry,
124 double x2,
double y2);
127 bool radii_ok()
const {
return m_radii_ok; }
130 void rewind(
unsigned)
136 unsigned vertex(
double* x,
double* y)
138 return m_arc.vertex(x, y);
144 unsigned num_vertices()
const {
return m_arc.num_vertices(); }
145 const double* vertices()
const {
return m_arc.vertices(); }
146 double* vertices() {
return m_arc.vertices(); }