Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUISettingsHandler.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-2025 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/****************************************************************************/
22// The dialog to change the view (gui) settings.
23/****************************************************************************/
24#include <config.h>
25
26#include <vector>
37#include <utils/xml/XMLSubSys.h>
38#include "GUISettingsHandler.h"
39
40
41// ===========================================================================
42// method definitions
43// ===========================================================================
44GUISettingsHandler::GUISettingsHandler(const std::string& content, bool isFile, bool netedit) :
45 SUMOSAXHandler(content),
46 mySettings("TEMPORARY_NAME", netedit),
47 myDelay(-1), myLookFrom(-1, -1, -1), myLookAt(-1, -1, -1), myZCoordSet(true),
48 myRotation(0),
49 myZoom(-1),
51 myCurrentScheme(nullptr),
52 myJamSoundTime(-1) {
53 if (isFile) {
54 XMLSubSys::runParser(*this, content);
55 } else {
56 setFileName("registrySettings");
58 reader->parseString(content);
59 delete reader;
60 }
61}
62
63
66
67
68void
70 bool ok = true;
71 switch (element) {
73 if (attrs.hasAttribute(SUMO_ATTR_TIME)) {
74 myBreakpoints.push_back(attrs.getSUMOTimeReporting(SUMO_ATTR_TIME, nullptr, ok));
75 } else {
76 myBreakpoints.push_back(attrs.getSUMOTimeReporting(SUMO_ATTR_VALUE, nullptr, ok));
77 WRITE_WARNING(TL("The 'value' attribute is deprecated for breakpoints. Please use 'time'."));
78 }
79 break;
81 myViewType = attrs.getOpt<std::string>(SUMO_ATTR_TYPE, nullptr, ok, "default");
83 break;
85 mySettings.show3DTLSLinkMarkers = StringUtils::toBool(attrs.getStringSecure("show3DTLSLinkMarkers", toString(mySettings.show3DTLSLinkMarkers)));
86 mySettings.show3DTLSDomes = StringUtils::toBool(attrs.getStringSecure("show3DTLSDomes", toString(mySettings.show3DTLSDomes)));
87 mySettings.show3DHeadUpDisplay = StringUtils::toBool(attrs.getStringSecure("show3DHeadUpDisplay", toString(mySettings.show3DHeadUpDisplay)));
88 mySettings.generate3DTLSModels = StringUtils::toBool(attrs.getStringSecure("generate3DTLSModels", toString(mySettings.generate3DTLSModels)));
89 mySettings.ambient3DLight = parseColor(attrs, "ambient3DLight", mySettings.ambient3DLight);
90 mySettings.diffuse3DLight = parseColor(attrs, "diffuse3DLight", mySettings.diffuse3DLight);
91 break;
92 case SUMO_TAG_DELAY:
93 myDelay = attrs.getOpt<double>(SUMO_ATTR_VALUE, nullptr, ok, myDelay);
94 break;
95 case SUMO_TAG_VIEWPORT: {
96 const double x = attrs.getOpt<double>(SUMO_ATTR_X, nullptr, ok, myLookFrom.x());
97 const double y = attrs.getOpt<double>(SUMO_ATTR_Y, nullptr, ok, myLookFrom.y());
98 const double z = attrs.getOpt<double>(SUMO_ATTR_Z, nullptr, ok, myLookFrom.z());
99 attrs.get<double>(SUMO_ATTR_Z, nullptr, myZCoordSet, false);
100 myLookFrom.set(x, y, z);
101 myZoom = attrs.getOpt<double>(SUMO_ATTR_ZOOM, nullptr, ok, myZoom);
102 const double cx = attrs.getOpt<double>(SUMO_ATTR_CENTER_X, nullptr, ok, myLookFrom.x());
103 const double cy = attrs.getOpt<double>(SUMO_ATTR_CENTER_Y, nullptr, ok, myLookFrom.y());
104 const double cz = attrs.getOpt<double>(SUMO_ATTR_CENTER_Z, nullptr, ok, 0.);
105 myLookAt.set(cx, cy, cz);
106 myRotation = attrs.getOpt<double>(SUMO_ATTR_ANGLE, nullptr, ok, myRotation);
107 break;
108 }
109 case SUMO_TAG_SNAPSHOT: {
110 std::string file = attrs.get<std::string>(SUMO_ATTR_FILE, nullptr, ok);
111 if (file != "" && !FileHelpers::isAbsolute(file)) {
113 }
114 mySnapshots[attrs.getOptSUMOTimeReporting(SUMO_ATTR_TIME, file.c_str(), ok, 0)].push_back(file);
115 }
116 break;
118 mySettings.name = attrs.getOpt<std::string>(SUMO_ATTR_NAME, nullptr, ok, mySettings.name);
119 if (gSchemeStorage.contains(mySettings.name)) {
120 mySettings.copy(gSchemeStorage.get(mySettings.name));
121 }
122 }
123 break;
125 mySettings.dither = StringUtils::toBool(attrs.getStringSecure("dither", toString(mySettings.dither)));
127 mySettings.trueZ = StringUtils::toBool(attrs.getStringSecure("trueZ", toString(mySettings.trueZ)));
128 mySettings.drawBoundaries = StringUtils::toBool(attrs.getStringSecure("drawBoundaries", toString(mySettings.drawBoundaries)));
129 mySettings.forceDrawForRectangleSelection = StringUtils::toBool(attrs.getStringSecure("forceDrawRectangleSelection", toString(mySettings.forceDrawForRectangleSelection)));
130 mySettings.disableDottedContours = StringUtils::toBool(attrs.getStringSecure("disableDottedContours", toString(mySettings.disableDottedContours)));
131 mySettings.geometryIndices = parseTextSettings("geometryIndices", attrs, mySettings.geometryIndices);
132 break;
134 mySettings.backgroundColor = RGBColor::parseColorReporting(attrs.getStringSecure("backgroundColor", toString(mySettings.backgroundColor)), "background", nullptr, true, ok);
135 mySettings.showGrid = StringUtils::toBool(attrs.getStringSecure("showGrid", toString(mySettings.showGrid)));
136 mySettings.gridXSize = StringUtils::toDouble(attrs.getStringSecure("gridXSize", toString(mySettings.gridXSize)));
137 mySettings.gridYSize = StringUtils::toDouble(attrs.getStringSecure("gridYSize", toString(mySettings.gridYSize)));
138 break;
140 int laneEdgeMode = StringUtils::toInt(attrs.getStringSecure("laneEdgeMode", "0"));
141 int laneEdgeScaleMode = StringUtils::toInt(attrs.getStringSecure("scaleMode", "0"));
142 mySettings.laneShowBorders = StringUtils::toBool(attrs.getStringSecure("laneShowBorders", toString(mySettings.laneShowBorders)));
143 mySettings.showBikeMarkings = StringUtils::toBool(attrs.getStringSecure("showBikeMarkings", toString(mySettings.showBikeMarkings)));
144 mySettings.showLinkDecals = StringUtils::toBool(attrs.getStringSecure("showLinkDecals", toString(mySettings.showLinkDecals)));
145 mySettings.realisticLinkRules = StringUtils::toBool(attrs.getStringSecure("realisticLinkRules", toString(mySettings.realisticLinkRules)));
146 mySettings.showLinkRules = StringUtils::toBool(attrs.getStringSecure("showLinkRules", toString(mySettings.showLinkRules)));
147 mySettings.showRails = StringUtils::toBool(attrs.getStringSecure("showRails", toString(mySettings.showRails)));
148 mySettings.secondaryShape = StringUtils::toBool(attrs.getStringSecure("secondaryShape", toString(mySettings.secondaryShape)));
149 mySettings.edgeName = parseTextSettings("edgeName", attrs, mySettings.edgeName);
150 mySettings.internalEdgeName = parseTextSettings("internalEdgeName", attrs, mySettings.internalEdgeName);
151 mySettings.cwaEdgeName = parseTextSettings("cwaEdgeName", attrs, mySettings.cwaEdgeName);
152 mySettings.streetName = parseTextSettings("streetName", attrs, mySettings.streetName);
153 mySettings.edgeValue = parseTextSettings("edgeValue", attrs, mySettings.edgeValue);
154 mySettings.edgeScaleValue = parseTextSettings("edgeScaleValue", attrs, mySettings.edgeScaleValue);
155 mySettings.hideConnectors = StringUtils::toBool(attrs.getStringSecure("hideConnectors", toString(mySettings.hideConnectors)));
156 mySettings.laneWidthExaggeration = StringUtils::toDouble(attrs.getStringSecure("widthExaggeration", toString(mySettings.laneWidthExaggeration)));
157 mySettings.laneMinSize = StringUtils::toDouble(attrs.getStringSecure("minSize", toString(mySettings.laneMinSize)));
158 mySettings.showLaneDirection = StringUtils::toBool(attrs.getStringSecure("showDirection", toString(mySettings.showLaneDirection)));
159 mySettings.showSublanes = StringUtils::toBool(attrs.getStringSecure("showSublanes", toString(mySettings.showSublanes)));
160 mySettings.spreadSuperposed = StringUtils::toBool(attrs.getStringSecure("spreadSuperposed", toString(mySettings.spreadSuperposed)));
161 mySettings.disableHideByZoom = StringUtils::toBool(attrs.getStringSecure("disableHideByZoom", toString(mySettings.disableHideByZoom)));
162 mySettings.edgeParam = attrs.getStringSecure("edgeParam", mySettings.edgeParam);
163 mySettings.laneParam = attrs.getStringSecure("laneParam", mySettings.laneParam);
164 mySettings.edgeData = attrs.getStringSecure("edgeData", mySettings.edgeData);
165 mySettings.edgeDataID = attrs.getStringSecure("edgeDataID", mySettings.edgeDataID);
166 mySettings.edgeDataScaling = attrs.getStringSecure("edgeDataScaling", mySettings.edgeDataScaling);
167 mySettings.edgeValueRainBow = parseRainbowSettings("edgeValue", attrs, mySettings.edgeValueRainBow);
168 myCurrentColorer = element;
169 mySettings.edgeColorer.setActive(laneEdgeMode);
170 mySettings.edgeScaler.setActive(laneEdgeScaleMode);
171 mySettings.laneColorer.setActive(laneEdgeMode);
172 mySettings.laneScaler.setActive(laneEdgeScaleMode);
173 }
174 break;
176 myCurrentScheme = nullptr;
177 myCurrentScaleScheme = nullptr;
178 const std::string name = attrs.getStringSecure(SUMO_ATTR_NAME, "");
180 if (StringUtils::startsWith(name, "meso:")) {
181 // see edgeColorer.save() in GUIVisualizationSettings::save
182 myCurrentScheme = mySettings.edgeColorer.getSchemeByName(name.substr(5));
183 } else {
184 myCurrentScheme = mySettings.laneColorer.getSchemeByName(name);
185 }
186 if (myCurrentScheme == nullptr) {
187 // legacy: meso schemes without prefix
188 myCurrentScheme = mySettings.edgeColorer.getSchemeByName(name);
189 }
190 }
192 myCurrentScheme = mySettings.vehicleColorer.getSchemeByName(name);
193 }
195 myCurrentScheme = mySettings.personColorer.getSchemeByName(name);
196 }
198 myCurrentScheme = mySettings.junctionColorer.getSchemeByName(name);
199 }
201 myCurrentScheme = mySettings.poiColorer.getSchemeByName(name);
202 }
204 myCurrentScheme = mySettings.polyColorer.getSchemeByName(name);
205 }
207 myCurrentScheme = mySettings.dataColorer.getSchemeByName(name);
208 }
209 if (myCurrentScheme && !myCurrentScheme->isFixed()) {
210 myCurrentScheme->setInterpolated(attrs.getOpt<bool>(SUMO_ATTR_INTERPOLATED, nullptr, ok, false));
211 myCurrentScheme->clear();
212 }
213 }
214 break;
216 myCurrentScheme = nullptr;
217 myCurrentScaleScheme = nullptr;
218 const std::string name = attrs.getStringSecure(SUMO_ATTR_NAME, "");
220 if (StringUtils::startsWith(name, "meso:")) {
221 // see edgeScaler.save() in GUIVisualizationSettings::save
222 myCurrentScaleScheme = mySettings.edgeScaler.getSchemeByName(name.substr(5));
223 } else {
224 myCurrentScaleScheme = mySettings.laneScaler.getSchemeByName(name);
225 }
226 if (myCurrentScaleScheme == nullptr) {
227 // legacy: meso schemes without prefix
228 myCurrentScaleScheme = mySettings.edgeScaler.getSchemeByName(name);
229 }
230 }
232 myCurrentScaleScheme = mySettings.vehicleScaler.getSchemeByName(name);
233 }
235 myCurrentScaleScheme = mySettings.dataScaler.getSchemeByName(name);
236 }
237 if (myCurrentScaleScheme && !myCurrentScaleScheme->isFixed()) {
238 myCurrentScaleScheme->setInterpolated(attrs.getOpt<bool>(SUMO_ATTR_INTERPOLATED, nullptr, ok, false));
239 myCurrentScaleScheme->clear();
240 }
241 }
242 break;
243 case SUMO_TAG_ENTRY:
244 if (myCurrentScheme != nullptr) {
245 RGBColor color = attrs.get<RGBColor>(SUMO_ATTR_COLOR, nullptr, ok);
246 if (myCurrentScheme->isFixed()) {
247 myCurrentScheme->setColor(attrs.getStringSecure(SUMO_ATTR_NAME, ""), color);
248 } else {
249 myCurrentScheme->addColor(color,
250 attrs.getOpt<double>(SUMO_ATTR_THRESHOLD, nullptr, ok, std::numeric_limits<double>::max()),
252 }
253 } else if (myCurrentScaleScheme != nullptr) {
254 double scale = attrs.get<double>(SUMO_ATTR_COLOR, nullptr, ok);
255 if (myCurrentScaleScheme->isFixed()) {
256 myCurrentScaleScheme->setColor(attrs.getStringSecure(SUMO_ATTR_NAME, ""), scale);
257 } else {
258 myCurrentScaleScheme->addColor(scale,
259 attrs.getOpt<double>(SUMO_ATTR_THRESHOLD, nullptr, ok, std::numeric_limits<double>::max()),
261 }
262 }
263 break;
265 mySettings.vehicleColorer.setActive(StringUtils::toInt(attrs.getStringSecure("vehicleMode", "0")));
266 mySettings.vehicleScaler.setActive(StringUtils::toInt(attrs.getStringSecure("vehicleScaleMode", "0")));
267 mySettings.vehicleQuality = StringUtils::toInt(attrs.getStringSecure("vehicleQuality", toString(mySettings.vehicleQuality)));
268 mySettings.showBlinker = StringUtils::toBool(attrs.getStringSecure("showBlinker", toString(mySettings.showBlinker)));
269 mySettings.drawMinGap = StringUtils::toBool(attrs.getStringSecure("drawMinGap", toString(mySettings.drawMinGap)));
270 mySettings.drawBrakeGap = StringUtils::toBool(attrs.getStringSecure("drawBrakeGap", toString(mySettings.drawBrakeGap)));
271 mySettings.showBTRange = StringUtils::toBool(attrs.getStringSecure("showBTRange", toString(mySettings.showBTRange)));
272 mySettings.showRouteIndex = StringUtils::toBool(attrs.getStringSecure("showRouteIndex", toString(mySettings.showRouteIndex)));
273 mySettings.scaleLength = StringUtils::toBool(attrs.getStringSecure("scaleLength", toString(mySettings.scaleLength)));
274 mySettings.drawReversed = StringUtils::toBool(attrs.getStringSecure("drawReversed", toString(mySettings.drawReversed)));
275 mySettings.showParkingInfo = StringUtils::toBool(attrs.getStringSecure("showParkingInfo", toString(mySettings.showParkingInfo)));
276 mySettings.showChargingInfo = StringUtils::toBool(attrs.getStringSecure("showChargingInfo", toString(mySettings.showChargingInfo)));
277 mySettings.vehicleSize = parseSizeSettings("vehicle", attrs, mySettings.vehicleSize);
278 mySettings.vehicleName = parseTextSettings("vehicleName", attrs, mySettings.vehicleName);
279 mySettings.vehicleValue = parseTextSettings("vehicleValue", attrs, mySettings.vehicleValue);
280 mySettings.vehicleScaleValue = parseTextSettings("vehicleScaleValue", attrs, mySettings.vehicleScaleValue);
281 mySettings.vehicleText = parseTextSettings("vehicleText", attrs, mySettings.vehicleText);
282 mySettings.vehicleParam = attrs.getStringSecure("vehicleParam", mySettings.vehicleParam);
283 mySettings.vehicleScaleParam = attrs.getStringSecure("vehicleScaleParam", mySettings.vehicleScaleParam);
284 mySettings.vehicleTextParam = attrs.getStringSecure("vehicleTextParam", mySettings.vehicleTextParam);
285 mySettings.vehicleValueRainBow = parseRainbowSettings("vehicleValueRainbow", attrs, mySettings.vehicleValueRainBow);
286 myCurrentColorer = element;
287 break;
289 mySettings.personColorer.setActive(StringUtils::toInt(attrs.getStringSecure("personMode", "0")));
290 mySettings.personQuality = StringUtils::toInt(attrs.getStringSecure("personQuality", toString(mySettings.personQuality)));
291 mySettings.personSize = parseSizeSettings("person", attrs, mySettings.personSize);
292 mySettings.personName = parseTextSettings("personName", attrs, mySettings.personName);
293 mySettings.personValue = parseTextSettings("personValue", attrs, mySettings.personValue);
294 mySettings.showPedestrianNetwork = StringUtils::toBool(attrs.getStringSecure("showPedestrianNetwork", toString(mySettings.showPedestrianNetwork)));
295 mySettings.pedestrianNetworkColor = RGBColor::parseColorReporting(attrs.getStringSecure("pedestrianNetworkColor", toString(mySettings.pedestrianNetworkColor)), "pedestrianNetworkColor", nullptr, true, ok);
296 myCurrentColorer = element;
297 break;
299 mySettings.containerColorer.setActive(StringUtils::toInt(attrs.getStringSecure("containerMode", "0")));
300 mySettings.containerQuality = StringUtils::toInt(attrs.getStringSecure("containerQuality", toString(mySettings.containerQuality)));
301 mySettings.containerSize = parseSizeSettings("container", attrs, mySettings.containerSize);
302 mySettings.containerName = parseTextSettings("containerName", attrs, mySettings.containerName);
303 myCurrentColorer = element;
304 break;
306 mySettings.junctionColorer.setActive(StringUtils::toInt(attrs.getStringSecure("junctionMode", "0")));
307 mySettings.drawLinkTLIndex = parseTextSettings("drawLinkTLIndex", attrs, mySettings.drawLinkTLIndex);
308 mySettings.drawLinkJunctionIndex = parseTextSettings("drawLinkJunctionIndex", attrs, mySettings.drawLinkJunctionIndex);
309 mySettings.junctionID = parseTextSettings("junctionID", attrs, mySettings.junctionID);
310 mySettings.junctionName = parseTextSettings("junctionName", attrs, mySettings.junctionName);
311 mySettings.internalJunctionName = parseTextSettings("internalJunctionName", attrs, mySettings.internalJunctionName);
312 mySettings.tlsPhaseIndex = parseTextSettings("tlsPhaseIndex", attrs, mySettings.tlsPhaseIndex);
313 mySettings.tlsPhaseName = parseTextSettings("tlsPhaseName", attrs, mySettings.tlsPhaseName);
314 mySettings.showLane2Lane = StringUtils::toBool(attrs.getStringSecure("showLane2Lane", toString(mySettings.showLane2Lane)));
315 mySettings.drawJunctionShape = StringUtils::toBool(attrs.getStringSecure("drawShape", toString(mySettings.drawJunctionShape)));
316 mySettings.drawCrossingsAndWalkingareas = StringUtils::toBool(attrs.getStringSecure(
317 "drawCrossingsAndWalkingareas", toString(mySettings.drawCrossingsAndWalkingareas)));
318 mySettings.junctionSize = parseSizeSettings("junction", attrs, mySettings.junctionSize);
319 mySettings.junctionValueRainBow = parseRainbowSettings("junctionValue", attrs, mySettings.junctionValueRainBow);
320 myCurrentColorer = element;
321 break;
323 mySettings.addMode = StringUtils::toInt(attrs.getStringSecure("addMode", toString(mySettings.addMode)));
324 mySettings.addSize = parseSizeSettings("add", attrs, mySettings.addSize);
325 mySettings.addName = parseTextSettings("addName", attrs, mySettings.addName);
326 mySettings.addFullName = parseTextSettings("addFullName", attrs, mySettings.addFullName);
327 // color settings (temporal, will be integrated in a schema
328 mySettings.colorSettings.busStopColorSign = parseColor(attrs, "busStopColorSign", mySettings.colorSettings.busStopColorSign);
329 mySettings.colorSettings.chargingStationColor = parseColor(attrs, "chargingStationColor", mySettings.colorSettings.chargingStationColor);
330 mySettings.colorSettings.chargingStationColorCharge = parseColor(attrs, "chargingStationColorCharge", mySettings.colorSettings.chargingStationColorCharge);
331 mySettings.colorSettings.chargingStationColorSign = parseColor(attrs, "chargingStationColorSign", mySettings.colorSettings.chargingStationColorSign);
332 mySettings.colorSettings.containerStopColor = parseColor(attrs, "containerStopColor", mySettings.colorSettings.containerStopColor);
333 mySettings.colorSettings.containerStopColorSign = parseColor(attrs, "containerStopColorSign", mySettings.colorSettings.containerStopColorSign);
334 mySettings.colorSettings.parkingAreaColor = parseColor(attrs, "parkingAreaColor", mySettings.colorSettings.parkingAreaColor);
335 mySettings.colorSettings.parkingAreaColorSign = parseColor(attrs, "parkingAreaColorSign", mySettings.colorSettings.parkingAreaColorSign);
336 mySettings.colorSettings.parkingSpaceColor = parseColor(attrs, "parkingSpaceColor", mySettings.colorSettings.parkingSpaceColor);
337 mySettings.colorSettings.parkingSpaceColorContour = parseColor(attrs, "parkingSpaceColorContour", mySettings.colorSettings.parkingSpaceColorContour);
338 mySettings.colorSettings.personTripColor = parseColor(attrs, "personTripColor", mySettings.colorSettings.personTripColor);
339 mySettings.colorSettings.rideColor = parseColor(attrs, "rideColor", mySettings.colorSettings.rideColor);
340 mySettings.colorSettings.selectedAdditionalColor = parseColor(attrs, "selectedAdditionalColor", mySettings.colorSettings.selectedAdditionalColor);
341 mySettings.colorSettings.selectedConnectionColor = parseColor(attrs, "selectedConnectionColor", mySettings.colorSettings.selectedConnectionColor);
342 mySettings.colorSettings.selectedContainerColor = parseColor(attrs, "selectedContainerColor", mySettings.colorSettings.selectedContainerColor);
343 mySettings.colorSettings.selectedContainerPlanColor = parseColor(attrs, "selectedContainerPlanColor", mySettings.colorSettings.selectedContainerPlanColor);
344 mySettings.colorSettings.selectedCrossingColor = parseColor(attrs, "selectedCrossingColor", mySettings.colorSettings.selectedCrossingColor);
345 mySettings.colorSettings.selectedEdgeColor = parseColor(attrs, "selectedEdgeColor", mySettings.colorSettings.selectedEdgeColor);
346 mySettings.colorSettings.selectedEdgeDataColor = parseColor(attrs, "selectedEdgeDataColor", mySettings.colorSettings.selectedEdgeDataColor);
347 mySettings.colorSettings.selectedLaneColor = parseColor(attrs, "selectedLaneColor", mySettings.colorSettings.selectedLaneColor);
348 mySettings.colorSettings.selectedPersonColor = parseColor(attrs, "selectedPersonColor", mySettings.colorSettings.selectedPersonColor);
349 mySettings.colorSettings.selectedPersonPlanColor = parseColor(attrs, "selectedPersonPlanColor", mySettings.colorSettings.selectedPersonPlanColor);
350 mySettings.colorSettings.selectedProhibitionColor = parseColor(attrs, "selectedProhibitionColor", mySettings.colorSettings.selectedProhibitionColor);
351 mySettings.colorSettings.selectedRouteColor = parseColor(attrs, "selectedRouteColor", mySettings.colorSettings.selectedRouteColor);
352 mySettings.colorSettings.selectedVehicleColor = parseColor(attrs, "selectedVehicleColor", mySettings.colorSettings.selectedVehicleColor);
353 mySettings.colorSettings.selectionColor = parseColor(attrs, "selectionColor", mySettings.colorSettings.selectionColor);
354 mySettings.colorSettings.stopColor = parseColor(attrs, "stopColor", mySettings.colorSettings.stopColor);
355 mySettings.colorSettings.waypointColor = parseColor(attrs, "waypointColor", mySettings.colorSettings.waypointColor);
356 mySettings.colorSettings.stopContainerColor = parseColor(attrs, "stopContainerColor", mySettings.colorSettings.stopContainerColor);
357 mySettings.colorSettings.stopPersonColor = parseColor(attrs, "stopPersonColor", mySettings.colorSettings.stopPersonColor);
358 mySettings.colorSettings.trainStopColor = parseColor(attrs, "trainStopColor", mySettings.colorSettings.trainStopColor);
359 mySettings.colorSettings.trainStopColorSign = parseColor(attrs, "trainStopColorSign", mySettings.colorSettings.trainStopColorSign);
360 mySettings.colorSettings.transhipColor = parseColor(attrs, "transhipColor", mySettings.colorSettings.transhipColor);
361 mySettings.colorSettings.transportColor = parseColor(attrs, "transportColor", mySettings.colorSettings.transportColor);
362 mySettings.colorSettings.vehicleTripColor = parseColor(attrs, "vehicleTripColor", mySettings.colorSettings.vehicleTripColor);
363 mySettings.colorSettings.walkColor = parseColor(attrs, "walkColor", mySettings.colorSettings.walkColor);
364 mySettings.widthSettings.personTripWidth = StringUtils::toDouble(attrs.getStringSecure("personTripWidth", toString(mySettings.widthSettings.personTripWidth)));
365 mySettings.widthSettings.rideWidth = StringUtils::toDouble(attrs.getStringSecure("rideWidth", toString(mySettings.widthSettings.rideWidth)));
366 mySettings.widthSettings.transhipWidth = StringUtils::toDouble(attrs.getStringSecure("transhipWidth", toString(mySettings.widthSettings.transhipWidth)));
367 mySettings.widthSettings.transportWidth = StringUtils::toDouble(attrs.getStringSecure("transportWidth", toString(mySettings.widthSettings.transportWidth)));
368 mySettings.widthSettings.tripWidth = StringUtils::toDouble(attrs.getStringSecure("tripWidth", toString(mySettings.widthSettings.tripWidth)));
369 mySettings.widthSettings.walkWidth = StringUtils::toDouble(attrs.getStringSecure("walkWidth", toString(mySettings.widthSettings.walkWidth)));
370 mySettings.colorSettings.busStopColor = parseColor(attrs, "busStopColor", mySettings.colorSettings.busStopColor);
371 break;
373 mySettings.poiTextParam = attrs.getStringSecure("poiTextParam", mySettings.poiTextParam);
374 mySettings.poiSize = parseSizeSettings("poi", attrs, mySettings.poiSize);
375 mySettings.poiDetail = StringUtils::toInt(attrs.getStringSecure("poiDetail", toString(mySettings.poiDetail)));
376 mySettings.poiName = parseTextSettings("poiName", attrs, mySettings.poiName);
377 mySettings.poiType = parseTextSettings("poiType", attrs, mySettings.poiType);
378 mySettings.poiText = parseTextSettings("poiText", attrs, mySettings.poiText);
379 mySettings.poiColorer.setActive(StringUtils::toInt(attrs.getStringSecure("personMode", "0")));
380 mySettings.poiUseCustomLayer = StringUtils::toBool(attrs.getStringSecure("poiUseCustomLayer", toString(mySettings.poiUseCustomLayer)));
381 mySettings.poiCustomLayer = StringUtils::toDouble(attrs.getStringSecure("poiCustomLayer", toString(mySettings.poiCustomLayer)));
382 myCurrentColorer = element;
383 break;
385 mySettings.polySize = parseSizeSettings("poly", attrs, mySettings.polySize);
386 mySettings.polyName = parseTextSettings("polyName", attrs, mySettings.polyName);
387 mySettings.polyType = parseTextSettings("polyType", attrs, mySettings.polyType);
388 mySettings.polyColorer.setActive(StringUtils::toInt(attrs.getStringSecure("personMode", "0")));
389 mySettings.polyUseCustomLayer = StringUtils::toBool(attrs.getStringSecure("polyUseCustomLayer", toString(mySettings.polyUseCustomLayer)));
390 mySettings.polyCustomLayer = StringUtils::toDouble(attrs.getStringSecure("polyCustomLayer", toString(mySettings.polyCustomLayer)));
391 myCurrentColorer = element;
392 break;
394 mySettings.dataColorer.setActive(StringUtils::toInt(attrs.getStringSecure("dataMode", "0")));
395 mySettings.dataScaler.setActive(StringUtils::toInt(attrs.getStringSecure("dataScaleMode", "0")));
396 mySettings.dataValueRainBow = parseRainbowSettings("dataValueRainbow", attrs, mySettings.dataValueRainBow);
397 mySettings.dataValue = parseTextSettings("dataValue", attrs, mySettings.dataValue);
398 mySettings.tazRelWidthExaggeration = StringUtils::toDouble(attrs.getStringSecure("tazRelExaggeration", toString(mySettings.tazRelWidthExaggeration)));
399 mySettings.edgeRelWidthExaggeration = StringUtils::toDouble(attrs.getStringSecure("edgeRelExaggeration", toString(mySettings.edgeRelWidthExaggeration)));
400 mySettings.relDataAttr = attrs.getStringSecure("relDataAttr", mySettings.relDataAttr);
401 mySettings.relDataScaleAttr = attrs.getStringSecure("relDataScaleAttr", mySettings.relDataScaleAttr);
402 myCurrentColorer = element;
403 break;
405 mySettings.showSizeLegend = StringUtils::toBool(attrs.getStringSecure("showSizeLegend", toString(mySettings.showSizeLegend)));
406 mySettings.showColorLegend = StringUtils::toBool(attrs.getStringSecure("showColorLegend", toString(mySettings.showColorLegend)));
407 mySettings.showVehicleColorLegend = StringUtils::toBool(attrs.getStringSecure("showVehicleColorLegend", toString(mySettings.showVehicleColorLegend)));
408 break;
411 if (attrs.hasAttribute(SUMO_ATTR_FILE)) {
412 d.filename = StringUtils::substituteEnvironment(attrs.get<std::string>(SUMO_ATTR_FILE, nullptr, ok));
413 } else {
414 d.filename = attrs.getStringSecure("filename", d.filename);
415 WRITE_WARNING(TL("The 'filename' attribute is deprecated for decals. Please use 'file'."));
416 }
417 if (d.filename != "" && !FileHelpers::isAbsolute(d.filename)) {
419 }
420 d.centerX = attrs.getOpt<double>(SUMO_ATTR_CENTER_X, nullptr, ok, d.centerX);
421 d.centerY = attrs.getOpt<double>(SUMO_ATTR_CENTER_Y, nullptr, ok, d.centerY);
422 d.centerZ = attrs.getOpt<double>(SUMO_ATTR_CENTER_Z, nullptr, ok, d.centerZ);
423 d.width = attrs.getOpt<double>(SUMO_ATTR_WIDTH, nullptr, ok, d.width);
424 d.height = attrs.getOpt<double>(SUMO_ATTR_HEIGHT, nullptr, ok, d.height);
425 d.altitude = StringUtils::toDouble(attrs.getStringSecure("altitude", "0"));
426 d.rot = StringUtils::toDouble(attrs.getStringSecure("rotation", toString(d.rot)));
429 d.layer = attrs.getOpt<double>(SUMO_ATTR_LAYER, nullptr, ok, d.layer);
431 d.initialised = false;
432 myDecals.push_back(d);
433 }
434 break;
436 myTrackers.push_back(attrs.get<std::string>(SUMO_ATTR_TLID, nullptr, ok));
437 }
438 break;
441 d.filename = "light" + attrs.getOpt<std::string>(SUMO_ATTR_INDEX, nullptr, ok, "0");
442 d.centerX = attrs.getOpt<double>(SUMO_ATTR_CENTER_X, nullptr, ok, d.centerX);
443 d.centerY = attrs.getOpt<double>(SUMO_ATTR_CENTER_Y, nullptr, ok, d.centerY);
444 d.centerZ = attrs.getOpt<double>(SUMO_ATTR_CENTER_Z, nullptr, ok, d.centerZ);
445 d.width = attrs.getOpt<double>(SUMO_ATTR_WIDTH, nullptr, ok, d.width);
446 d.height = attrs.getOpt<double>(SUMO_ATTR_HEIGHT, nullptr, ok, d.height);
447 d.altitude = StringUtils::toDouble(attrs.getStringSecure("altitude", "0"));
448 d.rot = StringUtils::toDouble(attrs.getStringSecure("rotation", toString(d.rot)));
451 d.layer = attrs.getOpt<double>(SUMO_ATTR_LAYER, nullptr, ok, d.layer);
452 d.initialised = false;
453 myDecals.push_back(d);
454 }
455 break;
457 const std::string id = attrs.get<std::string>(SUMO_ATTR_ID, nullptr, ok);
458 const std::string cmd = attrs.get<std::string>(SUMO_ATTR_COMMAND, nullptr, ok);
459 const double prob = attrs.get<double>(SUMO_ATTR_PROB, id.c_str(), ok);
460 myEventDistributions[id].add(cmd, prob);
461 }
462 break;
464 myJamSoundTime = attrs.get<double>(SUMO_ATTR_VALUE, nullptr, ok);
465 break;
466 default:
467 break;
468 }
469}
470
471void
473 switch (element) {
475 if (mySettings.name != "") {
477 myLoadedSettingNames.push_back(mySettings.name);
478 }
479 }
480 }
481}
482
483
485GUISettingsHandler::parseColor(const SUMOSAXAttributes& attrs, const std::string attribute, const RGBColor& defaultValue) const {
486 bool ok = true;
487 return RGBColor::parseColorReporting(attrs.getStringSecure(attribute, toString(defaultValue)), attribute.c_str(), nullptr, true, ok);
488}
489
490
493 const std::string& prefix, const SUMOSAXAttributes& attrs,
495 bool ok = true;
497 StringUtils::toBool(attrs.getStringSecure(prefix + "_show", toString(defaults.showText))),
498 StringUtils::toDouble(attrs.getStringSecure(prefix + "_size", toString(defaults.size))),
499 RGBColor::parseColorReporting(attrs.getStringSecure(prefix + "_color", toString(defaults.color)), "textSettings", nullptr, true, ok),
500 RGBColor::parseColorReporting(attrs.getStringSecure(prefix + "_bgColor", toString(defaults.bgColor)), "textSettings", nullptr, true, ok),
501 StringUtils::toBool(attrs.getStringSecure(prefix + "_constantSize", toString(defaults.constSize))),
502 StringUtils::toBool(attrs.getStringSecure(prefix + "_onlySelected", toString(defaults.onlySelected))));
503}
504
505
508 const std::string& prefix, const SUMOSAXAttributes& attrs,
511 StringUtils::toDouble(attrs.getStringSecure(prefix + "_minSize", toString(defaults.minSize))),
512 StringUtils::toDouble(attrs.getStringSecure(prefix + "_exaggeration", toString(defaults.exaggeration))),
513 StringUtils::toBool(attrs.getStringSecure(prefix + "_constantSize", toString(defaults.constantSize))),
514 StringUtils::toBool(attrs.getStringSecure(prefix + "_constantSizeSelected", toString(defaults.constantSizeSelected))));
515}
516
519 const std::string& prefix, const SUMOSAXAttributes& attrs,
522 StringUtils::toBool(attrs.getStringSecure(prefix + "HideCheck", toString(defaults.hideMin))),
523 StringUtils::toDouble(attrs.getStringSecure(prefix + "HideThreshold", toString(defaults.minThreshold))),
524 StringUtils::toBool(attrs.getStringSecure(prefix + "HideCheck2", toString(defaults.hideMax))),
525 StringUtils::toDouble(attrs.getStringSecure(prefix + "HideThreshold2", toString(defaults.maxThreshold))),
526 StringUtils::toBool(attrs.getStringSecure(prefix + "SetNeutral", toString(defaults.hideMax))),
527 StringUtils::toDouble(attrs.getStringSecure(prefix + "NeutralThreshold", toString(defaults.neutralThreshold))),
528 StringUtils::toBool(attrs.getStringSecure(prefix + "FixRange", toString(defaults.fixRange))),
529 StringUtils::toInt(attrs.getStringSecure(prefix + "RainbowScheme", toString(defaults.rainbowScheme))));
530}
531
532const std::vector<std::string>&
534 if (view) {
535 for (std::string name : myLoadedSettingNames) {
536 FXint index = view->getColoringSchemesCombo()->appendIconItem(name.c_str());
538 view->setColorScheme(name);
539 }
540 }
542}
543
544
545void
547 if (myLookFrom.z() > 0 || myZoom > 0) {
548 // z value stores zoom so we must convert first
549 double z = (view->is3DView()) ? myLookFrom.z() : view->getChanger().zoom2ZPos(myZoom);
550 if (view->is3DView() && !myZCoordSet) { // set view angle to ground to at least 45 degrees if no Z coordinate is given
551 z = myLookFrom.distanceTo2D(myLookAt) * sin(PI * 0.25);
552 }
553 Position lookFrom(myLookFrom.x(), myLookFrom.y(), z);
554 view->setViewportFromToRot(lookFrom, myLookAt, myRotation);
555 if (view->is3DView() && !myZCoordSet) {
556 view->recenterView();
557 }
558 }
559}
560
561
562void
564 if (!mySnapshots.empty()) {
565 for (auto item : mySnapshots) {
566 for (auto file : item.second) {
567 view->addSnapshot(item.first, file);
568 }
569 }
570 }
571}
572
573
574bool
576 return !myDecals.empty();
577}
578
579
580const std::vector<GUISUMOAbstractView::Decal>&
582 return myDecals;
583}
584
585
586double
588 return myDelay;
589}
590
591
592std::vector<SUMOTime>
593GUISettingsHandler::loadBreakpoints(const std::string& file) {
594 std::vector<SUMOTime> result;
595 std::ifstream strm(file.c_str());
596 if (!strm.good()) {
597 WRITE_ERRORF(TL("Could not open '%'."), file);
598 return result;
599 }
600 while (strm.good()) {
601 std::string val;
602 strm >> val;
603 if (val.length() == 0) {
604 continue;
605 }
606 try {
608 result.push_back(value);
609 } catch (NumberFormatException& e) {
610 WRITE_ERRORF(TL("A breakpoint value must be a time description (%)."), toString(e.what()));
611 } catch (EmptyData&) {
612 } catch (ProcessError&) {
613 WRITE_ERRORF(TL("Could not decode breakpoint '%'."), val);
614 }
615 }
616 return result;
617}
618
619
623 if (result.getOverallProb() > 0 && result.getOverallProb() < 1) {
624 // unscaled probabilities are assumed, fill up with dummy event
625 result.add("", 1. - result.getOverallProb());
626 }
627 return result;
628}
629
630
631/****************************************************************************/
long long int SUMOTime
Definition GUI.h:36
GUICompleteSchemeStorage gSchemeStorage
#define WRITE_ERRORF(...)
Definition MsgHandler.h:296
#define WRITE_WARNING(msg)
Definition MsgHandler.h:286
#define TL(string)
Definition MsgHandler.h:304
const std::string invalid_return< std::string >::value
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
Definition SUMOTime.cpp:46
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ SUMO_TAG_VIEWSETTINGS_POIS
@ SUMO_TAG_COLORSCHEME
@ SUMO_TAG_VIEWSETTINGS_DATA
@ SUMO_TAG_VIEWSETTINGS_3D
@ SUMO_TAG_VIEWSETTINGS_BACKGROUND
@ SUMO_TAG_VIEWSETTINGS_LEGEND
@ SUMO_TAG_ENTRY
@ SUMO_TAG_VIEWSETTINGS_EVENT
@ SUMO_TAG_DELAY
@ SUMO_TAG_VIEWSETTINGS_OPENGL
@ SUMO_TAG_SCALINGSCHEME
@ SUMO_TAG_VIEWSETTINGS_ADDITIONALS
@ SUMO_TAG_VIEWSETTINGS_EVENT_JAM_TIME
@ SUMO_TAG_VIEWSETTINGS_PERSONS
@ SUMO_TAG_VIEWSETTINGS_JUNCTIONS
@ SUMO_TAG_VIEWSETTINGS_VEHICLES
@ SUMO_TAG_SNAPSHOT
@ SUMO_TAG_VIEWSETTINGS_EDGES
@ SUMO_TAG_BREAKPOINT
@ SUMO_TAG_VIEWSETTINGS_DECAL
@ SUMO_TAG_VIEWSETTINGS_SCHEME
@ SUMO_TAG_VIEWSETTINGS
@ SUMO_TAG_VIEWPORT
@ SUMO_TAG_VIEWSETTINGS_LIGHT
@ SUMO_TAG_VIEWSETTINGS_POLYS
@ SUMO_TAG_VIEWSETTINGS_TRACKER
@ SUMO_TAG_VIEWSETTINGS_CONTAINERS
@ SUMO_ATTR_VALUE
@ SUMO_ATTR_THRESHOLD
@ SUMO_ATTR_FILE
@ SUMO_ATTR_Y
@ SUMO_ATTR_Z
@ SUMO_ATTR_X
@ SUMO_ATTR_CENTER_Y
@ SUMO_ATTR_ZOOM
@ SUMO_ATTR_INDEX
@ SUMO_ATTR_NAME
@ SUMO_ATTR_LAYER
A layer number.
@ SUMO_ATTR_COMMAND
@ SUMO_ATTR_ANGLE
@ SUMO_ATTR_HEIGHT
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_PROB
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_CENTER_Z
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_ID
@ SUMO_ATTR_INTERPOLATED
@ SUMO_ATTR_CENTER_X
@ SUMO_ATTR_WIDTH
@ SUMO_ATTR_TIME
trigger: the time of the step
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
static bool isAbsolute(const std::string &path)
Returns the information whether the given path is absolute.
static std::string getConfigurationRelative(const std::string &configPath, const std::string &path)
Returns the second path as a relative path to the first file.
virtual double zoom2ZPos(double zoom) const =0
Returns the camera height at which the given zoom level is reached.
MFXComboBoxIcon * getColoringSchemesCombo()
get coloring schemes combo
virtual void recenterView()
recenters the view
void addSnapshot(SUMOTime time, const std::string &file, const int w=-1, const int h=-1)
Sets the snapshot time to file map.
GUIPerspectiveChanger & getChanger() const
get changer
virtual void setViewportFromToRot(const Position &lookFrom, const Position &lookAt, double rotation)
applies the given viewport settings
virtual bool is3DView() const
return whether this is a 3D view
virtual bool setColorScheme(const std::string &)
set color scheme
GUISettingsHandler(const std::string &content, bool isFile=true, bool netedit=false)
Constructor.
double getDelay() const
Returns the parsed delay.
std::vector< std::string > myLoadedSettingNames
names of all loaded settings
double myZoom
Zoom level.
GUIColorScheme * myCurrentScheme
The current color scheme.
bool hasDecals() const
Returns whether any decals have been parsed.
const std::vector< std::string > & addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
static std::vector< SUMOTime > loadBreakpoints(const std::string &file)
loads breakpoints from the specified file
std::string myViewType
The view type (osg, opengl, default) loaded.
RGBColor parseColor(const SUMOSAXAttributes &attrs, const std::string attribute, const RGBColor &defaultValue) const
parse color attribute
std::vector< std::string > myTrackers
list of tlsIDs to open trackers for
std::map< std::string, RandomDistributor< std::string > > myEventDistributions
The parsed event distributions.
void myEndElement(int element)
Called when a closing tag occurs.
RandomDistributor< std::string > getEventDistribution(const std::string &id)
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag.
std::vector< SUMOTime > myBreakpoints
The parsed breakpoints.
~GUISettingsHandler()
Destructor.
bool myZCoordSet
Whether the Z coordinate is set in 3D view.
GUIVisualizationRainbowSettings parseRainbowSettings(const std::string &prefix, const SUMOSAXAttributes &attrs, GUIVisualizationRainbowSettings defaults)
parse attributes for rainbowSettings
double myRotation
View rotation.
std::vector< GUISUMOAbstractView::Decal > myDecals
The decals list to fill.
GUIVisualizationSettings mySettings
The settings to fill.
GUIScaleScheme * myCurrentScaleScheme
The current scaling scheme.
int myCurrentColorer
The last color scheme category (edges or vehicles).
GUIVisualizationTextSettings parseTextSettings(const std::string &prefix, const SUMOSAXAttributes &attrs, GUIVisualizationTextSettings defaults)
parse attributes for textSettings
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
GUIVisualizationSizeSettings parseSizeSettings(const std::string &prefix, const SUMOSAXAttributes &attrs, GUIVisualizationSizeSettings defaults)
parse attributes for sizeSettings
Position myLookFrom
The viewport loaded, zoom is stored in z coordinate.
void setSnapshots(GUISUMOAbstractView *view) const
Makes a snapshot if it has been parsed.
std::map< SUMOTime, std::vector< std::string > > mySnapshots
mappig of time steps to filenames for potential snapshots
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
Position myLookAt
The point to look at, only needed for osg view.
double myDelay
The delay loaded.
friend class SUMOSAXReader
void setFileName(const std::string &name)
Sets the current file name.
const std::string & getFileName() const
returns the current file name
long setCurrentItem(const FXint index, FXbool notify=FALSE)
Set the current item (index is zero-based).
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon item in the last position
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
static RGBColor parseColorReporting(const std::string &coldef, const std::string &objecttype, const char *objectid, bool report, bool &ok)
Parses a color information.
Definition RGBColor.cpp:361
Represents a generic random distribution.
Encapsulated SAX-Attributes.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue=T(), bool report=true) const
Tries to read given attribute assuming it is an int.
SUMOTime getOptSUMOTimeReporting(int attr, const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
virtual std::string getStringSecure(int id, const std::string &def) const =0
Returns the string-value of the named (by its enum-value) attribute.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
SUMOSAXHandler(const std::string &file="", const std::string &expectedRoot="")
Constructor.
void parseString(std::string content)
Parse XML from the given string.
static std::string to_lower_case(const std::string &str)
Transfers the content to lower case.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
static std::string substituteEnvironment(const std::string &str, const std::chrono::time_point< std::chrono::system_clock > *const timeRef=nullptr)
Replaces an environment variable with its value (similar to bash); syntax for a variable is ${NAME}...
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
static SUMOSAXReader * getSAXReader(SUMOSAXHandler &handler, const bool isNet=false, const bool isRoute=false)
Builds a reader and assigns the handler to it.
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false, const bool isRoute=false, const bool isExternal=false, const bool catchExceptions=true)
Runs the given handler on the given file; returns if everything's ok.
A decal (an image) that can be shown.
double tilt
The tilt of the image to the ground plane (in degrees).
double centerX
The center of the image in x-direction (net coordinates, in m).
double height
The height of the image (net coordinates in y-direction, in m).
double width
The width of the image (net coordinates in x-direction, in m).
bool initialised
Whether this image was initialised (inserted as a texture).
double rot
The rotation of the image in the ground plane (in degrees).
double layer
The layer of the image.
double altitude
The altitude of the image (net coordinates in z-direction, in m).
double centerY
The center of the image in y-direction (net coordinates, in m).
double centerZ
The center of the image in z-direction (net coordinates, in m).
std::string filename
The path to the file the image is located at.
double roll
The roll of the image to the ground plane (in degrees).
bool screenRelative
Whether this image should be skipped in 2D-views.
bool hideMax
whether data above threshold should not be colored
bool fixRange
whether the color scale should be fixed to the given min/max values
double minThreshold
threshold below which value should not be colored
int rainbowScheme
index in the list of color schemes
bool hideMin
whether data below threshold should not be colored
double neutralThreshold
neutral point of scale
double maxThreshold
threshold above which value should not be colored
double exaggeration
The size exaggeration (upscale).
bool constantSize
whether the object shall be drawn with constant size regardless of zoom
double minSize
The minimum size to draw this object.
bool constantSizeSelected
whether only selected objects shall be drawn with constant
RGBColor bgColor
background text color
bool onlySelected
whether only selected objects shall have text drawn
bool constSize
flag to avoid size changes