42 #ifdef CHECK_MEMORY_LEAKS
44 #endif // CHECK_MEMORY_LEAKS
65 std::string name = scheme.
name;
110 const std::vector<std::string>&
126 vs.
name =
"standard";
128 gSchemeStorage.
add(vs);
132 vs.
name =
"faster standard";
136 gSchemeStorage.
add(vs);
140 vs.
name =
"real world";
148 gSchemeStorage.
add(vs);
152 int noSaved = app->reg().readIntEntry(
"VisualizationSettings",
"settingNo", 0);
153 for (
int i = 0; i < noSaved; ++i) {
154 std::string name =
"visset#" +
toString(i);
155 std::string setting = app->reg().readStringEntry(
"VisualizationSettings", name.c_str(),
"");
160 app->reg().readStringEntry(
"VisualizationSettings", name.c_str(),
"");
163 int xmlSize = app->reg().readIntEntry(name.c_str(),
"xmlSize", 0);
164 std::string content =
"";
166 while (xmlSize > 0) {
167 std::string part = app->reg().readStringEntry(name.c_str(), (
"xml" +
toString(index)).c_str(),
"");
172 xmlSize -= (int) part.size();
175 if (content !=
"" && xmlSize == 0) {
190 const std::vector<std::string>& names =
getNames();
191 app->reg().writeIntEntry(
"VisualizationSettings",
"settingNo", (FXint) names.size() -
myNumInitialSettings);
193 for (std::vector<std::string>::const_iterator i = names.begin() +
myNumInitialSettings; i != names.end(); ++i, ++gidx) {
195 std::string sname =
"visset#" +
toString(gidx);
197 app->reg().writeStringEntry(
"VisualizationSettings", sname.c_str(), item.
name.c_str());
201 app->reg().writeIntEntry(sname.c_str(),
"xmlSize", (FXint)(content.size()));
202 const unsigned maxSize = 1500;
203 for (
int i = 0; i < (int)content.size(); i += maxSize) {
204 const std::string b = content.substr(i, maxSize);
205 app->reg().writeStringEntry(sname.c_str(), (
"xml" +
toString(i / maxSize)).c_str(), b.c_str());
int getNumInitialSettings() const
Returns the number of initial settings.
int myNumInitialSettings
The number of settings which were present at startup.
GUICompleteSchemeStorage()
Constructor.
GUICompleteSchemeStorage gSchemeStorage
std::string getString() const
Returns the current content as a string.
std::string addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
void setDefault(const std::string &name)
Makes the scheme with the given name the default.
virtual void setViewportFromTo(const Position &lookFrom, const Position &lookAt)
applies the given viewport settings
Position myLookFrom
The default viewport.
virtual void recenterView()
recenters the view
Stores the information about how to visualize structures.
SUMOReal minSize
The minimum size to draw this object.
bool showRails
Information whether rails shall be drawn.
~GUICompleteSchemeStorage()
Destructor.
bool laneShowBorders
Information whether lane borders shall be drawn.
SUMOReal x() const
Returns the x-position.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
std::string name
The name of this setting.
A point in 2D or 3D with translation and scaling methods.
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
void remove(const std::string &name)
Removes the setting with the given name.
SUMOReal z() const
Returns the z-position.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
std::map< std::string, GUIVisualizationSettings > mySettings
A map of settings referenced by their names.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
int containerQuality
The quality of container drawing.
RGBColor backgroundColor
The background color to use.
GUIVisualizationSettings & getDefault()
Returns the default scheme.
void saveViewport(const SUMOReal x, const SUMOReal y, const SUMOReal z)
Makes the given viewport the default.
Storage for available visualization settings.
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
void setViewport(GUISUMOAbstractView *view)
Sets the default viewport.
std::vector< std::string > mySortedSchemeNames
List of known setting names.
SUMOReal y() const
Returns the y-position.
void writeSettings(FXApp *app)
Writes the current scheme into the registry.
void set(SUMOReal x, SUMOReal y)
int personQuality
The quality of person drawing.
An XML-handler for visualisation schemes.
void save(OutputDevice &dev) const
Writes the settings into an output device.
GUIVisualizationSizeSettings vehicleSize
void init(FXApp *app)
Initialises the storage with some default settings.
int vehicleQuality
The quality of vehicle drawing.
An output device that encapsulates an ofstream.
void add(const GUIVisualizationSettings &scheme)
Adds a visualization scheme.
std::string myDefaultSettingName
Name of the default setting.