SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00008 // ------------------- 00009 /****************************************************************************/ 00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00012 /****************************************************************************/ 00013 // 00014 // This file is part of SUMO. 00015 // SUMO is free software: you can redistribute it and/or modify 00016 // it under the terms of the GNU General Public License as published by 00017 // the Free Software Foundation, either version 3 of the License, or 00018 // (at your option) any later version. 00019 // 00020 /****************************************************************************/ 00021 #ifndef NIVissimAbstractEdge_h 00022 #define NIVissimAbstractEdge_h 00023 00024 00025 // =========================================================================== 00026 // included modules 00027 // =========================================================================== 00028 #ifdef _MSC_VER 00029 #include <windows_config.h> 00030 #else 00031 #include <config.h> 00032 #endif 00033 00034 #include <map> 00035 #include <utils/geom/PositionVector.h> 00036 00037 00038 // =========================================================================== 00039 // class definitions 00040 // =========================================================================== 00044 class NIVissimAbstractEdge { 00045 public: 00046 NIVissimAbstractEdge(int id, const PositionVector& geom); 00047 virtual ~NIVissimAbstractEdge(); 00048 Position getGeomPosition(SUMOReal pos) const; 00049 void splitAssigning(); 00050 bool crossesEdge(NIVissimAbstractEdge* c) const; 00051 Position crossesEdgeAtPoint(NIVissimAbstractEdge* c) const; 00052 bool overlapsWith(const AbstractPoly& p, SUMOReal offset = 0.0) const; 00053 virtual void setNodeCluster(int nodeid) = 0; 00054 bool hasNodeCluster() const; 00055 SUMOReal crossesAtPoint(const Position& p1, 00056 const Position& p2) const; 00057 00058 virtual void buildGeom() = 0; 00059 int getID() const; 00060 const PositionVector& getGeometry() const; 00061 00062 void addDisturbance(int disturbance); 00063 00064 const std::vector<int>& getDisturbances() const; 00065 00066 public: 00067 static bool dictionary(int id, NIVissimAbstractEdge* e); 00068 static NIVissimAbstractEdge* dictionary(int id); 00069 static void splitAndAssignToNodes(); 00070 static std::vector<int> getWithin(const AbstractPoly& p, SUMOReal offset = 0.0); 00071 static void clearDict(); 00072 00073 00074 protected: 00075 int myID; 00076 PositionVector myGeom; 00077 std::vector<int> myDisturbances; 00078 int myNode; 00079 00080 private: 00081 typedef std::map<int, NIVissimAbstractEdge*> DictType; 00082 static DictType myDict; 00083 }; 00084 00085 00086 #endif 00087 00088 /****************************************************************************/ 00089