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-2020 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 "GNENetworkElement.h"
22 
23 #include <netbuild/NBTypeCont.h>
24 
25 
26 // ===========================================================================
27 // class definitions
28 // ===========================================================================
29 
31 
32 public:
34  friend class GNECreateEdgeFrame;
35 
39  GNELaneType(GNEEdgeType* edgeTypeParent);
40 
45  GNELaneType(GNEEdgeType* edgeTypeParent, const NBTypeCont::LaneTypeDefinition& laneType);
46 
48  ~GNELaneType();
49 
52 
54  void copyLaneType(GNELaneType* originalLaneType, GNEUndoList* undoList);
55 
59  void updateGeometry();
60 
64 
68  GNEMoveOperation* getMoveOperation(const double shapeOffset);
69 
71  void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList);
73 
76 
84 
86  void updateCenteringBoundary(const bool updateGrid);
87 
92  void drawGL(const GUIVisualizationSettings& s) const;
94 
97  /* @brief method for getting the Attribute of an XML key
98  * @param[in] key The attribute key
99  * @return string with the value associated to key
100  */
101  std::string getAttribute(SumoXMLAttr key) const;
102 
103  /* @brief method for setting the attribute and letting the object perform additional changes
104  * @param[in] key The attribute key
105  * @param[in] value The new value
106  * @param[in] undoList The undoList on which to register changes
107  */
108  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
109 
110  /* @brief method for checking if the key and their conrrespond attribute are valids
111  * @param[in] key The attribute key
112  * @param[in] value The value asociated to key key
113  * @return true if the value is valid, false in other case
114  */
115  bool isValid(SumoXMLAttr key, const std::string& value);
116 
117  /* @brief method for check if the value for certain attribute is set
118  * @param[in] key The attribute key
119  */
120  bool isAttributeEnabled(SumoXMLAttr key) const;
122 
124  const std::map<std::string, std::string>& getACParametersMap() const;
125 
126 protected:
129 
130 private:
132  void setAttribute(SumoXMLAttr key, const std::string& value);
133 
135  void setMoveShape(const GNEMoveResult& moveResult);
136 
138  void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
139 
141  GNELaneType(const GNELaneType& s) = delete;
142 
144  GNELaneType& operator=(const GNELaneType& s) = delete;
145 };
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition: GNELaneType.cpp:95
GNEEdgeType * myEdgeTypeParent
pointer to EdgeTypeParent
Definition: GNELaneType.h:128
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Position getPositionInView() const
Returns position of hierarchical element in view.
Definition: GNELaneType.cpp:82
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void updateGeometry()
update pre-computed geometry information
Definition: GNELaneType.cpp:76
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:35
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:63
bool isAttributeEnabled(SumoXMLAttr key) const
GNEMoveOperation * getMoveOperation(const double shapeOffset)
get move operation for the given shapeOffset
Definition: GNELaneType.cpp:89
GNEEdgeType * getEdgeTypeParent() const
get edge type parent
Definition: GNELaneType.cpp:57
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
~GNELaneType()
Destructor.
Definition: GNELaneType.cpp:52
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:39
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36
laneType definition
Definition: NBTypeCont.h:56