Line data Source code
1 : /****************************************************************************/
2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 : // Copyright (C) 2001-2024 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 : /****************************************************************************/
14 : /// @file VClassIcons.cpp
15 : /// @author Pablo Alvarez Lopez
16 : /// @author Angelo Banse
17 : /// @date Jan 2023
18 : ///
19 : // Function that returns the icon for a certain vClass
20 : /****************************************************************************/
21 : #include <config.h>
22 :
23 : #include <utils/common/SUMOVehicleClass.h>
24 : #include <utils/foxtools/fxheader.h>
25 : #include <utils/gui/images/GUIIconSubSys.h>
26 :
27 : #include "VClassIcons.h"
28 :
29 :
30 : // ===========================================================================
31 : // member method definitions
32 : // ===========================================================================
33 :
34 : FXIcon*
35 256734 : VClassIcons::getVClassIcon(const SUMOVehicleClass vc) {
36 256734 : switch (vc) {
37 7551 : case SVC_IGNORING:
38 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_IGNORING);
39 7551 : case SVC_PRIVATE:
40 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_PRIVATE);
41 7551 : case SVC_EMERGENCY:
42 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_EMERGENCY);
43 7551 : case SVC_AUTHORITY:
44 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_AUTHORITY);
45 7551 : case SVC_ARMY:
46 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_ARMY);
47 7551 : case SVC_VIP:
48 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_VIP);
49 7551 : case SVC_PEDESTRIAN:
50 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_PEDESTRIAN);
51 7551 : case SVC_PASSENGER:
52 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_PASSENGER);
53 7551 : case SVC_HOV:
54 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_HOV);
55 7551 : case SVC_TAXI:
56 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_TAXI);
57 7551 : case SVC_BUS:
58 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_BUS);
59 7551 : case SVC_COACH:
60 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_COACH);
61 7551 : case SVC_DELIVERY:
62 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_DELIVERY);
63 7551 : case SVC_TRUCK:
64 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_TRUCK);
65 7551 : case SVC_TRAILER:
66 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_TRAILER);
67 7551 : case SVC_MOTORCYCLE:
68 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_MOTORCYCLE);
69 7551 : case SVC_MOPED:
70 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_MOPED);
71 7551 : case SVC_BICYCLE:
72 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_BICYCLE);
73 7551 : case SVC_E_VEHICLE:
74 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_EVEHICLE);
75 7551 : case SVC_TRAM:
76 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_TRAM);
77 7551 : case SVC_RAIL_URBAN:
78 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_RAIL_URBAN);
79 7551 : case SVC_RAIL:
80 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_RAIL);
81 7551 : case SVC_RAIL_ELECTRIC:
82 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_RAIL_ELECTRIC);
83 7551 : case SVC_RAIL_FAST:
84 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_RAIL_FAST);
85 7551 : case SVC_SHIP:
86 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_SHIP);
87 7551 : case SVC_CONTAINER:
88 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_CONTAINER);
89 7551 : case SVC_CABLE_CAR:
90 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_CABLE_CAR);
91 7551 : case SVC_SUBWAY:
92 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_SUBWAY);
93 7551 : case SVC_AIRCRAFT:
94 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_AIRCRAFT);
95 7551 : case SVC_WHEELCHAIR:
96 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_WHEELCHAIR);
97 7551 : case SVC_SCOOTER:
98 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_SCOOTER);
99 7551 : case SVC_DRONE:
100 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_DRONE);
101 7551 : case SVC_CUSTOM1:
102 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_CUSTOM1);
103 7551 : case SVC_CUSTOM2:
104 7551 : return GUIIconSubSys::getIcon(GUIIcon::VCLASS_SMALL_CUSTOM2);
105 0 : default:
106 0 : throw ProcessError(TL("Invalid vClass"));
107 : }
108 : }
109 :
110 :
111 : /****************************************************************************/
|