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.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // -------------------
19 /****************************************************************************/
20 #ifndef NIVissimConnection_h
21 #define NIVissimConnection_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
34 #include <map>
36 #include <utils/geom/Position.h>
38 #include "NIVissimAbstractEdge.h"
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class NBEdgeCont;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
54  public NIVissimAbstractEdge {
55 public:
56  /* enum Direction {
57  NIVC_DIR_RIGHT,
58  NIVC_DIR_LEFT,
59  NIVC_DIR_ALL
60  }; */
61 
62  NIVissimConnection(int id, const std::string& name,
63  const NIVissimExtendedEdgePoint& from_def,
64  const NIVissimExtendedEdgePoint& to_def,
65  const PositionVector& geom,
66  const std::vector<int>& assignedVehicles,
67  const NIVissimClosedLanesVector& clv);
68  virtual ~NIVissimConnection();
69  void computeBounding();
70  int getFromEdgeID() const;
71  int getToEdgeID() const;
72  double getFromPosition() const;
73  double getToPosition() const;
76  void setNodeCluster(int nodeid);
77  const Boundary& getBoundingBox() const;
78 
80 
81  void buildGeom();
82 
83 
92  void recheckLanes(const NBEdge* const fromEdge, const NBEdge* const toEdge);
93 
94 public:
95  const std::vector<int>& getFromLanes() const;
96  const std::vector<int>& getToLanes() const;
97 
98 
99 
100  static bool dictionary(int id, NIVissimConnection* o);
101  static NIVissimConnection* dictionary(int id);
102  static std::vector<int> getWithin(const AbstractPoly& poly);
103  static void buildNodeClusters();
104  static std::vector<int> getForEdge(int edgeid, bool omitNodeAssigned = true);
105  static void dict_buildNBEdgeConnections(NBEdgeCont& ec);
106  static void dict_assignToEdges();
107  static int getMaxID();
108 
109 private:
110  std::string myName;
112  std::vector<int> myAssignedVehicles;
114 private:
115  typedef std::map<int, NIVissimConnection*> DictType;
116  static DictType myDict;
117  static int myMaxID;
118 };
119 
120 
121 #endif
122 
123 /****************************************************************************/
124 
static DictType myDict
static void dict_buildNBEdgeConnections(NBEdgeCont &ec)
const std::vector< int > & getFromLanes() const
std::vector< NIVissimClosedLaneDef * > NIVissimClosedLanesVector
The representation of a single edge during network building.
Definition: NBEdge.h:70
std::map< int, NIVissimConnection * > DictType
NIVissimClosedLanesVector myClosedLanes
static void buildNodeClusters()
std::vector< int > myAssignedVehicles
const std::vector< int > & getToLanes() const
static bool dictionary(int id, NIVissimConnection *o)
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:47
NIVissimExtendedEdgePoint myFromDef
static void dict_assignToEdges()
static std::vector< int > getWithin(const AbstractPoly &poly)
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
A list of positions.
void setNodeCluster(int nodeid)
const Boundary & getBoundingBox() const
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
double getToPosition() const
void recheckLanes(const NBEdge *const fromEdge, const NBEdge *const toEdge)
Resets lane numbers if all lanes shall be used.
int buildEdgeConnections(NBEdgeCont &ec)
Position getToGeomPosition() const
Position getFromGeomPosition() const
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)
NIVissimExtendedEdgePoint myToDef
static std::vector< int > getForEdge(int edgeid, bool omitNodeAssigned=true)
double getFromPosition() const