SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MSJunction.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // The base class for an intersection
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef MSJunction_h
24 #define MSJunction_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
37 #include <vector>
38 #include <map>
39 #include <utils/geom/Position.h>
41 #include <utils/common/Named.h>
42 #include <utils/common/SUMOTime.h>
45 
46 
47 class MSVehicle;
48 class MSLink;
49 class MSLane;
50 class MSEdge;
51 
52 typedef std::vector<const MSEdge*> ConstMSEdgeVector;
53 
54 // ===========================================================================
55 // class definitions
56 // ===========================================================================
61 class MSJunction : public Named {
62 public:
68  MSJunction(const std::string& id,
69  SumoXMLNodeType type,
70  const Position& position,
71  const PositionVector& shape);
72 
73 
75  virtual ~MSJunction();
76 
77 
80  virtual void postloadInit();
81 
82 
84  const Position& getPosition() const;
85 
86 
90  const PositionVector& getShape() const {
91  return myShape;
92  }
93 
94  virtual const std::vector<MSLink*>& getFoeLinks(const MSLink* const /*srcLink*/) const {
95  return myEmptyLinks;
96  }
97 
98  virtual const std::vector<MSLane*>& getFoeInternalLanes(const MSLink* const /*srcLink*/) const {
99  return myEmptyLanes;
100  }
101 
102  inline const ConstMSEdgeVector& getIncoming() const {
103  return myIncoming;
104  }
105 
106  inline const ConstMSEdgeVector& getOutgoing() const {
107  return myOutgoing;
108  }
109 
110  void addIncoming(MSEdge* edge) {
111  myIncoming.push_back(edge);
112  }
113 
114  void addOutgoing(MSEdge* edge) {
115  myOutgoing.push_back(edge);
116  }
117 
120  return myType;
121  }
122 
123 
124 protected:
127 
130 
133 
134  std::vector<MSLink*> myEmptyLinks;
135  std::vector<MSLane*> myEmptyLanes;
136 
137 
142 
144  typedef std::map<std::string, MSJunction* > DictType;
145 
146 private:
148  MSJunction(const MSJunction&);
149 
152 
153 };
154 
155 
156 #endif
157 
158 /****************************************************************************/
159 
MSJunction & operator=(const MSJunction &)
Invalidated assignment operator.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
virtual const std::vector< MSLink * > & getFoeLinks(const MSLink *const ) const
Definition: MSJunction.h:94
void addIncoming(MSEdge *edge)
Definition: MSJunction.h:110
SumoXMLNodeType myType
Tye type of this junction.
Definition: MSJunction.h:126
The base class for an intersection.
Definition: MSJunction.h:61
ConstMSEdgeVector myOutgoing
outgoing edges
Definition: MSJunction.h:141
const PositionVector & getShape() const
Returns this junction's shape.
Definition: MSJunction.h:90
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSJunction.h:50
std::vector< MSLink * > myEmptyLinks
Definition: MSJunction.h:134
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:79
virtual ~MSJunction()
Destructor.
Definition: MSJunction.cpp:57
A road/street connecting two junctions.
Definition: MSEdge.h:81
ConstMSEdgeVector myIncoming
incoming edges
Definition: MSJunction.h:139
Position myPosition
The position of the junction.
Definition: MSJunction.h:129
MSJunction(const std::string &id, SumoXMLNodeType type, const Position &position, const PositionVector &shape)
Constructor.
Definition: MSJunction.cpp:52
std::map< std::string, MSJunction * > DictType
definition of the static dictionary type
Definition: MSJunction.h:144
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
SumoXMLNodeType getType() const
return the type of this Junction
Definition: MSJunction.h:119
const ConstMSEdgeVector & getOutgoing() const
Definition: MSJunction.h:106
void addOutgoing(MSEdge *edge)
Definition: MSJunction.h:114
Base class for objects which have an id.
Definition: Named.h:45
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
virtual void postloadInit()
Definition: MSJunction.cpp:67
virtual const std::vector< MSLane * > & getFoeInternalLanes(const MSLink *const ) const
Definition: MSJunction.h:98
PositionVector myShape
The shape of the junction.
Definition: MSJunction.h:132
const ConstMSEdgeVector & getIncoming() const
Definition: MSJunction.h:102
std::vector< MSLane * > myEmptyLanes
Definition: MSJunction.h:135
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
const Position & getPosition() const
Definition: MSJunction.cpp:61