Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEEdgeType.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#include "GNENetworkElement.h"
23
24#include <netbuild/NBTypeCont.h>
25
26
27// ===========================================================================
28// class declarations
29// ===========================================================================
30class GNELaneType;
31class GNEEdgeTemplate;
33
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
39public:
41 friend class GNECreateEdgeFrame;
42
46 GNEEdgeType(GNECreateEdgeFrame* createEdgeFrame);
47
49 GNEEdgeType(const GNEEdgeType* edgeType);
50
54 GNEEdgeType(GNENet* net);
55
62 GNEEdgeType(GNENet* net, const std::string& ID, const NBTypeCont::EdgeTypeDefinition* edgeType);
63
66
68 void copyTemplate(const GNEEdgeTemplate* edgeTemplate);
69
71 const std::vector<GNELaneType*>& getLaneTypes() const;
72
74 int getLaneTypeIndex(const GNELaneType* laneType) const;
75
77 void addLaneType(GNELaneType* laneType);
78
80 void removeLaneType(const int index);
81
85 void updateGeometry();
86
90
95
97 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList);
99
102
110
112 void updateCenteringBoundary(const bool updateGrid);
113
118 void drawGL(const GUIVisualizationSettings& s) const;
119
121 void deleteGLObject();
122
124 void updateGLObject();
126
129 /* @brief method for getting the Attribute of an XML key
130 * @param[in] key The attribute key
131 * @return string with the value associated to key
132 */
133 std::string getAttribute(SumoXMLAttr key) const;
134
135 /* @brief method for setting the attribute and letting the object perform additional changes
136 * @param[in] key The attribute key
137 * @param[in] value The new value
138 * @param[in] undoList The undoList on which to register changes
139 */
140 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
141
142 /* @brief method for checking if the key and their conrrespond attribute are valids
143 * @param[in] key The attribute key
144 * @param[in] value The value associated to key key
145 * @return true if the value is valid, false in other case
146 */
147 bool isValid(SumoXMLAttr key, const std::string& value);
148
150
153
154protected:
156 std::vector<GNELaneType*> myLaneTypes;
157
158private:
160 void setAttribute(SumoXMLAttr key, const std::string& value);
161
163 void setMoveShape(const GNEMoveResult& moveResult);
164
166 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
167
169 GNEEdgeType(const GNEEdgeType& s) = delete;
170
172 GNEEdgeType& operator=(const GNEEdgeType& s) = delete;
173};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::vector< GNELaneType * > myLaneTypes
vector with laneTypes
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Position getPositionInView() const
Returns position of hierarchical element in view.
const Parameterised::Map & getACParametersMap() const
get parameters map
int getLaneTypeIndex(const GNELaneType *laneType) const
get laneType index
bool isValid(SumoXMLAttr key, const std::string &value)
void deleteGLObject()
delete element
GNEMoveOperation * getMoveOperation()
get move operation
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
GNEEdgeType(const GNEEdgeType &s)=delete
invalidated copy constructor
GNEEdgeType & operator=(const GNEEdgeType &s)=delete
invalidated assignment operator
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void removeLaneType(const int index)
remove laneType
void copyTemplate(const GNEEdgeTemplate *edgeTemplate)
copy edge template
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
const std::vector< GNELaneType * > & getLaneTypes() const
get laneTypes
void addLaneType(GNELaneType *laneType)
add laneType
void updateGLObject()
update GLObject (geometry, ID, etc.)
~GNEEdgeType()
Destructor.
std::string getAttribute(SumoXMLAttr key) const
void updateGeometry()
update pre-computed geometry information
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
move operation
move result
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
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
edgeType definition
Definition NBTypeCont.h:93