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

Method add

renderers/agg/include/agg_conv_clipper.h:96–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94 void end_contour(clipper::Polygons &p);
95
96 template<class VS> void add(VS &src, clipper::Polygons &p){
97 unsigned cmd;
98 double x; double y; double start_x; double start_y;
99 bool starting_first_line;
100
101 start_x = 0.0;
102 start_y = 0.0;
103 starting_first_line = true;
104 p.resize(0);
105
106 cmd = src->vertex( &x , &y );
107 while(!is_stop(cmd))
108 {
109 if(is_vertex(cmd))
110 {
111 if(is_move_to(cmd))
112 {
113 if(!starting_first_line ) end_contour(p);
114 start_x = x;
115 start_y = y;
116 }
117 add_vertex_( x, y );
118 starting_first_line = false;
119 }
120 else if(is_end_poly(cmd))
121 {
122 if(!starting_first_line && is_closed(cmd))
123 add_vertex_( start_x, start_y );
124 }
125 cmd = src->vertex( &x, &y );
126 }
127 end_contour(p);
128 }
129 };
130
131 //------------------------------------------------------------------------

Callers 1

add_vertex_Method · 0.45

Calls 7

is_stopFunction · 0.85
is_vertexFunction · 0.85
is_move_toFunction · 0.85
is_end_polyFunction · 0.85
is_closedFunction · 0.85
resizeMethod · 0.45
vertexMethod · 0.45

Tested by

no test coverage detected