/****************************************************************************/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 NGEdge.h14/// @author Markus Hartinger15/// @author Daniel Krajzewicz16/// @author Michael Behrisch17/// @date Mar, 200318///19// A netgen-representation of an edge20/****************************************************************************/21#pragma once22#include <config.h>2324#include <list>25#include <utils/common/Named.h>26#include <utils/common/UtilExceptions.h>27#include <utils/geom/Position.h>28#include <utils/geom/GeomHelper.h>293031// ===========================================================================32// class declarations33// ===========================================================================34class NGNode;35class NBNode;36class NBEdge;37class NBNetBuilder;383940// ===========================================================================41// class definitions42// ===========================================================================43/**44* @class NGEdge45* @brief A netgen-representation of an edge46*47* Please note that the edge makes itself known to the from- and the to-nodes48* on initialisation and removes this information from the nodes when being49* deleted. This implicates that nodes have to be deleted after the edges.50*/51class NGEdge : public Named {52public:53/** @brief Constructor54*55* Adds itself to the start and the end node's lists of connections.56*57* @param[in] id The id of the link58* @param[in] StarNGNode The begin node59* @param[in] EndNode The end node60*/61NGEdge(const std::string& id, NGNode* startNode, NGNode* endNode, const std::string& reverseID = "");626364/** @brief Destructor65*66* Removes itself from the start and the end node's lists of connections.67*/68~NGEdge();697071/** @brief Returns this link's start node72*73* @return The start node of the link74*/75NGNode* getStartNode() const {76return myStartNode;77}787980/** @brief Returns this link's end node81*82* @return The end node of the link83*/84NGNode* getEndNode() const {85return myEndNode;86}878889/** @brief Builds and returns this link's netbuild-representation90*91* Returns an edge built using the known values. Other values, such as the92* number of lanes, are gathered from defaults.93* The starting and the ending node must have been built in prior.94*95* @param[in] nb The netbuilder to retrieve the referenced nodes from96* @return The built edge97*/98NBEdge* buildNBEdge(NBNetBuilder& nb, std::string type, const bool reversed = false) const;99100101private:102/// @brief The node the edge starts at103NGNode* myStartNode;104105/// @brief The node the edge ends at106NGNode* myEndNode;107108/// @brief The id when building the reverse edge109const std::string myReverseID;110};111112113/**114* @typedef NGEdgeList115* @brief A list of edges (edge pointers)116*/117typedef std::list<NGEdge*> NGEdgeList;118119120