SUMO - Simulation of Urban MObility
GUISettingsHandler.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // The handler for parsing gui settings from xml.
00010 /****************************************************************************/
00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00013 /****************************************************************************/
00014 //
00015 //   This file is part of SUMO.
00016 //   SUMO is free software: you can redistribute it and/or modify
00017 //   it under the terms of the GNU General Public License as published by
00018 //   the Free Software Foundation, either version 3 of the License, or
00019 //   (at your option) any later version.
00020 //
00021 /****************************************************************************/
00022 #ifndef GUISettingsHandler_h
00023 #define GUISettingsHandler_h
00024 
00025 
00026 // ===========================================================================
00027 // included modules
00028 // ===========================================================================
00029 #ifdef _MSC_VER
00030 #include <windows_config.h>
00031 #else
00032 #include <config.h>
00033 #endif
00034 
00035 #include <utils/gui/windows/GUISUMOAbstractView.h>
00036 #include <utils/xml/SUMOSAXHandler.h>
00037 #include <utils/xml/XMLSubSys.h>
00038 
00039 
00040 // ===========================================================================
00041 // class definitions
00042 // ===========================================================================
00046 class GUISettingsHandler : public SUMOSAXHandler {
00047 public:
00051     GUISettingsHandler(const std::string& content, bool isFile = true) ;
00052 
00053 
00055     ~GUISettingsHandler() ;
00056 
00057 
00058 
00060 
00061 
00068     void myStartElement(int element, const SUMOSAXAttributes& attrs) ;
00070 
00071 
00072 
00076     std::string addSettings(GUISUMOAbstractView* view = 0) const ;
00077 
00078 
00082     void setViewport(GUISUMOAbstractView* view) const ;
00083 
00084 
00090     void setViewport(SUMOReal& zoom, SUMOReal& xoff, SUMOReal& yoff) const ;
00091 
00092 
00097     void setSnapshots(GUISUMOAbstractView* view) const ;
00098 
00099 
00103     bool hasDecals() const ;
00104 
00105 
00109     const std::vector<GUISUMOAbstractView::Decal>& getDecals() const ;
00110 
00111 
00115     SUMOReal getDelay() const ;
00116 
00117 
00118 private:
00120     GUIVisualizationSettings mySettings;
00121 
00123     SUMOReal myDelay;
00124 
00126     SUMOReal myZoom, myXPos, myYPos;
00127 
00129     std::map<SUMOTime, std::string> mySnapshots;
00130 
00132     std::vector<GUISUMOAbstractView::Decal> myDecals;
00133 
00135     int myCurrentColorer;
00136 
00138     GUIColorScheme* myCurrentScheme;
00139 
00140 private:
00141 
00143     GUIVisualizationTextSettings parseTextSettings(
00144         const std::string& prefix, const SUMOSAXAttributes& attrs,
00145         GUIVisualizationTextSettings defaults);
00146 
00147 };
00148 
00149 #endif
00150 
00151 /****************************************************************************/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines