SUMO - Simulation of Urban MObility

GUIVisualizationSettings.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Stores the information about how to visualize structures
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 #ifndef GUIVisualizationSettings_h
00020 #define GUIVisualizationSettings_h
00021 
00022 
00023 // ===========================================================================
00024 // included modules
00025 // ===========================================================================
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031 
00032 #include <string>
00033 #include <vector>
00034 #include <map>
00035 #include <utils/common/RGBColor.h>
00036 #include <utils/common/ToString.h>
00037 #include "GUIColorer.h"
00038 
00039 
00040 // ===========================================================================
00041 // class declarations
00042 // ===========================================================================
00043 class BaseSchemeInfoSource;
00044 class OutputDevice;
00045 
00046 
00047 // ===========================================================================
00048 // class definitions
00049 // ===========================================================================
00050 
00051 // cannot declare this as inner class because it needs to be used in forward
00052 // declaration (@todo fix inclusion order by removing references to guisim!)
00053 struct GUIVisualizationTextSettings {
00054     GUIVisualizationTextSettings(bool _show, float _size, RGBColor _color) :
00055         show(_show), size(_size), color(_color) {}
00056 
00057     bool show;
00058     float size;
00059     RGBColor color;
00060 
00061     bool operator==(const GUIVisualizationTextSettings& other) {
00062         return show == other.show &&
00063                size == other.size &&
00064                color == other.color;
00065     }
00066     bool operator!=(const GUIVisualizationTextSettings& other) {
00067         return !((*this) == other);
00068     }
00069 
00070     std::string print(const std::string& name) const {
00071         return name + "_show=\"" + toString(show) + "\" " +
00072                name + "_size=\"" + toString(size) + "\" " +
00073                name + "_color=\"" + toString(color) + "\" ";
00074     }
00075 };
00076 
00081 class GUIVisualizationSettings {
00082 public:
00083 
00085     GUIVisualizationSettings() throw();
00086 
00088     std::string name;
00089 
00091     bool antialiase;
00093     bool dither;
00094 
00096 
00097 
00099     RGBColor backgroundColor;
00101     bool showBackgroundDecals;
00103     bool showGrid;
00105     SUMOReal gridXSize, gridYSize;
00107 
00108 
00110 
00111 
00112 #ifdef HAVE_MESOSIM
00113 
00114     GUIColorer edgeColorer;
00115 
00117     static bool UseMesoSim;
00118 #endif
00119 
00120     GUIColorer laneColorer;
00122     bool laneShowBorders;
00124     bool showLinkDecals;
00126     bool showRails;
00127     // Setting bundles for optional drawing names with size and color
00128     GUIVisualizationTextSettings edgeName, internalEdgeName, streetName;
00129 
00130     bool hideConnectors;
00132 
00133 
00135 
00136 
00138     GUIColorer vehicleColorer;
00140     int vehicleQuality;
00142     float minVehicleSize;
00144     float vehicleExaggeration;
00146     bool showBlinker;
00148     bool drawLaneChangePreference;
00149     // Setting bundles for optional drawing vehicle names
00150     GUIVisualizationTextSettings vehicleName;
00152 
00153 
00155 
00156 
00158     int junctionMode;
00160     bool drawLinkTLIndex;
00162     bool drawLinkJunctionIndex;
00163     // Setting bundles for optional drawing junction names
00164     GUIVisualizationTextSettings junctionName, internalJunctionName;
00166 
00167 
00169     bool showLane2Lane;
00170 
00171 
00173 
00174 
00176     int addMode;
00178     float minAddSize;
00180     float addExaggeration;
00181     // Setting bundles for optional drawing additional names
00182     GUIVisualizationTextSettings addName;
00184 
00185 
00187 
00188 
00190     float minPOISize;
00192     float poiExaggeration;
00193     // Setting bundles for optional drawing poi names
00194     GUIVisualizationTextSettings poiName;
00196 
00198     bool showSizeLegend;
00199 
00201     SUMOReal scale;
00202 
00204     bool gaming;
00205 
00207     int editMode;
00208 
00210     SUMOReal selectionScale;
00211 
00215     void save(OutputDevice& dev) const throw(IOError);
00216 
00220     size_t getLaneEdgeMode() const;
00221 
00225     GUIColorScheme& getLaneEdgeScheme();
00226 
00228     bool operator==(const GUIVisualizationSettings& vs2);
00229 };
00230 
00231 
00232 #endif
00233 
00234 /****************************************************************************/
00235 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines