/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2017-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 Junction.cpp14/// @author Daniel Krajzewicz15/// @author Mario Krumnow16/// @author Jakob Erdmann17/// @author Michael Behrisch18/// @author Robert Hilbrich19/// @date 30.05.201220///21// C++ TraCI client API implementation22/****************************************************************************/23#include <config.h>2425#define LIBTRACI 126#include <libsumo/TraCIConstants.h>27#include <libsumo/Junction.h>28#include "Domain.h"29#include <libsumo/TraCIDefs.h>3031namespace libtraci {3233typedef Domain<libsumo::CMD_GET_JUNCTION_VARIABLE, libsumo::CMD_SET_JUNCTION_VARIABLE> Dom;343536// ===========================================================================37// member definitions38// ===========================================================================39std::vector<std::string>40Junction::getIDList() {41return Dom::getStringVector(libsumo::TRACI_ID_LIST, "");42}434445int46Junction::getIDCount() {47return Dom::getInt(libsumo::ID_COUNT, "");48}495051libsumo::TraCIPosition52Junction::getPosition(const std::string& junctionID, bool includeZ) {53return includeZ ? Dom::getPos3D(libsumo::VAR_POSITION3D, junctionID) : Dom::getPos(libsumo::VAR_POSITION, junctionID);54}555657libsumo::TraCIPositionVector58Junction::getShape(const std::string& junctionID) {59return Dom::getPolygon(libsumo::VAR_SHAPE, junctionID);60}616263const std::vector<std::string>64Junction::getIncomingEdges(const std::string& junctionID) {65return Dom::getStringVector(libsumo::INCOMING_EDGES, junctionID);66}676869const std::vector<std::string>70Junction::getOutgoingEdges(const std::string& junctionID) {71return Dom::getStringVector(libsumo::OUTGOING_EDGES, junctionID);72}737475LIBTRACI_PARAMETER_IMPLEMENTATION(Junction, JUNCTION)76LIBTRACI_SUBSCRIPTION_IMPLEMENTATION(Junction, JUNCTION)7778}798081/****************************************************************************/828384