MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / vertex

Method vertex

dep/agg/src/agg_vcgen_contour.cpp:101–162  ·  view source on GitHub ↗

------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

99
100 //------------------------------------------------------------------------
101 unsigned vcgen_contour::vertex(double* x, double* y)
102 {
103 unsigned cmd = path_cmd_line_to;
104 while(!is_stop(cmd))
105 {
106 switch(m_status)
107 {
108 case initial:
109 rewind(0);
110
111 case ready:
112 if(m_src_vertices.size() < 2 + unsigned(m_closed != 0))
113 {
114 cmd = path_cmd_stop;
115 break;
116 }
117 m_status = outline;
118 cmd = path_cmd_move_to;
119 m_src_vertex = 0;
120 m_out_vertex = 0;
121
122 case outline:
123 if(m_src_vertex >= m_src_vertices.size())
124 {
125 m_status = end_poly;
126 break;
127 }
128 m_stroker.calc_join(m_out_vertices,
129 m_src_vertices.prev(m_src_vertex),
130 m_src_vertices.curr(m_src_vertex),
131 m_src_vertices.next(m_src_vertex),
132 m_src_vertices.prev(m_src_vertex).dist,
133 m_src_vertices.curr(m_src_vertex).dist);
134 ++m_src_vertex;
135 m_status = out_vertices;
136 m_out_vertex = 0;
137
138 case out_vertices:
139 if(m_out_vertex >= m_out_vertices.size())
140 {
141 m_status = outline;
142 }
143 else
144 {
145 const point_d& c = m_out_vertices[m_out_vertex++];
146 *x = c.x;
147 *y = c.y;
148 return cmd;
149 }
150 break;
151
152 case end_poly:
153 if(!m_closed) return path_cmd_stop;
154 m_status = stop;
155 return path_cmd_end_poly | path_flags_close | path_flags_ccw;
156
157 case stop:
158 return path_cmd_stop;

Callers

nothing calls this directly

Calls 4

is_stopFunction · 0.85
calc_joinMethod · 0.80
sizeMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected