SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00008 // Storage for available visualization settings 00009 /****************************************************************************/ 00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00012 /****************************************************************************/ 00013 // 00014 // This file is part of SUMO. 00015 // SUMO is free software: you can redistribute it and/or modify 00016 // it under the terms of the GNU General Public License as published by 00017 // the Free Software Foundation, either version 3 of the License, or 00018 // (at your option) any later version. 00019 // 00020 /****************************************************************************/ 00021 #ifndef GUICompleteSchemeStorage_h 00022 #define GUICompleteSchemeStorage_h 00023 00024 00025 // =========================================================================== 00026 // included modules 00027 // =========================================================================== 00028 #ifdef _MSC_VER 00029 #include <windows_config.h> 00030 #else 00031 #include <config.h> 00032 #endif 00033 00034 #include <string> 00035 #include <vector> 00036 #include <algorithm> 00037 #include <map> 00038 #include <utils/gui/windows/GUISUMOAbstractView.h> 00039 00040 00041 // =========================================================================== 00042 // class definitions 00043 // =========================================================================== 00048 class GUICompleteSchemeStorage { 00049 public: 00051 GUICompleteSchemeStorage() ; 00052 00053 00055 ~GUICompleteSchemeStorage() ; 00056 00057 00061 void add(const GUIVisualizationSettings& scheme) ; 00062 00063 00068 GUIVisualizationSettings& get(const std::string& name) ; 00069 00070 00074 GUIVisualizationSettings& getDefault() ; 00075 00076 00081 bool contains(const std::string& name) const ; 00082 00083 00087 void remove(const std::string& name) ; 00088 00089 00093 void setDefault(const std::string& name) ; 00094 00095 00099 const std::vector<std::string> &getNames() const ; 00100 00101 00105 unsigned int getNumInitialSettings() const ; 00106 00107 00111 void init(FXApp* app) ; 00112 00113 00117 void writeSettings(FXApp* app) ; 00118 00119 00125 void saveViewport(const SUMOReal x, const SUMOReal y, const SUMOReal zoom) ; 00126 00127 00131 void setViewport(GUISUMOAbstractView* view) ; 00132 00133 00134 protected: 00136 std::map<std::string, GUIVisualizationSettings> mySettings; 00137 00139 std::vector<std::string> mySortedSchemeNames; 00140 00142 std::string myDefaultSettingName; 00143 00145 unsigned int myNumInitialSettings; 00146 00148 SUMOReal myX, myY, myZoom; 00149 00150 00151 }; 00152 00153 extern GUICompleteSchemeStorage gSchemeStorage; 00154 00155 00156 #endif 00157 00158 /****************************************************************************/ 00159