69 myGNEJunctionSource(myNet->retrieveJunction(myNBEdge.getFromNode()->getID())),
70 myGNEJunctionDestiny(myNet->retrieveJunction(myNBEdge.getToNode()->getID())),
71 myOrigShape(nbe.getInnerGeometry()),
73 myAmResponsible(false),
75 myConnectionStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED) {
79 for (
int i = 0; i < numLanes; i++) {
81 myLanes.back()->incRef(
"GNEEdge::GNEEdge");
85 i->updateGeometry(
true);
93 i->decRef(
"GNEEdge::~GNEEdge");
94 if (i->unreferenced()) {
96 WRITE_DEBUG(
"Deleting unreferenced " +
toString(i->getTag()) +
" '" + i->getID() +
"' in GNEEdge destructor");
102 i->decRef(
"GNEEdge::~GNEEdge");
103 if (i->unreferenced()) {
105 WRITE_DEBUG(
"Deleting unreferenced " +
toString(i->getTag()) +
" '" + i->getID() +
"' in GNEEdge destructor");
123 i->updateGeometry(updateGrid);
129 i->updateGeometry(updateGrid);
134 i->updateGeometry(updateGrid);
138 i->updateGeometry(updateGrid);
171 shapeStartEdited.
add(offset);
181 shapeEndEdited.
add(offset);
219 i->startGeometryMoving();
223 i->startGeometryMoving();
227 i->startGeometryMoving();
244 i->endGeometryMoving();
248 i->endGeometryMoving();
252 i->endGeometryMoving();
270 for (
int i = 0; i < (int)entireGeometry.size(); i++) {
271 if (entireGeometry[i].distanceTo2D(newPos) <
SNAP_RADIUS) {
272 if (i == 0 || i == (
int)(entireGeometry.size() - 1)) {
280 if (createIfNoExist) {
304 if (index < (
int)edgeGeometry.size()) {
306 double zValue = edgeGeometry[index].z();
308 edgeGeometry[index] = oldPos;
309 edgeGeometry[index].
add(offset);
311 edgeGeometry[index].setz(zValue);
331 for (
auto& i : modifiedShape) {
351 innerShapeToCommit.
removeClosest(innerShapeToCommit[(
int)innerShapeToCommit.size() - 1]);
376 modifiedShape.erase(modifiedShape.begin() + index);
407 ret.
add(i->getBoundary());
472 double circleWidthSquared = circleWidth * circleWidth;
487 glGetFloatv(GL_CURRENT_COLOR, color);
557 GNELane* lane2 = myLanes[myLanes.size() - 1];
563 if (angle > 90 && angle < 270) {
569 if (drawStreetName) {
595 if (geom[index].distanceTo(clickPos) <
SNAP_RADIUS) {
608 undoList->
p_begin(
"remove endpoint");
612 undoList->
p_begin(
"remove endpoint");
616 undoList->
p_begin(
"set endpoint");
677 std::vector<GNEConnection*> retrievedConnections;
679 for (
auto it : connections) {
683 retrievedConnections.push_back(retrievedGNEConnection);
690 retrievedGNEConnection->
incRef(
"GNEEdge::remakeGNEConnections");
700 if (it->unreferenced()) {
702 WRITE_DEBUG(
"Deleting unreferenced " +
toString(it->getTag()) +
" '" + it->getID() +
"' in rebuildGNEConnections()");
707 myGNEConnections = retrievedConnections;
716 if (i->isAttributeCarrierSelected()) {
717 i->unselectAttributeCarrier();
722 i->decRef(
"GNEEdge::clearGNEConnections");
724 if (i->unreferenced()) {
726 WRITE_DEBUG(
"Deleting unreferenced " +
toString(i->getTag()) +
" '" + i->getID() +
"' in clearGNEConnections()");
730 myGNEConnections.clear();
736 std::vector<GNEAdditional*> routeProbes;
738 if (i->getTag() == routeProbe->
getTag()) {
739 routeProbes.push_back(i);
743 auto it = std::find(routeProbes.begin(), routeProbes.end(), routeProbe);
744 if (it == routeProbes.end()) {
747 return (
int)(it - routeProbes.begin());
752 std::vector<GNECrossing*>
754 std::vector<GNECrossing*> crossings;
756 if (i->checkEdgeBelong(
this)) {
757 crossings.push_back(i);
761 if (i->checkEdgeBelong(
this)) {
762 crossings.push_back(i);
774 std::vector<std::string> edgeIDs = parse<std::vector<std::string> >(i->getAttribute(
SUMO_ATTR_EDGES));
776 if (edgeIDs.empty()) {
778 }
else if ((edgeIDs.size() == 1) && (allowEmpty ==
false)) {
780 if (edgeIDs.front() ==
getID()) {
783 throw ProcessError(
"Edge ID wasnt' found in Additional");
786 auto it = std::find(edgeIDs.begin(), edgeIDs.end(),
getID());
787 if (it != edgeIDs.end()) {
792 throw ProcessError(
"Edge ID wasnt' found in Additional");
801 undoList->
p_begin(
"copy template");
810 for (
int i = 0; i < (int)
myLanes.size(); i++) {
823 std::set<GUIGlID> result;
825 result.insert(i->getGlID());
831 const std::vector<GNELane*>&
837 const std::vector<GNEConnection*>&
879 return "lane specific";
885 return "lane specific";
891 return "lane specific";
938 const std::string origValue =
myLanes.at(0)->getAttribute(key);
941 it->setAttribute(key, value, undoList);
1064 return canParse<double>(value) && (parse<double>(value) > 0);
1066 return canParse<int>(value) && (parse<double>(value) > 0);
1068 return canParse<int>(value);
1088 return canParse<double>(value) && (parse<double>(value) >= 0);
1110 return canParse<bool>(value);
1170 result += i.first +
"=" + i.second +
"|";
1173 if (!result.empty()) {
1180 std::vector<std::pair<std::string, std::string> >
1182 std::vector<std::pair<std::string, std::string> > result;
1185 result.push_back(std::make_pair(i.first, i.second));
1196 std::vector<std::string> parsedValues;
1199 parsedValues.push_back(stValues.
next());
1202 for (
auto i : parsedValues) {
1203 std::vector<std::string> parsedParameters;
1206 parsedParameters.push_back(stParam.
next());
1250 throw InvalidArgument(
"GNEEdge::setAttribute (private) called for attr SUMO_ATTR_NUMLANES. This should never happen");
1288 WRITE_DEBUG(
"invalidating (removing) connections of edge '" +
getID() +
"' due it were guessed");
1292 WRITE_DEBUG(
"declaring connections of edge '" +
getID() +
"' as loaded (It will not be removed)");
1302 newShapeStart = parse<Position>(value);
1314 newShapeEnd = parse<Position>(value);
1323 if (parse<bool>(value)) {
1351 const int oldNumLanes = (int)
myLanes.size();
1352 for (
int i = oldNumLanes; i < numLanes; i++) {
1357 for (
int i = oldNumLanes - 1; i > numLanes - 1; i--) {
1372 myNBEdge.
addLane(index,
true, recomputeConnections, !recomputeConnections);
1379 lane =
new GNELane(*
this, index);
1382 lane->
incRef(
"GNEEdge::addLane");
1394 for (
int i = 0; i < (int)
myLanes.size(); ++i) {
1405 i->remakeGNEConnections();
1409 i->remakeGNEConnections();
1435 lane->
decRef(
"GNEEdge::removeLane");
1444 for (
int i = 0; i < (int)
myLanes.size(); ++i) {
1455 i->remakeGNEConnections();
1459 i->remakeGNEConnections();
1481 if (selectAfterCreation) {
1502 if (con !=
nullptr) {
1503 con->
decRef(
"GNEEdge::removeConnection");
1525 if ((i->getFromLaneIndex() == fromLane) && (i->getEdgeTo()->getNBEdge() == to) && (i->getToLaneIndex() == toLane)) {
1529 if (createIfNoExist) {
1536 return createdConnection;
1548 i->setMicrosimID(
getNBEdge()->getLaneID(i->getIndex()));
1556 if (i->isRestricted(vclass)) {
1568 if (i->checkEdgeBelong(
this)) {
1580 PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
1593 #ifdef DEBUG_SMOOTH_GEOM 1595 <<
" forElevation=" << forElevation
1598 <<
" smoothShape old=" << old <<
"\n";
1600 if (old.size() == 3 || old.size() == 4) {
1602 }
else if (old.size() > 4 && !forElevation) {
1604 init.push_back(old[0]);
1605 init.push_back(old[1]);
1606 init.push_back(old[-2]);
1607 init.push_back(old[-1]);
1613 if (incoming.size() == 1) {
1614 begShape = incoming[0]->getGeometry();
1616 assert(incoming.size() == 2);
1619 if (outgoing.size() == 1) {
1620 endShape = outgoing[0]->getGeometry();
1622 assert(outgoing.size() == 2);
1628 init.push_back(old[0]);
1631 init.push_back(old[-1]);
1635 init[1].setz(2 * init[0].z() - begZ);
1636 init[2].setz(2 * init[-1].z() - endZ);
1639 const double straightThresh =
DEG2RAD(oc.
getFloat(
"opendrive-output.straight-threshold"));
1642 #ifdef DEBUG_SMOOTH_GEOM 1644 std::cout <<
" begShape=" << begShape <<
" endShape=" << endShape <<
" forElevation=" << forElevation <<
" dist=" << dist <<
" ok=" << ok <<
" init=" << init <<
"\n";
1648 if (init.size() == 0) {
1651 const int numPoints =
MAX2(oc.
getInt(
"junctions.internal-link-detail"),
1653 return bezier(init, numPoints);
1661 if (modifiedShape.size() < 2) {
1664 PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
1674 if (elevationBase.size() == 0 || elevationBase[-1].z() != pos.z()) {
1675 elevationBase.push_back(pos);
1679 if (elevation.size() <= 2) {
1683 if (modifiedShape.size() < 5) {
1689 for (
int i = 1; i < (int)modifiedShape.size(); ++i) {
1690 seen += modifiedShape[i - 1].distanceTo2D(modifiedShape[i]);
1694 PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
1704 geom.erase(geom.begin());
GUIVisualizationSizeSettings junctionSize
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
static const PositionVector EMPTY
empty Vector
void copyTemplate(GNEEdge *tpl, GNEUndoList *undolist)
copy edge attributes from tpl
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
GNEJunction * myGNEJunctionSource
pointer to GNEJunction source
The information about how to spread the lanes from the given position.
std::string getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
void remakeGNEConnections()
remake connections
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
const GNEAttributeCarrier * getACUnderCursor() const
get AttributeCarrier under cursor
Position getPositionInView() const
Return current position.
double length2D() const
Returns the length.
A structure which describes a connection between edges or lanes.
void addIncomingGNEEdge(GNEEdge *edge)
add incoming GNEEdge
void setNumLanes(int numLanes, GNEUndoList *undoList)
changes the number of lanes. When reducing the number of lanes, higher-numbered lanes are removed fir...
int toLane
The lane the connections yields in.
const std::vector< T > & getSchemes() const
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
double scale
information about a lane's width (temporary, used for a single view)
GUIVisualizationTextSettings streetName
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
bool removeGenericParameter(const std::string &key)
remove generic parameter
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
void resetWritable()
Resets all options to be writeable.
GNENet * myNet
the net to inform about updates
bool myAmResponsible
whether we are responsible for deleting myNBNode
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void removeIncomingGNEEdge(GNEEdge *edge)
remove incoming GNEEdge
double z() const
Returns the z-position.
void addLane(GNELane *lane, const NBEdge::Lane &laneAttrs, bool recomputeConnections)
increase number of lanes by one use the given attributes and restore the GNELane
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
NBEdge * toEdge
The edge the connections yields in.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
begin/end of the description of a single lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
std::string myConnectionStatus
modification status of the connections
void add(const Position &pos)
Adds the given position to this one.
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
GNEJunction * myGNEJunctionDestiny
pointer to GNEJunction destiny
bool setConnection(int lane, NBEdge *destEdge, int destLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED)
Adds a connection to a certain lane of a certain edge.
PositionVector myOrigShape
restore point for undo
int indexOfClosest(const Position &p) const
index of the closest position to p
void setMicrosimID(const std::string &newID)
override to also set lane ids
static const RGBColor WHITE
void endGeometryMoving()
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
lane spread functions
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
std::set< GUIGlID > getLaneGlIDs()
returns GLIDs of all lanes
void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices)
add lane
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
double exaggeration
The size exaggeration (upscale)
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
GUIColorer laneColorer
The lane colorer.
Stores the information about how to visualize structures.
PositionVector resample(double maxLength) const
resample shape with the given number of points (equal spacing)
int getPriority() const
Returns the priority of the edge.
const std::string & getTypeID() const
get ID of type
static const double SNAP_RADIUS
double y() const
Returns the y-position.
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
The representation of a single edge during network building.
void unsetParameter(const std::string &key)
Removes a parameter.
void moveShapeStart(const Position &oldPos, const Position &offset)
move position of shape start without commiting change
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
bool hasRestrictedLane(SUMOVehicleClass vclass) const
check if edge has a restricted lane
double x() const
Returns the x-position.
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
Representation of a RouteProbe in netedit.
void setStreetName(const std::string &name)
sets the street name of this edge
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void smooth(GNEUndoList *undoList)
make geometry smooth
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false, const bool adaptToLaneRemoval=false)
Removes the specified connection(s)
A NBNetBuilder extended by visualisation and editing capabilities.
NBEdge * getTurnDestination(bool possibleDestination=false) const
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given ...
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void setLoadedLength(double val)
set loaded lenght
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...
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
void setShapeEndPos(const Position &pos)
change Shape EndPos
double endOffset
This lane's offset to the intersection begin.
void clearGNEConnections()
clear current connections
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void moveShapeEnd(const Position &oldPos, const Position &offset)
move position of shape end without commiting change
PositionVector interpolateZ(double zStart, double zEnd) const
returned vector that varies z smoothly over its length
double visibility
custom foe visiblity for connection
void removeEdgeFromCrossings(GNEJunction *junction, GNEUndoList *undoList)
remove crossing of junction
const std::vector< GNEConnection * > & getGNEConnections()
returns a reference to the GNEConnection vector
const std::string & getID() const
Returns the id.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
const SVCPermissions SVCAll
all VClasses are allowed
Lane & getLaneStruct(int lane)
void commitShapeStartChange(const Position &oldPos, GNEUndoList *undoList)
commit position changing in shape start
PositionVector smoothShape(const PositionVector &shape, bool forElevation)
return smoothed shape
void removeLane(GNELane *lane, bool recomputeConnections)
the number of lanes by one. argument is only used to increase robustness (assertions) ...
bool myWasSplit
whether this edge was created from a split
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
first coordinate of edge shape
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint ...
static const double UNSPECIFIED_WIDTH
unspecified lane width
A class that stores a 2D geometrical boundary.
PositionVector customShape
custom shape for connection
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
#define WRITE_WARNING(msg)
Boundary myMovingGeometryBoundary
boundary used during moving of elements
static OptionsCont & getOptions()
Retrieves the options.
whether a feature has been loaded,guessed,modified or approved
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
void setGeometry(PositionVector geom, bool inner, bool updateGrid)
update edge geometry and inform the lanes
int getVertexIndex(const Position &pos, bool createIfNoExist=true)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge ...
void removeOutgoingGNEEdge(GNEEdge *edge)
remove outgoing GNEEdge
bool keepClear
whether the junction must be kept clear when using this connection
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
GUIVisualizationTextSettings edgeName
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
An (internal) definition of a single lane of an edge.
void updateJunctionPosition(GNEJunction *junction, const Position &origPos, bool updateGrid)
update edge geometry after junction move
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
bool updateGenericParameter(const std::string &oldKey, const std::string &newKey)
update generic parameter
std::string getAttribute(SumoXMLAttr key) const
GNEUndoList * getUndoList() const
get the undoList object
int getIndex() const
returns the index of the lane
void push_front_noDoublePos(const Position &p)
insert in front a non double position
void updateGeometry(bool updateGrid)
update pre-computed geometry information
void removeDoublePoints(double minDist=POSITION_EPS, bool assertLength=false)
Removes positions if too near.
whether an edge is part of a bidirectional railway
bool hasLaneSpecificWidth() const
whether lanes differ in width
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
double speed
custom speed for connection
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
const double SUMO_const_halfLaneWidth
bool clickedOverShapeStart(const Position &pos)
void commitShapeEndChange(const Position &oldPos, GNEUndoList *undoList)
commit position changing in shape end
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
std::string getGenericParametersStr() const
return generic parameters in string format
int getNumLanes() const
Returns the number of lanes.
int fromLane
The lane the connections starts at.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
A point in 2D or 3D with translation and scaling methods.
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
double scaledSize(double scale, double constFactor=0.1) const
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
friend class GNEChange_Attribute
declare friend class
GNEEdge * getOppositeEdge() const
get opposite edge
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
void deleteLane(int index, bool recompute, bool shiftIndices)
delete lane
void updateGeometry(bool updateGrid)
Update the boundary of the junction.
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
static const std::string FEATURE_GUESSED
feature has been reguessed (may still be unchanged be we can't tell (yet)
GNEConnection * retrieveGNEConnection(int fromLane, NBEdge *to, int toLane, bool createIfNoExist=true)
get GNEConnection if exist, and if not create it if create is enabled
int myPriority
The priority of the edge.
bool geometryLike() const
whether this is structurally similar to a geometry node
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
const std::string & getStreetName() const
Returns the street name of this edge.
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
void startGeometryMoving()
edge: the shape in xml-definition
Boundary & grow(double by)
extends the boundary by the given amount
GUIColorer junctionColorer
The junction colorer.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
void addOutgoingGNEEdge(GNEEdge *edge)
add outgoing GNEEdge
const std::string getID() const
function to support debugging
int insertAtClosest(const Position &p)
inserts p between the two closest positions and returns the insertion index
static PositionVector bezierControlPoints(const PositionVector &begShape, const PositionVector &endShape, bool isTurnaround, double extrapolateBeg, double extrapolateEnd, bool &ok, NBNode *recordError=0, double straightThresh=DEG2RAD(5), int shapeFlag=0)
get bezier control points
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
double getEndOffset() const
Returns the offset to the destination node.
bool clickedOverShapeEnd(const Position &pos)
return true if user clicked over ShapeEnd
static const double INVALID_OFFSET
a value to signify offsets outside the range of [0, Line.length()]
GNEJunction * getGNEJunctionSource() const
returns the source-junction
void incRef(const std::string &debugMsg="")
Increarse reference.
The connection was given by the user.
double speed
The speed allowed on this lane.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
double width
This lane's width.
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
double getFinalLength() const
get length that will be assigned to the lanes in the final network
void selectAttributeCarrier(bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void decRef(const std::string &debugMsg="")
Decrease reference.
std::vector< GNECrossing * > getGNECrossings()
get GNECrossings vinculated with this Edge
bool updateGenericParameterValue(const std::string &key, const std::string &newValue)
update value generic parameter
begin/end of the description of an edge
GNEEdge(NBEdge &nbe, GNENet *net, bool wasSplit=false, bool loaded=false)
Constructor.
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
EditMode getCurrentEditMode() const
get the current edit mode
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
double getSpeed() const
Returns the speed allowed on this edge.
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
const PositionVector & getGeometry() const
Returns the geometry of the edge.
A road/street connecting two junctions (netedit-version)
int getRouteProbeRelativePosition(GNERouteProbe *routeProbe) const
obtain relative positions of RouteProbes
ConnectionVector myGNEConnections
vector with the connections of this edge
void updateGeometry(bool updateGrid)
update pre-computed geometry information
double getLaneWidth() const
Returns the default width of lanes of this edge.
int moveVertexShape(const int index, const Position &oldPos, const Position &offset)
change position of a vertex of shape without commiting change
static const double BUBBLE_RADIUS
constant values for drawing buubles
void reset()
Resets the boundary.
void setResponsible(bool newVal)
set responsibility for deleting internal strctures
void addConnection(NBEdge::Connection nbCon, bool selectAfterCreation=false)
adds a connection
const PositionVector & getShape() const
returns the shape of the lane
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
double length() const
Returns the length.
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
const std::vector< Connection > & getConnections() const
Returns the connections.
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
static void drawShapeDottedContour(const int type, const PositionVector &shape, const double width)
draw a dotted contour around the given Non closed shape with certain width
void moveEntireShape(const PositionVector &oldShape, const Position &offset)
move entire shape without commiting change
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
bool addGenericParameter(const std::string &key, const std::string &value)
add generic parameter
double contPos
custom position for internal junction on this connection
bool isInitialised() const
check if Boundary is Initialised
A storage for options typed value containers)
bool uncontrolled
check if Connection is uncontrolled
void markConnectionGeometryDeprecated()
check that connection's Geometry has to be updated
void mouseOverObject(const GUIVisualizationSettings &s) const
method for check if mouse is over objects
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
static int getCircleResolution(const GUIVisualizationSettings &settings)
function to calculate circle resolution for all circles drawn in drawGL(...) functions ...
std::string myType
The type of the edge.
void renameEdge(GNEEdge *edge, const std::string &newID)
updates the map and reserves new id
bool isValid(SumoXMLAttr key, const std::string &value)
void removeEdgeOfAdditionalParents(GNEUndoList *undoList, bool allowEmpty)
remove Edge of Additional Parent
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
void declareConnectionsAsLoaded(EdgeBuildingStep step=LANES2LANES_USER)
declares connections as fully loaded. This is needed to avoid recomputing connections if an edge has ...
const Position & getPosition() const
void removeExplicitTurnaround(std::string id)
remove edge id from the list of explicit turnarounds
void commitShapeChange(const PositionVector &oldShape, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of changeShapeGeometry(...)
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
GUIGlID getGlID() const
Returns the numerical id of the object.
LaneVector myLanes
vectgor with the lanes of this edge
std::vector< GNEAdditional * > myAdditionalChilds
list of Additional Childs of this NetElement
void removeConnection(NBEdge::Connection nbCon)
removes a connection
void updateLinkState()
recompute cached myLinkState
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
last coordinate of edge shape
std::vector< GNEAdditional * > myFirstAdditionalParents
list of Additional parents of this NetElement
void push_back_noDoublePos(const Position &p)
insert in back a non double position
static const RGBColor selectionColor
NBEdge & myNBEdge
the underlying NBEdge
NBNode * getFromNode() const
Returns the origin node of the edge.
void mul(double val)
Multiplies both positions with the given value.
bool hasString(const std::string &str) const
NBEdge * getNBEdge()
returns the internal NBEdge
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
void add(double xoff, double yoff, double zoff)
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
Boundary getBoundary() const
Returns the street's geometry.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
void setShapeStartPos(const Position &pos)
change Shape StartPos
NBNode * getNBNode() const
Return net build node.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
void setLogicValid(bool valid, GNEUndoList *undoList, const std::string &status=FEATURE_GUESSED)
void changeEdgeEndpoints(GNEEdge *edge, const std::string &newSourceID, const std::string &newDestID)
modifies endpoins of the given edge
int removeClosest(const Position &p)
removes the point closest to p and return the removal index
std::string getAttributeForSelection(SumoXMLAttr key) const
method for getting the attribute in the context of object selection
bool wasSplit()
whether this edge was created from a split
NBNode * getToNode() const
Returns the destination node of the edge.
Position getSplitPos(const Position &clickPos)
bool unreferenced()
check if object ins't referenced
friend class GNEChange_Lane
Friend class.
static PositionVector parseShapeReporting(const std::string &shpdef, const std::string &objecttype, const char *objectid, bool &ok, bool allowEmpty, bool report=true)
Builds a PositionVector from a string representation, reporting occurred errors.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GNEViewNet * getViewNet() const
get view net
void clearParameter()
Clears the parameter map.
void bezier(int npts, double b[], int cpts, double p[])
SumoXMLTag getTag() const
get XML Tag assigned to this object