Eclipse SUMO - Simulation of Urban MObility
GNELaneType.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2022 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
23 #include "GNENetworkElement.h"
24 
25 #include <netbuild/NBTypeCont.h>
26 
27 
28 // ===========================================================================
29 // class definitions
30 // ===========================================================================
31 
33 
34 public:
36  friend class GNECreateEdgeFrame;
37  friend class GNEEdgeType;
38 
40  GNELaneType(GNEEdgeType* edgeTypeParent);
41 
43  GNELaneType(GNEEdgeType* edgeTypeParent, const NBTypeCont::LaneTypeDefinition& laneType);
44 
46  ~GNELaneType();
47 
50 
52  void copyLaneType(GNELaneType* originalLaneType, GNEUndoList* undoList);
53 
57  void updateGeometry();
58 
62 
67 
69  void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList);
71 
74 
82 
84  double getExaggeration(const GUIVisualizationSettings& s) const;
85 
87  void updateCenteringBoundary(const bool updateGrid);
88 
93  void drawGL(const GUIVisualizationSettings& s) const;
95 
98  /* @brief method for getting the Attribute of an XML key
99  * @param[in] key The attribute key
100  * @return string with the value associated to key
101  */
102  std::string getAttribute(SumoXMLAttr key) const;
103 
104  /* @brief method for setting the attribute and letting the object perform additional changes
105  * @param[in] key The attribute key
106  * @param[in] value The new value
107  * @param[in] undoList The undoList on which to register changes
108  */
109  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
110 
111  /* @brief method for checking if the key and their conrrespond attribute are valids
112  * @param[in] key The attribute key
113  * @param[in] value The value asociated to key key
114  * @return true if the value is valid, false in other case
115  */
116  bool isValid(SumoXMLAttr key, const std::string& value);
117 
118  /* @brief method for check if the value for certain attribute is set
119  * @param[in] key The attribute key
120  */
121  bool isAttributeEnabled(SumoXMLAttr key) const;
122 
123  /* @brief method for check if the value for certain attribute is computed (for example, due a network recomputing)
124  * @param[in] key The attribute key
125  */
126  bool isAttributeComputed(SumoXMLAttr key) const;
127 
129 
131  const std::map<std::string, std::string>& getACParametersMap() const;
132 
133 protected:
136 
137 private:
139  void setAttribute(SumoXMLAttr key, const std::string& value);
140 
142  void setMoveShape(const GNEMoveResult& moveResult);
143 
145  void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
146 
148  GNELaneType(const GNELaneType& s) = delete;
149 
151  GNELaneType& operator=(const GNELaneType& s) = delete;
152 };
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition: GNELaneType.cpp:92
GNEEdgeType * myEdgeTypeParent
pointer to EdgeTypeParent
Definition: GNELaneType.h:135
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Position getPositionInView() const
Returns position of hierarchical element in view.
Definition: GNELaneType.cpp:79
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void updateGeometry()
update pre-computed geometry information
Definition: GNELaneType.cpp:73
bool isValid(SumoXMLAttr key, const std::string &value)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
std::string getAttribute(SumoXMLAttr key) const
GNELaneType(GNEEdgeType *edgeTypeParent)
Constructor.
Definition: GNELaneType.cpp:36
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
void copyLaneType(GNELaneType *originalLaneType, GNEUndoList *undoList)
copy values of given laneType in current laneType
Definition: GNELaneType.cpp:60
bool isAttributeEnabled(SumoXMLAttr key) const
bool isAttributeComputed(SumoXMLAttr key) const
GNEMoveOperation * getMoveOperation()
get move operation
Definition: GNELaneType.cpp:86
GNEEdgeType * getEdgeTypeParent() const
get edge type parent
Definition: GNELaneType.cpp:54
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNELaneType.cpp:98
~GNELaneType()
Destructor.
Definition: GNELaneType.cpp:49
GNELaneType & operator=(const GNELaneType &s)=delete
invalidated assignment operator
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
GNELaneType(const GNELaneType &s)=delete
invalidated copy constructor
move operation
move result
The popup menu of a globject.
Stores the information about how to visualize structures.
An upper class for objects with additional parameters.
Definition: Parameterised.h:41
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
laneType definition
Definition: NBTypeCont.h:59