SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // A reader for polygons and pois stored in XML-format 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 PCLoaderXML_h 00023 #define PCLoaderXML_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 <string> 00036 #include "PCPolyContainer.h" 00037 #include "PCTypeMap.h" 00038 #include <utils/xml/SUMOSAXHandler.h> 00039 #include <utils/common/UtilExceptions.h> 00040 00041 00042 // =========================================================================== 00043 // class definitions 00044 // =========================================================================== 00045 class OptionsCont; 00046 00047 00048 // =========================================================================== 00049 // class declarations 00050 // =========================================================================== 00058 class PCLoaderXML : public SUMOSAXHandler { 00059 public: 00071 static void loadIfSet(OptionsCont& oc, PCPolyContainer& toFill, 00072 PCTypeMap& tm) ; 00073 00074 00075 protected: 00081 PCLoaderXML(PCPolyContainer& toFill, 00082 PCTypeMap& tm, OptionsCont& oc) ; 00083 00084 00086 ~PCLoaderXML() ; 00087 00088 00089 protected: 00091 00092 00100 virtual void myStartElement(int element, 00101 const SUMOSAXAttributes& attrs) ; 00102 00103 00111 void myCharacters(int element, 00112 const std::string& chars) ; 00114 00115 00116 private: 00118 PCPolyContainer& myCont; 00119 00121 PCTypeMap& myTypeMap; 00122 00124 OptionsCont& myOptions; 00125 00126 00129 00131 std::string myCurrentID; 00132 00134 std::string myCurrentType; 00135 00137 RGBColor myCurrentColor; 00138 00140 bool myCurrentIgnorePrunning; 00141 00143 int myCurrentLayer; 00145 00146 00147 }; 00148 00149 00150 #endif 00151 00152 /****************************************************************************/ 00153