40 GNENetworkElement(createEdgeFrame->getViewNet()->getNet(),
"",
GLO_EDGE,
SUMO_TAG_TYPE, {}, {}, {}, {}, {}, {}, {}, {}) {
43 laneType->
incRef(
"GNEEdgeType::GNEEdgeType(Default)");
44 myLaneTypes.push_back(laneType);
49 GNENetworkElement(net, net->generateEdgeTypeID(),
GLO_EDGE,
SUMO_TAG_TYPE, {}, {}, {}, {}, {}, {}, {}, {}) {
52 laneType->
incRef(
"GNEEdgeType::GNEEdgeType");
53 myLaneTypes.push_back(laneType);
58 GNENetworkElement(net, ID,
GLO_EDGE,
SUMO_TAG_TYPE, {}, {}, {}, {}, {}, {}, {}, {}) {
60 for (
const auto &laneTypeDef : edgeType->laneTypeDefinitions) {
62 laneType->
incRef(
"GNEEdgeType::GNEEdgeType(parameters)");
63 myLaneTypes.push_back(laneType);
66 speed = edgeType->speed;
67 priority = edgeType->priority;
68 permissions = edgeType->permissions;
69 width = edgeType->width;
70 attrs = edgeType->attrs;
71 laneTypeDefinitions = edgeType->laneTypeDefinitions;
78 laneType->
decRef(
"GNEEdgeType::~GNEEdgeType");
86 const std::vector<GNELaneType*>&
108 if (position < 0 || position > (
int)
myLaneTypes.size()) {
126 undoList->
p_begin(
"add laneType");
155 undoList->
p_begin(
"remove laneType");
157 for (
int i = index; i < ((int)
myLaneTypes.size() - 1); i++) {
220 if (
attrs.count(key) == 0) {
238 if (
attrs.count(key) == 0) {
244 if (
attrs.count(key) == 0) {
283 return canParse<int>(value) && (parse<double>(value) > 0);
288 return canParse<double>(value) && (parse<double>(value) > 0);
298 if (value.empty() || (value ==
"-1")) {
301 return canParse<double>(value);
304 return canParse<int>(value);
319 const std::map<std::string, std::string>&
342 speed = parse<double>(value);
374 width = parse<double>(value);
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.
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
GNENet * myNet
pointer to net
void refreshEdgeTypeSelector()
refresh edge type selector
EdgeTypeSelector * getEdgeTypeSelector() const
getcustom edge selector
bool isAttributeEnabled(SumoXMLAttr key) const
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.
int getLaneTypeIndex(const GNELaneType *laneType) const
get laneType index
bool isValid(SumoXMLAttr key, const std::string &value)
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.
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
const std::vector< GNELaneType * > & getLaneTypes() const
get laneTypes
GNEMoveOperation * getMoveOperation(const double shapeOffset)
get move operation for the given shapeOffset
~GNEEdgeType()
Destructor.
std::string getAttribute(SumoXMLAttr key) const
void removeLaneType(GNELaneType *laneType)
remove laneType
void addLaneType(GNELaneType *laneType, const int position)
add laneType
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)
void updateID(GNEAttributeCarrier *AC, const std::string newID)
update ID
A NBNetBuilder extended by visualisation and editing capabilities.
GNEEdgeType * retrieveEdgeType(const std::string &id, bool failHard=true) const
get edge type by id
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
GNEViewNet * getViewNet() const
get view net
const std::string & getID() const
get ID
void decRef(const std::string &debugMsg="")
Decrease reference.
void incRef(const std::string &debugMsg="")
Increarse reference.
bool unreferenced()
check if object ins't referenced
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
GNEViewParent * getViewParent() const
get the net object
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
Stores the information about how to visualize structures.
static const double UNSPECIFIED_WIDTH
unspecified lane width
A storage for options typed value containers)
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
static OptionsCont & getOptions()
Retrieves the options.
static bool areParametersValid(const std::string &value, bool report=false, ParameterisedAttrType attrType=ParameterisedAttrType::STRING, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
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"
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".
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
A point in 2D or 3D with translation and scaling methods.
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
int priority
The priority of an edge.
double width
The width of lanes of edges of this edgeType [m].
double speed
The maximal velocity on an edge in m/s.
SVCPermissions permissions
List of vehicle edgeTypes that are allowed on this edge.
std::set< SumoXMLAttr > attrs
The attributes which have been set.
bool discard
Whether edges of this edgeType shall be discarded.