SUMO - Simulation of Urban MObility

NIVissimAbstractEdge.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // -------------------
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright (C) 2001-2011 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 NIVissimAbstractEdge_h
00020 #define NIVissimAbstractEdge_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 <map>
00033 #include <utils/common/VectorHelper.h>
00034 #include <utils/geom/PositionVector.h>
00035 
00036 
00037 // ===========================================================================
00038 // class definitions
00039 // ===========================================================================
00043 class NIVissimAbstractEdge {
00044 public:
00045     NIVissimAbstractEdge(int id, const PositionVector& geom);
00046     virtual ~NIVissimAbstractEdge();
00047     Position getGeomPosition(SUMOReal pos) const;
00048     void splitAssigning();
00049     bool crossesEdge(NIVissimAbstractEdge* c) const;
00050     Position crossesEdgeAtPoint(NIVissimAbstractEdge* c) const;
00051     bool overlapsWith(const AbstractPoly& p, SUMOReal offset=0.0) const;
00052     virtual void setNodeCluster(int nodeid) = 0;
00053     bool hasNodeCluster() const;
00054     SUMOReal crossesAtPoint(const Position& p1,
00055                             const Position& p2) const;
00056 
00057     virtual void buildGeom() = 0;
00058     int getID() const;
00059     const PositionVector& getGeometry() const;
00060 
00061     void addDisturbance(int disturbance);
00062 
00063     const IntVector& getDisturbances() const;
00064 
00065 public:
00066     static bool dictionary(int id, NIVissimAbstractEdge* e);
00067     static NIVissimAbstractEdge* dictionary(int id);
00068     static void splitAndAssignToNodes();
00069     static IntVector getWithin(const AbstractPoly& p, SUMOReal offset=0.0);
00070     static void clearDict();
00071 
00072 
00073 protected:
00074     int myID;
00075     PositionVector myGeom;
00076     IntVector myDisturbances;
00077     int myNode;
00078 
00079 private:
00080     typedef std::map<int, NIVissimAbstractEdge*> DictType;
00081     static DictType myDict;
00082 };
00083 
00084 
00085 #endif
00086 
00087 /****************************************************************************/
00088 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines