Eclipse SUMO - Simulation of Urban MObility
NGEdge.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // A netgen-representation of an edge
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <list>
26 #include <utils/common/Named.h>
28 #include <utils/geom/Position.h>
29 #include <utils/geom/GeomHelper.h>
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class NGNode;
36 class NBNode;
37 class NBEdge;
38 class NBNetBuilder;
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
52 class NGEdge : public Named {
53 public:
62  NGEdge(const std::string& id, NGNode* startNode, NGNode* endNode, const std::string& reverseID = "");
63 
64 
69  ~NGEdge();
70 
71 
76  NGNode* getStartNode() const {
77  return myStartNode;
78  }
79 
80 
85  NGNode* getEndNode() const {
86  return myEndNode;
87  }
88 
89 
99  NBEdge* buildNBEdge(NBNetBuilder& nb, std::string type, const bool reversed = false) const;
100 
101 
102 private:
105 
108 
110  const std::string myReverseID;
111 };
112 
113 
118 typedef std::list<NGEdge*> NGEdgeList;
std::list< NGEdge * > NGEdgeList
A list of edges (edge pointers)
Definition: NGEdge.h:118
The representation of a single edge during network building.
Definition: NBEdge.h:92
Instance responsible for building networks.
Definition: NBNetBuilder.h:107
Represents a single node (junction) during network building.
Definition: NBNode.h:66
A netgen-representation of an edge.
Definition: NGEdge.h:52
const std::string myReverseID
The id when building the reverse edge.
Definition: NGEdge.h:110
NBEdge * buildNBEdge(NBNetBuilder &nb, std::string type, const bool reversed=false) const
Builds and returns this link's netbuild-representation.
Definition: NGEdge.cpp:63
NGNode * getStartNode() const
Returns this link's start node.
Definition: NGEdge.h:76
~NGEdge()
Destructor.
Definition: NGEdge.cpp:56
NGNode * myStartNode
The node the edge starts at.
Definition: NGEdge.h:104
NGNode * myEndNode
The node the edge ends at.
Definition: NGEdge.h:107
NGNode * getEndNode() const
Returns this link's end node.
Definition: NGEdge.h:85
NGEdge(const std::string &id, NGNode *startNode, NGNode *endNode, const std::string &reverseID="")
Constructor.
Definition: NGEdge.cpp:49
A netgen-representation of a node.
Definition: NGNode.h:48
Base class for objects which have an id.
Definition: Named.h:54