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

Method vertex

renderers/agg/src/agg_vcgen_dash.cpp:142–231  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

140
141 //------------------------------------------------------------------------
142 unsigned vcgen_dash::vertex(double* x, double* y)
143 {
144 unsigned cmd = path_cmd_move_to;
145 while(!is_stop(cmd))
146 {
147 switch(m_status)
148 {
149 case initial:
150 rewind(0);
151
152 case ready:
153 if(m_num_dashes < 2 || m_src_vertices.size() < 2)
154 {
155 cmd = path_cmd_stop;
156 break;
157 }
158 m_status = polyline;
159 m_src_vertex = 1;
160 m_v1 = &m_src_vertices[0];
161 m_v2 = &m_src_vertices[1];
162 m_curr_rest = m_v1->dist;
163 *x = m_v1->x;
164 *y = m_v1->y;
165 if(m_dash_start >= 0.0) calc_dash_start(m_dash_start);
166 return path_cmd_move_to;
167
168 case polyline:
169 {
170 double dash_rest = m_dashes[m_curr_dash] - m_curr_dash_start;
171
172 unsigned cmd = (m_curr_dash & 1) ?
173 path_cmd_move_to :
174 path_cmd_line_to;
175
176 if(m_curr_rest > dash_rest)
177 {
178 m_curr_rest -= dash_rest;
179 ++m_curr_dash;
180 if(m_curr_dash >= m_num_dashes) m_curr_dash = 0;
181 m_curr_dash_start = 0.0;
182 *x = m_v2->x - (m_v2->x - m_v1->x) * m_curr_rest / m_v1->dist;
183 *y = m_v2->y - (m_v2->y - m_v1->y) * m_curr_rest / m_v1->dist;
184 }
185 else
186 {
187 m_curr_dash_start += m_curr_rest;
188 *x = m_v2->x;
189 *y = m_v2->y;
190 ++m_src_vertex;
191 m_v1 = m_v2;
192 m_curr_rest = m_v1->dist;
193 if(m_closed)
194 {
195 if(m_src_vertex > m_src_vertices.size())
196 {
197 m_status = stop;
198 }
199 else

Callers

nothing calls this directly

Calls 2

is_stopFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected