56 std::string name = scheme.
name;
104const std::vector<std::string>&
168 int noSaved = app->reg().readIntEntry(
"VisualizationSettings",
"settingNo", 0);
169 for (
int i = 0; i < noSaved; ++i) {
170 std::string name =
"visset#" +
toString(i);
171 std::string setting = app->reg().readStringEntry(
"VisualizationSettings", name.c_str(),
"");
174 app->reg().readStringEntry(
"VisualizationSettings", name.c_str(),
"");
177 int xmlSize = app->reg().readIntEntry(name.c_str(),
"xmlSize", 0);
178 std::string content =
"";
180 while (xmlSize > 0) {
181 std::string part = app->reg().readStringEntry(name.c_str(), (
"xml" +
toString(index)).c_str(),
"");
186 xmlSize -= (int) part.size();
189 if (content !=
"" && xmlSize == 0) {
204 const std::vector<std::string>& names =
getNames();
205 app->reg().writeIntEntry(
"VisualizationSettings",
"settingNo", (FXint) names.size() -
myNumInitialSettings);
207 for (std::vector<std::string>::const_iterator it = names.begin() +
myNumInitialSettings; it != names.end(); ++it, ++gidx) {
209 std::string sname =
"visset#" +
toString(gidx);
211 app->reg().writeStringEntry(
"VisualizationSettings", sname.c_str(), item->
name.c_str());
215 app->reg().writeIntEntry(sname.c_str(),
"xmlSize", (FXint)(content.size()));
216 const unsigned maxSize = 1500;
217 for (
int i = 0; i < (int)content.size(); i += maxSize) {
218 const std::string b = content.substr(i, maxSize);
219 app->reg().writeStringEntry(sname.c_str(), (
"xml" +
toString(i / maxSize)).c_str(), b.c_str());
235 d.initialised =
false;
GUICompleteSchemeStorage gSchemeStorage
GUICompleteSchemeStorage gSchemeStorage
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Storage for available visualization settings.
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 remove(const std::string name)
Removes the setting with the given name.
std::map< std::string, GUIVisualizationSettings * > mySettings
A map of settings referenced by their names.
GUIVisualizationSettings & getDefault()
Returns the default scheme.
GUICompleteSchemeStorage()
Constructor.
std::vector< GUISUMOAbstractView::Decal > myDecals
The default decals.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
void add(const GUIVisualizationSettings &scheme)
Adds a visualization scheme.
int getNumInitialSettings() const
Returns the number of initial settings.
void saveViewport(const double x, const double y, const double z, const double rot)
Makes the given viewport the default.
std::vector< std::string > mySortedSchemeNames
List of known setting names.
std::string myDefaultSettingName
Name of the default setting.
void init(FXApp *app, bool netedit=false)
Initialises the storage with some default settings.
int myNumInitialSettings
The number of settings which were present at startup.
void setDefault(const std::string &name)
Makes the scheme with the given name the default.
void saveDecals(const std::vector< GUISUMOAbstractView::Decal > &decals)
Makes the given decals the default.
Position myLookFrom
The default viewport.
void writeSettings(FXApp *app)
Writes the current scheme into the registry.
void setViewport(GUISUMOAbstractView *view)
Sets the default viewport.
~GUICompleteSchemeStorage()
Destructor.
void setSchemeByName(std::string name)
virtual void recenterView()
recenters the view
virtual void setViewportFromToRot(const Position &lookFrom, const Position &lookAt, double rotation)
applies the given viewport settings
An XML-handler for visualisation schemes.
const std::vector< std::string > & addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
Stores the information about how to visualize structures.
RGBColor backgroundColor
The background color to use.
GUIVisualizationSizeSettings vehicleSize
GUIVisualizationSizeSettings junctionSize
GUIColorer vehicleColorer
The vehicle colorer.
static const std::string SCHEME_NAME_SELECTION
std::string name
The name of this setting.
GUIColorer edgeColorer
The mesoscopic edge colorer.
int containerQuality
The quality of container drawing.
int personQuality
The quality of person drawing.
GUIColorer poiColorer
The POI colorer.
GUIColorer polyColorer
The polygon colorer.
int vehicleQuality
The quality of vehicle drawing.
bool showRails
Information whether rails shall be drawn.
bool showSublanes
Whether to show sublane boundaries.
static const std::string SCHEME_NAME_TYPE
bool hideConnectors
flag to show or hide connectors
GUIColorer personColorer
The person colorer.
void save(OutputDevice &dev) const
Writes the settings into an output device.
bool showLaneDirection
Whether to show direction indicators for lanes.
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
GUIColorer laneColorer
The lane colorer.
bool laneShowBorders
Information whether lane borders shall be drawn.
GUIColorer containerColorer
The container colorer.
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
GUIColorer junctionColorer
The junction colorer.
void copy(const GUIVisualizationSettings &s)
copy all content from another GUIVisualizationSettings (note: DON'T USE in DrawGL functions!...
An output device that encapsulates an ofstream.
std::string getString() const
Returns the current content as a string.
A point in 2D or 3D with translation and scaling methods.
void set(double x, double y)
set positions x and y
double x() const
Returns the x-position.
double z() const
Returns the z-position.
double y() const
Returns the y-position.
bool constantSize
whether the object shall be drawn with constant size regardless of zoom
double minSize
The minimum size to draw this object.