SUMO - Simulation of Urban MObility
GNEConnection.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A class for represent connections between Lanes
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GNEConnection_h
21 #define GNEConnection_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 "GNENetElement.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class GNEEdge;
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
44 
45 class GNEConnection : public GNENetElement {
46 public:
57  GNEConnection(GNEEdge* edgeFrom, GNEEdge* edgeTo, GNELane* fromLane, GNELane* toLane, bool pass, bool keepClear, SUMOReal contPos, bool uncontrolled);
58 
61 
64  void updateGeometry();
65 
69 
71  GNEEdge* getEdgeTo();
72 
75 
77  GNELane* getToLane();
78 
80  int getFromLaneIndex();
81 
83  int getToLaneIndex();
84 
86  bool getPass();
87 
89  bool getKeepClear();
90 
93 
95  bool getUncontrolled();
96 
98  void setPass(bool pass);
99 
101  void setKeepClear(bool keepClear);
102 
104  void setContPos(SUMOReal contPos);
105 
107  void setUncontrolled(bool uncontrolled);
108 
111 
119 
128 
134 
139  void drawGL(const GUIVisualizationSettings& s) const;
141 
144  /* @brief method for getting the Attribute of an XML key
145  * @param[in] key The attribute key
146  * @return string with the value associated to key
147  */
148  std::string getAttribute(SumoXMLAttr key) const;
149 
150  /* @brief method for setting the attribute and letting the object perform additional changes
151  * @param[in] key The attribute key
152  * @param[in] value The new value
153  * @param[in] undoList The undoList on which to register changes
154  */
155  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
156 
157  /* @brief method for checking if the key and their conrrespond attribute are valids
158  * @param[in] key The attribute key
159  * @param[in] value The value asociated to key key
160  * @return true if the value is valid, false in other case
161  */
162  bool isValid(SumoXMLAttr key, const std::string& value);
164 
165 protected:
168 
171 
174 
177 
179  bool myPass;
180 
183 
186 
189 
190 private:
192  void setAttribute(SumoXMLAttr key, const std::string& value);
193 
196 
199 };
200 
201 
202 #endif
203 
204 /****************************************************************************/
205 
int getFromLaneIndex()
get lane index of the incoming lane
GNEEdge * getEdgeTo()
get the name of the edge the vehicles may reach when leaving "from"
void updateGeometry()
update pre-computed geometry information
void setKeepClear(bool keepClear)
set parameter keepClear
bool isValid(SumoXMLAttr key, const std::string &value)
Stores the information about how to visualize structures.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GNEEdge * myEdgeTo
The name of the edge the vehicles may reach when leaving "from".
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
bool getKeepClear()
get parameter keepClear
GNELane * myFromLane
the incoming lane
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
GNEEdge * myEdgeFrom
The name of the edge the vehicles leave.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
bool myPass
if set, vehicles which pass this (lane-2-lane) connection) will not wait
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
int getToLaneIndex()
get lane index of the outgoing lane
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
bool getPass()
get parameter pass
bool myKeepClear
if set to false, vehicles which pass this (lane-2-lane) connection) will not worry about blocking the...
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNELane * myToLane
the outgoing lane
~GNEConnection()
Destructor.
GNEConnection & operator=(const GNEConnection &)
Invalidated assignment operator.
SUMOReal myContPos
if set to 0, no internal junction will be built for this connection. If set to a positive value...
GNELane * getFromLane()
the get incoming lane
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:54
void setUncontrolled(bool uncontrolled)
set parameter uncontrolled
void setPass(bool pass)
set parameter pass
The popup menu of a globject.
void setContPos(SUMOReal contPos)
set parameter ContPos
SUMOReal getContPos()
get parameter ContPos
#define SUMOReal
Definition: config.h:214
bool getUncontrolled()
get parameter uncontrolled
GNELane * getToLane()
get outgoing lane
GNEConnection(GNEEdge *edgeFrom, GNEEdge *edgeTo, GNELane *fromLane, GNELane *toLane, bool pass, bool keepClear, SUMOReal contPos, bool uncontrolled)
Constructor.
std::string getAttribute(SumoXMLAttr key) const
A window containing a gl-object&#39;s parameter.
GNEEdge * getEdgeFrom()
get the name of the edge the vehicles leave
bool myUncontrolled
if set to true, This connection will not be TLS-controlled despite its node being controlled...