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

Method add_vertex

renderers/agg/src/agg_vcgen_markers_term.cpp:33–72  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

31
32 //------------------------------------------------------------------------
33 void vcgen_markers_term::add_vertex(double x, double y, unsigned cmd)
34 {
35 if(is_move_to(cmd))
36 {
37 if(m_markers.size() & 1)
38 {
39 // Initial state, the first coordinate was added.
40 // If two of more calls of start_vertex() occures
41 // we just modify the last one.
42 m_markers.modify_last(coord_type(x, y));
43 }
44 else
45 {
46 m_markers.add(coord_type(x, y));
47 }
48 }
49 else
50 {
51 if(is_vertex(cmd))
52 {
53 if(m_markers.size() & 1)
54 {
55 // Initial state, the first coordinate was added.
56 // Add three more points, 0,1,1,0
57 m_markers.add(coord_type(x, y));
58 m_markers.add(m_markers[m_markers.size() - 1]);
59 m_markers.add(m_markers[m_markers.size() - 3]);
60 }
61 else
62 {
63 if(m_markers.size())
64 {
65 // Replace two last points: 0,1,1,0 -> 0,1,2,1
66 m_markers[m_markers.size() - 1] = m_markers[m_markers.size() - 2];
67 m_markers[m_markers.size() - 2] = coord_type(x, y);
68 }
69 }
70 }
71 }
72 }
73
74
75 //------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 6

is_move_toFunction · 0.85
is_vertexFunction · 0.85
coord_typeClass · 0.50
sizeMethod · 0.45
modify_lastMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected