NGEdge.cpp
Go to the documentation of this file.00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifdef _MSC_VER
00025 #include <windows_config.h>
00026 #else
00027 #include <config.h>
00028 #endif
00029
00030 #include <algorithm>
00031 #include <netbuild/NBNode.h>
00032 #include <netbuild/NBNodeCont.h>
00033 #include <netbuild/NBEdge.h>
00034 #include <netbuild/NBOwnTLDef.h>
00035 #include <netbuild/NBTypeCont.h>
00036 #include <netbuild/NBTrafficLightLogicCont.h>
00037 #include <netbuild/NBNetBuilder.h>
00038 #include <utils/common/UtilExceptions.h>
00039 #include <utils/common/ToString.h>
00040 #include <utils/geom/GeoConvHelper.h>
00041 #include <utils/options/OptionsCont.h>
00042 #include <utils/options/Option.h>
00043 #include "NGEdge.h"
00044 #include "NGNode.h"
00045
00046 #ifdef CHECK_MEMORY_LEAKS
00047 #include <foreign/nvwa/debug_new.h>
00048 #endif // CHECK_MEMORY_LEAKS
00049
00050
00051
00052
00053
00054
00055
00056
00057 NGEdge::NGEdge(const std::string &id, NGNode *startNode, NGNode *endNode) throw()
00058 : myID(id), myStartNode(startNode), myEndNode(endNode) {
00059 myStartNode->addLink(this);
00060 myEndNode->addLink(this);
00061 }
00062
00063
00064 NGEdge::~NGEdge() throw() {
00065 myStartNode->removeLink(this);
00066 myEndNode->removeLink(this);
00067 }
00068
00069
00070 NBEdge *
00071 NGEdge::buildNBEdge(NBNetBuilder &nb) const throw(ProcessError) {
00072 return new NBEdge(
00073 myID,
00074 nb.getNodeCont().retrieve(myStartNode->getID()),
00075 nb.getNodeCont().retrieve(myEndNode->getID()),
00076 "netgen-default",
00077 nb.getTypeCont().getDefaultSpeed(),
00078 nb.getTypeCont().getDefaultNoLanes(),
00079 nb.getTypeCont().getDefaultPriority()
00080 );
00081 }
00082
00083
00084
00085