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-sim.org/
11 // Copyright (C) 2001-2014 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 {
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  Direction direction, SUMOReal dxnothalt, SUMOReal dxeinordnen,
68  SUMOReal zuschlag1, SUMOReal zuschlag2, SUMOReal seglength,
69  const std::vector<int>& assignedVehicles,
70  const NIVissimClosedLanesVector& clv);
71  virtual ~NIVissimConnection();
72  void computeBounding();
73  int getFromEdgeID() const;
74  int getToEdgeID() const;
75  SUMOReal getFromPosition() const;
76  SUMOReal getToPosition() const;
79  void setNodeCluster(int nodeid);
80  const Boundary& getBoundingBox() const;
81 
82  unsigned int buildEdgeConnections(NBEdgeCont& ec);
83 
84  void buildGeom();
85 
86 
95  void recheckLanes(const NBEdge* const fromEdge, const NBEdge* const toEdge);
96 
97 public:
98  const std::vector<int>& getFromLanes() const;
99  const std::vector<int>& getToLanes() const;
100 
101 
102 
103  static bool dictionary(int id, const std::string& name,
104  const NIVissimExtendedEdgePoint& from_def,
105  const NIVissimExtendedEdgePoint& to_def,
106  const PositionVector& geom,
107  Direction direction, SUMOReal dxnothalt, SUMOReal dxeinordnen,
108  SUMOReal zuschlag1, SUMOReal zuschlag2, SUMOReal seglength,
109  const std::vector<int>& assignedVehicles,
110  const NIVissimClosedLanesVector& clv);
111  static bool dictionary(int id, NIVissimConnection* o);
112  static NIVissimConnection* dictionary(int id);
113  static std::vector<int> getWithin(const AbstractPoly& poly);
114  static void buildNodeClusters();
115  static std::vector<int> getForEdge(int edgeid, bool omitNodeAssigned = true);
116  static void dict_buildNBEdgeConnections(NBEdgeCont& ec);
117  static void dict_assignToEdges();
118  static int getMaxID();
119 
120 private:
121  std::string myName;
126  std::vector<int> myAssignedVehicles;
128 private:
129  typedef std::map<int, NIVissimConnection*> DictType;
130  static DictType myDict;
131  static int myMaxID;
132 };
133 
134 
135 #endif
136 
137 /****************************************************************************/
138 
SUMOReal getFromPosition() const
static DictType myDict
const std::vector< int > & getToLanes() const
static void dict_buildNBEdgeConnections(NBEdgeCont &ec)
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
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
Position getToGeomPosition() const
NIVissimExtendedEdgePoint myFromDef
static void dict_assignToEdges()
NIVissimConnection(int id, const std::string &name, const NIVissimExtendedEdgePoint &from_def, const NIVissimExtendedEdgePoint &to_def, const PositionVector &geom, Direction direction, SUMOReal dxnothalt, SUMOReal dxeinordnen, SUMOReal zuschlag1, SUMOReal zuschlag2, SUMOReal seglength, const std::vector< int > &assignedVehicles, const NIVissimClosedLanesVector &clv)
static std::vector< int > getWithin(const AbstractPoly &poly)
SUMOReal getToPosition() const
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
void setNodeCluster(int nodeid)
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
const Boundary & getBoundingBox() const
void recheckLanes(const NBEdge *const fromEdge, const NBEdge *const toEdge)
Resets lane numbers if all lanes shall be used.
const std::vector< int > & getFromLanes() const
static bool dictionary(int id, const std::string &name, const NIVissimExtendedEdgePoint &from_def, const NIVissimExtendedEdgePoint &to_def, const PositionVector &geom, Direction direction, SUMOReal dxnothalt, SUMOReal dxeinordnen, SUMOReal zuschlag1, SUMOReal zuschlag2, SUMOReal seglength, const std::vector< int > &assignedVehicles, const NIVissimClosedLanesVector &clv)
#define SUMOReal
Definition: config.h:215
NIVissimExtendedEdgePoint myToDef
Position getFromGeomPosition() const
static std::vector< int > getForEdge(int edgeid, bool omitNodeAssigned=true)
unsigned int buildEdgeConnections(NBEdgeCont &ec)