SUMO - Simulation of Urban MObility

GUISettingsHandler.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // The handler for parsing gui settings from xml.
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 GUISettingsHandler_h
00020 #define GUISettingsHandler_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 <utils/gui/windows/GUISUMOAbstractView.h>
00033 #include <utils/xml/SUMOSAXHandler.h>
00034 #include <utils/xml/XMLSubSys.h>
00035 
00036 
00037 // ===========================================================================
00038 // class definitions
00039 // ===========================================================================
00043 class GUISettingsHandler : public SUMOSAXHandler {
00044 public:
00048     GUISettingsHandler(const std::string& content, bool isFile=true) throw();
00049 
00050 
00052     ~GUISettingsHandler() throw();
00053 
00054 
00055 
00057 
00058 
00065     void myStartElement(int element, const SUMOSAXAttributes& attrs) throw(ProcessError);
00067 
00068 
00069 
00073     std::string addSettings(GUISUMOAbstractView* view=0) const throw();
00074 
00075 
00079     void setViewport(GUISUMOAbstractView* view) const throw();
00080 
00081 
00087     void setViewport(SUMOReal& zoom, SUMOReal& xoff, SUMOReal& yoff) const throw();
00088 
00089 
00094     void setSnapshots(GUISUMOAbstractView* view) const throw();
00095 
00096 
00100     bool hasDecals() const throw();
00101 
00102 
00106     const std::vector<GUISUMOAbstractView::Decal>& getDecals() const throw();
00107 
00108 
00112     SUMOReal getDelay() const throw();
00113 
00114 
00115 private:
00117     GUIVisualizationSettings mySettings;
00118 
00120     SUMOReal myDelay;
00121 
00123     SUMOReal myZoom, myXPos, myYPos;
00124 
00126     std::map<SUMOTime, std::string> mySnapshots;
00127 
00129     std::vector<GUISUMOAbstractView::Decal> myDecals;
00130 
00132     int myCurrentColorer;
00133 
00135     GUIColorScheme* myCurrentScheme;
00136 
00137 private:
00138 
00140     GUIVisualizationTextSettings parseTextSettings(
00141         const std::string& prefix, const SUMOSAXAttributes& attrs,
00142         GUIVisualizationTextSettings defaults);
00143 
00144 };
00145 
00146 #endif
00147 
00148 /****************************************************************************/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines