Path: blob/main/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.cpp
169684 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file NIVissimExtendedEdgePoint.cpp14/// @author Daniel Krajzewicz15/// @author Michael Behrisch16/// @date Sept 200217///18// -------------------19/****************************************************************************/20#include <config.h>2122#include <utils/common/VectorHelper.h>23#include <netbuild/NBEdge.h>24#include "NIVissimExtendedEdgePoint.h"25#include "NIVissimEdge.h"262728// ===========================================================================29// method definitions30// ===========================================================================31NIVissimExtendedEdgePoint::NIVissimExtendedEdgePoint(32int edgeid, const std::vector<int>& lanes, double position,33const std::vector<int>& assignedVehicles)34: myEdgeID(edgeid), myLanes(lanes), myPosition(position),35myAssignedVehicles(assignedVehicles) {}363738NIVissimExtendedEdgePoint::~NIVissimExtendedEdgePoint() {}394041int42NIVissimExtendedEdgePoint::getEdgeID() const {43return myEdgeID;44}454647double48NIVissimExtendedEdgePoint::getPosition() const {49return myPosition;50}515253Position54NIVissimExtendedEdgePoint::getGeomPosition() const {55return56NIVissimAbstractEdge::dictionary(myEdgeID)->getGeomPosition(myPosition);57}585960const std::vector<int>&61NIVissimExtendedEdgePoint::getLanes() const {62return myLanes;63}646566void67NIVissimExtendedEdgePoint::recheckLanes(const NBEdge* const edge) {68// check whether an "all" indicator is there69bool hadAll = false;70for (std::vector<int>::const_iterator i = myLanes.begin(); !hadAll && i != myLanes.end(); ++i) {71if ((*i) == -1) {72hadAll = true;73}74}75// no -> return76if (!hadAll) {77return;78}79// patch lane indices80myLanes.clear();81for (int i = 0; i < (int) edge->getNumLanes(); ++i) {82myLanes.push_back(i);83}84}858687/****************************************************************************/888990