MCPcopy Create free account
hub / github.com/MapServer/MapServer / vertex

Method vertex

renderers/agg/src/agg_vcgen_bspline.cpp:126–190  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

124
125 //------------------------------------------------------------------------
126 unsigned vcgen_bspline::vertex(double* x, double* y)
127 {
128 unsigned cmd = path_cmd_line_to;
129 while(!is_stop(cmd))
130 {
131 switch(m_status)
132 {
133 case initial:
134 rewind(0);
135
136 case ready:
137 if(m_src_vertices.size() < 2)
138 {
139 cmd = path_cmd_stop;
140 break;
141 }
142
143 if(m_src_vertices.size() == 2)
144 {
145 *x = m_src_vertices[m_src_vertex].x;
146 *y = m_src_vertices[m_src_vertex].y;
147 m_src_vertex++;
148 if(m_src_vertex == 1) return path_cmd_move_to;
149 if(m_src_vertex == 2) return path_cmd_line_to;
150 cmd = path_cmd_stop;
151 break;
152 }
153
154 cmd = path_cmd_move_to;
155 m_status = polygon;
156 m_src_vertex = 0;
157
158 case polygon:
159 if(m_cur_abscissa >= m_max_abscissa)
160 {
161 if(m_closed)
162 {
163 m_status = end_poly;
164 break;
165 }
166 else
167 {
168 *x = m_src_vertices[m_src_vertices.size() - 1].x;
169 *y = m_src_vertices[m_src_vertices.size() - 1].y;
170 m_status = end_poly;
171 return path_cmd_line_to;
172 }
173 }
174
175 *x = m_spline_x.get_stateful(m_cur_abscissa);
176 *y = m_spline_y.get_stateful(m_cur_abscissa);
177 m_src_vertex++;
178 m_cur_abscissa += m_interpolation_step;
179 return (m_src_vertex == 1) ? path_cmd_move_to : path_cmd_line_to;
180
181 case end_poly:
182 m_status = stop;
183 return path_cmd_end_poly | m_closed;

Callers

nothing calls this directly

Calls 3

is_stopFunction · 0.85
get_statefulMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected