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-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/****************************************************************************/
22// The dialog to change the view (gui) settings.
23/****************************************************************************/
24#include <config.h>
25
26#include <vector>
38#include <utils/xml/XMLSubSys.h>
39#include "GUISettingsHandler.h"
40
41
42// ===========================================================================
43// method definitions
44// ===========================================================================
45GUISettingsHandler::GUISettingsHandler(FXApp* app, const std::string& content, bool isFile, bool netedit) :
46 SUMOSAXHandler(content),
47 myApp(app),
48 mySettings(nullptr, "TEMPORARY_NAME", netedit),
49 myDelay(-1), myLookFrom(-1, -1, -1), myLookAt(-1, -1, -1), myZCoordSet(true),
50 myRotation(0),
51 myZoom(-1),
52 myCurrentColorer(SUMO_TAG_NOTHING),
53 myCurrentScheme(nullptr),
54 myJamSoundTime(-1) {
55 if (isFile) {
56 XMLSubSys::runParser(*this, content);
57 } else {
58 setFileName("registrySettings");
60 reader->parseString(content);
61 delete reader;
62 }
63}
64
65
68
69
70void
72 bool ok = true;
73 switch (element) {
75 if (attrs.hasAttribute(SUMO_ATTR_TIME)) {
76 myBreakpoints.push_back(attrs.getSUMOTimeReporting(SUMO_ATTR_TIME, nullptr, ok));
77 } else {
78 myBreakpoints.push_back(attrs.getSUMOTimeReporting(SUMO_ATTR_VALUE, nullptr, ok));
79 WRITE_WARNING(TL("The 'value' attribute is deprecated for breakpoints. Please use 'time'."));
80 }
81 break;
83 myViewType = attrs.getOpt<std::string>(SUMO_ATTR_TYPE, nullptr, ok, "default");
85 break;
93 break;
94 case SUMO_TAG_DELAY:
95 myDelay = attrs.getOpt<double>(SUMO_ATTR_VALUE, nullptr, ok, myDelay);
96 break;
97 case SUMO_TAG_VIEWPORT: {
98 double x = attrs.getOpt<double>(SUMO_ATTR_X, nullptr, ok, myLookFrom.x());
99 double y = attrs.getOpt<double>(SUMO_ATTR_Y, nullptr, ok, myLookFrom.y());
101 Position geo(attrs.get<double>(SUMO_ATTR_LON, nullptr, ok), attrs.get<double>(SUMO_ATTR_LAT, nullptr, ok));
102 if (GeoConvHelper::getFinal().x2cartesian_const(geo)) {
103 x = geo.x();
104 y = geo.y();
105 }
106 }
107 const double z = attrs.getOpt<double>(SUMO_ATTR_Z, nullptr, ok, myLookFrom.z());
108 attrs.get<double>(SUMO_ATTR_Z, nullptr, myZCoordSet, false);
109 myLookFrom.set(x, y, z);
110 myZoom = attrs.getOpt<double>(SUMO_ATTR_ZOOM, nullptr, ok, myZoom);
111 const double cx = attrs.getOpt<double>(SUMO_ATTR_CENTER_X, nullptr, ok, myLookFrom.x());
112 const double cy = attrs.getOpt<double>(SUMO_ATTR_CENTER_Y, nullptr, ok, myLookFrom.y());
113 const double cz = attrs.getOpt<double>(SUMO_ATTR_CENTER_Z, nullptr, ok, 0.);
114 myLookAt.set(cx, cy, cz);
115 myRotation = attrs.getOpt<double>(SUMO_ATTR_ANGLE, nullptr, ok, myRotation);
116 break;
117 }
118 case SUMO_TAG_SNAPSHOT: {
119 std::string file = attrs.get<std::string>(SUMO_ATTR_FILE, nullptr, ok);
120 if (file != "" && !FileHelpers::isAbsolute(file)) {
122 }
123 mySnapshots[attrs.getOptSUMOTimeReporting(SUMO_ATTR_TIME, file.c_str(), ok, 0)].push_back(file);
124 }
125 break;
127 mySettings.name = attrs.getOpt<std::string>(SUMO_ATTR_NAME, nullptr, ok, mySettings.name);
130 }
131 }
132 break;
141 break;
143 mySettings.backgroundColor = RGBColor::parseColorReporting(attrs.getStringSecure("backgroundColor", toString(mySettings.backgroundColor)), "background", nullptr, true, ok);
147 break;
149 int laneEdgeMode = StringUtils::toInt(attrs.getStringSecure("laneEdgeMode", "0"));
150 int laneEdgeScaleMode = StringUtils::toInt(attrs.getStringSecure("scaleMode", "0"));
171
172 // disable hide by zoom is the only
173 if (myApp) {
174 myApp->reg().writeBoolEntry("NETEDIT", "disableHideByZoom", mySettings.disableHideByZoom);
175 }
176
183 myCurrentColorer = element;
184 mySettings.edgeColorer.setActive(laneEdgeMode);
185 mySettings.edgeScaler.setActive(laneEdgeScaleMode);
186 mySettings.laneColorer.setActive(laneEdgeMode);
187 mySettings.laneScaler.setActive(laneEdgeScaleMode);
188 }
189 break;
191 myCurrentScheme = nullptr;
192 myCurrentScaleScheme = nullptr;
193 const std::string name = attrs.getStringSecure(SUMO_ATTR_NAME, "");
195 if (StringUtils::startsWith(name, "meso:")) {
196 // see edgeColorer.save() in GUIVisualizationSettings::save
198 } else {
200 }
201 if (myCurrentScheme == nullptr) {
202 // legacy: meso schemes without prefix
204 }
205 }
208 }
211 }
214 }
217 }
220 }
223 }
225 myCurrentScheme->setInterpolated(attrs.getOpt<bool>(SUMO_ATTR_INTERPOLATED, nullptr, ok, false));
227 }
228 }
229 break;
231 myCurrentScheme = nullptr;
232 myCurrentScaleScheme = nullptr;
233 const std::string name = attrs.getStringSecure(SUMO_ATTR_NAME, "");
235 if (StringUtils::startsWith(name, "meso:")) {
236 // see edgeScaler.save() in GUIVisualizationSettings::save
238 } else {
240 }
241 if (myCurrentScaleScheme == nullptr) {
242 // legacy: meso schemes without prefix
244 }
245 }
248 }
251 }
253 myCurrentScaleScheme->setInterpolated(attrs.getOpt<bool>(SUMO_ATTR_INTERPOLATED, nullptr, ok, false));
255 }
256 }
257 break;
258 case SUMO_TAG_ENTRY:
259 if (myCurrentScheme != nullptr) {
260 RGBColor color = attrs.get<RGBColor>(SUMO_ATTR_COLOR, nullptr, ok);
261 if (myCurrentScheme->isFixed()) {
263 } else {
265 attrs.getOpt<double>(SUMO_ATTR_THRESHOLD, nullptr, ok, std::numeric_limits<double>::max()),
267 }
268 } else if (myCurrentScaleScheme != nullptr) {
269 double scale = attrs.get<double>(SUMO_ATTR_COLOR, nullptr, ok);
272 } else {
274 attrs.getOpt<double>(SUMO_ATTR_THRESHOLD, nullptr, ok, std::numeric_limits<double>::max()),
276 }
277 }
278 break;
301 myCurrentColorer = element;
302 break;
310 mySettings.pedestrianNetworkColor = RGBColor::parseColorReporting(attrs.getStringSecure("pedestrianNetworkColor", toString(mySettings.pedestrianNetworkColor)), "pedestrianNetworkColor", nullptr, true, ok);
311 myCurrentColorer = element;
312 break;
318 myCurrentColorer = element;
319 break;
332 "drawCrossingsAndWalkingareas", toString(mySettings.drawCrossingsAndWalkingareas)));
335 myCurrentColorer = element;
336 break;
342 // color settings (temporal, will be integrated in a schema
386 break;
397 myCurrentColorer = element;
398 break;
406 myCurrentColorer = element;
407 break;
417 myCurrentColorer = element;
418 break;
423 break;
426 if (attrs.hasAttribute(SUMO_ATTR_FILE)) {
427 d.filename = StringUtils::substituteEnvironment(attrs.get<std::string>(SUMO_ATTR_FILE, nullptr, ok));
428 } else {
429 d.filename = attrs.getStringSecure("filename", d.filename);
430 WRITE_WARNING(TL("The 'filename' attribute is deprecated for decals. Please use 'file'."));
431 }
432 if (d.filename != "" && !FileHelpers::isAbsolute(d.filename)) {
434 }
435 d.centerX = attrs.getOpt<double>(SUMO_ATTR_CENTER_X, nullptr, ok, d.centerX);
436 d.centerY = attrs.getOpt<double>(SUMO_ATTR_CENTER_Y, nullptr, ok, d.centerY);
437 d.centerZ = attrs.getOpt<double>(SUMO_ATTR_CENTER_Z, nullptr, ok, d.centerZ);
438 d.width = attrs.getOpt<double>(SUMO_ATTR_WIDTH, nullptr, ok, d.width);
439 d.height = attrs.getOpt<double>(SUMO_ATTR_HEIGHT, nullptr, ok, d.height);
440 d.altitude = StringUtils::toDouble(attrs.getStringSecure("altitude", "0"));
441 d.rot = StringUtils::toDouble(attrs.getStringSecure("rotation", toString(d.rot)));
444 d.layer = attrs.getOpt<double>(SUMO_ATTR_LAYER, nullptr, ok, d.layer);
446 d.initialised = false;
447 myDecals.push_back(d);
448 }
449 break;
451 myTrackers.push_back(attrs.get<std::string>(SUMO_ATTR_TLID, nullptr, ok));
452 }
453 break;
456 d.filename = "light" + attrs.getOpt<std::string>(SUMO_ATTR_INDEX, nullptr, ok, "0");
457 d.centerX = attrs.getOpt<double>(SUMO_ATTR_CENTER_X, nullptr, ok, d.centerX);
458 d.centerY = attrs.getOpt<double>(SUMO_ATTR_CENTER_Y, nullptr, ok, d.centerY);
459 d.centerZ = attrs.getOpt<double>(SUMO_ATTR_CENTER_Z, nullptr, ok, d.centerZ);
460 d.width = attrs.getOpt<double>(SUMO_ATTR_WIDTH, nullptr, ok, d.width);
461 d.height = attrs.getOpt<double>(SUMO_ATTR_HEIGHT, nullptr, ok, d.height);
462 d.altitude = StringUtils::toDouble(attrs.getStringSecure("altitude", "0"));
463 d.rot = StringUtils::toDouble(attrs.getStringSecure("rotation", toString(d.rot)));
466 d.layer = attrs.getOpt<double>(SUMO_ATTR_LAYER, nullptr, ok, d.layer);
467 d.initialised = false;
468 myDecals.push_back(d);
469 }
470 break;
472 const std::string id = attrs.get<std::string>(SUMO_ATTR_ID, nullptr, ok);
473 const std::string cmd = attrs.get<std::string>(SUMO_ATTR_COMMAND, nullptr, ok);
474 const double prob = attrs.get<double>(SUMO_ATTR_PROB, id.c_str(), ok);
475 myEventDistributions[id].add(cmd, prob);
476 }
477 break;
479 myJamSoundTime = attrs.get<double>(SUMO_ATTR_VALUE, nullptr, ok);
480 break;
481 default:
482 break;
483 }
484}
485
486void
488 switch (element) {
490 if (mySettings.name != "") {
493 }
494 }
495 }
496}
497
498
500GUISettingsHandler::parseColor(const SUMOSAXAttributes& attrs, const std::string attribute, const RGBColor& defaultValue) const {
501 bool ok = true;
502 return RGBColor::parseColorReporting(attrs.getStringSecure(attribute, toString(defaultValue)), attribute.c_str(), nullptr, true, ok);
503}
504
505
508 const std::string& prefix, const SUMOSAXAttributes& attrs,
510 bool ok = true;
512 StringUtils::toBool(attrs.getStringSecure(prefix + "_show", toString(defaults.showText))),
513 StringUtils::toDouble(attrs.getStringSecure(prefix + "_size", toString(defaults.size))),
514 RGBColor::parseColorReporting(attrs.getStringSecure(prefix + "_color", toString(defaults.color)), "textSettings", nullptr, true, ok),
515 RGBColor::parseColorReporting(attrs.getStringSecure(prefix + "_bgColor", toString(defaults.bgColor)), "textSettings", nullptr, true, ok),
516 StringUtils::toBool(attrs.getStringSecure(prefix + "_constantSize", toString(defaults.constSize))),
517 StringUtils::toBool(attrs.getStringSecure(prefix + "_onlySelected", toString(defaults.onlySelected))));
518}
519
520
523 const std::string& prefix, const SUMOSAXAttributes& attrs,
526 StringUtils::toDouble(attrs.getStringSecure(prefix + "_minSize", toString(defaults.minSize))),
527 StringUtils::toDouble(attrs.getStringSecure(prefix + "_exaggeration", toString(defaults.exaggeration))),
528 StringUtils::toBool(attrs.getStringSecure(prefix + "_constantSize", toString(defaults.constantSize))),
529 StringUtils::toBool(attrs.getStringSecure(prefix + "_constantSizeSelected", toString(defaults.constantSizeSelected))));
530}
531
534 const std::string& prefix, const SUMOSAXAttributes& attrs,
537 StringUtils::toBool(attrs.getStringSecure(prefix + "HideCheck", toString(defaults.hideMin))),
538 StringUtils::toDouble(attrs.getStringSecure(prefix + "HideThreshold", toString(defaults.minThreshold))),
539 StringUtils::toBool(attrs.getStringSecure(prefix + "HideCheck2", toString(defaults.hideMax))),
540 StringUtils::toDouble(attrs.getStringSecure(prefix + "HideThreshold2", toString(defaults.maxThreshold))),
541 StringUtils::toBool(attrs.getStringSecure(prefix + "SetNeutral", toString(defaults.hideMax))),
542 StringUtils::toDouble(attrs.getStringSecure(prefix + "NeutralThreshold", toString(defaults.neutralThreshold))),
543 StringUtils::toBool(attrs.getStringSecure(prefix + "FixRange", toString(defaults.fixRange))),
544 StringUtils::toInt(attrs.getStringSecure(prefix + "RainbowScheme", toString(defaults.rainbowScheme))));
545}
546
547const std::vector<std::string>&
549 if (view) {
550 for (std::string name : myLoadedSettingNames) {
551 FXint index = view->getColoringSchemesCombo()->appendIconItem(name.c_str());
553 view->setColorScheme(name);
554 }
555 }
557}
558
559
560void
562 if (myLookFrom.z() > 0 || myZoom > 0) {
563 // z value stores zoom so we must convert first
564 double z = (view->is3DView()) ? myLookFrom.z() : view->getChanger().zoom2ZPos(myZoom);
565 if (view->is3DView() && !myZCoordSet) { // set view angle to ground to at least 45 degrees if no Z coordinate is given
566 z = myLookFrom.distanceTo2D(myLookAt) * sin(PI * 0.25);
567 }
568 Position lookFrom(myLookFrom.x(), myLookFrom.y(), z);
569 view->setViewportFromToRot(lookFrom, myLookAt, myRotation);
570 if (view->is3DView() && !myZCoordSet) {
571 view->recenterView();
572 }
573 }
574}
575
576
577void
579 if (!mySnapshots.empty()) {
580 for (auto item : mySnapshots) {
581 for (auto file : item.second) {
582 view->addSnapshot(item.first, file);
583 }
584 }
585 }
586}
587
588
589bool
591 return !myDecals.empty();
592}
593
594
595const std::vector<GUISUMOAbstractView::Decal>&
597 return myDecals;
598}
599
600
601double
603 return myDelay;
604}
605
606
607std::vector<SUMOTime>
608GUISettingsHandler::loadBreakpoints(const std::string& file) {
609 std::vector<SUMOTime> result;
610 std::ifstream strm(file.c_str());
611 if (!strm.good()) {
612 WRITE_ERRORF(TL("Could not open '%'."), file);
613 return result;
614 }
615 while (strm.good()) {
616 std::string val;
617 strm >> val;
618 if (val.length() == 0) {
619 continue;
620 }
621 try {
622 SUMOTime value = string2time(val);
623 result.push_back(value);
624 } catch (NumberFormatException& e) {
625 WRITE_ERRORF(TL("A breakpoint value must be a time description (%)."), toString(e.what()));
626 } catch (EmptyData&) {
627 } catch (ProcessError&) {
628 WRITE_ERRORF(TL("Could not decode breakpoint '%'."), val);
629 }
630 }
631 return result;
632}
633
634
638 if (result.getOverallProb() > 0 && result.getOverallProb() < 1) {
639 // unscaled probabilities are assumed, fill up with dummy event
640 result.add("", 1. - result.getOverallProb());
641 }
642 return result;
643}
644
645
646/****************************************************************************/
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
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_LON
@ 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_LAT
@ 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:49
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.
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
void add(const GUIVisualizationSettings &scheme)
Adds a visualization scheme.
virtual double zoom2ZPos(double zoom) const =0
Returns the camera height at which the given zoom level is reached.
void setColor(const int pos, const T &color)
int addColor(const T &color, const double threshold, const std::string &name="")
void setInterpolated(const bool interpolate, double interpolationStart=0.f)
T * getSchemeByName(std::string name)
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
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
GUISettingsHandler(FXApp *app, const std::string &content, bool isFile=true, bool netedit=false)
Constructor.
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
FXApp * myApp
pointer to App
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.
GUIVisualizationTextSettings addName
GUIVisualizationTextSettings tlsPhaseIndex
bool poiUseCustomLayer
whether the rendering layer of POIs should be overriden
GUIVisualizationTextSettings vehicleName
GUIVisualizationTextSettings junctionName
RGBColor backgroundColor
The background color to use.
GUIVisualizationSizeSettings vehicleSize
GUIVisualizationSizeSettings containerSize
bool showBlinker
Information whether vehicle blinkers shall be drawn.
GUIVisualizationTextSettings internalEdgeName
bool showPedestrianNetwork
Flag for visualizing the pedestrian network generated for JuPedSim.
double polyCustomLayer
the custom layer for polygons
GUIVisualizationSizeSettings junctionSize
bool drawBoundaries
enable or disable draw boundaries
bool showBikeMarkings
Information whether bicycle lane marking shall be drawn.
std::string edgeDataID
id for coloring by live edgeData
GUIScaler laneScaler
The lane scaler.
GUIVisualizationTextSettings edgeScaleValue
bool dither
Information whether dithering shall be enabled.
GUIColorer vehicleColorer
The vehicle colorer.
bool disableHideByZoom
disable hide by zoom
std::string relDataScaleAttr
key for scaling by edgeRelation / tazRelation attribute
GUIVisualizationTextSettings personValue
bool showLinkRules
Information whether link rules (colored bars) shall be drawn.
GUIScaler dataScaler
The size scaling settings for data elements.
GUIVisualizationRainbowSettings vehicleValueRainBow
GUIVisualizationTextSettings poiType
GUIVisualizationSizeSettings addSize
std::string name
The name of this setting.
GUIColorer edgeColorer
The mesoscopic edge colorer.
int containerQuality
The quality of container drawing.
RGBColor pedestrianNetworkColor
The color of the pedestrian network generated for JuPedSim.
GUIVisualizationTextSettings internalJunctionName
GUIVisualizationTextSettings vehicleScaleValue
GUIVisualizationSizeSettings poiSize
bool drawJunctionShape
whether the shape of the junction should be drawn
std::string edgeData
key for coloring by edgeData
GUIVisualizationTextSettings geometryIndices
GUIVisualizationTextSettings dataValue
bool show3DTLSDomes
whether the semi-transparent domes around 3D TL models should be drawn
bool realisticLinkRules
Information whether link rules (colored bars) shall be drawn with a realistic color scheme.
bool trueZ
drawl all objects according to their z data
int personQuality
The quality of person drawing.
GUIColorer poiColorer
The POI colorer.
GUIVisualizationWidthSettings widthSettings
width settings
GUIVisualizationTextSettings poiName
std::string vehicleScaleParam
key for scaling by vehicle parameter
bool showParkingInfo
Set whether parking related information should be shown.
GUIVisualizationTextSettings vehicleValue
bool disableDottedContours
flag for disable dotted contours in netedit
GUIColorer polyColorer
The polygon colorer.
int vehicleQuality
The quality of vehicle drawing.
GUIVisualizationTextSettings drawLinkJunctionIndex
bool generate3DTLSModels
whether 3D TLS models should be generated automatically
GUIVisualizationTextSettings addFullName
GUIVisualizationTextSettings edgeValue
bool fps
Information whether frames-per-second should be drawn.
std::string vehicleParam
key for coloring by vehicle parameter
bool showRails
Information whether rails shall be drawn.
GUIVisualizationSizeSettings personSize
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
GUIVisualizationTextSettings cwaEdgeName
GUIVisualizationTextSettings junctionID
std::string vehicleTextParam
key for rendering vehicle textual parameter
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
GUIVisualizationColorSettings colorSettings
color settings
bool showSublanes
Whether to show sublane boundaries.
GUIVisualizationRainbowSettings edgeValueRainBow
checks and thresholds for rainbow coloring
bool showGrid
Information whether a grid shall be shown.
bool scaleLength
Whether vehicle length shall be scaled with length/geometry factor.
bool showVehicleColorLegend
Information whether the vehicle color legend shall be drawn.
double edgeRelWidthExaggeration
The edgeRelation exaggeration (upscale thickness)
bool hideConnectors
flag to show or hide connectors
GUIScaler vehicleScaler
The size scaling settings for vehicles.
GUIColorer personColorer
The person colorer.
bool show3DTLSLinkMarkers
whether the TLS link markers should be drawn
bool polyUseCustomLayer
whether the rendering layer of polygons should be overriden
double poiCustomLayer
the custom layer for POIs
bool showChargingInfo
Set whether the charging search related information should be shown.
RGBColor ambient3DLight
3D material light components
GUIVisualizationRainbowSettings junctionValueRainBow
bool forceDrawForRectangleSelection
flag to force draw for rectangle selection (see drawForRectangleSelection)
bool showLaneDirection
Whether to show direction indicators for lanes.
GUIVisualizationRainbowSettings dataValueRainBow
value below which edgeData and edgeRelation data value should not be rendered
bool secondaryShape
whether secondary lane shape shall be drawn
GUIScaler edgeScaler
The mesoscopic edge scaler.
bool drawMinGap
Information whether the minimum gap shall be drawn.
GUIVisualizationTextSettings streetName
GUIVisualizationTextSettings poiText
GUIVisualizationTextSettings vehicleText
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
bool show3DHeadUpDisplay
whether to draw the head up display items
GUIColorer laneColorer
The lane colorer.
GUIVisualizationTextSettings polyName
double tazRelWidthExaggeration
The tazRelation exaggeration (upscale thickness)
bool laneShowBorders
Information whether lane borders shall be drawn.
GUIVisualizationTextSettings tlsPhaseName
GUIVisualizationTextSettings edgeName
Setting bundles for optional drawing names with size and color.
bool showSizeLegend
Information whether the size legend shall be drawn.
double laneMinSize
The minimum visual lane width for drawing.
GUIVisualizationTextSettings drawLinkTLIndex
GUIVisualizationTextSettings containerName
GUIVisualizationSizeSettings polySize
GUIColorer containerColorer
The container colorer.
double gridXSize
Information about the grid spacings.
bool showBTRange
Information whether the communication range shall be drawn.
bool drawReversed
Whether to draw reversed vehicles in their reversed state.
GUIVisualizationTextSettings personName
bool showColorLegend
Information whether the edge color legend shall be drawn.
std::string poiTextParam
key for rendering poi textual parameter
bool showRouteIndex
Information whether the route index should be shown.
bool drawCrossingsAndWalkingareas
whether crossings and walkingareas shall be drawn
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
int addMode
The additional structures visualization scheme.
std::string relDataAttr
key for coloring by edgeRelation / tazRelation attribute
GUIColorer junctionColorer
The junction colorer.
void copy(const GUIVisualizationSettings &s)
copy all content from another GUIVisualizationSettings (note: DON'T USE in DrawGL functions!...
std::string edgeParam
key for coloring by edge parameter
bool drawBrakeGap
Information whether the brake gap shall be drawn.
GUIVisualizationTextSettings polyType
int poiDetail
The detail level for drawing POIs.
std::string edgeDataScaling
key for scaling by edgeData
void setFileName(const std::string &name)
Sets the current file name.
const std::string & getFileName() const
returns the current file name
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
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
void set(double x, double y)
set positions x and y
Definition Position.h:82
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition Position.h:273
double x() const
Returns the x-position.
Definition Position.h:52
double z() const
Returns the z-position.
Definition Position.h:62
double y() const
Returns the y-position.
Definition Position.h:57
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:389
Represents a generic random distribution.
double getOverallProb() const
Return the sum of the probabilites assigned to the members.
bool add(T val, double prob, bool checkDuplicates=true)
Adds a value with an assigned probability to the 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.
SAX-handler base for SUMO-files.
SAX-reader encapsulation containing binary reader.
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.
RGBColor vehicleTripColor
color for vehicle trips
RGBColor parkingSpaceColorContour
color for parkingSpace contour
RGBColor selectionColor
basic selection color
RGBColor selectedEdgeColor
edge selection color
RGBColor selectedPersonPlanColor
person plan selection color (Rides, Walks, stopPersons...)
RGBColor stopPersonColor
color for stopPersons
RGBColor selectedCrossingColor
crossings selection color
RGBColor chargingStationColor
color for chargingStations
RGBColor parkingSpaceColor
color for parkingSpace innen
RGBColor selectedLaneColor
lane selection color
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
RGBColor selectedEdgeDataColor
edge data selection color
RGBColor trainStopColorSign
color for trainStops signs
RGBColor transhipColor
color for tranships
RGBColor waypointColor
color for Waypoints
RGBColor containerStopColor
color for containerStops
RGBColor selectedProhibitionColor
prohibition selection color
RGBColor selectedConnectionColor
connection selection color
RGBColor busStopColorSign
color for busStops signs
RGBColor selectedContainerColor
container selection color
RGBColor containerStopColorSign
color for containerStop signs
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
RGBColor parkingAreaColorSign
color for parkingArea sign
RGBColor transportColor
color for transport
RGBColor busStopColor
color for busStops
RGBColor selectedVehicleColor
vehicle selection color
RGBColor chargingStationColorCharge
color for chargingStation during charging
RGBColor parkingAreaColor
color for parkingAreas
RGBColor selectedPersonColor
person selection color
RGBColor selectedContainerPlanColor
container plan selection color (Rides, Walks, containerStops...)
RGBColor personTripColor
color for stopPersons
RGBColor stopContainerColor
color for containerStops
RGBColor trainStopColor
color for trainStops
RGBColor chargingStationColorSign
color for chargingStation sign
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
double personTripWidth
width for person trips