SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // ------------------- 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00011 /****************************************************************************/ 00012 // 00013 // This file is part of SUMO. 00014 // SUMO is free software: you can redistribute it and/or modify 00015 // it under the terms of the GNU General Public License as published by 00016 // the Free Software Foundation, either version 3 of the License, or 00017 // (at your option) any later version. 00018 // 00019 /****************************************************************************/ 00020 00021 00022 // =========================================================================== 00023 // included modules 00024 // =========================================================================== 00025 #ifdef _MSC_VER 00026 #include <windows_config.h> 00027 #else 00028 #include <config.h> 00029 #endif 00030 00031 00032 #include "NIVissimEdge.h" 00033 #include "NIVissimConnection.h" 00034 #include "NIVissimNodeParticipatingEdge.h" 00035 00036 #ifdef CHECK_MEMORY_LEAKS 00037 #include <foreign/nvwa/debug_new.h> 00038 #endif // CHECK_MEMORY_LEAKS 00039 00040 00041 00042 NIVissimNodeParticipatingEdge::NIVissimNodeParticipatingEdge( 00043 int edgeid, SUMOReal frompos, SUMOReal topos) 00044 : myEdgeID(edgeid), myFromPos(frompos), myToPos(topos) {} 00045 00046 NIVissimNodeParticipatingEdge::~NIVissimNodeParticipatingEdge() {} 00047 00048 00049 int 00050 NIVissimNodeParticipatingEdge::getID() const { 00051 return myEdgeID; 00052 } 00053 00054 00055 bool 00056 NIVissimNodeParticipatingEdge::positionLiesWithin(SUMOReal pos) const { 00057 return 00058 (myFromPos < myToPos && myFromPos >= pos && myToPos <= pos) 00059 || 00060 (myFromPos > myToPos && myFromPos <= pos && myToPos >= pos); 00061 } 00062 00063 SUMOReal 00064 NIVissimNodeParticipatingEdge::getFromPos() const { 00065 return myFromPos; 00066 } 00067 00068 00069 SUMOReal 00070 NIVissimNodeParticipatingEdge::getToPos() const { 00071 return myToPos; 00072 } 00073 00074 00075 00076 /****************************************************************************/ 00077