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
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 double getExaggeration(const GUIVisualizationSettings& s) const;
86
88 void updateCenteringBoundary(const bool updateGrid);
89
94 void drawGL(const GUIVisualizationSettings& s) const;
95
97 void deleteGLObject();
98
100 void updateGLObject();
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 conrrespond attribute are valids
119 * @param[in] key The attribute key
120 * @param[in] value The value associated 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);
124
126
129
130protected:
133
134private:
136 void setAttribute(SumoXMLAttr key, const std::string& value);
137
139 void setMoveShape(const GNEMoveResult& moveResult);
140
142 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
143
145 GNELaneType(const GNELaneType& s) = delete;
146
148 GNELaneType& operator=(const GNELaneType& s) = delete;
149};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
Definition: GNELaneType.cpp:92
GNELaneType & operator=(const GNELaneType &s)=delete
invalidated assignment operator
GNEEdgeType * myEdgeTypeParent
pointer to EdgeTypeParent
Definition: GNELaneType.h:132
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
void deleteGLObject()
delete element
const Parameterised::Map & getACParametersMap() const
get parameters map
GNELaneType(GNEEdgeType *edgeTypeParent)
Constructor.
Definition: GNELaneType.cpp:36
void copyLaneType(GNELaneType *originalLaneType, GNEUndoList *undoList)
copy values of given laneType in current laneType
Definition: GNELaneType.cpp:60
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 associated with this GLObject
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNELaneType.cpp:98
~GNELaneType()
Destructor.
Definition: GNELaneType.cpp:49
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.
Definition: Parameterised.h:41
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
laneType definition
Definition: NBTypeCont.h:59