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

Method add

dep/agg/include/agg_conv_gpc.h:127–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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