 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
65 myGNEJunctionSource(myNet->retrieveJunction(myNBEdge.getFromNode()->getID())),
66 myGNEJunctionDestiny(myNet->retrieveJunction(myNBEdge.getToNode()->getID())),
68 myAmResponsible(false),
70 myConnectionStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED) {
74 for (
int i = 0; i < numLanes; i++) {
76 myLanes.back()->incRef(
"GNEEdge::GNEEdge");
86 myNBEdge(
NBEdge::DummyEdge) {
92 i->decRef(
"GNEEdge::~GNEEdge");
93 if (i->unreferenced()) {
95 WRITE_DEBUG(
"Deleting unreferenced " + i->getTagStr() +
" '" + i->getID() +
"' in GNEEdge destructor");
101 i->decRef(
"GNEEdge::~GNEEdge");
102 if (i->unreferenced()) {
104 WRITE_DEBUG(
"Deleting unreferenced " + i->getTagStr() +
" '" + i->getID() +
"' in GNEEdge destructor");
145 if (i->getTagProperty().isPersonPlan()) {
146 i->getDemandElementParents().front()->markSegmentGeometryDeprecated();
148 i->markSegmentGeometryDeprecated();
193 shapeStartEdited.
add(offset);
209 shapeEndEdited.
add(offset);
257 i->startGeometryMoving();
261 i->startGeometryMoving();
265 i->startGeometryMoving();
269 i->startGeometryMoving();
273 i->startGeometryMoving();
288 i->endGeometryMoving();
292 i->endGeometryMoving();
296 i->endGeometryMoving();
300 i->endGeometryMoving();
304 i->endGeometryMoving();
325 for (
int i = 0; i < (int)entireGeometry.size(); i++) {
326 if (entireGeometry[i].distanceTo2D(newPos) <
SNAP_RADIUS) {
327 if (i == 0 || i == (
int)(entireGeometry.size() - 1)) {
335 if (createIfNoExist) {
365 if (index < (
int)edgeGeometry.size()) {
367 edgeGeometry[index] = oldPos;
368 edgeGeometry[index].
add(offset);
388 for (
auto& i : modifiedShape) {
406 innerShapeToCommit.
removeClosest(innerShapeToCommit[(
int)innerShapeToCommit.size() - 1]);
432 modifiedShape.erase(modifiedShape.begin() + index);
466 for (
const auto& i :
myLanes) {
467 b.
add(i->getCenteringBoundary());
556 glPushName(i->getGlID());
570 glPushName(i->getGlID());
634 if (geom[index].distanceTo(clickPos) <
SNAP_RADIUS) {
647 undoList->
p_begin(
"remove endpoint");
651 undoList->
p_begin(
"remove endpoint");
663 undoList->
p_begin(
"set endpoint");
717 std::vector<GNEConnection*> retrievedConnections;
719 for (
auto it : connections) {
723 retrievedConnections.push_back(retrievedGNEConnection);
730 retrievedGNEConnection->
incRef(
"GNEEdge::remakeGNEConnections");
740 if (it->unreferenced()) {
742 WRITE_DEBUG(
"Deleting unreferenced " + it->getTagStr() +
" '" + it->getID() +
"' in rebuildGNEConnections()");
756 if (i->isAttributeCarrierSelected()) {
757 i->unselectAttributeCarrier();
760 i->decRef(
"GNEEdge::clearGNEConnections");
762 if (i->unreferenced()) {
764 WRITE_DEBUG(
"Deleting unreferenced " + i->getTagStr() +
" '" + i->getID() +
"' in clearGNEConnections()");
774 std::vector<GNEAdditional*> routeProbes;
777 routeProbes.push_back(i);
781 auto it = std::find(routeProbes.begin(), routeProbes.end(), routeProbe);
782 if (it == routeProbes.end()) {
785 return (
int)(it - routeProbes.begin());
790 std::vector<GNECrossing*>
792 std::vector<GNECrossing*> crossings;
794 if (i->checkEdgeBelong(
this)) {
795 crossings.push_back(i);
799 if (i->checkEdgeBelong(
this)) {
800 crossings.push_back(i);
809 undoList->
p_begin(
"copy template");
819 for (
int i = 0; i < (int)
myLanes.size(); i++) {
831 std::set<GUIGlID> result;
833 result.insert(i->getGlID());
839 const std::vector<GNELane*>&
845 const std::vector<GNEConnection*>&
887 return "lane specific";
893 return "lane specific";
899 return "lane specific";
948 const std::string origValue =
myLanes.at(0)->getAttribute(key);
951 it->setAttribute(key, value, undoList);
1074 return canParse<double>(value) && (parse<double>(value) > 0);
1076 return canParse<int>(value) && (parse<double>(value) > 0);
1078 return canParse<int>(value);
1088 return canParse<PositionVector>(value);
1094 return canParse<double>(value) && ((parse<double>(value) >= -1) || (parse<double>(value) ==
NBEdge::UNSPECIFIED_WIDTH));
1096 return canParse<double>(value) && parse<double>(value) >= 0 && parse<double>(value) <
myNBEdge.
getLoadedLength();
1098 return canParse<double>(value);
1100 if (value.empty()) {
1102 }
else if (canParse<Position>(value)) {
1103 Position shapeStart = parse<Position>(value);
1110 if (value.empty()) {
1112 }
else if (canParse<Position>(value)) {
1113 Position shapeEnd = parse<Position>(value);
1122 return canParse<bool>(value);
1136 result += i.first +
"=" + i.second +
"|";
1139 if (!result.empty()) {
1146 std::vector<std::pair<std::string, std::string> >
1148 std::vector<std::pair<std::string, std::string> > result;
1151 result.push_back(std::make_pair(i.first, i.second));
1162 std::vector<std::string> parsedValues;
1165 parsedValues.push_back(stValues.
next());
1168 for (
auto i : parsedValues) {
1169 std::vector<std::string> parsedParameters;
1172 parsedParameters.push_back(stParam.
next());
1238 glTranslated(0, 0, route->
getType());
1244 if ((segment->junction == junction) && (segment->element == route) && segment->visible) {
1259 if ((segment->edge ==
this) && (segment->element == route) && segment->visible) {
1302 glTranslated(0, 0, tripOrFromTo->
getType());
1314 if ((segment->junction == junction) && (segment->element == tripOrFromTo) && segment->visible) {
1322 if ((segment->edge ==
this) && (segment->element == tripOrFromTo) && segment->visible) {
1341 bool drawPersonPlan =
false;
1343 drawPersonPlan =
true;
1345 drawPersonPlan =
true;
1347 drawPersonPlan =
true;
1350 drawPersonPlan =
true;
1353 if (drawPersonPlan) {
1355 double personPlanWidth = 0;
1367 if (duplicateWidth) {
1368 personPlanWidth *= 2;
1383 glPushName(personPlan->
getGlID());
1387 glTranslated(0, 0, personPlan->
getType());
1395 if ((segment->junction == junction) && (segment->element == personPlan) && segment->visible) {
1412 if ((segment->edge ==
this) && (segment->element == personPlan) && segment->visible) {
1437 if (arrivalPos != -1) {
1440 GNELane* arrivalPosLane =
nullptr;
1443 arrivalPosLane = personPlan->
getDemandElementParents().at(1)->getEdgeParents().back()->getLaneByVClass(vClassPersonPlan);
1445 arrivalPosLane = personPlan->
getEdgeParents().back()->getLaneByVClass(vClassPersonPlan);
1451 double circleWidthSquared = circleWidth * circleWidth;
1479 if (personPlan->
getDemandElementParents().front()->getDemandElementChildren().front()->getTagProperty().isPersonStop()) {
1482 firstEdge = &personPlan->
getDemandElementParents().front()->getDemandElementChildren().front()->getLaneParents().front()->getParentEdge();
1485 firstEdge = &personPlan->
getDemandElementParents().front()->getDemandElementChildren().front()->getAdditionalParents().front()->getLaneParents().front()->getParentEdge();
1492 firstEdge = personPlan->
getDemandElementParents().front()->getDemandElementChildren().front()->getEdgeParents().front();
1495 if ((firstEdge ==
this) && personPlan->
getDemandElementParents().front()->getDemandElementChildren().front() == personPlan) {
1529 throw InvalidArgument(
"GNEEdge::setAttribute (private) called for attr SUMO_ATTR_NUMLANES. This should never happen");
1573 WRITE_DEBUG(
"invalidating (removing) connections of edge '" +
getID() +
"' due it were guessed");
1577 WRITE_DEBUG(
"declaring connections of edge '" +
getID() +
"' as loaded (It will not be removed)");
1587 newShapeStart = parse<Position>(value);
1603 newShapeEnd = parse<Position>(value);
1616 if (parse<bool>(value)) {
1637 const int oldNumLanes = (int)
myLanes.size();
1638 for (
int i = oldNumLanes; i < numLanes; i++) {
1643 for (
int i = oldNumLanes - 1; i > numLanes - 1; i--) {
1658 myNBEdge.
addLane(index,
true, recomputeConnections, !recomputeConnections);
1665 lane =
new GNELane(*
this, index);
1668 lane->
incRef(
"GNEEdge::addLane");
1680 for (
int i = 0; i < (int)
myLanes.size(); ++i) {
1691 i->remakeGNEConnections();
1695 i->remakeGNEConnections();
1711 if (lane ==
nullptr) {
1721 lane->
decRef(
"GNEEdge::removeLane");
1730 for (
int i = 0; i < (int)
myLanes.size(); ++i) {
1741 i->remakeGNEConnections();
1745 i->remakeGNEConnections();
1767 if (selectAfterCreation) {
1775 dynamic_cast<GNEDetectorE2*>(i)->checkE2MultilaneIntegrity();
1781 dynamic_cast<GNEDetectorE2*>(i)->checkE2MultilaneIntegrity();
1800 if (con !=
nullptr) {
1801 con->
decRef(
"GNEEdge::removeConnection");
1806 dynamic_cast<GNEDetectorE2*>(i)->checkE2MultilaneIntegrity();
1812 dynamic_cast<GNEDetectorE2*>(i)->checkE2MultilaneIntegrity();
1833 if ((i->getFromLaneIndex() == fromLane) && (i->getEdgeTo()->getNBEdge() == to) && (i->getToLaneIndex() == toLane)) {
1837 if (createIfNoExist) {
1841 WRITE_DEBUG(
"Created " + createdConnection->
getTagStr() +
" '" + createdConnection->
getID() +
"' in retrieveGNEConnection()");
1845 dynamic_cast<GNEDetectorE2*>(i)->checkE2MultilaneIntegrity();
1851 dynamic_cast<GNEDetectorE2*>(i)->checkE2MultilaneIntegrity();
1854 return createdConnection;
1866 i->setMicrosimID(
getNBEdge()->getLaneID(i->getIndex()));
1874 if (i->isRestricted(vclass)) {
1886 if (i->checkEdgeBelong(
this)) {
1898 PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
1911 #ifdef DEBUG_SMOOTH_GEOM
1913 <<
" forElevation=" << forElevation
1916 <<
" smoothShape old=" << old <<
"\n";
1918 if (old.size() == 3 || old.size() == 4) {
1920 }
else if (old.size() > 4 && !forElevation) {
1922 init.push_back(old[0]);
1923 init.push_back(old[1]);
1924 init.push_back(old[-2]);
1925 init.push_back(old[-1]);
1931 if (incoming.size() == 1) {
1932 begShape = incoming[0]->getGeometry();
1934 assert(incoming.size() == 2);
1937 if (outgoing.size() == 1) {
1938 endShape = outgoing[0]->getGeometry();
1940 assert(outgoing.size() == 2);
1946 init.push_back(old[0]);
1949 init.push_back(old[-1]);
1953 init[1].setz(2 * init[0].z() - begZ);
1954 init[2].setz(2 * init[-1].z() - endZ);
1957 const double straightThresh =
DEG2RAD(oc.
getFloat(
"opendrive-output.straight-threshold"));
1960 #ifdef DEBUG_SMOOTH_GEOM
1962 std::cout <<
" begShape=" << begShape <<
" endShape=" << endShape <<
" forElevation=" << forElevation <<
" dist=" << dist <<
" ok=" << ok <<
" init=" << init <<
"\n";
1966 if (init.size() == 0) {
1969 const int numPoints =
MAX2(oc.
getInt(
"junctions.internal-link-detail"),
1971 return init.
bezier(numPoints);
1979 if (modifiedShape.size() < 2) {
1982 PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
1992 if (elevationBase.size() == 0 || elevationBase[-1].z() != pos.z()) {
1993 elevationBase.push_back(pos);
1997 if (elevation.size() <= 2) {
2001 if (modifiedShape.size() < 5) {
2007 for (
int i = 1; i < (int)modifiedShape.size(); ++i) {
2008 seen += modifiedShape[i - 1].distanceTo2D(modifiedShape[i]);
2012 PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
2022 geom.erase(geom.begin());
2046 double circleWidthSquared = circleWidth * circleWidth;
2055 if (color.
alpha() > 0) {
2145 if (spreadSuperposed) {
2149 Position shift(dist * cos(shiftA), dist * sin(shiftA));
2154 if (angle > 90 && angle < 270) {
2160 if (drawStreetName) {
2176 if (s.
scale * exaggeration >= 3) {
2178 glPushName(rerouter->
getGlID());
2180 for (
const auto& j :
myLanes) {
2185 glTranslated(lanePos.
x(), lanePos.
y(), rerouter->
getType());
2186 glRotated(-1 * laneRot, 0, 0, 1);
2187 glScaled(exaggeration, exaggeration, 1);
2189 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
2190 glBegin(GL_TRIANGLES);
2191 glColor3d(1, .8f, 0);
2193 glVertex2d(0 - 1.4, 0);
2194 glVertex2d(0 - 1.4, 6);
2195 glVertex2d(0 + 1.4, 6);
2196 glVertex2d(0 + 1.4, 0);
2197 glVertex2d(0 - 1.4, 0);
2198 glVertex2d(0 + 1.4, 6);
unsigned char alpha() const
Returns the alpha-amount of the color.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Position getSplitPos(const Position &clickPos)
static const double BUBBLE_RADIUS
constant values for drawing buubles
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
Position getPositionInView() const
Returns position of hierarchical element in view.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
bool myAmResponsible
whether we are responsible for deleting myNBNode
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
RGBColor selectedEdgeColor
edge selection color
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
NBEdge * toEdge
The edge the connections yields in.
An Element which don't belongs to GNENet but has influency in the simulation.
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
void addLane(GNELane *lane, const NBEdge::Lane &laneAttrs, bool recomputeConnections)
increase number of lanes by one use the given attributes and restore the GNELane
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048)
double speed
The speed allowed on this lane.
An Element which don't belongs to GNENet but has influency in the simulation.
bool unreferenced()
check if object ins't referenced
std::string myConnectionStatus
modification status of the connections
void copyTemplate(GNEEdge *tpl, GNEUndoList *undolist)
copy edge attributes from tpl
GNEJunction * myGNEJunctionSource
pointer to GNEJunction source
void updateGeometry()
update pre-computed geometry information
const std::string getID() const
function to support debugging
#define WRITE_WARNING(msg)
void removeExplicitTurnaround(std::string id)
remove edge id from the list of explicit turnarounds
GUIVisualizationSizeSettings junctionSize
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
static const double SNAP_RADIUS
const GNEDemandElement * getLockedPerson() const
get locked person
static const RGBColor BLACK
bool uncontrolled
check if Connection is uncontrolled
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
double z() const
Returns the z-position.
int insertAtClosest(const Position &p)
inserts p between the two closest positions and returns the insertion index
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
bool drawBoundaries
enable or disable draw boundaries
void resetWritable()
Resets all options to be writeable.
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool hasNext()
returns the information whether further substrings exist
void drawPartialPersonPlan(const GUIVisualizationSettings &s, const GNEDemandElement *personPlan, const GNEJunction *junction) const
draw partial person plan
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
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void moveShapeStart(const Position &oldPos, const Position &offset)
move position of shape start without commiting change
A NBNetBuilder extended by visualisation and editing capabilities.
static const double route
width for routes
void setStreetName(const std::string &name)
sets the street name of this edge
GNEJunction * myGNEJunctionDestiny
pointer to GNEJunction destiny
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
std::vector< Segment >::const_iterator end() const
end iterator
double contPos
custom position for internal junction on this connection
void drawPartialTripFromTo(const GUIVisualizationSettings &s, const GNEDemandElement *tripOrFromTo, const GNEJunction *junction) const
draw partial trip and Flow
GUIVisualizationWidthSettings widthSettings
width settings
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
void setMicrosimID(const std::string &newID)
override to also set lane ids
void endGeometryMoving()
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
GNEEdge()
constructor for dummy edge
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
begin/end of the description of a single lane
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
void removeIncomingGNEEdge(GNEEdge *edge)
remove incoming GNEEdge
void setShapeEndPos(const Position &pos)
change Shape EndPos
void drawEdgeName(const GUIVisualizationSettings &s) const
draw edge name
void clearGNEConnections()
clear current connections
static const double ride
width for rides
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
static OptionsCont & getOptions()
Retrieves the options.
int getPriority() const
Returns the priority of the edge.
bool showDemandElements() const
check if show demand elements checkbox is enabled
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
const std::vector< GNEEdge * > & getEdgeParents() const
get edge parents
void setDistance(double distance)
set lane specific speed (negative lane implies set for all lanes)
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
last coordinate of edge shape
const DemandElementSegmentGeometry & getDemandElementSegmentGeometry() const
get demand element segment geometry
const std::vector< GNEConnection * > & getGNEConnections() const
returns a reference to the GNEConnection vector
void removeLane(GNELane *lane, bool recomputeConnections)
@briefdecrease the number of lanes by one. argument is only used to increase robustness (assertions)
double length() const
Returns the length.
bool hasRestrictedLane(SUMOVehicleClass vclass) const
check if edge has a restricted lane
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
void drawPartialRoute(const GUIVisualizationSettings &s, const GNEDemandElement *route, const GNEJunction *junction) const
draw partial route
void setLoadedLength(double val)
set loaded lenght
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
void smooth(GNEUndoList *undoList)
make geometry smooth
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
The connection was given by the user.
int myPriority
The priority of the edge.
The information about how to spread the lanes from the given position.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
GNELane * getLaneFrom() const
@briefthe get lane of the incoming lane
SumoXMLTag
Numbers representing SUMO-XML - element names.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
void moveShapeEnd(const Position &oldPos, const Position &offset)
move position of shape end without commiting change
int fromLane
The lane the connections starts at.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
PositionVector shape
The shape of the netElement element.
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
static const double geometryPointsText
details for Geometry Points Texts
double scaledSize(double scale, double constFactor=0.1) const
get scale size
void updateGeometry()
update pre-computed geometry information
The representation of a single edge during network building.
void removeEdgeFromCrossings(GNEJunction *junction, GNEUndoList *undoList)
remove crossing of junction
Representation of a RouteProbe in netedit.
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
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
GUIColorer junctionColorer
The junction colorer.
int getIndex() const
returns the index of the lane
void commitShapeStartChange(const Position &oldPos, GNEUndoList *undoList)
commit position changing in shape start
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute attr
double speed
custom speed for connection
PositionVector smoothShape(const PositionVector &shape, bool forElevation)
return smoothed shape
A road/street connecting two junctions (netedit-version)
bool myWasSplit
whether this edge was created from a split
friend class GNEChange_Attribute
declare friend class
std::string getAttribute(SumoXMLAttr key) const
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void add(double xoff, double yoff, double zoff)
int toLane
The lane the connections yields in.
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
const Position & getPosition() const
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
first coordinate of edge shape
NBNode * getNBNode() const
Return net build node.
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
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)
static const std::string FEATURE_GUESSED
feature has been reguessed (may still be unchanged be we can't tell (yet)
virtual std::string getAttribute(SumoXMLAttr key) const =0
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
GUIVisualizationTextSettings addName
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
void reset()
Resets the boundary.
int removeClosest(const Position &p)
removes the point closest to p and return the removal index
NBNode * getToNode() const
Returns the destination node of the edge.
whether a feature has been loaded,guessed,modified or approved
const double SUMO_const_halfLaneWidth
std::vector< Segment >::const_iterator begin() const
begin iterator
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.
void push_back_noDoublePos(const Position &p)
insert in back a non double position
a flow definitio nusing a from-to edges instead of a route (used by router)
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
GUIVisualizationDetailSettings detailSettings
detail settings
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
bool clickedOverShapeStart(const Position &pos)
void commitShapeEndChange(const Position &oldPos, GNEUndoList *undoList)
commit position changing in shape end
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
double getLaneWidth() const
Returns the default width of lanes of this edge.
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
std::string getGenericParametersStr() const
return generic parameters in string format
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
GNELane * getLaneTo() const
@briefthe get lane of the outgoing lane
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
virtual std::string getAttribute(SumoXMLAttr key) const =0
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
NBEdge * getNBEdge() const
returns the internal NBEdge
static const double INVALID_OFFSET
a value to signify offsets outside the range of [0, Line.length()]
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
void addIncomingGNEEdge(GNEEdge *edge)
add incoming GNEEdge
virtual double getAttributeDouble(SumoXMLAttr key) const =0
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
virtual const RGBColor & getColor() const =0
get color
void drawChildConnections(const GUIVisualizationSettings &s, const GUIGlObjectType GLTypeParent) const
vehicle is a passenger car (a "normal" car)
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
GUIGlID getGlID() const
Returns the numerical id of the object.
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
A class that stores a 2D geometrical boundary.
Position getPositionInView() const
Returns position of hierarchical element in view.
static GNEEdge & getDummyEdge()
Dummy edge to use when a reference must be supplied in the no-arguments constructor (FOX technicality...
int getNumLanes() const
Returns the number of lanes.
begin/end of the description of an edge
static void drawShapeDottedContourRectangle(const GUIVisualizationSettings &s, const int type, const Position ¢er, const double width, const double height, const double rotation=0, const double offsetX=0, const double offsetY=0)
draw a dotted contour around the given Position with certain width and height
static const double personTrip
width for person trips
double getChildRotation(const GNELane *lane)
get child rotation calculated in ChildConnections
static const RGBColor personTrip
color for personStops
double scale
information about a lane's width (temporary, used for a single view)
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
Supermode currentSupermode
the current supermode
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
void drawRerouterSymbol(const GUIVisualizationSettings &s, GNEAdditional *rerouter) const
draw Rerouter symbols
static void drawShapeDottedContourBetweenLanes(const GUIVisualizationSettings &s, const int type, const PositionVector &frontLaneShape, const double offsetFrontLaneShape, const PositionVector &backLaneShape, const double offsetBackLaneShape)
draw a dotted contour around the given lane shapes
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
static const double trip
width for trips
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
GNEUndoList * getUndoList() const
get the undoList object
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
A storage for options typed value containers)
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
bool isWalk() const
return true if tag correspond to a walk element
static const PositionVector EMPTY
empty Vector
bool clickedOverShapeEnd(const Position &pos)
return true if user clicked over ShapeEnd
bool editingElevation() const
check if we're editing elevation
Lane & getLaneStruct(int lane)
double width
This lane's width.
GNEEdge * getOppositeEdge() const
get opposite edge
void addOutgoingGNEEdge(GNEEdge *edge)
add outgoing GNEEdge
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
int indexOfClosest(const Position &p) const
index of the closest position to p
void decRef(const std::string &debugMsg="")
Decrease reference.
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
double length2D() const
Returns the length.
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
GNEConnection * retrieveGNEConnection(int fromLane, NBEdge *to, int toLane, bool createIfNoExist=true)
get GNEConnection if exist, and if not create it if create is enabled
void setGeometry(PositionVector geom, bool inner)
update edge geometry and inform the lanes
void mul(double val)
Multiplies both positions with the given value.
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false, const bool adaptToLaneRemoval=false, const bool keepPossibleTurns=false)
Removes the specified connection(s)
void declareConnectionsAsLoaded(EdgeBuildingStep step=LANES2LANES_USER)
declares connections as fully loaded. This is needed to avoid recomputing connections if an edge has ...
const NetElementGeometry & getGeometry() const
int getRouteProbeRelativePosition(GNERouteProbe *routeProbe) const
obtain relative positions of RouteProbes
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
void setLogicValid(bool valid, GNEUndoList *undoList, const std::string &status=FEATURE_GUESSED)
void startGeometryMoving()
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
GNEViewNet * getViewNet() const
get view net
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
ConnectionVector myGNEConnections
vector with the connections of this edge
GUIVisualizationTextSettings streetName
const std::string & getStreetName() const
Returns the street name of this edge.
an e2 detector over multiple lanes (used by Netedit)
GUIVisualizationColorSettings colorSettings
color settings
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
void setResponsible(bool newVal)
set responsibility for deleting internal strctures
void addConnection(NBEdge::Connection nbCon, bool selectAfterCreation=false)
adds a connection
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
bool isPersonTrip() const
return true if tag correspond to a person trip
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
void drawGeometryPoints(const GUIVisualizationSettings &s) const
draw geometry points
bool showNonInspectedDemandElements(const GNEDemandElement *demandElement) const
check if non inspected element has to be hidden
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
GNEJunction * getGNEJunctionSource() const
returns the source-junction
double getEndOffset() const
Returns the offset to the destination node.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
bool isPersonPlan() const
return true if tag correspond to a person plan
std::set< GUIGlID > getLaneGlIDs() const
returns GLIDs of all lanes
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
const std::vector< GNEDemandElement * > & getDemandElementParents() const
return vector of demand elements that have as Parent this edge (For example, Calibrators)
std::vector< GNECrossing * > getGNECrossings()
get GNECrossings vinculated with this Edge
double y() const
Returns the y-position.
void moveEntireShape(const PositionVector &oldShape, const Position &offset)
move entire shape without commiting change
void deleteLane(int index, bool recompute, bool shiftIndices)
delete lane
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
PositionVector resample(double maxLength) const
resample shape with the given number of points (equal spacing)
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators)
void updateJunctionPosition(GNEJunction *junction, const Position &origPos)
update edge geometry after junction move
double rotationAtOffset(double pos) const
Returns the rotation at the given length.
double getSpeed() const
Returns the speed allowed on this edge.
Demanding mode (Routes, Vehicles etc..)
bool geometryLike() const
whether this is structurally similar to a geometry node
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
An (internal) definition of a single lane of an edge.
PositionVector interpolateZ(double zStart, double zEnd) const
returned vector that varies z smoothly over its length
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
const std::vector< GNEAdditional * > & getAdditionalChildren() const
return vector of additionals that have as Parent this edge (For example, Calibrators)
int moveVertexShape(const int index, const Position &oldPos, const Position &offset)
change position of a vertex of shape without commiting change
bool keepClear
whether the junction must be kept clear when using this connection
const SVCPermissions SVCAll
all VClasses are allowed
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
virtual std::string getAttribute(SumoXMLAttr key) const =0
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void incRef(const std::string &debugMsg="")
Increarse reference.
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
std::string myType
The type of the edge.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
static const double UNSPECIFIED_WIDTH
unspecified lane width
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
static const RGBColor ride
color for rides
void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices)
add lane
PositionVector customShape
custom shape for connection
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
void removeConnection(NBEdge::Connection nbCon)
removes a connection
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
const Position & getChildPosition(const GNELane *lane)
get child position calculated in ChildConnections
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
double getFinalLength() const
get length that will be assigned to the lanes in the final network
GNENet * myNet
the net to inform about updates
void updateLinkState()
recompute cached myLinkState
begin/end of the description of a route
void clearParameter()
Clears the parameter map.
const std::string & getTypeID() const
get ID of type
RGBColor selectedPersonPlanColor
person plan selection color (Rides, Walks, personStops...)
void renameEdge(GNEEdge *edge, const std::string &newID)
updates the map and reserves new id
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
lane spread functions
void updateGeometry()
update pre-computed geometry information
GUIVisualizationSizeSettings addSize
bool hasString(const std::string &str) const
void add(const Position &pos)
Adds the given position to this one.
GUIColorer laneColorer
The lane colorer.
bool isInitialised() const
check if Boundary is Initialised
void markConnectionGeometryDeprecated()
check that connection's Geometry has to be updated
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
PositionVector bezier(int numPoints)
return a bezier interpolation
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
Boundary & grow(double by)
extends the boundary by the given amount
static void drawShapeDottedContourPartialShapes(const GUIVisualizationSettings &s, const int type, const Position &begin, const Position &end, const double width)
draw a dotted contour in a partial shapes
bool isValid(SumoXMLAttr key, const std::string &value)
static const RGBColor walk
color for walks
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
return value for lane coloring according to the given scheme
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
double endOffset
This lane's offset to the intersection begin.
void selectAttributeCarrier(bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
bool isRide() const
return true if tag correspond to a ride element
const std::string & getTagStr() const
get tag assigned to this object in string format
void commitShapeChange(const PositionVector &oldShape, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of changeShapeGeometry(....
LaneVector myLanes
vectgor with the lanes of this edge
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Stores the information about how to visualize structures.
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
GNELane * getLaneByVClass(const SUMOVehicleClass vClass) const
return the first lane that allow a vehicle of type vClass (or the first lane, if none was found)
static const RGBColor vehicleTrips
color for vehicle trips
const std::set< GNEDemandElement * > & getSortedDemandElementChildrenByType(SumoXMLTag tag) const
return vector of demand elements that have as Parent this edge (For example, Calibrators)
friend class GNEChange_Lane
Friend class.
A structure which describes a connection between edges or lanes.
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators)
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 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.
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
begin/end of the description of a embedded route (used in NETEDIT)
const std::string getOptionalName() const
Returns the street name.
bool showAllPersonPlans() const
check all person plans has to be show
whether an edge is part of a bidirectional railway
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
double visibility
custom foe visiblity for connection
RGBColor selectedVehicleColor
vehicle selection color
edge: the shape in xml-definition
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
NetworkEditMode networkEditMode
the current Network edit mode
const std::string & getID() const
Returns the id.
NBEdge & myNBEdge
the underlying NBEdge
const std::vector< Connection > & getConnections() const
Returns the connections.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
GUIVisualizationTextSettings edgeName
NBNode * getFromNode() const
Returns the origin node of the edge.
const std::vector< T > & getSchemes() const
mode for moving network elements
GUIVisualizationTextSettings edgeValue
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
a single trip definition (used by router)
void changeEdgeEndpoints(GNEEdge *edge, const std::string &newSourceID, const std::string &newDestID)
modifies endpoins of the given edge
void remakeGNEConnections()
remake connections
void push_front_noDoublePos(const Position &p)
insert in front a non double position
void setShapeStartPos(const Position &pos)
change Shape StartPos
void removeDoublePoints(double minDist=POSITION_EPS, bool assertLength=false)
Removes positions if too near.
double getDistance() const
void removeOutgoingGNEEdge(GNEEdge *edge)
remove outgoing GNEEdge
static const RGBColor WHITE
double exaggeration
The size exaggeration (upscale)
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
parent of an additional element
bool hasLaneSpecificWidth() const
whether lanes differ in width
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
Boundary myMovingGeometryBoundary
boundary used during moving of elements
static const double walk
width for walks
std::string getAttributeForSelection(SumoXMLAttr key) const
method for getting the attribute in the context of object selection
NBEdge * getTurnDestination(bool possibleDestination=false) const
bool wasSplit()
whether this edge was created from a split
const std::string & getID() const
void setNumLanes(int numLanes, GNEUndoList *undoList)
changes the number of lanes. When reducing the number of lanes, higher-numbered lanes are removed fir...