SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // A reader for a SUMO network's projection description 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 PCNetProjectionLoader_h 00023 #define PCNetProjectionLoader_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 <utils/xml/SUMOSAXHandler.h> 00037 #include <utils/common/UtilExceptions.h> 00038 #include <utils/geom/Position.h> 00039 00040 00041 // =========================================================================== 00042 // class definitions 00043 // =========================================================================== 00044 class OptionsCont; 00045 00046 00047 // =========================================================================== 00048 // class declarations 00049 // =========================================================================== 00054 class PCNetProjectionLoader : public SUMOSAXHandler { 00055 public: 00069 static void loadIfSet(OptionsCont& oc, Position& netOffset, Boundary& origNetBoundary, 00070 Boundary& convNetBoundary, std::string& projParameter) ; 00071 00072 00073 protected: 00080 PCNetProjectionLoader(Position& netOffset, 00081 Boundary& origNetBoundary, Boundary& convNetBoundary, std::string& projParameter) ; 00082 00083 00085 ~PCNetProjectionLoader() ; 00086 00087 00091 bool hasReadAll() const ; 00092 00093 00094 protected: 00096 00097 00105 virtual void myStartElement(int element, 00106 const SUMOSAXAttributes& attrs) ; 00107 00108 00116 void myCharacters(int element, 00117 const std::string& chars) ; 00119 00120 00121 private: 00123 Position& myNetOffset; 00124 00126 Boundary& myOrigNetBoundary; 00127 00129 Boundary& myConvNetBoundary; 00130 00132 std::string& myProjParameter; 00133 00135 bool myFoundOffset, myFoundOrigNetBoundary, myFoundConvNetBoundary, myFoundProj; 00136 00137 00138 }; 00139 00140 00141 #endif 00142 00143 /****************************************************************************/ 00144