00001 /****************************************************************************/ 00007 // ------------------- 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 NIVissimNodeDef_Edges_h 00020 #define NIVissimNodeDef_Edges_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 00033 #include <string> 00034 #include <map> 00035 #include "NIVissimNodeParticipatingEdgeVector.h" 00036 #include "NIVissimExtendedEdgePoint.h" 00037 #include "NIVissimNodeDef.h" 00038 00039 class NIVissimNodeDef_Edges : 00040 public NIVissimNodeDef { 00041 public: 00042 NIVissimNodeDef_Edges(int id, const std::string &name, 00043 const NIVissimNodeParticipatingEdgeVector &edges); 00044 virtual ~NIVissimNodeDef_Edges(); 00045 static bool dictionary(int id, const std::string &name, 00046 const NIVissimNodeParticipatingEdgeVector &edges); 00047 // virtual void computeBounding(); 00048 virtual void searchAndSetConnections(); 00049 virtual SUMOReal getEdgePosition(int edgeid) const; 00050 00054 class id_matches { 00055 public: 00056 explicit id_matches(int id) : myEdgeID(id) { } 00057 bool operator()(NIVissimNodeParticipatingEdge *e) { 00058 return e->getID()==myEdgeID; 00059 } 00060 private: 00061 int myEdgeID; 00062 }; 00063 00064 class lying_within_match { 00065 public: 00066 explicit lying_within_match(NIVissimNodeParticipatingEdge *e) : myEdge(e) { } 00067 bool operator()(NIVissimExtendedEdgePoint *e) { 00068 return e->getEdgeID()==myEdge->getID() && 00069 myEdge->positionLiesWithin(e->getPosition()); 00070 } 00071 private: 00072 NIVissimNodeParticipatingEdge *myEdge; 00073 }; 00074 00075 protected: 00076 NIVissimNodeParticipatingEdgeVector myEdges; 00077 }; 00078 00079 00080 #endif 00081 00082 /****************************************************************************/ 00083
1.5.6