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

Method add

renderers/agg/include/agg_conv_gpc.h:119–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117
118 //--------------------------------------------------------------------
119 template<class VS> void add(VS& src, gpc_polygon& p)
120 {
121 unsigned cmd;
122 double x, y;
123 double start_x = 0.0;
124 double start_y = 0.0;
125 bool line_to = false;
126 unsigned orientation = 0;
127
128 m_contour_accumulator.remove_all();
129
130 while(!is_stop(cmd = src.vertex(&x, &y)))
131 {
132 if(is_vertex(cmd))
133 {
134 if(is_move_to(cmd))
135 {
136 if(line_to)
137 {
138 end_contour(orientation);
139 orientation = 0;
140 }
141 start_contour();
142 start_x = x;
143 start_y = y;
144 }
145 add_vertex(x, y);
146 line_to = true;
147 }
148 else
149 {
150 if(is_end_poly(cmd))
151 {
152 orientation = get_orientation(cmd);
153 if(line_to && is_closed(cmd))
154 {
155 add_vertex(start_x, start_y);
156 }
157 }
158 }
159 }
160 if(line_to)
161 {
162 end_contour(orientation);
163 }
164 make_polygon(p);
165 }
166
167
168 private:

Callers 2

start_contourMethod · 0.45
add_vertexMethod · 0.45

Calls 8

is_stopFunction · 0.85
is_vertexFunction · 0.85
is_move_toFunction · 0.85
is_end_polyFunction · 0.85
get_orientationFunction · 0.85
is_closedFunction · 0.85
remove_allMethod · 0.45
vertexMethod · 0.45

Tested by

no test coverage detected