SUMO - Simulation of Urban MObility
GNECrossing.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A class for visualizing Inner Lanes (used when editing traffic lights)
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 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 GNECrossing_h
21 #define GNECrossing_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 // ===========================================================================
39 class PositionVector;
40 class GNEJunction;
41 class GNEEdge;
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
52 class GNECrossing : public GNENetElement {
53 public:
54 
59  GNECrossing(GNEJunction* parentJunction, NBNode::Crossing* crossing);
60 
62  virtual ~GNECrossing();
63 
65  void updateGeometry();
66 
69 
72 
75 
83 
92 
99 
104  void drawGL(const GUIVisualizationSettings& s) const;
106 
109  /* @brief method for getting the Attribute of an XML key
110  * @param[in] key The attribute key
111  * @return string with the value associated to key
112  */
113  std::string getAttribute(SumoXMLAttr key) const;
114 
115  /* @brief method for setting the attribute and letting the object perform additional changes
116  * @param[in] key The attribute key
117  * @param[in] value The new value
118  * @param[in] undoList The undoList on which to register changes
119  */
120  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
121 
122  /* @brief method for checking if the key and their correspond attribute are valids
123  * @param[in] key The attribute key
124  * @param[in] value The value asociated to key key
125  * @return true if the value is valid, false in other case
126  */
127  bool isValid(SumoXMLAttr key, const std::string& value);
129 
131  bool checkEdgeBelong(GNEEdge* edges) const;
132 
134  bool checkEdgeBelong(const std::vector<GNEEdge*>& edges) const;
135 
136 private:
139 
142 
145 
149  std::vector<double> myShapeRotations;
150 
152  std::vector<double> myShapeLengths;
154 
157 
159  void setAttribute(SumoXMLAttr key, const std::string& value);
160 
161 private:
163  GNECrossing(const GNECrossing&);
164 
167 };
168 
169 
170 #endif
171 
172 /****************************************************************************/
173 
bool checkEdgeBelong(GNEEdge *edges) const
return true if a edge belongs to crossing&#39;s edges
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Stores the information about how to visualize structures.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
GNECrossing(GNEJunction *parentJunction, NBNode::Crossing *crossing)
Constructor.
Definition: GNECrossing.cpp:58
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
void updateGeometry()
update pre-computed geometry information
Definition: GNECrossing.cpp:71
NBNode::Crossing * myCrossing
the data for this crossing
Definition: GNECrossing.h:141
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:52
std::vector< double > myShapeRotations
Definition: GNECrossing.h:149
A list of positions.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
GNECrossing & operator=(const GNECrossing &)
Invalidated assignment operator.
GNEJunction * getParentJunction() const
get parent Junction
Definition: GNECrossing.cpp:94
GNEJunction * myParentJunction
the parent junction of this crossing
Definition: GNECrossing.h:138
GUIGLObjectPopupMenu * myPopup
the created popup
Definition: GNECrossing.h:156
NBNode::Crossing * getNBCrossing() const
get referente to NBode::Crossing
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:58
The popup menu of a globject.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
virtual ~GNECrossing()
Destructor.
Definition: GNECrossing.cpp:67
A definition of a pedestrian crossing.
Definition: NBNode.h:135
bool isValid(SumoXMLAttr key, const std::string &value)
std::vector< double > myShapeLengths
The lengths of the shape parts.
Definition: GNECrossing.h:152
const PositionVector myShape
the shape of the edge
Definition: GNECrossing.h:144
A window containing a gl-object&#39;s parameter.