Eclipse SUMO - Simulation of Urban MObility
GUISettingsHandler.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2020 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 /****************************************************************************/
21 // The dialog to change the view (gui) settings.
22 /****************************************************************************/
23 #include <config.h>
24 
25 #include <vector>
27 #include <utils/common/ToString.h>
28 #include <utils/common/RGBColor.h>
36 #include <utils/xml/XMLSubSys.h>
37 #include "GUISettingsHandler.h"
38 
39 
40 // ===========================================================================
41 // method definitions
42 // ===========================================================================
43 GUISettingsHandler::GUISettingsHandler(const std::string& content, bool isFile, bool netedit) :
44  SUMOSAXHandler(content),
45  mySettings(netedit),
46  myDelay(-1), myLookFrom(-1, -1, -1), myLookAt(-1, -1, -1),
47  myRotation(0),
48  myCurrentColorer(SUMO_TAG_NOTHING),
49  myCurrentScheme(nullptr),
50  myJamSoundTime(-1) {
51  if (isFile) {
52  XMLSubSys::runParser(*this, content);
53  } else {
54  setFileName("registrySettings");
55  SUMOSAXReader* reader = XMLSubSys::getSAXReader(*this);
56  reader->parseString(content);
57  delete reader;
58  }
59 }
60 
61 
63 }
64 
65 
66 void
68  bool ok = true;
69  switch (element) {
71  if (attrs.hasAttribute(SUMO_ATTR_TIME)) {
72  myBreakpoints.push_back(attrs.getSUMOTimeReporting(SUMO_ATTR_TIME, nullptr, ok));
73  } else {
74  myBreakpoints.push_back(attrs.getSUMOTimeReporting(SUMO_ATTR_VALUE, nullptr, ok));
75  WRITE_WARNING("The 'value' attribute is deprecated for breakpoints. Please use 'time'.");
76  }
77  break;
79  myViewType = attrs.getOpt<std::string>(SUMO_ATTR_TYPE, nullptr, ok, "default");
80  std::transform(myViewType.begin(), myViewType.end(), myViewType.begin(), tolower);
81  break;
82  case SUMO_TAG_DELAY:
83  myDelay = attrs.getOpt<double>(SUMO_ATTR_VALUE, nullptr, ok, myDelay);
84  break;
85  case SUMO_TAG_VIEWPORT: {
86  const double x = attrs.getOpt<double>(SUMO_ATTR_X, nullptr, ok, myLookFrom.x());
87  const double y = attrs.getOpt<double>(SUMO_ATTR_Y, nullptr, ok, myLookFrom.y());
88  const double z = attrs.getOpt<double>(SUMO_ATTR_ZOOM, nullptr, ok, myLookFrom.z());
89  myLookFrom.set(x, y, z);
90  const double cx = attrs.getOpt<double>(SUMO_ATTR_CENTER_X, nullptr, ok, myLookAt.x());
91  const double cy = attrs.getOpt<double>(SUMO_ATTR_CENTER_Y, nullptr, ok, myLookAt.y());
92  const double cz = attrs.getOpt<double>(SUMO_ATTR_CENTER_Z, nullptr, ok, myLookAt.z());
93  myLookAt.set(cx, cy, cz);
94  myRotation = attrs.getOpt<double>(SUMO_ATTR_ANGLE, nullptr, ok, myRotation);
95  break;
96  }
97  case SUMO_TAG_SNAPSHOT: {
98  std::string file = attrs.get<std::string>(SUMO_ATTR_FILE, nullptr, ok);
99  if (file != "" && !FileHelpers::isAbsolute(file)) {
101  }
102  mySnapshots[attrs.getOptSUMOTimeReporting(SUMO_ATTR_TIME, file.c_str(), ok, 0)].push_back(file);
103  }
104  break;
106  mySettings.name = attrs.getOpt<std::string>(SUMO_ATTR_NAME, nullptr, ok, mySettings.name);
109  }
110  }
111  break;
118  break;
120  mySettings.backgroundColor = RGBColor::parseColorReporting(attrs.getStringSecure("backgroundColor", toString(mySettings.backgroundColor)), "background", nullptr, true, ok);
124  break;
126  int laneEdgeMode = StringUtils::toInt(attrs.getStringSecure("laneEdgeMode", "0"));
127  int laneEdgeScaleMode = StringUtils::toInt(attrs.getStringSecure("scaleMode", "0"));
151  myCurrentColorer = element;
152  mySettings.edgeColorer.setActive(laneEdgeMode);
153  mySettings.edgeScaler.setActive(laneEdgeScaleMode);
154  mySettings.laneColorer.setActive(laneEdgeMode);
155  mySettings.laneScaler.setActive(laneEdgeScaleMode);
156  }
157  break;
159  myCurrentScheme = nullptr;
160  myCurrentScaleScheme = nullptr;
163  if (myCurrentScheme == nullptr) {
165  }
166  }
169  }
172  }
175  }
178  }
181  }
183  myCurrentScheme->setInterpolated(attrs.getOpt<bool>(SUMO_ATTR_INTERPOLATED, nullptr, ok, false));
185  }
186  break;
188  myCurrentScheme = nullptr;
189  myCurrentScaleScheme = nullptr;
192  if (myCurrentScaleScheme == nullptr) {
194  }
195  }
197  myCurrentScaleScheme->setInterpolated(attrs.getOpt<bool>(SUMO_ATTR_INTERPOLATED, nullptr, ok, false));
199  }
200  break;
201  case SUMO_TAG_ENTRY:
202  if (myCurrentScheme != nullptr) {
203  RGBColor color = attrs.get<RGBColor>(SUMO_ATTR_COLOR, nullptr, ok);
204  if (myCurrentScheme->isFixed()) {
206  } else {
207  myCurrentScheme->addColor(color, attrs.getOpt<double>(SUMO_ATTR_THRESHOLD, nullptr, ok, std::numeric_limits<double>::max()));
208  }
209  } else if (myCurrentScaleScheme != nullptr) {
210  double scale = attrs.get<double>(SUMO_ATTR_COLOR, nullptr, ok);
211  if (myCurrentScaleScheme->isFixed()) {
213  } else {
214  myCurrentScaleScheme->addColor(scale, attrs.getOpt<double>(SUMO_ATTR_THRESHOLD, nullptr, ok, std::numeric_limits<double>::max()));
215  }
216  }
217  break;
230  myCurrentColorer = element;
231  break;
238  myCurrentColorer = element;
239  break;
245  myCurrentColorer = element;
246  break;
259  "drawCrossingsAndWalkingareas", toString(mySettings.drawCrossingsAndWalkingareas)));
261  myCurrentColorer = element;
262  break;
268  break;
276  myCurrentColorer = element;
277  break;
283  myCurrentColorer = element;
284  break;
289  break;
292  if (attrs.hasAttribute(SUMO_ATTR_FILE)) {
293  d.filename = attrs.get<std::string>(SUMO_ATTR_FILE, nullptr, ok);
294  } else {
295  d.filename = attrs.getStringSecure("filename", d.filename);
296  WRITE_WARNING("The 'filename' attribute is deprecated for decals. Please use 'file'.");
297  }
298  if (d.filename != "" && !FileHelpers::isAbsolute(d.filename)) {
300  }
301  d.centerX = attrs.getOpt<double>(SUMO_ATTR_CENTER_X, nullptr, ok, d.centerX);
302  d.centerY = attrs.getOpt<double>(SUMO_ATTR_CENTER_Y, nullptr, ok, d.centerY);
303  d.centerZ = attrs.getOpt<double>(SUMO_ATTR_CENTER_Z, nullptr, ok, d.centerZ);
304  d.width = attrs.getOpt<double>(SUMO_ATTR_WIDTH, nullptr, ok, d.width);
305  d.height = attrs.getOpt<double>(SUMO_ATTR_HEIGHT, nullptr, ok, d.height);
306  d.altitude = StringUtils::toDouble(attrs.getStringSecure("altitude", toString(d.height)));
307  d.rot = StringUtils::toDouble(attrs.getStringSecure("rotation", toString(d.rot)));
308  d.tilt = StringUtils::toDouble(attrs.getStringSecure("tilt", toString(d.tilt)));
309  d.roll = StringUtils::toDouble(attrs.getStringSecure("roll", toString(d.roll)));
310  d.layer = attrs.getOpt<double>(SUMO_ATTR_LAYER, nullptr, ok, d.layer);
312  d.initialised = false;
313  myDecals.push_back(d);
314  }
315  break;
318  d.filename = "light" + attrs.getOpt<std::string>(SUMO_ATTR_INDEX, nullptr, ok, "0");
319  d.centerX = attrs.getOpt<double>(SUMO_ATTR_CENTER_X, nullptr, ok, d.centerX);
320  d.centerY = attrs.getOpt<double>(SUMO_ATTR_CENTER_Y, nullptr, ok, d.centerY);
321  d.centerZ = attrs.getOpt<double>(SUMO_ATTR_CENTER_Z, nullptr, ok, d.centerZ);
322  d.width = attrs.getOpt<double>(SUMO_ATTR_WIDTH, nullptr, ok, d.width);
323  d.height = attrs.getOpt<double>(SUMO_ATTR_HEIGHT, nullptr, ok, d.height);
324  d.altitude = StringUtils::toDouble(attrs.getStringSecure("altitude", toString(d.height)));
325  d.rot = StringUtils::toDouble(attrs.getStringSecure("rotation", toString(d.rot)));
326  d.tilt = StringUtils::toDouble(attrs.getStringSecure("tilt", toString(d.tilt)));
327  d.roll = StringUtils::toDouble(attrs.getStringSecure("roll", toString(d.roll)));
328  d.layer = attrs.getOpt<double>(SUMO_ATTR_LAYER, nullptr, ok, d.layer);
329  d.initialised = false;
330  myDecals.push_back(d);
331  }
332  break;
334  const std::string id = attrs.get<std::string>(SUMO_ATTR_ID, nullptr, ok);
335  const std::string cmd = attrs.get<std::string>(SUMO_ATTR_COMMAND, nullptr, ok);
336  const double prob = attrs.get<double>(SUMO_ATTR_PROB, id.c_str(), ok);
337  myEventDistributions[id].add(cmd, prob);
338  }
339  break;
341  myJamSoundTime = attrs.get<double>(SUMO_ATTR_VALUE, nullptr, ok);
342  break;
343  default:
344  break;
345  }
346 }
347 
348 
351  const std::string& prefix, const SUMOSAXAttributes& attrs,
352  GUIVisualizationTextSettings defaults) {
353  bool ok = true;
355  StringUtils::toBool(attrs.getStringSecure(prefix + "_show", toString(defaults.show))),
356  StringUtils::toDouble(attrs.getStringSecure(prefix + "_size", toString(defaults.size))),
357  RGBColor::parseColorReporting(attrs.getStringSecure(prefix + "_color", toString(defaults.color)), "textSettings", nullptr, true, ok),
358  RGBColor::parseColorReporting(attrs.getStringSecure(prefix + "_bgColor", toString(defaults.bgColor)), "textSettings", nullptr, true, ok),
359  StringUtils::toBool(attrs.getStringSecure(prefix + "_constantSize", toString(defaults.constSize))));
360 }
361 
362 
365  const std::string& prefix, const SUMOSAXAttributes& attrs,
366  GUIVisualizationSizeSettings defaults) {
368  StringUtils::toDouble(attrs.getStringSecure(prefix + "_minSize", toString(defaults.minSize))),
369  StringUtils::toDouble(attrs.getStringSecure(prefix + "_exaggeration", toString(defaults.exaggeration))),
370  StringUtils::toBool(attrs.getStringSecure(prefix + "_constantSize", toString(defaults.constantSize))),
371  StringUtils::toBool(attrs.getStringSecure(prefix + "_constantSizeSelected", toString(defaults.constantSizeSelected))));
372 }
373 
374 
375 std::string
377  if (mySettings.name != "") {
379  if (view) {
380  FXint index = view->getColoringSchemesCombo()->appendItem(mySettings.name.c_str());
381  view->getColoringSchemesCombo()->setCurrentItem(index);
383  }
384  }
385  return mySettings.name;
386 }
387 
388 
389 void
391  if (myLookFrom.z() > 0) {
392  // z value stores zoom so we must convert first
393  Position lookFrom(myLookFrom.x(), myLookFrom.y(), view->getChanger().zoom2ZPos(myLookFrom.z()));
394  view->setViewportFromToRot(lookFrom, myLookAt, myRotation);
395  }
396 }
397 
398 
399 void
401  if (!mySnapshots.empty()) {
402  for (auto item : mySnapshots) {
403  for (auto file : item.second) {
404  view->addSnapshot(item.first, file);
405  }
406  }
407  }
408 }
409 
410 
411 bool
413  return !myDecals.empty();
414 }
415 
416 
417 const std::vector<GUISUMOAbstractView::Decal>&
419  return myDecals;
420 }
421 
422 
423 double
425  return myDelay;
426 }
427 
428 
429 std::vector<SUMOTime>
430 GUISettingsHandler::loadBreakpoints(const std::string& file) {
431  std::vector<SUMOTime> result;
432  std::ifstream strm(file.c_str());
433  while (strm.good()) {
434  std::string val;
435  strm >> val;
436  if (val.length() == 0) {
437  continue;
438  }
439  try {
440  SUMOTime value = string2time(val);
441  result.push_back(value);
442  } catch (NumberFormatException& e) {
443  WRITE_ERROR(" A breakpoint-value must be an int. " + toString(e.what()));
444  } catch (EmptyData&) {
445  } catch (ProcessError&) {
446  WRITE_ERROR(" Could not decode breakpoint '" + val + "'");
447  }
448  }
449  return result;
450 }
451 
452 
456  if (result.getOverallProb() > 0 && result.getOverallProb() < 1) {
457  // unscaled probabilities are assumed, fill up with dummy event
458  result.add("", 1. - result.getOverallProb());
459  }
460  return result;
461 }
462 
463 
464 /****************************************************************************/
GUICompleteSchemeStorage gSchemeStorage
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:284
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:276
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
Definition: SUMOTime.cpp:45
long long int SUMOTime
Definition: SUMOTime.h:31
@ SUMO_TAG_NOTHING
invalid tag
@ SUMO_TAG_VIEWSETTINGS_POIS
@ SUMO_TAG_COLORSCHEME
@ 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_CONTAINERS
@ SUMO_ATTR_VALUE
@ SUMO_ATTR_THRESHOLD
@ SUMO_ATTR_FILE
@ SUMO_ATTR_Y
@ 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_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:44
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)
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
FXComboBox * getColoringSchemesCombo()
get coloring schemes combo
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.
GUIColorScheme * myCurrentScheme
The current color scheme.
bool hasDecals() const
Returns whether any decals have been parsed.
static std::vector< SUMOTime > loadBreakpoints(const std::string &file)
loads breakpoints from the specified file
std::string addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
std::string myViewType
The view type (osg, opengl, default) loaded.
std::map< std::string, RandomDistributor< std::string > > myEventDistributions
The parsed event distributions.
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.
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.
GUIVisualizationTextSettings addName
GUIVisualizationTextSettings tlsPhaseIndex
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
GUIVisualizationSizeSettings junctionSize
bool drawBoundaries
enable or disable draw boundaries
bool showBikeMarkings
Information whether bicycle lane marking shall be drawn.
GUIScaler laneScaler
The lane scaler.
bool dither
Information whether dithering shall be enabled.
GUIColorer vehicleColorer
The vehicle colorer.
GUIVisualizationTextSettings personValue
bool showLinkRules
Information whether link rules (colored bars) shall be drawn.
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.
GUIVisualizationTextSettings internalJunctionName
GUIVisualizationSizeSettings poiSize
bool drawJunctionShape
whether the shape of the junction should be drawn
std::string edgeData
key for coloring by edgeData
int personQuality
The quality of person drawing.
GUIColorer poiColorer
The POI colorer.
GUIVisualizationTextSettings poiName
GUIVisualizationTextSettings vehicleValue
GUIColorer polyColorer
The polygon colorer.
int vehicleQuality
The quality of vehicle drawing.
GUIVisualizationTextSettings drawLinkJunctionIndex
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.
bool showSublanes
Whether to show sublane boundaries.
bool showGrid
Information whether a grid shall be shown.
bool showVehicleColorLegend
Information whether the vehicle color legend shall be drawn.
bool hideConnectors
flag to show or hidde connectors
GUIColorer personColorer
The person colorer.
bool forceDrawForRectangleSelection
flag to force draw for rectangle selection (see drawForRectangleSelection)
bool showLaneDirection
Whether to show direction indicators for lanes.
bool edgeValueHideCheck
value below which edge data value should not be rendered
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.
GUIColorer laneColorer
The lane colorer.
GUIVisualizationTextSettings polyName
bool laneShowBorders
Information whether lane borders shall be drawn.
GUIVisualizationTextSettings tlsPhaseName
GUIVisualizationTextSettings edgeName
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 forceDrawForPositionSelection
flag to force draw for position selection (see drawForPositionSelection)
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 crosings and walkingareas shall be drawn
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
int addMode
The additional structures visualization scheme.
GUIColorer junctionColorer
The junction colorer.
std::string edgeParam
key for coloring by edge parameter
bool drawBrakeGap
Information whether the brake gap shall be drawn.
GUIVisualizationTextSettings polyType
void setFileName(const std::string &name)
Sets the current file name.
const std::string & getFileName() const
returns the current file name
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36
void set(double x, double y)
set positions x and y
Definition: Position.h:84
double x() const
Returns the x-position.
Definition: Position.h:54
double z() const
Returns the z-position.
Definition: Position.h:64
double y() const
Returns the y-position.
Definition: Position.h:59
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:258
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, 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.
Definition: SUMOSAXReader.h:52
void parseString(std::string content)
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
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.
Definition: XMLSubSys.cpp:132
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false, const bool isRoute=false)
Runs the given handler on the given file; returns if everything's ok.
Definition: XMLSubSys.cpp:148
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.
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 constSize
@brif flag to avoid size changes