|
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/common/VectorHelper.h> 00036 #include <utils/geom/PositionVector.h> 00037 00038 00039 // =========================================================================== 00040 // class definitions 00041 // =========================================================================== 00045 class NIVissimAbstractEdge { 00046 public: 00047 NIVissimAbstractEdge(int id, const PositionVector& geom); 00048 virtual ~NIVissimAbstractEdge(); 00049 Position getGeomPosition(SUMOReal pos) const; 00050 void splitAssigning(); 00051 bool crossesEdge(NIVissimAbstractEdge* c) const; 00052 Position crossesEdgeAtPoint(NIVissimAbstractEdge* c) const; 00053 bool overlapsWith(const AbstractPoly& p, SUMOReal offset = 0.0) const; 00054 virtual void setNodeCluster(int nodeid) = 0; 00055 bool hasNodeCluster() const; 00056 SUMOReal crossesAtPoint(const Position& p1, 00057 const Position& p2) const; 00058 00059 virtual void buildGeom() = 0; 00060 int getID() const; 00061 const PositionVector& getGeometry() const; 00062 00063 void addDisturbance(int disturbance); 00064 00065 const IntVector& getDisturbances() const; 00066 00067 public: 00068 static bool dictionary(int id, NIVissimAbstractEdge* e); 00069 static NIVissimAbstractEdge* dictionary(int id); 00070 static void splitAndAssignToNodes(); 00071 static IntVector getWithin(const AbstractPoly& p, SUMOReal offset = 0.0); 00072 static void clearDict(); 00073 00074 00075 protected: 00076 int myID; 00077 PositionVector myGeom; 00078 IntVector myDisturbances; 00079 int myNode; 00080 00081 private: 00082 typedef std::map<int, NIVissimAbstractEdge*> DictType; 00083 static DictType myDict; 00084 }; 00085 00086 00087 #endif 00088 00089 /****************************************************************************/ 00090