00001 /****************************************************************************/ 00007 // A reader for polygons and pois stored in XML-format 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright 2001-2010 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 PCLoaderXML_h 00020 #define PCLoaderXML_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 "PCPolyContainer.h" 00034 #include "PCTypeMap.h" 00035 #include <utils/xml/SUMOSAXHandler.h> 00036 #include <utils/common/UtilExceptions.h> 00037 00038 00039 // =========================================================================== 00040 // class definitions 00041 // =========================================================================== 00042 class OptionsCont; 00043 00044 00045 // =========================================================================== 00046 // class declarations 00047 // =========================================================================== 00055 class PCLoaderXML : public SUMOSAXHandler { 00056 public: 00068 static void loadIfSet(OptionsCont &oc, PCPolyContainer &toFill, 00069 PCTypeMap &tm) throw(ProcessError); 00070 00071 00072 protected: 00078 PCLoaderXML(PCPolyContainer &toFill, 00079 PCTypeMap &tm, OptionsCont &oc) throw(); 00080 00081 00083 ~PCLoaderXML() throw(); 00084 00085 00086 protected: 00088 00089 00097 virtual void myStartElement(SumoXMLTag element, 00098 const SUMOSAXAttributes &attrs) throw(ProcessError); 00099 00100 00108 void myCharacters(SumoXMLTag element, 00109 const std::string &chars) throw(ProcessError); 00111 00112 00113 private: 00115 PCPolyContainer &myCont; 00116 00118 PCTypeMap &myTypeMap; 00119 00121 OptionsCont &myOptions; 00122 00123 00126 00128 std::string myCurrentID; 00129 00131 std::string myCurrentType; 00132 00134 RGBColor myCurrentColor; 00135 00137 bool myCurrentIgnorePrunning; 00138 00140 int myCurrentLayer; 00142 00143 00144 }; 00145 00146 00147 #endif 00148 00149 /****************************************************************************/ 00150
1.5.6