Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUIBaseVehicleHelper.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// Functions used in GUIBaseVehicleHelper and GNEVehicle
20/****************************************************************************/
21#include <config.h>
23
30#include "GLHelper.h"
32
33
34// ===========================================================================
35// data definitions
36// ===========================================================================
37/* -------------------------------------------------------------------------
38 * drawed shapes
39 * ----------------------------------------------------------------------- */
40static const double vehiclePoly_PassengerCarBody[] = { .5, 0, 0, 0, 0, .3, 0.08, .44, 0.25, .5, 0.95, .5, 1., .4, 1., -.4, 0.95, -.5, 0.25, -.5, 0.08, -.44, 0, -.3, 0, 0, -10000 };
41static const double vehiclePoly_PassengerCarBodyFront[] = { 0.1, 0, 0.025, 0, 0.025, 0.25, 0.27, 0.4, 0.27, -.4, 0.025, -0.25, 0.025, 0, -10000 };
42static const double vehiclePoly_PassengerFrontGlass[] = { 0.35, 0, 0.3, 0, 0.3, 0.4, 0.43, 0.3, 0.43, -0.3, 0.3, -0.4, 0.3, 0, -10000 };
43static const double vehiclePoly_PassengerSedanRightGlass[] = { 0.36, -.43, 0.34, -.47, 0.77, -.47, 0.67, -.37, 0.45, -.37, 0.34, -.47, -10000 };
44static const double vehiclePoly_PassengerSedanLeftGlass[] = { 0.36, .43, 0.34, .47, 0.77, .47, 0.67, .37, 0.45, .37, 0.34, .47, -10000 };
45static const double vehiclePoly_PassengerSedanBackGlass[] = { 0.80, 0, 0.70, 0, 0.70, 0.3, 0.83, 0.4, 0.83, -.4, 0.70, -.3, 0.70, 0, -10000 };
46static const double vehiclePoly_PassengerHatchbackRightGlass[] = { 0.36, -.43, 0.34, -.47, 0.94, -.47, 0.80, -.37, 0.45, -.37, 0.34, -.47, -10000 };
47static const double vehiclePoly_PassengerHatchbackLeftGlass[] = { 0.36, .43, 0.34, .47, 0.94, .47, 0.80, .37, 0.45, .37, 0.34, .47, -10000 };
48static const double vehiclePoly_PassengerHatchbackBackGlass[] = { 0.92, 0, 0.80, 0, 0.80, 0.3, 0.95, 0.4, 0.95, -.4, 0.80, -.3, 0.80, 0, -10000 };
49static const double vehiclePoly_PassengerWagonRightGlass[] = { 0.36, -.43, 0.34, -.47, 0.94, -.47, 0.87, -.37, 0.45, -.37, 0.34, -.47, -10000 };
50static const double vehiclePoly_PassengerWagonLeftGlass[] = { 0.36, .43, 0.34, .47, 0.94, .47, 0.87, .37, 0.45, .37, 0.34, .47, -10000 };
51static const double vehiclePoly_PassengerWagonBackGlass[] = { 0.92, 0, 0.90, 0, 0.90, 0.3, 0.95, 0.4, 0.95, -.4, 0.90, -.3, 0.90, 0, -10000 };
52
53static const double vehiclePoly_PassengerVanBody[] = { .5, 0, 0, 0, 0, .4, 0.1, .5, 0.97, .5, 1., .47, 1., -.47, 0.97, -.5, 0.1, -.5, 0, -.4, 0, 0, -10000 };
54static const double vehiclePoly_PassengerVanBodyFront[] = { 0.1, 0, 0.025, 0, 0.025, 0.25, 0.13, 0.4, 0.13, -.4, 0.025, -0.25, 0.025, 0, -10000 };
55static const double vehiclePoly_PassengerVanFrontGlass[] = { 0.21, 0, 0.16, 0, 0.16, 0.4, 0.29, 0.3, 0.29, -0.3, 0.16, -0.4, 0.16, 0, -10000 };
56static const double vehiclePoly_PassengerVanRightGlass[] = { 0.36, -.43, 0.20, -.47, 0.98, -.47, 0.91, -.37, 0.31, -.37, 0.20, -.47, -10000 };
57static const double vehiclePoly_PassengerVanLeftGlass[] = { 0.36, .43, 0.20, .47, 0.98, .47, 0.91, .37, 0.31, .37, 0.20, .47, -10000 };
58static const double vehiclePoly_PassengerVanBackGlass[] = { 0.95, 0, 0.94, 0, 0.94, 0.3, 0.98, 0.4, 0.98, -.4, 0.94, -.3, 0.94, 0, -10000 };
59
60static const double vehiclePoly_TaxiSign[] = { .56, .241, .56, -.241, .49, -.241, .49, .241, -10000 };
61
62static const double vehiclePoly_DeliveryMediumRightGlass[] = { 0.21, -.43, 0.20, -.47, 0.38, -.47, 0.38, -.37, 0.31, -.37, 0.20, -.47, -10000 };
63static const double vehiclePoly_DeliveryMediumLeftGlass[] = { 0.21, .43, 0.20, .47, 0.38, .47, 0.38, .37, 0.31, .37, 0.20, .47, -10000 };
64
65static const double vehiclePoly_TransportBody[] = { .5, 0, 0, 0, 0, .45, 0.05, .5, 2.25, .5, 2.25, -.5, 0.05, -.5, 0, -.45, 0, 0, -10000 };
66static const double vehiclePoly_TransportFrontGlass[] = { 0.1, 0, 0.05, 0, 0.05, 0.45, 0.25, 0.4, 0.25, -.4, 0.05, -0.45, 0.05, 0, -10000 };
67static const double vehiclePoly_TransportRightGlass[] = { 0.36, -.47, 0.10, -.48, 1.25, -.48, 1.25, -.4, 0.3, -.4, 0.10, -.48, -10000 };
68static const double vehiclePoly_TransportLeftGlass[] = { 0.36, .47, 0.10, .48, 1.25, .48, 1.25, .4, 0.3, .4, 0.10, .48, -10000 };
69
70static const double vehiclePoly_EVehicleBody[] = { .5, 0, 0, 0, 0, .3, 0.08, .44, 0.25, .5, 0.75, .5, .92, .44, 1, .3, 1, -.3, .92, -.44, .75, -.5, .25, -.5, 0.08, -.44, 0, -.3, 0, 0, -1000 };
71static const double vehiclePoly_EVehicleFrontGlass[] = { .5, 0, 0.05, .05, 0.05, .25, 0.13, .39, 0.3, .45, 0.70, .45, .87, .39, .95, .25, .95, -.25, .87, -.39, .70, -.45, .3, -.45, 0.13, -.39, 0.05, -.25, 0.05, 0.05, -1000 };
72//static const double vehiclePoly_EVehicleFrontGlass[] = { 0.35,0, 0.1,0, 0.1,0.4, 0.43,0.3, 0.43,-0.3, 0.1,-0.4, 0.1,0, -10000 };
73//static const double vehiclePoly_EVehicleBackGlass[] = { 0.65, 0, 0.9, 0, 0.9, 0.4, 0.57, 0.3, 0.57, -0.3, 0.9, -0.4, 0.9, 0, -10000 };
74
75static const double vehiclePoly_Ship[] = { 0.25, 0, 0, 0, 0.1, 0.25, 0.2, 0.45, 0.25, 0.5, 0.95, 0.5, 1.0, 0.45, 1.0, -0.45, 0.95, -0.5, 0.25, -0.5, 0.2, -0.45, 0.1, -0.25, 0, 0, -10000 };
76static const double vehiclePoly_ShipDeck[] = { 0.5, 0, 0.25, 0.4, 0.95, 0.4, 0.95, -0.4, 0.25, -0.4, 0.25, 0.4, -10000 };
77static const double vehiclePoly_ShipSuperStructure[] = { 0.8, 0, 0.5, 0.3, 0.85, 0.3, 0.85, -0.3, 0.5, -0.3, 0.5, 0.3, -10000 };
78
79static const double vehiclePoly_Cyclist[] = { 0.5, 0, 0.25, 0.45, 0.25, 0.5, 0.8, 0.15, 0.8, -0.15, 0.25, -0.5, 0.25, -0.45, -10000 };
80static const double vehiclePoly_CargoCyclist[] = { 0.7, 0, 0.47, 0.45, 0.47, 0.5, 0.92, 0.15, 0.92, -0.15, 0.47, -0.5, 0.47, -0.45, -10000 };
81static const double vehiclePoly_CargoBicycleBox[] = {
82 .265, 0, .09, -.27, .44, -.40, .44, .40, .09, .27, .09, -.27, -10000
83};
84static const double vehiclePoly_CargoBicycleBoxInterior[] = {
85 .265, 0, .12, -.22, .41, -.32, .41, .32, .12, .22, .12, -.22, -10000
86};
87static const double vehiclePoly_BicycleSeat[] = { 0.565, 0, 0.570, 0.03, 0.575, 0.05, 0.585, 0.06, 0.645, 0.06, 0.665, 0.07, 0.685, 0.10, 0.695, 0.13, 0.715, 0.16, 0.735, 0.18, 0.742, 0.17, 0.745, 0.16, 0.755, 0.13, 0.76, 0.11, 0.765, 0, 0.76, -0.11, 0.755, -0.13, 0.745, -0.16, 0.742, -0.17, 0.735, -0.18, 0.715, -0.16, 0.695, -0.13, 0.685, -0.10, 0.665, -0.07, 0.645, -0.06, 0.585, -0.06, 0.575, -0.05, 0.57, -0.03, -10000 };
88static const double vehiclePoly_MotorcycleSeat[] = { 0.5, 0, 0.503, 0.072, 0.506, 0.097, 0.518, 0.135, 0.539, 0.162, 0.567, 0.183, 0.641, 0.194, 0.698, 0.202, 0.706, 0.194, 0.713, 0.189, 0.721, 0.162, 0.729, 0.132, 0.732, 0.097, 0.734, 0.051, 0.735, 0, 0.734, -0.051, 0.732, -0.097, 0.729, -0.132, 0.721, -0.162, 0.713, -0.189, 0.706, -0.194, 0.698, -0.202, 0.641, -0.194, 0.567, -0.183, 0.539, -0.162, 0.518, -0.135, 0.506, -0.097, 0.503, -0.072, -10000 };
89
90static const double vehiclePoly_EmergencySign[] = { .2, .5, -.2, .5, -.2, -.5, .2, -.5, -10000 };
91static const double vehiclePoly_Emergency[] = { .1, .1, -.1, .1, -.1, -.1, .1, -.1, -10000 };
92static const double vehiclePoly_Emergency2[] = { .04, .3, -.04, .3, -.04, -.3, .04, -.3, -10000 };
93
94static const double vehiclePoly_EmergencyLadder[] = { -.5, .3, .5, .3, .5, .2, -.5, .2, -10000 };
95static const double vehiclePoly_EmergencyLadder2[] = { -.5, -.3, .5, -.3, .5, -.2, -.5, -.2, -10000 };
96static const double vehiclePoly_EmergencyLadder3[] = { -.45, .3, -.4, .3, -.4, -.3, -.45, -.3, -10000 };
97static const double vehiclePoly_EmergencyLadder4[] = { .45, .3, .4, .3, .4, -.3, .45, -.3, -10000 };
98static const double vehiclePoly_EmergencyLadder5[] = { .05, .3, .0, .3, .0, -.3, .05, -.3, -10000 };
99static const double vehiclePoly_EmergencyLadder6[] = { -.25, .3, -.2, .3, -.2, -.3, -.25, -.3, -10000 };
100static const double vehiclePoly_EmergencyLadder7[] = { .25, .3, .2, .3, .2, -.3, .25, -.3, -10000 };
101
102static const double vehiclePoly_scooterBase[] = { -.17, .5, -.2, .5, -.2, -.5, -.17, -.5, -10000 };
103static const double vehiclePoly_scooterBase2[] = { .98, .05, 1., .05, 1., -.05, .98, -.05, -10000 };
104static const double vehiclePoly_scooterBase3[] = { -.32, .6, .32, .6, .32, -.6, -.32, -.6, -10000 };
105
106static const double vehiclePoly_aircraft[] = {0.633, -0.500, 0.609, -0.465, 0.563, -0.460, 0.517, -0.168, 0.413, -0.156, 0.509, -0.053, 0.509, 0.053, 0.413, -0.156, 0.413, 0.156, 0.385, -0.101, 0.385, 0.101, 0.354, -0.058, 0.354, 0.058, 0.109, -0.050, 0.109, 0.050, 0, -0.003, 0, 0.003, 0, 0.003, 0.633, 0.500, 0.633, 0.500, 0.609, 0.465, 0.563, 0.460, 0.517, 0.168, 0.413, 0.156, 0.509, 0.053, 0.385, 0.101, 0.326, 0.158, 0.326, 0.108, 0.413, 0.156, 0.385, 0.101, 0.509, 0.053, 0.509, -0.053, 0.761, 0.043, 0.761, -0.043, 0.830, 0.030, 0.830, -0.030, 0.952, -0.196, 0.933, -0.196, 0.907, -0.008, 0.830, 0.030, 0.933, 0.196, 0.952, 0.196, 0.907, 0.008, 0.830, 0.030, 0.907, -0.008, 1.000, 0.003, 0.907, 0.008, 0.354, -0.058, 0.509, -0.053, 0.413, -0.156, 0.385, -0.101, 0.326, -0.158, 0.326, -0.108, 0.385, -0.101, -10000};
107static const double vehiclePoly_WheelchairFootrest[] = { 0.053, -0.324, 0.003, -0.259, 0.003, -0.056, 0.102, -0.056, 0.102, -0.259, 0.083, -0.286, -10000 };
108static const double vehiclePoly_WheelchairArm[] = { 0.75, -0.30, 0.75, -0.44, 0.62, -0.50, 0.47, -0.50, 0.44, -0.47, 0.44, -0.38, -10000 };
109static const double vehiclePoly_WheelchairLeg[] = { 0.45, -0.26, 0.40, -0.01, 0.03, -0.06, 0., -0.09, 0., -0.19, 0.03, -0.215, -10000 };
110static const double vehiclePoly_aircraftEngines[] = {0.326, -0.158, 0.413, -0.156, 0.326, -0.108, 0.385, -0.101, 0.385, -0.101, 0.385, 0.101, 0.385, 0.101, 0.326, 0.108, 0.413, 0.156, 0.326, 0.158, -10000};
111//static const double vehiclePoly_Rickshaw[] = { 0.5, 0, 0.25, 0.45, 0.25, 0.5, 0.8, 0.15, 0.8, -0.15, 0.25, -0.5, 0.25, -0.45, -10000 };
112
113// ===========================================================================
114// method definitions
115// ===========================================================================
116
118static void
119drawRoundedRect(const double cx, const double cy, const double halfX, const double halfY, const double radius, const int stepsPerCorner = 6) {
120 const double ix = halfX - radius;
121 const double iy = halfY - radius;
122 glBegin(GL_TRIANGLE_FAN);
123 glVertex2d(cx, cy);
124 const double cornerX[] = { ix, -ix, -ix, ix };
125 const double cornerY[] = { iy, iy, -iy, -iy };
126 for (int c = 0; c < 4; c++) {
127 for (int i = 0; i <= stepsPerCorner; i++) {
128 const double a = DEG2RAD(90. * c + 90. * i / stepsPerCorner);
129 glVertex2d(cx + cornerX[c] + radius * cos(a), cy + cornerY[c] + radius * sin(a));
130 }
131 }
132 glVertex2d(cx + ix + radius, cy + iy);
133 glEnd();
134}
135
136void
137GUIBaseVehicleHelper::drawPoly(const double* poses, const double offset) {
139 glTranslated(0, 0, offset * .1);
140 glPolygonOffset(0, (GLfloat) - offset);
141 glBegin(GL_TRIANGLE_FAN);
142 int i = 0;
143 while (poses[i] > -999) {
144 glVertex2d(poses[i], poses[i + 1]);
145 i = i + 2;
146 }
147 glEnd();
149}
150
151void
152GUIBaseVehicleHelper::drawAction_drawVehicleAsBoxPlus(const double width, const double length, bool amReversed) {
154 glScaled(width, length, 1.);
155 glBegin(GL_TRIANGLE_STRIP);
156 if (amReversed) {
157 glVertex2d(-.5, 0.);
158 glVertex2d(.5, 0.);
159 glVertex2d(-.5, .85);
160 glVertex2d(.5, .85);
161 glVertex2d(0., 1.);
162 } else {
163 glVertex2d(0., 0.);
164 glVertex2d(-.5, .15);
165 glVertex2d(.5, .15);
166 glVertex2d(-.5, 1.);
167 glVertex2d(.5, 1.);
168 }
169 glEnd();
171}
172
173
174void
175GUIBaseVehicleHelper::drawAction_drawVehicleAsTrianglePlus(const double width, const double length, bool amReversed) {
176 if (length >= 8.) {
177 drawAction_drawVehicleAsBoxPlus(width, length, amReversed);
178 return;
179 }
181 glScaled(width, length, 1.);
182 glBegin(GL_TRIANGLES);
183 if (amReversed) {
184 glVertex2d(0., 1.);
185 glVertex2d(-.5, 0.);
186 glVertex2d(.5, 0.);
187 } else {
188 glVertex2d(0., 0.);
189 glVertex2d(-.5, 1.);
190 glVertex2d(.5, 1.);
191 }
192 glEnd();
194}
195
196
197void
199 const int steps = MIN2(MAX2(16, int(detail / 5)), 64);
200 GLHelper::drawFilledCircle(width / 2, steps);
201}
202
203void
204GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(const GUIVisualizationSettings& s, const SUMOVehicleShape shape, const double width, const double length,
205 int carriageIndex, bool isStopped, bool amReversed) {
207 RGBColor current = GLHelper::getColor();
208 RGBColor lighter = current.changedBrightness(51);
209 RGBColor darker = current.changedBrightness(-51);
211 glRotated(90, 0, 0, 1);
212
213 glScaled(length, width, 1.);
214
215 // If the vehicle is 'logically' reversed then reverse the drawing box
216 // NB at the moment the only vehicles that will have amReversed set true are trains. Here this supports a train with guiShape="aircraft"
217 if (amReversed) {
218 glRotatef(180, 0, 0, 1);
219 glTranslated(-1, 0, 0);
220 }
221
222 // draw main body
223 switch (shape) {
226 GLHelper::setColor(lighter);
228 glColor3d(0, 0, 0);
230 break;
232 glTranslated(0, 0, .045);
234 glTranslated(0, 0, -.045);
235 glScaled(.7, 2, 1);
236 glTranslated(0, 0, .04);
237 GLHelper::setColor(lighter);
239 glTranslated(0, 0, -.04);
240 break;
245 darker = current.changedBrightness(-50);
246 // the cargo bicycle carries its load in front, so the rider sits further back
247 const bool cargo = shape == SUMOVehicleShape::BICYCLE_CARGO;
248 const double riderOffset = cargo ? 0.2 : 0.;
249 const double seatOffset = cargo ? 0.1 : 0.;
250 if (!isStopped) {
251 // body
253 // head
255 glTranslated(0.4 + riderOffset, 0, .5);
256 glScaled(0.1, 0.2, 1);
257 GLHelper::setColor(darker);
260 } else if ((shape == SUMOVehicleShape::BICYCLE) || cargo) {
261 // seat
262 GLHelper::setColor(darker);
264 glTranslated(seatOffset, 0, 0);
267 } else {
268 // seat
269 GLHelper::setColor(darker);
271 }
272 if (cargo) {
273 GLHelper::setColor(current);
275 GLHelper::setColor(darker);
277 }
278 // bike frame
281 glTranslated(0.5, 0, .3);
282 glScaled(0.5, 0.05, 1);
285 // handle bar
287 glTranslated(cargo ? 0.47 : 0.25, 0, .3);
288 glScaled(0.02, 0.5, 1);
291 }
292 break;
299 GLHelper::setColor(lighter);
301 glColor3d(0, 0, 0);
303 break;
306 GLHelper::setColor(lighter);
308 glColor3d(0, 0, 0);
313 break;
316 GLHelper::setColor(lighter);
318 glColor3d(0, 0, 0);
322 break;
326 if (carriageIndex < 1) {
327 glScaled(1. / length, 1, 1.);
329 glColor3d(0, 0, 0);
333 }
334 break;
338 double ml = length;
339 glScaled(1. / (length), 1, 1.);
340 glTranslated(0, 0, .04);
341 glBegin(GL_TRIANGLE_FAN);
342 glVertex2d(ml / 2., 0);
343 glVertex2d(0, 0);
344 glVertex2d(0, -.45);
345 glVertex2d(0 + .05, -.5);
346 glVertex2d(ml - .05, -.5);
347 glVertex2d(ml, -.45);
348 glVertex2d(ml, .45);
349 glVertex2d(ml - .05, .5);
350 glVertex2d(0 + .05, .5);
351 glVertex2d(0, .45);
352 glVertex2d(0, 0);
353 glEnd();
354 glTranslated(0, 0, -.04);
355
356 glTranslated(0, 0, .045);
357 glColor3d(0, 0, 0);
358 glBegin(GL_QUADS);
359 glVertex2d(0 + .05, .48);
360 glVertex2d(0 + .05, -.48);
361 glVertex2d(0 + .15, -.48);
362 glVertex2d(0 + .15, .48);
363
364 glVertex2d(ml - .1, .45);
365 glVertex2d(ml - .1, -.45);
366 glVertex2d(ml - .05, -.45);
367 glVertex2d(ml - .05, .45);
368
369 glVertex2d(0 + .20, .49);
370 glVertex2d(0 + .20, .45);
371 glVertex2d(ml - .20, .45);
372 glVertex2d(ml - .20, .49);
373
374 glVertex2d(0 + .20, -.49);
375 glVertex2d(0 + .20, -.45);
376 glVertex2d(ml - .20, -.45);
377 glVertex2d(ml - .20, -.49);
378
379 glEnd();
380 glTranslated(0, 0, -.045);
381 }
382 break;
387 // generic rail carriage (see GUIVehicle::drawAction_drawCarriageClass)
388 glRotated(-90, 0, 0, 1);
389 const double xCornerCut = 0.3 / width;
390 const double yCornerCut = 0.4 / length;
391 const double drawnCarriageLength = 1;
392 const double halfWidth = 0.5;
393 glBegin(GL_TRIANGLE_FAN);
394 glVertex2d(-halfWidth + xCornerCut, 0);
395 glVertex2d(-halfWidth, yCornerCut);
396 glVertex2d(-halfWidth, drawnCarriageLength - yCornerCut);
397 glVertex2d(-halfWidth + xCornerCut, drawnCarriageLength);
398 glVertex2d(halfWidth - xCornerCut, drawnCarriageLength);
399 glVertex2d(halfWidth, drawnCarriageLength - yCornerCut);
400 glVertex2d(halfWidth, yCornerCut);
401 glVertex2d(halfWidth - xCornerCut, 0);
402 glEnd();
403 // assume we are only rendering the head of the train (carriage rendering was disabled via param)
404 glTranslated(0, 0, 0.1);
405 glColor3d(0, 0, 0);
406 glBegin(GL_TRIANGLE_FAN);
407 glVertex2d(-halfWidth + 2 * xCornerCut, yCornerCut);
408 glVertex2d(-halfWidth + xCornerCut, 3 * yCornerCut);
409 glVertex2d(halfWidth - xCornerCut, 3 * yCornerCut);
410 glVertex2d(halfWidth - 2 * xCornerCut, yCornerCut);
411 glEnd();
412 }
413 break;
414
417 GLHelper::setColor(darker);
419 glTranslated(0, 0, .048);
420 GLHelper::setColor(current);
421 glBegin(GL_QUADS);
422 glVertex2d(.3, .5);
423 glVertex2d(.35, .5);
424 glVertex2d(.35, -.5);
425 glVertex2d(.3, -.5);
426
427 glVertex2d(.3, -.05);
428 glVertex2d(.7, -.05);
429 glVertex2d(.7, .05);
430 glVertex2d(.3, .05);
431
432 glVertex2d(.7, .5);
433 glVertex2d(.65, .5);
434 glVertex2d(.65, -.5);
435 glVertex2d(.7, -.5);
436 glEnd();
437 glTranslated(0, 0, -.048);
438 //drawPoly(vehiclePoly_EVehicleBackGlass, 4.5);
439 break;
442 // ant is stretched via vehicle length
443 GLHelper::setColor(darker);
444 // draw left side
445 GLHelper::drawBoxLine(Position(-0.2, -.10), 350, 0.5, .02);
446 GLHelper::drawBoxLine(Position(-0.3, -.50), 240, 0.4, .03);
447 GLHelper::drawBoxLine(Position(0.3, -.10), 340, 0.8, .03);
448 GLHelper::drawBoxLine(Position(0.05, -.80), 290, 0.6, .04);
449 GLHelper::drawBoxLine(Position(0.4, -.10), 20, 0.8, .03);
450 GLHelper::drawBoxLine(Position(0.65, -.80), 75, 0.6, .04);
451 GLHelper::drawBoxLine(Position(0.5, -.10), 55, 0.8, .04);
452 GLHelper::drawBoxLine(Position(1.1, -.55), 90, 0.6, .04);
453 // draw right side
454 GLHelper::drawBoxLine(Position(-0.2, .10), 190, 0.5, .02);
455 GLHelper::drawBoxLine(Position(-0.3, .50), 300, 0.4, .03);
456 GLHelper::drawBoxLine(Position(0.3, .10), 200, 0.8, .03);
457 GLHelper::drawBoxLine(Position(0.05, .80), 250, 0.6, .04);
458 GLHelper::drawBoxLine(Position(0.4, .10), 160, 0.8, .03);
459 GLHelper::drawBoxLine(Position(0.65, .80), 105, 0.6, .04);
460 GLHelper::drawBoxLine(Position(0.5, .10), 125, 0.8, .04);
461 GLHelper::drawBoxLine(Position(1.1, .55), 90, 0.6, .04);
462 // draw body
463 GLHelper::setColor(current);
464 glTranslated(0, 0, 0.1);
466 glTranslated(.4, 0, 0);
468 glTranslated(.4, 0, 0);
471 break;
478 break;
479 }
480 case SUMOVehicleShape::EMERGENCY: // similar to delivery
482 GLHelper::setColor(darker);
484 glColor3d(0, 0, 0);
488 // first aid sign
489 glTranslated(0.7, 0, 0);
490 glColor3d(.18, .55, .34);
492 glColor3d(1, 1, 1);
495 break;
496 case SUMOVehicleShape::FIREBRIGADE: // similar to delivery in red orange
498 GLHelper::setColor(lighter);
500 glColor3d(0, 0, 0);
504 // draw ladder
505 glTranslated(0.7, 0, 0);
506 glColor3d(1, .5, 0);
508 glColor3d(.5, .5, .5);
516 break;
517 case SUMOVehicleShape::POLICE: // similar to passenger grey with blue
519 GLHelper::setColor(lighter);
521 glColor3d(0, 0, 0);
523 // first aid sign
524 glTranslated(0.7, 0, 0);
525 glColor3d(.5, .5, .5);
527 glColor3d(0, 0, 1);
530 break;
531 case SUMOVehicleShape::RICKSHAW: // Rickshaw
533 // wheels
534 GLHelper::setColor(darker);
536 glTranslated(.5, .5, -0.1);
539 //other wheel
541 glTranslated(.5, -.5, -0.1);
544 break;
545
546 case SUMOVehicleShape::AIRCRAFT: // Aircraft polygon has many points but we do not expect to have high numbers of aircraft being visualised!
548 glBegin(GL_TRIANGLE_STRIP);
549 {
550 int i = 0;
551 while (vehiclePoly_aircraft[i] > -999) {
552 glVertex2d(vehiclePoly_aircraft[i], vehiclePoly_aircraft[i + 1]);
553 i = i + 2;
554 }
555 }
556 glEnd();
558 glTranslated(0, 0, 0.1);
559 glBegin(GL_TRIANGLE_STRIP);
560 {
561 int i = 0;
562 while (vehiclePoly_aircraftEngines[i] > -999) {
564 i = i + 2;
565 }
566 }
567 glEnd();
569 // navigation lights
570 glColor3d(1.f, 0, 0);
572 glTranslated(0.62, -0.49, 0.1);
575 glColor3d(0, 1.f, 0);
577 glTranslated(0.62, 0.49, 0.1);
580 break;
581
583 const RGBColor tyreColor(102, 102, 102);
584 // left and right side are mirrored
585 for (const double side : {
586 -1., 1.
587 }) {
589 glScaled(1, side, 1);
590 // tyres
591 GLHelper::setColor(tyreColor);
592 drawRoundedRect(0.670, -0.447, 0.290, 0.026, 0.026);
593 drawRoundedRect(0.650, -0.4605, 0.254, 0.0395, 0.03);
594 // frame: side rail, push handle, front leg and footrest
595 GLHelper::setColor(current);
596 glRectd(0.359, -0.417, 1., -0.358);
597 glRectd(0.826, -0.324, 0.939, -0.282);
598 glRectd(0.05, -0.324, 0.273, -0.286);
601 }
602 // seat
603 glRectd(0.273, -0.36, 0.826, 0.36);
604 if (!isStopped) {
605 // person
606 GLHelper::setColor(darker);
607 for (const double side : {
608 -1., 1.
609 }) {
611 glScaled(1, side, 1);
615 }
617 glTranslated(0, 0, 0.2);
618 drawRoundedRect(0.686, 0, 0.083, 0.46, 0.05);
619 drawRoundedRect(0.575, 0, 0.195, 0.26, 0.05);
620 // head
621 glTranslated(0.674, 0, 0.1);
622 glScaled(0.094, 0.157, 1);
626 }
627 break;
628 }
630 // draw in units of the vehicle width so that the cabin ends keep their designed
631 // proportions and only the middle section stretches with the vehicle length
633 const double len = length / width;
634 glScaled(1. / len, 1., 1.);
635 // length/width ratio of the reference design, cabin ends shrink for shorter vehicles
636 const double k = MIN2(1., len / 1.64);
637 const double cap = 0.254 * k;
638 const double body[] = {
639 0., -0.245, 0.044 * k, -0.341, cap, -0.5, len - cap, -0.5, len - 0.044 * k, -0.341, len, -0.245,
640 len, 0.245, len - 0.044 * k, 0.341, len - cap, 0.5, cap, 0.5, 0.044 * k, 0.341, 0., 0.245, -10000
641 };
642 drawPoly(body, 1);
643 // windows at both ends
644 const double window[] = {
645 0.195 * k, -0.402, 0.057 * k, -0.305, 0.041 * k, -0.235, 0.041 * k, 0.235, 0.057 * k, 0.305, 0.195 * k, 0.402, -10000
646 };
648 drawPoly(window, 2);
650 glTranslated(len, 0, 0);
651 glScaled(-1, 1, 1);
652 drawPoly(window, 2);
654 glTranslated(0, 0, 0.2);
655 // roof grills are repeated along the cabin so that they keep roughly their designed length
656 const double gap = 0.033;
657 const double grillStart = 0.3115 * k;
658 const double grillRange = len - 2 * grillStart;
659 const int numGrills = MAX2(1, (int)(grillRange / (1.0165 * k) + 0.5));
660 const double grillLength = (grillRange - (numGrills - 1) * gap) / numGrills;
661 // rails on the long sides, split in the middle or between the grills
662 const double railStart = 0.279 * k;
663 const double railRange = len - 2 * railStart;
664 const int numRails = MAX2(2, numGrills);
665 const double railLength = (railRange - (numRails - 1) * gap) / numRails;
666 for (int i = 0; i < numRails; i++) {
667 const double x = railStart + railLength / 2 + i * (railLength + gap);
668 drawRoundedRect(x, -0.459, railLength / 2, 0.016, 0.016);
669 drawRoundedRect(x, 0.459, railLength / 2, 0.016, 0.016);
670 }
671 GLHelper::setColor(darker);
672 for (int i = 0; i < numGrills; i++) {
673 const double x = grillStart + grillLength / 2 + i * (grillLength + gap);
674 for (const double offset : {
675 -0.265, 0., 0.265
676 }) {
677 drawRoundedRect(x, offset, grillLength / 2, 0.116, 0.02);
678 }
679 }
681 break;
682 }
684 // draw within a centered square so that the rotors stay circular
685 const double size = MIN2(length, width);
686 glScaled(1. / length, 1. / width, 1.);
687 glTranslated(length / 2., 0, 0);
688 glScaled(size, size, 1.);
689 const RGBColor bladeColor(90, 90, 90);
690 const RGBColor hubColor(150, 150, 150);
691 const double rotor = 0.3;
692 // arms
693 GLHelper::setColor(current);
694 for (const double angle : {
695 45., -45.
696 }) {
698 glTranslated(0, 0, 0.1);
699 glRotated(angle, 0, 0, 1);
700 glRectd(-rotor * sqrt(2.), -0.035, rotor * sqrt(2.), 0.035);
702 }
703 // motor mounts
704 for (const double sx : {
705 -1., 1.
706 }) {
707 for (const double sy : {
708 -1., 1.
709 }) {
711 glTranslated(sx * rotor, sy * rotor, 0.15);
714 }
715 }
716 // body with camera at the front
718 glTranslated(0, 0, 0.2);
719 drawRoundedRect(-0.2, 0, 0.06, 0.07, 0.03);
720 drawRoundedRect(0, 0, 0.2, 0.14, 0.06);
721 glTranslated(0, 0, 0.05);
722 GLHelper::setColor(darker);
723 drawRoundedRect(0, 0, 0.15, 0.09, 0.04);
724 drawRoundedRect(-0.23, 0, 0.02, 0.04, 0.015);
726 // propellers (perpendicular to the arms)
727 for (const double sx : {
728 -1., 1.
729 }) {
730 for (const double sy : {
731 -1., 1.
732 }) {
734 glTranslated(sx * rotor, sy * rotor, 0.3);
736 glRotated(-45. * sx * sy, 0, 0, 1);
737 glScaled(0.19, 0.03, 1.);
738 GLHelper::setColor(bladeColor);
741 glTranslated(0, 0, 0.05);
742 GLHelper::setColor(hubColor);
744 glTranslated(0, 0, 0.05);
745 GLHelper::setColor(bladeColor);
748 }
749 }
750 break;
751 }
753 RGBColor darker2 = current.changedBrightness(-25);
755 // front small oval
756 GLHelper::setColor(darker);
757 glTranslated(0.2, 0, 0.15); // glTranslated(0.3, 0, 0.15);
758 glScaled(0.09, 0.13, 0.7); // was glScaled(0.04, 0.06, 0.7);
761 // handlebar
763 glTranslated(0.42, 0, 0.1); // was glTranslated(0.5, 0, 0.1);
764 glColor3d(0.3, 0.3, 0.3);
767 // front oval
769 GLHelper::setColor(darker2);
770 glTranslated(0.17, 0, 0.1); // was glTranslated(0.29, 0, 0.1);
771 glScaled(0.17, 0.19, 0.9); // was glScaled(0.07, 0.08, 0.9);
774 // tail rectangle
776 glColor3d(0.3, 0.3, 0.3);
778 // tail oval
779 GLHelper::setColor(darker2);
780 glTranslated(0.83, 0, 0.1); // was glTranslated(0.71, 0, 0.1);
781 glScaled(0.17, 0.17, 0.9); // was glScaled(0.07, 0.08, 0.9);
784 // base oval
786 GLHelper::setColor(lighter);
787 glTranslated(0.5, 0, 0.1); // was glTranslated(0.5, 0, 0.1);
788 glScaled(0.5, 0.28, 0.9); // was glScaled(0.28, 0.14, 0.9);
790 // center rectangle
791 GLHelper::setColor(current);
794 break;
795 }
796 default: // same as passenger
798 glColor3d(1, 1, 1);
800 glColor3d(0, 0, 0);
802 break;
803 }
804
805 // draw decorations
806 switch (shape) {
808 break;
811 //glScaled(length, 1, 1.);
812 glBegin(GL_TRIANGLE_FAN);
813 glVertex2d(1 / 2., 0);
814 glVertex2d(0, 0);
815 glVertex2d(0, -.03);
816 glVertex2d(0 + .05, -.05);
817 glVertex2d(1 - .05, -.05);
818 glVertex2d(1, -.03);
819 glVertex2d(1, .03);
820 glVertex2d(1 - .05, .05);
821 glVertex2d(0 + .05, .05);
822 glVertex2d(0, .03);
823 glVertex2d(0, 0);
824 glEnd();
825 break;
828 //glScaled(length, 1, 1.);
829 glBegin(GL_TRIANGLE_FAN);
830 glVertex2d(1 / 2., 0);
831 glVertex2d(0, 0);
832 glVertex2d(0, -.03);
833 glVertex2d(0 + .05, -.2);
834 glVertex2d(1 - .05, -.2);
835 glVertex2d(1, -.03);
836 glVertex2d(1, .03);
837 glVertex2d(1 - .05, .2);
838 glVertex2d(0 + .05, .2);
839 glVertex2d(0, .03);
840 glVertex2d(0, 0);
841 glEnd();
842 break;
848 break;
853 break;
858 break;
861 break;
866
867 glTranslated(0, 0, 6);
868 glColor3d(0, 0, 0);
869 // square-pattern in front
870 glRectd(0.146, 0.24675, 0.171, 0.176);
871 glRectd(0.121, 0.176, 0.146, 0.1055);
872 glRectd(0.146, 0.1055, 0.171, 0.035);
873 glRectd(0.121, 0.035, 0.146, -0.035);
874 glRectd(0.146, -0.1055, 0.171, -0.035);
875 glRectd(0.121, -0.176, 0.146, -0.1055);
876 glRectd(0.146, -0.24675, 0.171, -0.176);
877 // square-pattern at the back
878 glRectd(0.913, 0.24675, 0.938, 0.176);
879 glRectd(0.888, 0.176, 0.913, 0.1055);
880 glRectd(0.888, 0.176, 0.913, 0.1055);
881 glRectd(0.913, 0.1055, 0.938, 0.035);
882 glRectd(0.888, 0.035, 0.913, -0.035);
883 glRectd(0.913, -0.1055, 0.938, -0.035);
884 glRectd(0.888, -0.176, 0.913, -0.1055);
885 glRectd(0.888, -0.176, 0.913, -0.1055);
886 glRectd(0.913, -0.24675, 0.938, -0.176);
887
888 GLHelper::setColor(darker);
890 glScaled(0.2, 0.5, 1);
891 GLHelper::drawText("TAXI", Position(2.58, 0), 5, 0.3, RGBColor::BLACK, 90);
892 break;
894 GLHelper::setColor(current);
895 GLHelper::drawBoxLine(Position(2.3, 0), 90., length - 2.3, .5);
896 break;
898 if (carriageIndex < 0) {
899 GLHelper::setColor(current);
900 GLHelper::drawBoxLine(Position(2.8, 0), 90., length - 2.8, .5);
901 }
902 break;
904 GLHelper::setColor(current);
905 double l = length - 2.3;
906 if (carriageIndex != 0) {
907 l = l / 2.;
908 GLHelper::drawBoxLine(Position(2.3, 0), 90., l, .5);
909 GLHelper::drawBoxLine(Position(2.3 + l + .5, 0), 90., l - .5, .5);
910 } else {
911 GLHelper::drawBoxLine(Position(2.3, 0), 90., l, .5);
912 }
913 break;
914 }
917 glTranslated(0, 0, .1);
918 GLHelper::setColor(darker);
919 GLHelper::drawBoxLine(Position(3.8, 0), 90., 1, .3);
920 glTranslated(0, 0, .1);
921 glColor3d(0, 0, 0);
922 GLHelper::drawBoxLine(Position(4.3, .2), 90., 1, .06);
923 GLHelper::drawBoxLine(Position(4.3, -.2), 90., 1, .06);
924 GLHelper::drawBoxLine(Position(5.3, .2), 90., 3, .03);
925 GLHelper::drawBoxLine(Position(5.3, -.2), 90., 3, .03);
927 break;
946 break;
947 default: // same as passenger/sedan
951 break;
952 }
953 /*
954 glBegin(GL_TRIANGLE_FAN);
955 glVertex2d(.5,.5); // center - strip begin
956 glVertex2d(0, .5); // center, front
957 glVertex2d(0, .8); // ... clockwise ... (vehicle right side)
958 glVertex2d(0.08, .94);
959 glVertex2d(0.25, 1.);
960 glVertex2d(0.95, 1.);
961 glVertex2d(1., .9);
962 glVertex2d(1., .1); // (vehicle left side)
963 glVertex2d(0.95, 0.);
964 glVertex2d(0.25, 0.);
965 glVertex2d(0.08, .06);
966 glVertex2d(0, .2); //
967 glVertex2d(0, .5); // center, front (close)
968 glEnd();
969
970 glPolygonOffset(0, -4.5);
971 glColor3d(1, 1, 1); // front
972 glBegin(GL_TRIANGLE_FAN);
973 glVertex2d(0.1,0.5);
974 glVertex2d(0.025,0.5);
975 glVertex2d(0.025,0.75);
976 glVertex2d(0.27,0.9);
977 glVertex2d(0.27,0.1);
978 glVertex2d(0.025,0.25);
979 glVertex2d(0.025,0.5);
980 glEnd();
981
982 glColor3d(0, 0, 0); // front glass
983 glBegin(GL_TRIANGLE_FAN);
984 glVertex2d(0.35,0.5);
985 glVertex2d(0.3,0.5);
986 glVertex2d(0.3,0.9);
987 glVertex2d(0.43,0.8);
988 glVertex2d(0.43,0.2);
989 glVertex2d(0.3,0.1);
990 glVertex2d(0.3,0.5);
991 glEnd();
992
993 glBegin(GL_TRIANGLE_FAN); // back glass
994 glVertex2d(0.92,0.5);
995 glVertex2d(0.90,0.5);
996 glVertex2d(0.90,0.8);
997 glVertex2d(0.95,0.9);
998 glVertex2d(0.95,0.1);
999 glVertex2d(0.90,0.2);
1000 glVertex2d(0.90,0.5);
1001 glEnd();
1002
1003 glBegin(GL_TRIANGLE_FAN); // right glass
1004 glVertex2d(0.36,0.07);
1005 glVertex2d(0.34,0.03);
1006 glVertex2d(0.94,0.03);
1007 glVertex2d(0.87,0.13);
1008 glVertex2d(0.45,0.13);
1009 glVertex2d(0.34,0.03);
1010 glEnd();
1011
1012 glBegin(GL_TRIANGLE_FAN); // left glass
1013 glVertex2d(0.36,1.-0.07);
1014 glVertex2d(0.34,1.-0.03);
1015 glVertex2d(0.94,1.-0.03);
1016 glVertex2d(0.87,1.-0.13);
1017 glVertex2d(0.45,1.-0.13);
1018 glVertex2d(0.34,1.-0.03);
1019 glEnd();
1020 */
1021
1023}
1024
1025
1026bool
1027GUIBaseVehicleHelper::drawAction_drawVehicleAsImage(const GUIVisualizationSettings& /* s */, const std::string& file, const GUIGlObject* /* o */, const double width, double length) {
1028 if (file != "") {
1029 int textureID = GUITexturesHelper::getTextureID(file);
1030 if (textureID > 0) {
1031 GUITexturesHelper::drawTexturedBox(textureID, -width * 0.5, 0, width * 0.5, length);
1032 return true;
1033 }
1034 }
1035 return false;
1036}
1037
1038
1039/****************************************************************************/
static const double vehiclePoly_PassengerVanRightGlass[]
static const double vehiclePoly_CargoBicycleBox[]
static const double vehiclePoly_EmergencyLadder3[]
static const double vehiclePoly_PassengerVanBodyFront[]
static const double vehiclePoly_WheelchairArm[]
static const double vehiclePoly_EVehicleFrontGlass[]
static const double vehiclePoly_ShipSuperStructure[]
static const double vehiclePoly_scooterBase[]
static const double vehiclePoly_MotorcycleSeat[]
static const double vehiclePoly_PassengerVanBody[]
static void drawRoundedRect(const double cx, const double cy, const double halfX, const double halfY, const double radius, const int stepsPerCorner=6)
draw a filled rectangle with rounded corners centered at (cx, cy)
static const double vehiclePoly_PassengerWagonLeftGlass[]
static const double vehiclePoly_TransportFrontGlass[]
static const double vehiclePoly_CargoBicycleBoxInterior[]
static const double vehiclePoly_PassengerHatchbackRightGlass[]
static const double vehiclePoly_DeliveryMediumRightGlass[]
static const double vehiclePoly_PassengerHatchbackLeftGlass[]
static const double vehiclePoly_Ship[]
static const double vehiclePoly_EmergencyLadder6[]
static const double vehiclePoly_PassengerSedanLeftGlass[]
static const double vehiclePoly_Emergency2[]
static const double vehiclePoly_PassengerVanBackGlass[]
static const double vehiclePoly_EmergencyLadder7[]
static const double vehiclePoly_WheelchairFootrest[]
static const double vehiclePoly_PassengerHatchbackBackGlass[]
static const double vehiclePoly_aircraftEngines[]
static const double vehiclePoly_EmergencyLadder4[]
static const double vehiclePoly_PassengerFrontGlass[]
static const double vehiclePoly_EmergencyLadder2[]
static const double vehiclePoly_TransportLeftGlass[]
static const double vehiclePoly_PassengerVanLeftGlass[]
static const double vehiclePoly_Cyclist[]
static const double vehiclePoly_PassengerWagonBackGlass[]
static const double vehiclePoly_PassengerSedanRightGlass[]
static const double vehiclePoly_PassengerCarBodyFront[]
static const double vehiclePoly_scooterBase2[]
static const double vehiclePoly_scooterBase3[]
static const double vehiclePoly_TaxiSign[]
static const double vehiclePoly_aircraft[]
static const double vehiclePoly_EmergencySign[]
static const double vehiclePoly_TransportBody[]
static const double vehiclePoly_WheelchairLeg[]
static const double vehiclePoly_CargoCyclist[]
static const double vehiclePoly_EmergencyLadder[]
static const double vehiclePoly_PassengerWagonRightGlass[]
static const double vehiclePoly_DeliveryMediumLeftGlass[]
static const double vehiclePoly_TransportRightGlass[]
static const double vehiclePoly_PassengerSedanBackGlass[]
static const double vehiclePoly_Emergency[]
static const double vehiclePoly_PassengerVanFrontGlass[]
static const double vehiclePoly_ShipDeck[]
static const double vehiclePoly_PassengerCarBody[]
static const double vehiclePoly_EVehicleBody[]
static const double vehiclePoly_BicycleSeat[]
static const double vehiclePoly_EmergencyLadder5[]
#define DEG2RAD(x)
Definition GeomHelper.h:35
SUMOVehicleShape
Definition of vehicle classes to differ between different appearances.
@ RICKSHAW
render as a rickshaw
@ BUS
render as a bus
@ RAIL_CARGO
render as a cargo train
@ CABLE_CAR
render as a cable car
@ EMERGENCY
render as an emergency vehicle
@ RAIL
render as a rail
@ PASSENGER_VAN
render as a van
@ PASSENGER
render as a passenger vehicle
@ SCOOTER
render as a scooter
@ RAIL_CAR
render as a (city) rail without locomotive
@ SHIP
render as a arbitrary ship
@ DELIVERY
render as a delivery vehicle
@ BICYCLE
render as a bicycle
@ BICYCLE_CARGO
render as a front-loading cargo bicycle
@ MOTORCYCLE
render as a motorcycle
@ UNKNOWN
not defined
@ BUS_TROLLEY
render as a trolley bus
@ TAXI
automated car (with cruise controllers)
@ E_VEHICLE
render as a (futuristic) e-vehicle
@ ANT
render as a giant ant
@ TRUCK
render as a transport vehicle
@ AIRCRAFT
render as aircraft
@ FIREBRIGADE
render as a fire brigade
@ PASSENGER_HATCHBACK
render as a hatchback passenger vehicle ("Fliessheck")
@ MOPED
render as a moped
@ BUS_FLEXIBLE
render as a flexible city bus
@ TRUCK_1TRAILER
render as a transport vehicle with one trailer
@ PASSENGER_SEDAN
render as a sedan passenger vehicle ("Stufenheck")
@ WHEELCHAIR
render as a wheelchair
@ DRONE
render as a drone
@ BUS_COACH
render as a coach
@ POLICE
render as a police car
@ PASSENGER_WAGON
render as a wagon passenger vehicle ("Combi")
@ TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
@ PEDESTRIAN
render as a pedestrian
T MIN2(T a, T b)
Definition StdDefs.h:80
T MAX2(T a, T b)
Definition StdDefs.h:86
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:649
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
Definition GLHelper.cpp:564
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
static RGBColor getColor()
gets the gl-color
Definition GLHelper.cpp:655
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
Definition GLHelper.cpp:296
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, const int align=0, double width=-1)
Definition GLHelper.cpp:742
static bool drawAction_drawVehicleAsImage(const GUIVisualizationSettings &s, const std::string &file, const GUIGlObject *o, const double width, double length)
try to draw vehicle as raster image and return true if successful
static void drawAction_drawVehicleAsCircle(const double width, double detail)
draw vehicle as a circle
static void drawPoly(const double *poses, const double offset)
draw poly
static void drawAction_drawVehicleAsTrianglePlus(const double width, const double length, bool amReversed=false)
draw vehicle as a triangle
static void drawAction_drawVehicleAsPoly(const GUIVisualizationSettings &s, const SUMOVehicleShape shape, const double width, const double length, int carriageIndex=-1, bool isStopped=false, bool amReversed=false)
draw vehicle as a polygon
static void drawAction_drawVehicleAsBoxPlus(const double width, const double length, bool amReversed=false)
draw vehicle as a Box
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
Stores the information about how to visualize structures.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
static const RGBColor GREY
Definition RGBColor.h:213
static const RGBColor BLACK
Definition RGBColor.h:212
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition RGBColor.cpp:228
#define UNUSED_PARAMETER(x)
detail namespace with internal helper functions
Definition json.hpp:263