NIVissimExtendedEdgePoint.cpp

Go to the documentation of this file.
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 
00020 
00021 // ===========================================================================
00022 // included modules
00023 // ===========================================================================
00024 #ifdef _MSC_VER
00025 #include <windows_config.h>
00026 #else
00027 #include <config.h>
00028 #endif
00029 
00030 #include <utils/common/VectorHelper.h>
00031 #include <netbuild/NBEdge.h>
00032 #include "NIVissimExtendedEdgePoint.h"
00033 #include "NIVissimEdge.h"
00034 
00035 #ifdef CHECK_MEMORY_LEAKS
00036 #include <foreign/nvwa/debug_new.h>
00037 #endif // CHECK_MEMORY_LEAKS
00038 
00039 
00040 // ===========================================================================
00041 // method definitions
00042 // ===========================================================================
00043 NIVissimExtendedEdgePoint::NIVissimExtendedEdgePoint(
00044     int edgeid, const IntVector &lanes, SUMOReal position,
00045     const IntVector &assignedVehicles) throw()
00046         : myEdgeID(edgeid), myLanes(lanes), myPosition(position),
00047         myAssignedVehicles(assignedVehicles) {}
00048 
00049 
00050 NIVissimExtendedEdgePoint::~NIVissimExtendedEdgePoint() {}
00051 
00052 
00053 int
00054 NIVissimExtendedEdgePoint::getEdgeID() const {
00055     return myEdgeID;
00056 }
00057 
00058 
00059 SUMOReal
00060 NIVissimExtendedEdgePoint::getPosition() const {
00061     return myPosition;
00062 }
00063 
00064 
00065 Position2D
00066 NIVissimExtendedEdgePoint::getGeomPosition() const {
00067     return
00068         NIVissimAbstractEdge::dictionary(myEdgeID)->getGeomPosition(myPosition);
00069 }
00070 
00071 
00072 const IntVector &
00073 NIVissimExtendedEdgePoint::getLanes() const {
00074     return myLanes;
00075 }
00076 
00077 
00078 void
00079 NIVissimExtendedEdgePoint::recheckLanes(const NBEdge * const edge) throw() {
00080     // check whether an "all" indicator is there
00081     bool hadAll = false;
00082     for (IntVector::const_iterator i=myLanes.begin(); !hadAll&&i!=myLanes.end(); ++i) {
00083         if ((*i)==-1) {
00084             hadAll = true;
00085         }
00086     }
00087     // no -> return
00088     if (!hadAll) {
00089         return;
00090     }
00091     // patch lane indices
00092     myLanes.clear();
00093     for (int i=0; i<(int) edge->getNoLanes(); ++i) {
00094         myLanes.push_back(i);
00095     }
00096 }
00097 
00098 
00099 /****************************************************************************/
00100 

Generated on Wed May 5 00:06:34 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6