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

Method vertex

dep/agg/include/agg_conv_marker.h:92–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 //------------------------------------------------------------------------
91 template <class MarkerLocator, class MarkerShapes>
92 unsigned conv_marker<MarkerLocator, MarkerShapes>::vertex(
93 double* x, double* y)
94 {
95 unsigned cmd = path_cmd_move_to;
96 double x1, y1, x2, y2;
97
98 while (!is_stop(cmd))
99 {
100 switch (m_status)
101 {
102 case initial:
103 if (m_num_markers == 0)
104 {
105 cmd = path_cmd_stop;
106 break;
107 }
108 m_marker_locator->rewind(m_marker);
109 ++m_marker;
110 m_num_markers = 0;
111 m_status = markers;
112
113 case markers:
114 if (is_stop(m_marker_locator->vertex(&x1, &y1)))
115 {
116 m_status = initial;
117 break;
118 }
119 if (is_stop(m_marker_locator->vertex(&x2, &y2)))
120 {
121 m_status = initial;
122 break;
123 }
124 ++m_num_markers;
125 m_mtx = m_transform;
126 m_mtx *=
127 trans_affine_rotation(std::atan2(y2 - y1, x2 - x1));
128 m_mtx *= trans_affine_translation(x1, y1);
129 m_marker_shapes->rewind(m_marker - 1);
130 m_status = polygon;
131
132 case polygon:
133 cmd = m_marker_shapes->vertex(x, y);
134 if (is_stop(cmd))
135 {
136 cmd = path_cmd_move_to;
137 m_status = markers;
138 break;
139 }
140 m_mtx.transform(x, y);
141 return cmd;
142
143 case stop:
144 cmd = path_cmd_stop;
145 break;
146 }
147 }
148 return cmd;
149 }

Callers

nothing calls this directly

Calls 5

is_stopFunction · 0.85
rewindMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected