Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNELaneType.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2023 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
27class GNEEdgeType;
28
29// ===========================================================================
30// class definitions
31// ===========================================================================
32
34
35public:
37 friend class GNECreateEdgeFrame;
38 friend class GNEEdgeType;
39
41 GNELaneType(GNEEdgeType* edgeTypeParent);
42
44 GNELaneType(GNEEdgeType* edgeTypeParent, const NBTypeCont::LaneTypeDefinition& laneType);
45
48
51
53 void copyLaneType(GNELaneType* originalLaneType, GNEUndoList* undoList);
54
58 void updateGeometry();
59
63
68
70 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList);
72
75
83
85 void updateCenteringBoundary(const bool updateGrid);
86
91 void drawGL(const GUIVisualizationSettings& s) const;
92
94 void deleteGLObject();
95
97 void updateGLObject();
99
102 /* @brief method for getting the Attribute of an XML key
103 * @param[in] key The attribute key
104 * @return string with the value associated to key
105 */
106 std::string getAttribute(SumoXMLAttr key) const;
107
108 /* @brief method for setting the attribute and letting the object perform additional changes
109 * @param[in] key The attribute key
110 * @param[in] value The new value
111 * @param[in] undoList The undoList on which to register changes
112 */
113 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
114
115 /* @brief method for checking if the key and their conrrespond attribute are valids
116 * @param[in] key The attribute key
117 * @param[in] value The value associated to key key
118 * @return true if the value is valid, false in other case
119 */
120 bool isValid(SumoXMLAttr key, const std::string& value);
121
123
126
127protected:
130
131private:
133 void setAttribute(SumoXMLAttr key, const std::string& value);
134
136 void setMoveShape(const GNEMoveResult& moveResult);
137
139 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
140
142 GNELaneType(const GNELaneType& s) = delete;
143
145 GNELaneType& operator=(const GNELaneType& s) = delete;
146};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
GNELaneType & operator=(const GNELaneType &s)=delete
invalidated assignment operator
GNEEdgeType * myEdgeTypeParent
pointer to EdgeTypeParent
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Position getPositionInView() const
Returns position of hierarchical element in view.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void updateGeometry()
update pre-computed geometry information
bool isValid(SumoXMLAttr key, const std::string &value)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
std::string getAttribute(SumoXMLAttr key) const
void deleteGLObject()
delete element
const Parameterised::Map & getACParametersMap() const
get parameters map
void copyLaneType(GNELaneType *originalLaneType, GNEUndoList *undoList)
copy values of given laneType in current laneType
GNEMoveOperation * getMoveOperation()
get move operation
GNEEdgeType * getEdgeTypeParent() const
get edge type parent
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
~GNELaneType()
Destructor.
void updateGLObject()
update GLObject (geometry, ID, etc.)
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.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
laneType definition
Definition NBTypeCont.h:59