63 myGNEJunctionSource(myNet->retrieveJunction(myNBEdge.getFromNode()->getID())),
64 myGNEJunctionDestiny(myNet->retrieveJunction(myNBEdge.getToNode()->getID())),
66 myAmResponsible(false),
68 myConnectionStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED) {
72 for (
int i = 0; i < numLanes; i++) {
74 myLanes.back()->incRef(
"GNEEdge::GNEEdge");
78 i->updateGeometry(
true);
91 i->decRef(
"GNEEdge::~GNEEdge");
92 if (i->unreferenced()) {
94 WRITE_DEBUG(
"Deleting unreferenced " + i->getTagStr() +
" '" + i->getID() +
"' in GNEEdge destructor");
100 i->decRef(
"GNEEdge::~GNEEdge");
101 if (i->unreferenced()) {
103 WRITE_DEBUG(
"Deleting unreferenced " + i->getTagStr() +
" '" + i->getID() +
"' in GNEEdge destructor");
121 i->updateGeometry(updateGrid);
127 i->updateGeometry(updateGrid);
132 i->updateGeometry(updateGrid);
136 i->updateGeometry(updateGrid);
169 shapeStartEdited.
add(offset);
185 shapeEndEdited.
add(offset);
229 i->startGeometryMoving();
233 i->startGeometryMoving();
237 i->startGeometryMoving();
254 i->endGeometryMoving();
258 i->endGeometryMoving();
262 i->endGeometryMoving();
283 for (
int i = 0; i < (int)entireGeometry.size(); i++) {
284 if (entireGeometry[i].distanceTo2D(newPos) <
SNAP_RADIUS) {
285 if (i == 0 || i == (
int)(entireGeometry.size() - 1)) {
293 if (createIfNoExist) {
321 if (index < (
int)edgeGeometry.size()) {
323 edgeGeometry[index] = oldPos;
324 edgeGeometry[index].
add(offset);
344 for (
auto& i : modifiedShape) {
362 innerShapeToCommit.
removeClosest(innerShapeToCommit[(
int)innerShapeToCommit.size() - 1]);
387 modifiedShape.erase(modifiedShape.begin() + index);
418 ret.
add(i->getBoundary());
483 double circleWidthSquared = circleWidth * circleWidth;
498 glGetFloatv(GL_CURRENT_COLOR, color);
581 GNELane* lane2 = myLanes[myLanes.size() - 1];
587 if (angle > 90 && angle < 270) {
593 if (drawStreetName) {
622 if (geom[index].distanceTo(clickPos) <
SNAP_RADIUS) {
635 undoList->
p_begin(
"remove endpoint");
639 undoList->
p_begin(
"remove endpoint");
651 undoList->
p_begin(
"set endpoint");
713 std::vector<GNEConnection*> retrievedConnections;
715 for (
auto it : connections) {
719 retrievedConnections.push_back(retrievedGNEConnection);
726 retrievedGNEConnection->
incRef(
"GNEEdge::remakeGNEConnections");
736 if (it->unreferenced()) {
738 WRITE_DEBUG(
"Deleting unreferenced " + it->getTagStr() +
" '" + it->getID() +
"' in rebuildGNEConnections()");
743 myGNEConnections = retrievedConnections;
752 if (i->isAttributeCarrierSelected()) {
753 i->unselectAttributeCarrier();
758 i->decRef(
"GNEEdge::clearGNEConnections");
760 if (i->unreferenced()) {
762 WRITE_DEBUG(
"Deleting unreferenced " + i->getTagStr() +
" '" + i->getID() +
"' in clearGNEConnections()");
766 myGNEConnections.clear();
772 std::vector<GNEAdditional*> routeProbes;
775 routeProbes.push_back(i);
779 auto it = std::find(routeProbes.begin(), routeProbes.end(), routeProbe);
780 if (it == routeProbes.end()) {
783 return (
int)(it - routeProbes.begin());
788 std::vector<GNECrossing*>
790 std::vector<GNECrossing*> crossings;
792 if (i->checkEdgeBelong(
this)) {
793 crossings.push_back(i);
797 if (i->checkEdgeBelong(
this)) {
798 crossings.push_back(i);
810 std::vector<std::string> edgeIDs;
817 if (edgeIDs.empty()) {
819 }
else if (edgeIDs.size() == 1) {
821 if (edgeIDs.front() ==
getID()) {
824 throw ProcessError(
"Edge ID wasnt' found in Additional");
827 auto it = std::find(edgeIDs.begin(), edgeIDs.end(),
getID());
828 if (it != edgeIDs.end()) {
833 throw ProcessError(
"Edge ID wasnt' found in Additional");
842 undoList->
p_begin(
"copy template");
851 for (
int i = 0; i < (int)
myLanes.size(); i++) {
864 std::set<GUIGlID> result;
866 result.insert(i->getGlID());
872 const std::vector<GNELane*>&
878 const std::vector<GNEConnection*>&
920 return "lane specific";
926 return "lane specific";
932 return "lane specific";
979 const std::string origValue =
myLanes.at(0)->getAttribute(key);
982 it->setAttribute(key, value, undoList);
1104 return canParse<double>(value) && (parse<double>(value) > 0);
1106 return canParse<int>(value) && (parse<double>(value) > 0);
1108 return canParse<int>(value);
1118 return canParse<PositionVector>(value);
1126 return canParse<double>(value) && (parse<double>(value) >= 0);
1128 if (value.empty()) {
1130 }
else if(canParse<Position>(value)) {
1131 Position shapeStart = parse<Position>(value);
1138 if (value.empty()) {
1140 }
else if(canParse<Position>(value)) {
1141 Position shapeEnd = parse<Position>(value);
1150 return canParse<bool>(value);
1164 result += i.first +
"=" + i.second +
"|";
1167 if (!result.empty()) {
1174 std::vector<std::pair<std::string, std::string> >
1176 std::vector<std::pair<std::string, std::string> > result;
1179 result.push_back(std::make_pair(i.first, i.second));
1190 std::vector<std::string> parsedValues;
1193 parsedValues.push_back(stValues.
next());
1196 for (
auto i : parsedValues) {
1197 std::vector<std::string> parsedParameters;
1200 parsedParameters.push_back(stParam.
next());
1244 throw InvalidArgument(
"GNEEdge::setAttribute (private) called for attr SUMO_ATTR_NUMLANES. This should never happen");
1256 setGeometry(parse<PositionVector>(value),
true,
true);
1280 WRITE_DEBUG(
"invalidating (removing) connections of edge '" +
getID() +
"' due it were guessed");
1284 WRITE_DEBUG(
"declaring connections of edge '" +
getID() +
"' as loaded (It will not be removed)");
1294 newShapeStart = parse<Position>(value);
1306 newShapeEnd = parse<Position>(value);
1315 if (parse<bool>(value)) {
1345 const int oldNumLanes = (int)
myLanes.size();
1346 for (
int i = oldNumLanes; i < numLanes; i++) {
1351 for (
int i = oldNumLanes - 1; i > numLanes - 1; i--) {
1366 myNBEdge.
addLane(index,
true, recomputeConnections, !recomputeConnections);
1373 lane =
new GNELane(*
this, index);
1376 lane->
incRef(
"GNEEdge::addLane");
1388 for (
int i = 0; i < (int)
myLanes.size(); ++i) {
1399 i->remakeGNEConnections();
1403 i->remakeGNEConnections();
1419 if (lane ==
nullptr) {
1429 lane->
decRef(
"GNEEdge::removeLane");
1438 for (
int i = 0; i < (int)
myLanes.size(); ++i) {
1449 i->remakeGNEConnections();
1453 i->remakeGNEConnections();
1475 if (selectAfterCreation) {
1483 dynamic_cast<GNEDetectorE2*
>(i)->checkE2MultilaneIntegrity();
1489 dynamic_cast<GNEDetectorE2*
>(i)->checkE2MultilaneIntegrity();
1508 if (con !=
nullptr) {
1509 con->
decRef(
"GNEEdge::removeConnection");
1514 dynamic_cast<GNEDetectorE2*
>(i)->checkE2MultilaneIntegrity();
1520 dynamic_cast<GNEDetectorE2*
>(i)->checkE2MultilaneIntegrity();
1543 if ((i->getFromLaneIndex() == fromLane) && (i->getEdgeTo()->getNBEdge() == to) && (i->getToLaneIndex() == toLane)) {
1547 if (createIfNoExist) {
1551 WRITE_DEBUG(
"Created " + createdConnection->
getTagStr() +
" '" + createdConnection->
getID() +
"' in retrieveGNEConnection()");
1557 dynamic_cast<GNEDetectorE2*
>(i)->checkE2MultilaneIntegrity();
1563 dynamic_cast<GNEDetectorE2*
>(i)->checkE2MultilaneIntegrity();
1566 return createdConnection;
1578 i->setMicrosimID(
getNBEdge()->getLaneID(i->getIndex()));
1586 if (i->isRestricted(vclass)) {
1598 if (i->checkEdgeBelong(
this)) {
1610 PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
1623 #ifdef DEBUG_SMOOTH_GEOM 1625 <<
" forElevation=" << forElevation
1628 <<
" smoothShape old=" << old <<
"\n";
1630 if (old.size() == 3 || old.size() == 4) {
1632 }
else if (old.size() > 4 && !forElevation) {
1634 init.push_back(old[0]);
1635 init.push_back(old[1]);
1636 init.push_back(old[-2]);
1637 init.push_back(old[-1]);
1643 if (incoming.size() == 1) {
1644 begShape = incoming[0]->getGeometry();
1646 assert(incoming.size() == 2);
1649 if (outgoing.size() == 1) {
1650 endShape = outgoing[0]->getGeometry();
1652 assert(outgoing.size() == 2);
1658 init.push_back(old[0]);
1661 init.push_back(old[-1]);
1665 init[1].setz(2 * init[0].z() - begZ);
1666 init[2].setz(2 * init[-1].z() - endZ);
1669 const double straightThresh =
DEG2RAD(oc.
getFloat(
"opendrive-output.straight-threshold"));
1672 #ifdef DEBUG_SMOOTH_GEOM 1674 std::cout <<
" begShape=" << begShape <<
" endShape=" << endShape <<
" forElevation=" << forElevation <<
" dist=" << dist <<
" ok=" << ok <<
" init=" << init <<
"\n";
1678 if (init.size() == 0) {
1681 const int numPoints =
MAX2(oc.
getInt(
"junctions.internal-link-detail"),
1683 return bezier(init, numPoints);
1691 if (modifiedShape.size() < 2) {
1694 PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
1704 if (elevationBase.size() == 0 || elevationBase[-1].z() != pos.z()) {
1705 elevationBase.push_back(pos);
1709 if (elevation.size() <= 2) {
1713 if (modifiedShape.size() < 5) {
1719 for (
int i = 1; i < (int)modifiedShape.size(); ++i) {
1720 seen += modifiedShape[i - 1].distanceTo2D(modifiedShape[i]);
1724 PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
1734 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.
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)
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
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.
RGBColor selectedEdgeColor
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.
int indexOfClosest(const Position &p) const
index of the closest position to p
an e2 detector over multiple lanes (used by Netedit)
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
GNEEdge()
constructor for dummy edge
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
GUIVisualizationTextSettings edgeValue
Position snapToActiveGrid(const Position &pos) const
Returns a position that is mapped to the closest grid point if the grid is active.
The representation of a single edge during network building.
void moveShapeStart(const Position &oldPos, const Position &offset)
move position of shape start without commiting change
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048)
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...
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
void setShapeStartPos(const Position &pos, bool updateGrid)
change Shape StartPos
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
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
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge ...
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
GNELane * getLaneFrom() const
get lane of the incoming lane
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
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.
static GNEEdge DummyEdge
Dummy edge to use when a reference must be supplied in the no-arguments constructor (FOX technicality...
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.
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 hasLaneSpecificEndOffset() const
whether lanes differ in offset
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
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
GNELane * getLaneTo() const
get lane of the outgoing lane
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.
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
begin/end of the description of an edge
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
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
bool editingElevation() const
return true if elevation is being edited
void moveEntireShape(const PositionVector &oldShape, const Position &offset)
move entire shape without commiting change
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
const std::string & getTagStr() const
get tag assigned to this object in string format
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
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
static int getCircleResolution(const GUIVisualizationSettings &settings)
function to calculate circle resolution for all circles drawn in drawGL(...) functions ...
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions) ...
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)
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
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
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
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
void setShapeEndPos(const Position &pos, bool updateGrid)
change Shape EndPos
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 getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
return value for lane coloring according to the given scheme
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
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.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void removeEdgeOfAdditionalParents(GNEUndoList *undoList)
remove Edge of Additional Parent
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[])