Eclipse SUMO - Simulation of Urban MObility
NIVissimConnection.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 /****************************************************************************/
19 // -------------------
20 /****************************************************************************/
21 #pragma once
22 #include <config.h>
23 
24 #include <string>
25 #include <map>
27 #include <utils/geom/Position.h>
29 #include "NIVissimAbstractEdge.h"
32 
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 class NBEdgeCont;
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
45  public NIVissimAbstractEdge {
46 public:
47  /* enum Direction {
48  NIVC_DIR_RIGHT,
49  NIVC_DIR_LEFT,
50  NIVC_DIR_ALL
51  }; */
52 
53  NIVissimConnection(int id, const std::string& name,
54  const NIVissimExtendedEdgePoint& from_def,
55  const NIVissimExtendedEdgePoint& to_def,
56  const PositionVector& geom,
57  const std::vector<int>& assignedVehicles,
58  const NIVissimClosedLanesVector& clv);
59  virtual ~NIVissimConnection();
60  void computeBounding();
61  int getFromEdgeID() const;
62  int getToEdgeID() const;
63  double getFromPosition() const;
64  double getToPosition() const;
67  void setNodeCluster(int nodeid);
68  const Boundary& getBoundingBox() const;
69 
71 
72  void buildGeom();
73 
74 
83  void recheckLanes(const NBEdge* const fromEdge, const NBEdge* const toEdge);
84 
85 public:
86  const std::vector<int>& getFromLanes() const;
87  const std::vector<int>& getToLanes() const;
88 
89 
90 
91  static bool dictionary(int id, NIVissimConnection* o);
92  static NIVissimConnection* dictionary(int id);
93  static std::vector<int> getWithin(const AbstractPoly& poly);
94  static void buildNodeClusters();
95  static std::vector<int> getForEdge(int edgeid, bool omitNodeAssigned = true);
96  static void dict_buildNBEdgeConnections(NBEdgeCont& ec);
97  static void dict_assignToEdges();
98  static int getMaxID();
99 
100 private:
101  std::string myName;
103  std::vector<int> myAssignedVehicles;
105 private:
106  typedef std::map<int, NIVissimConnection*> DictType;
107  static DictType myDict;
108  static int myMaxID;
109 };
std::vector< NIVissimClosedLaneDef * > NIVissimClosedLanesVector
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:59
The representation of a single edge during network building.
Definition: NBEdge.h:92
std::map< int, NIVissimAbstractEdge * > DictType
static void buildNodeClusters()
NIVissimExtendedEdgePoint myToDef
static DictType myDict
NIVissimConnection(int id, const std::string &name, const NIVissimExtendedEdgePoint &from_def, const NIVissimExtendedEdgePoint &to_def, const PositionVector &geom, const std::vector< int > &assignedVehicles, const NIVissimClosedLanesVector &clv)
static std::vector< int > getWithin(const AbstractPoly &poly)
const std::vector< int > & getFromLanes() const
static void dict_buildNBEdgeConnections(NBEdgeCont &ec)
double getFromPosition() const
void setNodeCluster(int nodeid)
static std::vector< int > getForEdge(int edgeid, bool omitNodeAssigned=true)
NIVissimExtendedEdgePoint myFromDef
const Boundary & getBoundingBox() const
int buildEdgeConnections(NBEdgeCont &ec)
const std::vector< int > & getToLanes() const
static void dict_assignToEdges()
static bool dictionary(int id, NIVissimConnection *o)
Position getToGeomPosition() const
std::vector< int > myAssignedVehicles
std::map< int, NIVissimConnection * > DictType
double getToPosition() const
NIVissimClosedLanesVector myClosedLanes
Position getFromGeomPosition() const
void recheckLanes(const NBEdge *const fromEdge, const NBEdge *const toEdge)
Resets lane numbers if all lanes shall be used.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
A list of positions.