74 for (
int i = 0; i < numLanes; i++) {
76 myLanes.back()->incRef(
"GNEEdge::GNEEdge");
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()");
747 myGNEConnections = retrievedConnections;
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()");
768 myGNEConnections.clear();
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);
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.
static const RGBColor walk
color for walks
void updateGeometry()
update pre-computed geometry information
RGBColor selectedPersonPlanColor
person plan selection color (Rides, Walks, personStops...)
void remakeGNEConnections()
remake connections
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
Position getPositionInView() const
Returns position of hierarchical element in view.
SumoXMLTag
Numbers representing SUMO-XML - element names.
double length2D() const
Returns the length.
A structure which describes a connection between edges or lanes.
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 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
const Position & getChildPosition(const GNELane *lane)
get child position calculated in ChildConnections
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.
PositionVector shape
The shape of the netElement element.
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
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
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
GUIVisualizationTextSettings addName
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.
a flow definitio nusing a from-to edges instead of a route (used by router)
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
int indexOfClosest(const Position &p) const
index of the closest position to p
RGBColor selectedVehicleColor
vehicle selection color
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
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)
const GNEDemandElement * getLockedPerson() const
get locked person
double exaggeration
The size exaggeration (upscale)
unsigned char alpha() const
Returns the alpha-amount of the color.
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
GUIColorer laneColorer
The lane colorer.
bool isPersonPlan() const
return true if tag correspond to a person plan
Stores the information about how to visualize structures.
PositionVector resample(double maxLength) const
resample shape with the given number of points (equal spacing)
void drawEdgeName(const GUIVisualizationSettings &s) const
draw edge name
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
The representation of a single edge during network building.
void drawPartialPersonPlan(const GUIVisualizationSettings &s, const GNEDemandElement *personPlan, const GNEJunction *junction) const
draw partial person plan
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
const std::vector< GNEConnection * > & getGNEConnections() const
returns a reference to the GNEConnection vector
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 drawPartialTripFromTo(const GUIVisualizationSettings &s, const GNEDemandElement *tripOrFromTo, const GNEJunction *junction) const
draw partial trip and Flow
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
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.
double getChildRotation(const GNELane *lane)
get child rotation calculated in ChildConnections
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...
virtual double getAttributeDouble(SumoXMLAttr key) const =0
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
double rotationAtOffset(double pos) const
Returns the rotation at the given length.
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
bool editingElevation() const
check if we're editing elevation
static const double ride
width for rides
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 ...
static const RGBColor BLACK
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.
bool hasNext()
returns the information whether further substrings exist
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.
virtual std::string getAttribute(SumoXMLAttr key) const =0
first coordinate of edge shape
void drawPartialRoute(const GUIVisualizationSettings &s, const GNEDemandElement *route, const GNEJunction *junction) const
draw partial route
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.
bool isPersonTrip() const
return true if tag correspond to a person trip
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
const std::vector< GNEAdditional * > & getAdditionalChildren() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
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.
virtual std::string getAttribute(SumoXMLAttr key) const =0
PositionVector customShape
custom shape for connection
begin/end of the description of a route
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
#define WRITE_WARNING(msg)
double getDistance() const
Boundary myMovingGeometryBoundary
boundary used during moving of elements
mode for moving network elements
static OptionsCont & getOptions()
Retrieves the options.
const std::vector< GNEEdge * > & getEdgeParents() const
get edge parents
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
bool isRide() const
return true if tag correspond to a ride element
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)
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
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 removeOutgoingGNEEdge(GNEEdge *edge)
remove outgoing GNEEdge
PositionVector bezier(int numPoints)
return a bezier interpolation
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
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
NBEdge * getNBEdge() const
returns the internal NBEdge
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions ...
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
An (internal) definition of a single lane of an edge.
static const double personTrip
width for person trips
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GUIVisualizationSizeSettings addSize
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 removeDoublePoints(double minDist=POSITION_EPS, bool assertLength=false)
Removes positions if too near.
whether an edge is part of a bidirectional railway
GUIVisualizationWidthSettings widthSettings
width settings
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
Position getPositionInView() const
Returns position of hierarchical element in view.
double speed
custom speed for connection
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
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
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
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
const std::set< GNEDemandElement * > & getSortedDemandElementChildrenByType(SumoXMLTag tag) const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
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
Supermode currentSupermode
the current supermode
double scaledSize(double scale, double constFactor=0.1) const
get scale size
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
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
static const double route
width for routes
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
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
virtual const RGBColor & getColor() const =0
get color
static const std::string FEATURE_GUESSED
feature has been reguessed (may still be unchanged be we can't tell (yet)
static GNEEdge & getDummyEdge()
Dummy edge to use when a reference must be supplied in the no-arguments constructor (FOX technicality...
GNEConnection * retrieveGNEConnection(int fromLane, NBEdge *to, int toLane, bool createIfNoExist=true)
get GNEConnection if exist, and if not create it if create is enabled
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
const std::string & getID() const
int myPriority
The priority of the edge.
bool geometryLike() const
whether this is structurally similar to a geometry node
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
void drawRerouterSymbol(const GUIVisualizationSettings &s, GNEAdditional *rerouter) const
draw Rerouter symbols
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
const NetElementGeometry & getGeometry() const
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.
std::set< GUIGlID > getLaneGlIDs() const
returns GLIDs of all lanes
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.
static const RGBColor ride
color for rides
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
vehicle is a passenger car (a "normal" car)
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
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
begin/end of the description of an edge
void setGeometry(PositionVector geom, bool inner)
update edge geometry and inform the lanes
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
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.
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
const DemandElementSegmentGeometry & getDemandElementSegmentGeometry() const
get demand element segment geometry
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
GUIVisualizationDetailSettings detailSettings
detail settings
const std::vector< GNEDemandElement * > & getDemandElementParents() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
bool showNonInspectedDemandElements(const GNEDemandElement *demandElement) const
check if non inspected element has to be hidden
ConnectionVector myGNEConnections
vector with the connections of this edge
static const double walk
width for walks
static const RGBColor vehicleTrips
color for vehicle trips
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
bool showDemandElements() const
check if show demand elements checkbox is enabled
void drawGeometryPoints(const GUIVisualizationSettings &s) const
draw geometry points
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.
static const RGBColor personTrip
color for personStops
std::vector< Segment >::const_iterator end() const
end iterator
void updateGeometry()
update pre-computed geometry information
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.
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
void drawChildConnections(const GUIVisualizationSettings &s, const GUIGlObjectType GLTypeParent) const
An Element which don't belongs to GNENet but has influency in the simulation.
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
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
Demanding mode (Routes, Vehicles etc..)
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 updateJunctionPosition(GNEJunction *junction, const Position &origPos)
update edge geometry after junction move
void markConnectionGeometryDeprecated()
check that connection's Geometry has to be updated
void updateGeometry()
update pre-computed geometry information
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)
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
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)
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.
begin/end of the description of a embedded route (used in NETEDIT)
GUIGlID getGlID() const
Returns the numerical id of the object.
LaneVector myLanes
vectgor with the lanes of this edge
static const std::string FEATURE_LOADED
void removeConnection(NBEdge::Connection nbCon)
removes a connection
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute attr
void updateLinkState()
recompute cached myLinkState
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
std::vector< Segment >::const_iterator begin() const
begin iterator
NetworkEditMode networkEditMode
the current Network edit mode
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
GUIVisualizationColorSettings colorSettings
color settings
last coordinate of edge shape
const std::string getOptionalName() const
Returns the street name.
void push_back_noDoublePos(const Position &p)
insert in back a non double position
a single trip definition (used by router)
parent of an additional element
NBEdge & myNBEdge
the underlying NBEdge
NBNode * getFromNode() const
Returns the origin node of the edge.
bool isWalk() const
return true if tag correspond to a walk element
bool showAllPersonPlans() const
check all person plans has to be show
RGBColor selectedEdgeColor
edge selection color
void setDistance(double distance)
set lane specific speed (negative lane implies set for all lanes)
void mul(double val)
Multiplies both positions with the given value.
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
bool hasString(const std::string &str) const
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
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
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
static const double geometryPointsText
details for Geometry Points Texts
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
return value for lane coloring according to the given scheme
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
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
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) ...
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
bool drawBoundaries
enable or disable draw boundaries
virtual std::string getAttribute(SumoXMLAttr key) const =0
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
static const double trip
width for trips
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.
An Element which don't belongs to GNENet but has influency in the simulation.
GNEViewNet * getViewNet() const
get view net
void clearParameter()
Clears the parameter map.