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

Method join_path

renderers/agg/include/agg_path_storage.h:736–776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

734 // it behaves as if the pen of a plotter was always down (drawing)
735 template<class VertexSource>
736 void join_path(VertexSource& vs, unsigned path_id = 0)
737 {
738 double x, y;
739 unsigned cmd;
740 vs.rewind(path_id);
741 cmd = vs.vertex(&x, &y);
742 if(!is_stop(cmd))
743 {
744 if(is_vertex(cmd))
745 {
746 double x0, y0;
747 unsigned cmd0 = last_vertex(&x0, &y0);
748 if(is_vertex(cmd0))
749 {
750 if(calc_distance(x, y, x0, y0) > vertex_dist_epsilon)
751 {
752 if(is_move_to(cmd)) cmd = path_cmd_line_to;
753 m_vertices.add_vertex(x, y, cmd);
754 }
755 }
756 else
757 {
758 if(is_stop(cmd0))
759 {
760 cmd = path_cmd_move_to;
761 }
762 else
763 {
764 if(is_move_to(cmd)) cmd = path_cmd_line_to;
765 }
766 m_vertices.add_vertex(x, y, cmd);
767 }
768 }
769 while(!is_stop(cmd = vs.vertex(&x, &y)))
770 {
771 m_vertices.add_vertex(x, y, is_move_to(cmd) ?
772 unsigned(path_cmd_line_to) :
773 cmd);
774 }
775 }
776 }
777
778 // Concatenate polygon/polyline.
779 //--------------------------------------------------------------------

Callers

nothing calls this directly

Calls 7

is_stopFunction · 0.85
is_vertexFunction · 0.85
calc_distanceFunction · 0.85
is_move_toFunction · 0.85
rewindMethod · 0.45
vertexMethod · 0.45
add_vertexMethod · 0.45

Tested by

no test coverage detected