16 #ifndef AGG_CONV_ADAPTOR_VCGEN_INCLUDED 17 #define AGG_CONV_ADAPTOR_VCGEN_INCLUDED 19 #include "agg_basics.h" 27 void add_vertex(
double,
double,
unsigned) {}
30 void rewind(
unsigned) {}
31 unsigned vertex(
double*,
double*) {
return path_cmd_stop; }
36 template<
class VertexSource,
52 void attach(VertexSource& source) { m_source = &source; }
54 Generator& generator() {
return m_generator; }
55 const Generator& generator()
const {
return m_generator; }
57 Markers& markers() {
return m_markers; }
58 const Markers& markers()
const {
return m_markers; }
60 void rewind(
unsigned path_id)
62 m_source->rewind(path_id);
66 unsigned vertex(
double* x,
double* y);
74 VertexSource* m_source;
75 Generator m_generator;
88 template<
class VertexSource,
class Generator,
class Markers>
91 unsigned cmd = path_cmd_stop;
98 m_markers.remove_all();
99 m_last_cmd = m_source->vertex(&m_start_x, &m_start_y);
100 m_status = accumulate;
103 if(is_stop(m_last_cmd))
return path_cmd_stop;
105 m_generator.remove_all();
106 m_generator.add_vertex(m_start_x, m_start_y, path_cmd_move_to);
107 m_markers.add_vertex(m_start_x, m_start_y, path_cmd_move_to);
111 cmd = m_source->vertex(x, y);
121 m_generator.add_vertex(*x, *y, cmd);
122 m_markers.add_vertex(*x, *y, path_cmd_line_to);
128 m_last_cmd = path_cmd_stop;
133 m_generator.add_vertex(*x, *y, cmd);
138 m_generator.rewind(0);
142 cmd = m_generator.vertex(x, y);
145 m_status = accumulate;