77 WRITE_WARNING(
TL(
"The 'value' attribute is deprecated for breakpoints. Please use 'time'."));
169 mySettings.edgeColorer.setActive(laneEdgeMode);
170 mySettings.edgeScaler.setActive(laneEdgeScaleMode);
171 mySettings.laneColorer.setActive(laneEdgeMode);
172 mySettings.laneScaler.setActive(laneEdgeScaleMode);
330 mySettings.colorSettings.chargingStationColorCharge =
parseColor(attrs,
"chargingStationColorCharge",
mySettings.colorSettings.chargingStationColorCharge);
331 mySettings.colorSettings.chargingStationColorSign =
parseColor(attrs,
"chargingStationColorSign",
mySettings.colorSettings.chargingStationColorSign);
337 mySettings.colorSettings.parkingSpaceColorContour =
parseColor(attrs,
"parkingSpaceColorContour",
mySettings.colorSettings.parkingSpaceColorContour);
340 mySettings.colorSettings.selectedAdditionalColor =
parseColor(attrs,
"selectedAdditionalColor",
mySettings.colorSettings.selectedAdditionalColor);
341 mySettings.colorSettings.selectedConnectionColor =
parseColor(attrs,
"selectedConnectionColor",
mySettings.colorSettings.selectedConnectionColor);
343 mySettings.colorSettings.selectedContainerPlanColor =
parseColor(attrs,
"selectedContainerPlanColor",
mySettings.colorSettings.selectedContainerPlanColor);
349 mySettings.colorSettings.selectedPersonPlanColor =
parseColor(attrs,
"selectedPersonPlanColor",
mySettings.colorSettings.selectedPersonPlanColor);
350 mySettings.colorSettings.selectedProhibitionColor =
parseColor(attrs,
"selectedProhibitionColor",
mySettings.colorSettings.selectedProhibitionColor);
415 WRITE_WARNING(
TL(
"The 'filename' attribute is deprecated for decals. Please use 'file'."));
457 const std::string
id = attrs.
get<std::string>(
SUMO_ATTR_ID,
nullptr, ok);
532const std::vector<std::string>&
566 for (
auto file : item.second) {
580const std::vector<GUISUMOAbstractView::Decal>&
594 std::vector<SUMOTime> result;
595 std::ifstream strm(file.c_str());
600 while (strm.good()) {
603 if (val.length() == 0) {
608 result.push_back(
value);
623 if (result.getOverallProb() > 0 && result.getOverallProb() < 1) {
625 result.add(
"", 1. - result.getOverallProb());
GUICompleteSchemeStorage gSchemeStorage
#define WRITE_ERRORF(...)
#define WRITE_WARNING(msg)
const std::string invalid_return< std::string >::value
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ SUMO_TAG_VIEWSETTINGS_POIS
@ SUMO_TAG_VIEWSETTINGS_DATA
@ SUMO_TAG_VIEWSETTINGS_3D
@ SUMO_TAG_VIEWSETTINGS_BACKGROUND
@ SUMO_TAG_VIEWSETTINGS_LEGEND
@ SUMO_TAG_VIEWSETTINGS_EVENT
@ SUMO_TAG_VIEWSETTINGS_OPENGL
@ SUMO_TAG_VIEWSETTINGS_ADDITIONALS
@ SUMO_TAG_VIEWSETTINGS_EVENT_JAM_TIME
@ SUMO_TAG_VIEWSETTINGS_PERSONS
@ SUMO_TAG_VIEWSETTINGS_JUNCTIONS
@ SUMO_TAG_VIEWSETTINGS_VEHICLES
@ SUMO_TAG_VIEWSETTINGS_EDGES
@ SUMO_TAG_VIEWSETTINGS_DECAL
@ SUMO_TAG_VIEWSETTINGS_SCHEME
@ SUMO_TAG_VIEWSETTINGS_LIGHT
@ SUMO_TAG_VIEWSETTINGS_POLYS
@ SUMO_TAG_VIEWSETTINGS_TRACKER
@ SUMO_TAG_VIEWSETTINGS_CONTAINERS
@ SUMO_ATTR_LAYER
A layer number.
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_TIME
trigger: the time of the step
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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
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.
static RGBColor parseColorReporting(const std::string &coldef, const std::string &objecttype, const char *objectid, bool report, bool &ok)
Parses a color information.
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