60 myLaneTypes.push_back(laneType);
65 GNENetworkElement(net, ID,
GLO_EDGE,
SUMO_TAG_TYPE,
GUIIconSubSys::getIcon(
GUIIcon::
EDGETYPE), {}, {}, {}, {}, {}, {}) {
67 for (
const auto& laneTypeDef : edgeType->laneTypeDefinitions) {
69 myLaneTypes.push_back(laneType);
72 speed = edgeType->speed;
73 friction = edgeType->friction;
74 priority = edgeType->priority;
75 permissions = edgeType->permissions;
76 spreadType = edgeType->spreadType;
77 oneWay = edgeType->oneWay;
78 discard = edgeType->discard;
79 width = edgeType->width;
80 widthResolution = edgeType->widthResolution;
81 maxWidth = edgeType->maxWidth;
82 minWidth = edgeType->minWidth;
83 sidewalkWidth = edgeType->sidewalkWidth;
84 bikeLaneWidth = edgeType->bikeLaneWidth;
85 restrictions = edgeType->restrictions;
86 attrs = edgeType->attrs;
87 laneTypeDefinitions = edgeType->laneTypeDefinitions;
127const std::vector<GNELaneType*>&
135 for (
int i = 0; i < (int)
myLaneTypes.size(); i++) {
224 if (
attrs.count(key) == 0) {
225 return toString(neteditOptions.getFloat(
"default.speed"));
230 if (
attrs.count(key) == 0) {
231 return toString(neteditOptions.getFloat(
"default.friction"));
254 if (
attrs.count(key) == 0) {
260 if (
attrs.count(key) == 0) {
301 return canParse<int>(value) && (parse<double>(value) > 0);
306 return canParse<double>(value) && (parse<double>(value) > 0);
320 if (value.empty() || (value ==
"-1")) {
323 return canParse<double>(value);
326 return canParse<int>(value);
355 const int numLanes = parse<int>(value);
372 speed = parse<double>(value);
437 width = parse<double>(value);
@ GLO_EDGETYPE
an edgeType
GUIIcon
An enumeration of icons used by the gui applications.
const SVCPermissions SVCAll
all VClasses are allowed
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
@ SUMO_TAG_TYPE
type (edge)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_WIDTHRESOLUTION
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_SPREADTYPE
The information about how to spread the lanes from the given position.
@ SUMO_ATTR_BIKELANEWIDTH
@ SUMO_ATTR_SIDEWALKWIDTH
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const std::string getID() const
get ID (all Attribute Carriers have one)
const std::string & getTagStr() const
get tag assigned to this object in string format
GNENet * myNet
pointer to net
void refreshAttributesCreator()
refresh attribute creator
void updateIDinComboBox(const std::string &oldID, const std::string &newID)
update id in comboBox
void refreshLaneTypeSelector()
refresh LaneTypeSelector
EdgeTypeSelector * getEdgeTypeSelector() const
get edgeType selector
GNEAttributesCreator * getEdgeTypeAttributes() const
get edgeType attributes
LaneTypeSelector * getLaneTypeSelector()
get lane type selector
std::string getAttribute(SumoXMLAttr key) const
const std::vector< GNELaneTemplate * > & getLaneTemplates() const
get vector with the lane templates of this edge
std::vector< GNELaneType * > myLaneTypes
vector with laneTypes
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
GNEEdgeType(GNECreateEdgeFrame *createEdgeFrame)
Constructor for default edge (empty ID)
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
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
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
GNEEdgeType * retrieveEdgeType(const std::string &id, bool hardFail=true) const
get edge type by id
void updateEdgeTypeID(GNEEdgeType *edgeType, const std::string &newID)
update edgeType ID in container
A NBNetBuilder extended by visualisation and editing capabilities.
void deleteNetworkElement(GNENetworkElement *networkElement, GNEUndoList *undoList)
delete network element
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEViewNet * getViewNet() const
get view net
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
Stores the information about how to visualize structures.
static const double UNSPECIFIED_WIDTH
unspecified lane width
static OptionsCont & getOptions()
Retrieves the options.
An upper class for objects with additional parameters.
static bool areParametersValid(const std::string &value, bool report=false, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
std::map< std::string, std::string > Map
parameters map
void setParametersStr(const std::string ¶msString, const std::string kvsep="=", const std::string sep="|")
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
std::string getParametersStr(const std::string kvsep="=", const std::string sep="|") const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
A point in 2D or 3D with translation and scaling methods.
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
lane spread functions
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
const std::string & getString(const T key) const
bool hasString(const std::string &str) const
T get(const std::string &str) const
int priority
The priority of an edge.
double width
The width of lanes of edges of this edgeType [m].
double minWidth
The minimum width for lanes of this edgeType [m].
double speed
The maximal velocity on an edge in m/s.
LaneSpreadFunction spreadType
lane spread type
SVCPermissions permissions
List of vehicle edgeTypes that are allowed on this edge.
double maxWidth
The maximum width for lanes of this edgeType [m].
double widthResolution
The resolution for interpreting custom (noisy) lane widths of this edgeType [m].
bool oneWay
Whether one-way traffic is mostly common for this edgeType (mostly unused)
std::set< SumoXMLAttr > attrs
The attributes which have been set.
double friction
The default friction on an edge.
bool discard
Whether edges of this edgeType shall be discarded.