00001 /****************************************************************************/ 00007 // Interface for building edges 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 NLEdgeControlBuilder_h 00020 #define NLEdgeControlBuilder_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 <vector> 00034 #include <microsim/MSEdge.h> 00035 #include <utils/geom/Position2DVector.h> 00036 00037 00038 // =========================================================================== 00039 // class declarations 00040 // =========================================================================== 00041 class MSEdgeControl; 00042 class MSLane; 00043 class MSNet; 00044 class OutputDevice; 00045 00046 00047 // =========================================================================== 00048 // class definitions 00049 // =========================================================================== 00061 class NLEdgeControlBuilder { 00062 public: 00064 typedef std::vector<MSEdge*> EdgeCont; 00065 00066 public: 00068 NLEdgeControlBuilder(); 00069 00070 00072 virtual ~NLEdgeControlBuilder(); 00073 00074 00086 void beginEdgeParsing(const std::string &id, 00087 MSEdge::EdgeBasicFunction function) throw(InvalidArgument); 00088 00089 00096 virtual MSLane *addLane(const std::string &id, SUMOReal maxSpeed, 00097 SUMOReal length, bool isDepart, const Position2DVector &shape, 00098 const std::vector<SUMOVehicleClass> &allowed, 00099 const std::vector<SUMOVehicleClass> &disallowed); 00100 00101 00104 virtual MSEdge *closeEdge(); 00105 00107 MSEdgeControl *build(); 00108 00109 00118 virtual MSEdge *buildEdge(const std::string &id) throw(); 00119 00120 00121 protected: 00123 unsigned int myCurrentNumericalLaneID; 00124 00126 unsigned int myCurrentNumericalEdgeID; 00127 00129 EdgeCont myEdges; 00130 00132 MSEdge *myActiveEdge; 00133 00135 std::vector<MSLane*> *m_pLaneStorage; 00136 00138 MSLane *m_pDepartLane; 00139 00141 unsigned int m_iNoSingle; 00142 00144 unsigned int m_iNoMulti; 00145 00147 MSEdge::EdgeBasicFunction m_Function; 00148 00149 private: 00151 NLEdgeControlBuilder(const NLEdgeControlBuilder &s); 00152 00154 NLEdgeControlBuilder &operator=(const NLEdgeControlBuilder &s); 00155 00156 }; 00157 00158 00159 #endif 00160 00161 /****************************************************************************/ 00162
1.5.6