SUMO - Simulation of Urban MObility
NIVissimConnection.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // -------------------
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef NIVissimConnection_h
22 #define NIVissimConnection_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <map>
37 #include <utils/geom/Position.h>
39 #include "NIVissimAbstractEdge.h"
42 
43 
44 // ===========================================================================
45 // class declarations
46 // ===========================================================================
47 class NBEdgeCont;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
55  public NIVissimAbstractEdge {
56 public:
57  /* enum Direction {
58  NIVC_DIR_RIGHT,
59  NIVC_DIR_LEFT,
60  NIVC_DIR_ALL
61  }; */
62 
63  NIVissimConnection(int id, const std::string& name,
64  const NIVissimExtendedEdgePoint& from_def,
65  const NIVissimExtendedEdgePoint& to_def,
66  const PositionVector& geom,
67  const std::vector<int>& assignedVehicles,
68  const NIVissimClosedLanesVector& clv);
69  virtual ~NIVissimConnection();
70  void computeBounding();
71  int getFromEdgeID() const;
72  int getToEdgeID() const;
73  SUMOReal getFromPosition() const;
74  SUMOReal getToPosition() const;
77  void setNodeCluster(int nodeid);
78  const Boundary& getBoundingBox() const;
79 
81 
82  void buildGeom();
83 
84 
93  void recheckLanes(const NBEdge* const fromEdge, const NBEdge* const toEdge);
94 
95 public:
96  const std::vector<int>& getFromLanes() const;
97  const std::vector<int>& getToLanes() const;
98 
99 
100 
101  static bool dictionary(int id, NIVissimConnection* o);
102  static NIVissimConnection* dictionary(int id);
103  static std::vector<int> getWithin(const AbstractPoly& poly);
104  static void buildNodeClusters();
105  static std::vector<int> getForEdge(int edgeid, bool omitNodeAssigned = true);
106  static void dict_buildNBEdgeConnections(NBEdgeCont& ec);
107  static void dict_assignToEdges();
108  static int getMaxID();
109 
110 private:
111  std::string myName;
113  std::vector<int> myAssignedVehicles;
115 private:
116  typedef std::map<int, NIVissimConnection*> DictType;
117  static DictType myDict;
118  static int myMaxID;
119 };
120 
121 
122 #endif
123 
124 /****************************************************************************/
125 
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:71
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:48
NIVissimExtendedEdgePoint myFromDef
static void dict_assignToEdges()
static std::vector< int > getWithin(const AbstractPoly &poly)
SUMOReal getFromPosition() const
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
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
void recheckLanes(const NBEdge *const fromEdge, const NBEdge *const toEdge)
Resets lane numbers if all lanes shall be used.
int buildEdgeConnections(NBEdgeCont &ec)
SUMOReal getToPosition() const
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)
#define SUMOReal
Definition: config.h:213
NIVissimExtendedEdgePoint myToDef
static std::vector< int > getForEdge(int edgeid, bool omitNodeAssigned=true)