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 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
51 class GNECrossing : public GNENetElement {
52 public:
53 
58  GNECrossing(GNEJunction* parentJunction, const std::string& id);
59 
61  virtual ~GNECrossing();
62 
64  void updateGeometry();
65 
68 
71 
74 
82 
91 
98 
103  void drawGL(const GUIVisualizationSettings& s) const;
105 
108  /* @brief method for getting the Attribute of an XML key
109  * @param[in] key The attribute key
110  * @return string with the value associated to key
111  */
112  std::string getAttribute(SumoXMLAttr key) const;
113 
114  /* @brief method for setting the attribute and letting the object perform additional changes
115  * @param[in] key The attribute key
116  * @param[in] value The new value
117  * @param[in] undoList The undoList on which to register changes
118  */
119  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
120 
121  /* @brief method for checking if the key and their correspond attribute are valids
122  * @param[in] key The attribute key
123  * @param[in] value The value asociated to key key
124  * @return true if the value is valid, false in other case
125  */
126  bool isValid(SumoXMLAttr key, const std::string& value);
128 
129 private:
132 
135 
138 
142  std::vector<double> myShapeRotations;
143 
145  std::vector<double> myShapeLengths;
147 
150 
152  void setAttribute(SumoXMLAttr key, const std::string& value);
153 
154 private:
156  GNECrossing(const GNECrossing&);
157 
160 };
161 
162 
163 #endif
164 
165 /****************************************************************************/
166 
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
NBNode::Crossing & myCrossing
the data for this crossing
Definition: GNECrossing.h:134
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
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.
GNECrossing(GNEJunction *parentJunction, const std::string &id)
Constructor.
Definition: GNECrossing.cpp:58
void updateGeometry()
update pre-computed geometry information
Definition: GNECrossing.cpp:71
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:51
std::vector< double > myShapeRotations
Definition: GNECrossing.h:142
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:131
NBNode::Crossing & getNBCrossing() const
get referente to NBode::Crossing
GUIGLObjectPopupMenu * myPopup
the created popup
Definition: GNECrossing.h:149
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
The popup menu of a globject.
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:145
const PositionVector myShape
the shape of the edge
Definition: GNECrossing.h:137
A window containing a gl-object&#39;s parameter.
std::string getAttribute(SumoXMLAttr key) const
GNEJunction * getParentJunction() const
get parent Junction
Definition: GNECrossing.cpp:94