39 #ifdef CHECK_MEMORY_LEAKS
41 #endif // CHECK_MEMORY_LEAKS
58 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
60 for (PositionVector::const_iterator i = v.begin(); i != v.end(); i++) {
62 glVertex2d(p.
x(), p.
y());
66 glVertex2d(p.
x(), p.
y());
76 glTranslated(beg.
x(), beg.
y(), 0);
77 glRotated(rot, 0, 0, 1);
79 glVertex2d(-width, 0);
80 glVertex2d(-width, -visLength);
81 glVertex2d(width, -visLength);
93 glTranslated((beg2.
x() + beg1.
x())*.5, (beg2.
y() + beg1.
y())*.5, 0);
94 glRotated(rot, 0, 0, 1);
96 glVertex2d(-width, 0);
97 glVertex2d(-width, -visLength);
98 glVertex2d(width, -visLength);
107 const std::vector<SUMOReal>& rots,
108 const std::vector<SUMOReal>& lengths,
110 int e = (
int) geom.size() - 1;
111 for (
int i = 0; i < e; i++) {
120 const std::vector<SUMOReal>& rots,
121 const std::vector<SUMOReal>& lengths,
123 int minS = (
int)
MIN4(rots.size(), lengths.size(), geom1.size(), geom2.size());
124 for (
int i = 0; i < minS; i++) {
132 int e = (
int) geom.size() - 1;
133 for (
int i = 0; i < e; i++) {
147 glTranslated(beg.
x(), beg.
y(), 0);
148 glRotated(rot, 0, 0, 1);
151 glVertex2d(0, -visLength);
161 glTranslated((beg2.
x() + beg1.
x())*.5, (beg2.
y() + beg1.
y())*.5, 0);
162 glRotated(rot, 0, 0, 1);
165 glVertex2d(0, -visLength);
175 int e = (
int) v.size() - 1;
176 for (
int i = 0; i < e; ++i) {
177 glVertex2d(v[i].x(), v[i].y());
178 glVertex2d(v[i + 1].x(), v[i + 1].y());
188 glVertex2d(beg.
x(), beg.
y());
189 glVertex2d(end.
x(), end.
y());
204 for (
int i = 0; i < 360; i += 10) {
210 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
211 std::pair<SUMOReal, SUMOReal> p1 =
213 for (
int i = (
int)(beg / 10); i < steps && (36.0 / (
SUMOReal) steps * (
SUMOReal) i) * 10 < end; i++) {
214 const std::pair<SUMOReal, SUMOReal>& p2 =
216 glBegin(GL_TRIANGLES);
217 glVertex2d(p1.first * width, p1.second * width);
218 glVertex2d(p2.first * width, p2.second * width);
223 const std::pair<SUMOReal, SUMOReal>& p2 =
225 glBegin(GL_TRIANGLES);
226 glVertex2d(p1.first * width, p1.second * width);
227 glVertex2d(p2.first * width, p2.second * width);
243 for (
int i = 0; i < 360; i += 10) {
249 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
250 std::pair<SUMOReal, SUMOReal> p1 =
252 for (
int i = (
int)(beg / 10); i < steps && (36.0 / (
SUMOReal) steps * (
SUMOReal) i) * 10 < end; i++) {
253 const std::pair<SUMOReal, SUMOReal>& p2 =
255 glBegin(GL_TRIANGLES);
256 glVertex2d(p1.first * width, p1.second * width);
257 glVertex2d(p2.first * width, p2.second * width);
258 glVertex2d(p2.first * iwidth, p2.second * iwidth);
260 glVertex2d(p2.first * iwidth, p2.second * iwidth);
261 glVertex2d(p1.first * iwidth, p1.second * iwidth);
262 glVertex2d(p1.first * width, p1.second * width);
266 const std::pair<SUMOReal, SUMOReal>& p2 =
268 glBegin(GL_TRIANGLES);
269 glVertex2d(p1.first * width, p1.second * width);
270 glVertex2d(p2.first * width, p2.second * width);
271 glVertex2d(p2.first * iwidth, p2.second * iwidth);
273 glVertex2d(p2.first * iwidth, p2.second * iwidth);
274 glVertex2d(p1.first * iwidth, p1.second * iwidth);
275 glVertex2d(p1.first * width, p1.second * width);
283 if (l.
length() < tLength) {
284 tWidth = tWidth * l.
length() / tLength;
289 glTranslated(rl.p1().x(), rl.p1().y(), 0);
291 glBegin(GL_TRIANGLES);
292 glVertex2d(0, -tLength);
293 glVertex2d(-tWidth, 0);
294 glVertex2d(+tWidth, 0);
309 glGetDoublev(GL_CURRENT_COLOR, current);
310 return RGBColor(static_cast<unsigned char>(current[0] * 255. + 0.5),
311 static_cast<unsigned char>(current[1] * 255. + 0.5),
312 static_cast<unsigned char>(current[2] * 255. + 0.5),
313 static_cast<unsigned char>(current[3] * 255. + 0.5));
322 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
324 glTranslated(pos.
x(), pos.
y(), layer);
328 glRotated(180, 1, 0, 0);
329 glRotated(angle, 0, 0, 1);
330 glTranslated(-w / 2., 0.4, 0);
341 if (boxAngle > 360) {
346 const SUMOReal borderWidth = size / 20;
347 const SUMOReal boxHeight = size * 0.8;
348 const SUMOReal boxWidth = stringWidth + size / 2;
350 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
351 glTranslated(0, 0, layer);
354 left.
sub(boxWidth / 2, -boxHeight / 2.7);
356 left.
add(borderWidth * 1.5, 0);
358 glTranslated(0, 0, 0.01);
359 drawBoxLine(left, boxAngle, boxWidth - 3 * borderWidth, boxHeight - 2 * borderWidth);
364 glTranslated(pos.
x(), pos.
y(), 0.01);
367 glRotated(180, 1, 0, 0);
368 glRotated(angle, 0, 0, 1);
369 glTranslated(-stringWidth / 2., 0, 0);