Eclipse SUMO - Simulation of Urban MObility
GNEEdgeType.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#include "GNENetworkElement.h"
23
24#include <netbuild/NBTypeCont.h>
25
26
27// ===========================================================================
28// class declarations
29// ===========================================================================
30
31class GNELaneType;
32class GNEEdgeTemplate;
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
38
40
41public:
43 friend class GNECreateEdgeFrame;
44
48 GNEEdgeType(GNECreateEdgeFrame* createEdgeFrame);
49
51 GNEEdgeType(const GNEEdgeType* edgeType);
52
56 GNEEdgeType(GNENet* net);
57
64 GNEEdgeType(GNENet* net, const std::string& ID, const NBTypeCont::EdgeTypeDefinition* edgeType);
65
68
70 void copyTemplate(const GNEEdgeTemplate* edgeTemplate);
71
73 const std::vector<GNELaneType*>& getLaneTypes() const;
74
76 int getLaneTypeIndex(const GNELaneType* laneType) const;
77
79 void addLaneType(GNELaneType* laneType);
80
82 void removeLaneType(const int index);
83
87 void updateGeometry();
88
92
97
99 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList);
101
104
112
114 double getExaggeration(const GUIVisualizationSettings& s) const;
115
117 void updateCenteringBoundary(const bool updateGrid);
118
123 void drawGL(const GUIVisualizationSettings& s) const;
124
126 void deleteGLObject();
127
129 void updateGLObject();
131
134 /* @brief method for getting the Attribute of an XML key
135 * @param[in] key The attribute key
136 * @return string with the value associated to key
137 */
138 std::string getAttribute(SumoXMLAttr key) const;
139
140 /* @brief method for setting the attribute and letting the object perform additional changes
141 * @param[in] key The attribute key
142 * @param[in] value The new value
143 * @param[in] undoList The undoList on which to register changes
144 */
145 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
146
147 /* @brief method for checking if the key and their conrrespond attribute are valids
148 * @param[in] key The attribute key
149 * @param[in] value The value associated to key key
150 * @return true if the value is valid, false in other case
151 */
152 bool isValid(SumoXMLAttr key, const std::string& value);
153
155
158
159protected:
161 std::vector<GNELaneType*> myLaneTypes;
162
163private:
165 void setAttribute(SumoXMLAttr key, const std::string& value);
166
168 void setMoveShape(const GNEMoveResult& moveResult);
169
171 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
172
174 GNEEdgeType(const GNEEdgeType& s) = delete;
175
177 GNEEdgeType& operator=(const GNEEdgeType& s) = delete;
178};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::vector< GNELaneType * > myLaneTypes
vector with laneTypes
Definition: GNEEdgeType.h:161
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
GNEEdgeType(GNECreateEdgeFrame *createEdgeFrame)
Constructor for default edge (empty ID)
Definition: GNEEdgeType.cpp:39
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
Definition: GNEEdgeType.cpp:92
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
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
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.
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
edgeType definition
Definition: NBTypeCont.h:93