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-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 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 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
51 class GNECrossing : public GNENetElement {
52 
53 public:
54 
61  GNECrossing(GNEJunction& parentJunction, const std::string& id);
62 
64  virtual ~GNECrossing();
65 
67  void updateGeometry();
68 
71 
79 
88 
95 
100  void drawGL(const GUIVisualizationSettings& s) const;
102 
105  /* @brief method for getting the Attribute of an XML key
106  * @param[in] key The attribute key
107  * @return string with the value associated to key
108  */
109  std::string getAttribute(SumoXMLAttr key) const;
110 
111  /* @brief method for setting the attribute and letting the object perform additional changes
112  * @param[in] key The attribute key
113  * @param[in] value The new value
114  * @param[in] undoList The undoList on which to register changes
115  */
116  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
117 
118  /* @brief method for checking if the key and their correspond attribute are valids
119  * @param[in] key The attribute key
120  * @param[in] value The value asociated to key key
121  * @return true if the value is valid, false in other case
122  */
123  bool isValid(SumoXMLAttr key, const std::string& value);
125 
126 private:
129 
132 
135 
139  std::vector<SUMOReal> myShapeRotations;
140 
142  std::vector<SUMOReal> myShapeLengths;
144 
147 
149  void setAttribute(SumoXMLAttr key, const std::string& value);
150 
151 private:
153  GNECrossing(const GNECrossing&);
154 
157 
158 };
159 
160 
161 #endif
162 
163 /****************************************************************************/
164 
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNECrossing.cpp:89
GNECrossing(GNEJunction &parentJunction, const std::string &id)
Constructor.
Definition: GNECrossing.cpp:59
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
Definition: GNECrossing.h:142
Stores the information about how to visualize structures.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void updateGeometry()
update pre-computed geometry information
Definition: GNECrossing.cpp:73
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:51
A list of positions.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
GNECrossing & operator=(const GNECrossing &)
Invalidated assignment operator.
GNEJunction & myParentJunction
the parent junction of this crossing
Definition: GNECrossing.h:128
GUIGLObjectPopupMenu * myPopup
the created popup
Definition: GNECrossing.h:146
NBNode::Crossing myCrossing
the data for this crossing
Definition: GNECrossing.h:131
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
The popup menu of a globject.
virtual ~GNECrossing()
Destructor.
Definition: GNECrossing.cpp:69
A definition of a pedestrian crossing.
Definition: NBNode.h:132
bool isValid(SumoXMLAttr key, const std::string &value)
const PositionVector myShape
the shape of the edge
Definition: GNECrossing.h:134
A window containing a gl-object&#39;s parameter.
std::vector< SUMOReal > myShapeRotations
Definition: GNECrossing.h:139
std::string getAttribute(SumoXMLAttr key) const