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

Method vertex

renderers/agg/src/agg_vcgen_contour.cpp:102–163  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected