52 {}, {}, {}, {}, {}, {}, {}, {}),
55 myAmCreateEdgeSource(
false),
56 myLogicStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED),
57 myAmResponsible(
false),
58 myHasValidLogic(loaded),
59 myAmTLSSelected(
false),
60 myColorForMissingConnections(
false) {
62 updateCenteringBoundary(
false);
70 if (crossing->unreferenced()) {
72 WRITE_DEBUG(
"Deleting unreferenced " + crossing->getTagStr() +
" '" + crossing->getID() +
"' in GNEJunction destructor");
79 WRITE_DEBUG(
"Deleting NBNode of '" +
getID() +
"' in GNEJunction destructor");
127 int newIndex = index;
131 if (positionAtOffset.
distanceSquaredTo2D(shapeToMove[index]) > (snap_radius * snap_radius)) {
151 if (shape.size() > 2) {
157 if ((index != -1) && shape[index].distanceSquaredTo2D(clickedPosition) < (snap_radius * snap_radius)) {
159 shape.erase(shape.begin() + index);
174 if (rebuildNBNodeCrossings) {
181 std::vector<GNECrossing*> retrievedCrossings;
186 retrievedCrossings.push_back(retrievedGNECrossing);
197 retrievedGNECrossing->
incRef();
204 if (crossing->isAttributeCarrierSelected()) {
205 crossing->unselectAttributeCarrier();
207 if (crossing->unreferenced()) {
211 WRITE_DEBUG(
"Deleting unreferenced " + crossing->getTagStr() +
" in rebuildGNECrossings()");
268 const std::string menuEntry =
"Convert to roundabout (using junction radius " +
toString(radius) +
")";
274 mcRoundabout->disable();
281 mcCustomShape->disable();
282 mcClearConnections->disable();
283 mcResetConnections->disable();
286 if (handlingSelection) {
287 mcResetCustomShape->setText(
"Reset junction shapes");
291 mcClearConnections->disable();
295 mcResetCustomShape->disable();
301 std::string reason =
"wrong edit mode";
303 mcReplace->setText(mcReplace->getText() +
" (" + reason.c_str() +
")");
304 mcReplace->disable();
306 if (numEndpoints == 1) {
308 mcSplitReconnect->disable();
326 const double EXTENT = 2;
352 bool drawBubble =
true;
370 if (junctionExaggeration > 0) {
391 if (junctionShapeColor.
alpha() != 0) {
399 if (junctionExaggeration > 1) {
405 if (junctionClosedShape.
around(mousePosition)) {
409 glTranslated(mousePosition.
x(), mousePosition.
y(), 0.1);
431 if (junctionExaggeration > 1) {
452 if (bubbleColor.
alpha() != 0) {
523 std::vector<GNEJunction*>
526 std::set<GNEJunction*> junctions;
528 junctions.insert(i->getParentJunctions().front());
531 junctions.insert(i->getParentJunctions().back());
533 return std::vector<GNEJunction*>(junctions.begin(), junctions.end());
590 const std::vector<GNEEdge*>&
596 const std::vector<GNEEdge*>&
602 const std::vector<GNECrossing*>&
608 std::vector<GNEConnection*>
610 std::vector<GNEConnection*> connections;
612 for (
const auto& j : i->getGNEConnections()) {
613 connections.push_back(j);
658 assert(undoList != 0);
662 for (EdgeVector::iterator it = incoming.begin(); it != incoming.end(); it++) {
682 std::vector<NBEdge::Connection> connections = srcNBE->
getConnections();
684 for (std::vector<NBEdge::Connection>::reverse_iterator con_it = connections.rbegin(); con_it != connections.rend(); con_it++) {
685 if (lane >= 0 && (*con_it).fromLane != lane) {
688 bool hasTurn = con_it->toEdge == turnEdge;
697 std::vector<NBConnection> removeConnections;
699 removeConnections.push_back(
NBConnection(srcNBE, con.fromLane, con.toEdge, con.toLane));
709 std::vector<NBConnection> removeConnections;
712 std::vector<NBEdge::Connection> connections = srcNBE->getConnections();
713 for (std::vector<NBEdge::Connection>::reverse_iterator con_it = connections.rbegin(); con_it != connections.rend(); con_it++) {
714 if ((*con_it).toEdge == destNBE) {
715 if (lane >= 0 && (*con_it).toLane != lane) {
718 bool hasTurn = srcNBE->getTurnDestination() == destNBE;
725 removeConnections.push_back(
NBConnection(srcNBE, (*con_it).fromLane, destNBE, (*con_it).toLane));
737 if (connections.size() > 0) {
739 for (
const auto& TLS : coypOfTls) {
742 if (tlDef !=
nullptr) {
743 std::string newID = tlDef->
getID();
750 undoList->add(
new GNEChange_TLS(
this, replacementDef,
true,
false, newID),
true);
752 const std::vector<NBNode*> copyOfNodes = tlDef->
getNodes();
753 for (
const auto& node : copyOfNodes) {
755 undoList->add(
new GNEChange_TLS(sharing, tlDef,
false),
true);
756 undoList->add(
new GNEChange_TLS(sharing, replacementDef,
true,
false, newID),
true);
775 for (
const auto& TLS : coypOfTls) {
778 if (tlDef !=
nullptr) {
779 std::string newID = tlDef->
getID();
782 for (
int i = 0; i < (int)which->
getLanes().size(); ++i) {
786 undoList->add(
new GNEChange_TLS(
this, replacementDef,
true,
false, newID),
true);
788 const std::vector<NBNode*> copyOfNodes = tlDef->
getNodes();
789 for (
const auto& node : copyOfNodes) {
791 undoList->add(
new GNEChange_TLS(sharing, tlDef,
false),
true);
792 undoList->add(
new GNEChange_TLS(sharing, replacementDef,
true,
false, newID),
true);
802 for (EdgeVector::iterator it = incoming.begin(); it != incoming.end(); it++) {
815 for (
const auto& TLS : coypOfTls) {
817 if (tlDef !=
nullptr) {
819 std::string newID = tlDef->
getID();
824 replacementDef = repl;
841 replacementDef = repl;
847 undoList->add(
new GNEChange_TLS(
this, replacementDef,
true,
false, newID),
true);
849 const std::vector<NBNode*> copyOfNodes = tlDef->
getNodes();
850 for (
const auto& node : copyOfNodes) {
852 undoList->add(
new GNEChange_TLS(sharing, tlDef,
false),
true);
853 undoList->add(
new GNEChange_TLS(sharing, replacementDef,
true,
false, newID),
true);
867 EdgeSet edgeSet(c->getCrossingEdges().begin(), c->getCrossingEdges().end());
869 if (edgeSet.count(edge->
getNBEdge()) == 1) {
871 if ((c->getCrossingEdges().size() == 1) && (c->getCrossingEdges().front() == edge->
getNBEdge())) {
876 std::vector<std::string> edges = GNEAttributeCarrier::parse<std::vector<std::string>>(c->getAttribute(
SUMO_ATTR_EDGES));
877 edges.erase(std::find(edges.begin(), edges.end(), edge->
getID()));
896 if (crossing->getCrossingEdges() == NBNodeCrossing->
edges) {
900 if (createIfNoExist) {
904 WRITE_DEBUG(
"Created " + createdGNECrossing->
getTagStr() +
" '" + createdGNECrossing->
getID() +
"' in retrieveGNECrossing()");
909 return createdGNECrossing;
920 for (
const auto& j : i->getGNEConnections()) {
921 j->markConnectionGeometryDeprecated();
923 if (includingNeighbours) {
924 i->getParentJunctions().front()->markConnectionsDeprecated(
false);
1003 for (
const auto& tag : copyOfPathAdditionalElements) {
1004 for (
const auto& additionalElement : tag.second) {
1006 additionalElement->updateGeometry();
1011 for (
const auto& tag : copyOfPathDemandElements) {
1012 for (
const auto& demandElement : tag.second) {
1013 demandElement->invalidatePath();
1018 for (
const auto& tag : copyOfPathGenericDatas) {
1019 for (
const auto& genericData : tag.second) {
1021 genericData->updateGeometry();
1066 for (
const auto& j : i->getGNEConnections()) {
1067 if (j->getNBEdgeConnection().keepClear) {
1109 undoList->
p_begin(
"change keepClear for whole junction");
1111 for (
const auto& j : i->getGNEConnections()) {
1127 for (
const auto& TLS : copyOfTls) {
1133 undoList->add(
new GNEChange_TLS(
this,
nullptr,
true),
true);
1135 }
else if (
getNBNode()->isTLControlled()) {
1139 for (
const auto& TLS : copyOfTls) {
1140 undoList->add(
new GNEChange_TLS(
this, TLS,
false,
false),
true);
1156 for (
const auto& TLS : copyOfTls) {
1158 if (oldLoaded !=
nullptr) {
1161 std::vector<NBNode*> nodes = TLS->getNodes();
1162 for (
const auto& node : nodes) {
1164 undoList->add(
new GNEChange_TLS(junction, TLS,
false),
true);
1165 undoList->add(
new GNEChange_TLS(junction, newDef,
true),
true);
1176 for (
const auto& oldTLS : copyOfTls) {
1177 std::vector<NBNode*> copyOfNodes = oldTLS->getNodes();
1181 for (
const auto& node : copyOfNodes) {
1183 undoList->add(
new GNEChange_TLS(oldJunction, oldTLS,
false),
true);
1185 for (
const auto& node : copyOfNodes) {
1187 undoList->add(
new GNEChange_TLS(oldJunction, newTLS,
true),
true);
1196 assert(copyOfTls.size() > 0);
1199 const bool currentIsSingle = currentTLS->
getNodes().size() == 1;
1200 const bool currentIsLoaded =
dynamic_cast<NBLoadedSUMOTLDef*
>(currentTLS) !=
nullptr;
1201 if (currentIsLoaded) {
1206 for (
const auto& TLS : copyOfTls) {
1211 const std::map<std::string, NBTrafficLightDefinition*> programs = tlCont.
getPrograms(value);
1212 if (programs.size() > 0) {
1213 for (
const auto& TLSProgram : programs) {
1215 if (
dynamic_cast<NBOwnTLDef*
>(oldTLS) !=
nullptr) {
1223 newTLSJoined->
joinLogic(currentTLSCopy);
1224 undoList->add(
new GNEChange_TLS(
this, newTLSJoined,
true,
true),
true);
1226 undoList->add(
new GNEChange_TLS(
this,
nullptr,
true,
false, value),
true);
1230 std::vector<NBNode*> copyOfNodes = oldTLS->
getNodes();
1231 for (
const auto& node : copyOfNodes) {
1233 undoList->add(
new GNEChange_TLS(oldJunction, oldTLS,
false),
true);
1234 undoList->add(
new GNEChange_TLS(oldJunction, newTLS,
true),
true);
1239 if (currentIsSingle && currentIsLoaded) {
1242 renamedLogic->
setID(value);
1244 renamedTLS->
setID(value);
1245 undoList->add(
new GNEChange_TLS(
this, renamedTLS,
true,
true),
true);
1248 undoList->add(
new GNEChange_TLS(
this,
nullptr,
true,
false, value),
true);
1251 delete currentTLSCopy;
1269 return canParse<Position>(value);
1272 return canParse<PositionVector>(value);
1274 return canParse<double>(value) && (parse<double>(value) >= -1);
1282 return canParse<bool>(value);
1290 return canParse<bool>(value);
1309 if (i->getGNEConnections().size() > 0) {
1321 const std::map<std::string, std::string>&
1343 glTranslated(pos.
x(), pos.
y(), 0.2);
1345 const double halfWidth = 32 / s.
scale;
1346 const double halfHeight = 64 / s.
scale;
1357 crossing->drawGL(s);
1361 for (
const auto& connection : incomingEdge->getGNEConnections()) {
1362 connection->drawGL(s);
1367 if (!demandElement->getTagProperty().isPlacedInRTree()) {
1368 demandElement->drawGL(s);
1373 for (
const auto& element : tag.second) {
1374 element->drawJunctionPathChildren(s,
this, 0);
1425 i->clearGNEConnections();
1446 for (
const auto& TLS : copyOfTls) {
1464 if (parse<bool>(value)) {
1513 switch (activeScheme) {
1571 if (edge->getGNEConnections().size() > 0) {
1599 for (
const auto& edge :
getNBNode()->getEdges()) {
1603 std::set<GNEJunction*> affectedJunctions;
1604 std::set<GNEEdge*> affectedEdges;
1608 affectedJunctions.insert(edge->getParentJunctions().front());
1609 affectedJunctions.insert(edge->getParentJunctions().back());
1611 for (
const auto& junctionSourceEdge : edge->getParentJunctions().front()->getChildEdges()) {
1612 affectedEdges.insert(junctionSourceEdge);
1615 for (
const auto& junctionDestinyEdge : edge->getParentJunctions().back()->getChildEdges()) {
1616 affectedEdges.insert(junctionDestinyEdge);
1620 for (
const auto& affectedEdge : affectedEdges) {
1622 if (updateEdgeBoundaries) {
1623 affectedEdge->updateCenteringBoundary(
true);
1626 affectedEdge->updateGeometry();
1665 tlCont.
insert(tlDef, forceInsert);
1673 if (tlDef->
getNodes().size() == 1) {
@ NETWORK_CREATE_EDGE
mode for creating new edges
@ NETWORK_TLS
mode for editing tls
@ NETWORK_CONNECT
mode for connecting lanes
@ MID_GNE_JUNCTION_CLEAR_CONNECTIONS
clear junction's connections
@ MID_GNE_JUNCTION_SELECT_ROUNDABOUT
select all roundabout nodes and edges of the current roundabout
@ MID_GNE_JUNCTION_RESET_SHAPE
reset junction shape
@ MID_GNE_JUNCTION_RESET_CONNECTIONS
reset junction's connections
@ MID_GNE_JUNCTION_SPLIT
turn junction into multiple junctions
@ MID_GNE_JUNCTION_REPLACE
turn junction into geometry node
@ MID_GNE_JUNCTION_CONVERT_ROUNDABOUT
convert junction to roundabout
@ MID_GNE_JUNCTION_SPLIT_RECONNECT
turn junction into multiple junctions and reconnect them heuristically
@ MID_GNE_JUNCTION_EDIT_SHAPE
edit junction shape
@ GLO_TEMPORALSHAPE
temporal shape (used in NETEDIT)
#define WRITE_GLDEBUG(msg)
std::set< NBEdge * > EdgeSet
container for unique edges
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_TRAFFIC_LIGHT
a traffic light
@ SUMO_TAG_EDGE
begin/end of the description of an edge
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
@ TRAFFIC_LIGHT_RIGHT_ON_RED
@ TRAFFIC_LIGHT_NOJUNCTION
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_TLLINKINDEX2
link: the index of the opposite direction link of a pedestrian crossing
@ SUMO_ATTR_RADIUS
The turning radius at an intersection in m.
@ SUMO_ATTR_TLLAYOUT
node: the layout of the traffic light program
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_EDGES
the edges of a route
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_FRINGE
Fringe type of node.
@ GNE_ATTR_MODIFICATION_STATUS
whether a feature has been loaded,guessed,modified or approved
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_TLTYPE
node: the type of traffic light
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_RIGHT_OF_WAY
How to compute right of way.
@ SUMO_ATTR_TLLINKINDEX
link: the index of the link within the traffic light
@ SUMO_ATTR_KEEP_CLEAR
Whether vehicles must keep the junction clear.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
Boundary & grow(double by)
extends the boundary by the given amount
static void drawFilledPoly(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
static void drawFilledPolyTesselated(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
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, const int align=0, double width=-1)
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
An Element which don't belongs to GNENet but has influency in the simulation.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
static const std::string FEATURE_GUESSED
feature has been reguessed (may still be unchanged be we can't tell (yet)
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GNENet * myNet
pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
static const std::string FEATURE_MODIFIED
feature has been manually modified (implies approval)
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void updateGeometry()
update pre-computed geometry information
An Element which don't belongs to GNENet but has influency in the simulation.
A road/street connecting two junctions (netedit-version)
NBEdge * getNBEdge() const
returns the internal NBEdge
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
void updateJunctionPosition(GNEJunction *junction, const Position &origPos)
update edge geometry after junction move
An Element which don't belongs to GNENet but has influency in the simulation.
class for NETEDIT geometries over lanes
void updateGeometry(const PositionVector &shape, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
update geometry shape
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEEdge * > & getChildEdges() const
get child edges
void removeTLSConnections(std::vector< NBConnection > &connections, GNEUndoList *undoList)
remove the given connections from all traffic light definitions of this junction
void markAsCreateEdgeSource()
marks as first junction in createEdge-mode
void addTrafficLight(NBTrafficLightDefinition *tlDef, bool forceInsert)
adds a traffic light
std::map< SumoXMLTag, std::vector< GNEAdditional * > > myPathAdditionalElements
map with references to path additional elements
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
void updateGeometryAfterNetbuild(bool rebuildNBNodeCrossings=false)
update pre-computed geometry information without modifying netbuild structures
bool myAmResponsible
whether we are responsible for deleting myNBNode
void addPathGenericData(GNEGenericData *genericData)
add path demand element (used by GNEPathElement)
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
friend class GNEChange_TLS
Declare friend class.
std::string getAttribute(SumoXMLAttr key) const
void setResponsible(bool newVal)
set responsibility for deleting internal strctures
bool myColorForMissingConnections
whether this junction probably should have some connections but doesn't
GNEJunction(GNENet *net, NBNode *nbn, bool loaded=false)
Constructor.
void unMarkAsCreateEdgeSource()
removes mark as first junction in createEdge-mode
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
std::map< SumoXMLTag, std::vector< GNEDemandElement * > > myPathDemandElements
map with references to path demand elements
void moveJunctionGeometry(const Position &pos, const bool updateEdgeBoundaries)
reposition the node at pos without updating GRID and informs the edges
void updateGeometry()
update pre-computed geometry information (including crossings)
void removePathDemandElement(GNEDemandElement *demandElement)
remove path demand element (used by GNEPathElement)
bool isLogicValid()
whether this junction has a valid logic
void drawTLSIcon(const GUIVisualizationSettings &s) const
draw TLS icon
std::vector< GNEEdge * > myGNEOutgoingEdges
vector with the (child) outgoings GNEEdges vinculated with this junction
std::map< SumoXMLTag, std::vector< GNEGenericData * > > myPathGenericDatas
map with references to path generic data elements
void removePathAdditionalElement(GNEAdditional *additionalElement)
remove path additional element (used by GNEPathElement)
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
determines color value
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
void drawJunctionChildren(const GUIVisualizationSettings &s) const
draw junction childs
void selectTLS(bool selected)
notify the junction of being selected in tls-mode. (used to control drawing)
void addPathAdditionalElement(GNEAdditional *additionalElement)
add path additional element (used by GNEPathElement)
void replaceIncomingConnections(GNEEdge *which, GNEEdge *by, GNEUndoList *undoList)
replace one edge by another in all tls connections
void removeOutgoingGNEEdge(GNEEdge *edge)
remove outgoing GNEEdge
void markAsModified(GNEUndoList *undoList)
prevent re-guessing connections at this junction
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
std::vector< GNECrossing * > myGNECrossings
the built crossing objects
void invalidateTLS(GNEUndoList *undoList, const NBConnection &deletedConnection=NBConnection::InvalidConnection, const NBConnection &addedConnection=NBConnection::InvalidConnection)
void removeIncomingGNEEdge(GNEEdge *edge)
remove incoming GNEEdge
std::vector< GNEConnection * > getGNEConnections() const
Returns all GNEConnections vinculated with this junction.
void invalidatePathElements()
invalidate path element childs
GNECrossing * retrieveGNECrossing(NBNode::Crossing *NBNodeCrossing, bool createIfNoExist=true)
get GNECrossing if exist, and if not create it if create is enabled
std::vector< GNEEdge * > myGNEIncomingEdges
vector with the (child) incomings GNEEdges vinculated with this junction
const PositionVector & getJunctionShape() const
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
void markConnectionsDeprecated(bool includingNeighbours)
mark connections as deprecated
void mirrorXLeftHand()
temporarily mirror coordinates in lefthand network to compute correct crossing geometries
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double myMaxDrawingSize
The maximum size (in either x-, or y-dimension) for determining whether to draw or not.
Position getPositionInView() const
Returns position of hierarchical element in view.
void removePathGenericData(GNEGenericData *genericData)
remove path demand element (used by GNEPathElement)
bool myAmTLSSelected
whether this junction is selected in tls-mode
void removeConnectionsFrom(GNEEdge *edge, GNEUndoList *undoList, bool updateTLS, int lane=-1)
remove all connections from the given edge
bool isValid(SumoXMLAttr key, const std::string &value)
void addIncomingGNEEdge(GNEEdge *edge)
add incoming GNEEdge
RGBColor setColor(const GUIVisualizationSettings &s, bool bubble) const
sets junction color depending on circumstances
bool myHasValidLogic
whether this junctions logic is valid
std::string myLogicStatus
modification status of the junction logic (all connections across this junction)
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
const std::vector< GNEEdge * > & getGNEOutgoingEdges() const
Returns incoming GNEEdges.
void removeEdgeFromCrossings(GNEEdge *edge, GNEUndoList *undoList)
removes the given edge from all pedestrian crossings
NBNode * getNBNode() const
Return net build node.
void addPathDemandElement(GNEDemandElement *demandElement)
add path demand element (used by GNEPathElement)
NBNode * myNBNode
A reference to the represented junction.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void checkMissingConnections()
compute whether this junction probably should have some connections but doesn't
std::vector< GNEJunction * > getJunctionNeighbours() const
return GNEJunction neighbours
GNEMoveOperation * getMoveOperation(const double shapeOffset)
get move operation for the given shapeOffset
~GNEJunction()
Destructor.
void setLogicValid(bool valid, GNEUndoList *undoList, const std::string &status=FEATURE_GUESSED)
void removeConnectionsTo(GNEEdge *edge, GNEUndoList *undoList, bool updateTLS, int lane=-1)
remove all connections to the given edge
bool myAmCreateEdgeSource
whether this junction is the first junction for a newly creatededge
void addOutgoingGNEEdge(GNEEdge *edge)
add outgoing GNEEdge
void rebuildGNECrossings(bool rebuildNBNodeCrossings=true)
rebuilds crossing objects for this junction
bool isAttributeEnabled(SumoXMLAttr key) const
void removeTrafficLight(NBTrafficLightDefinition *tlDef)
removes a traffic light
PositionVector shapeToUpdate
shape to update (edited in moveElement)
void updateID(GNEAttributeCarrier *AC, const std::string newID)
update ID
A NBNetBuilder extended by visualisation and editing capabilities.
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
NBNetBuilder * getNetBuilder() const
get net builder
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true) const
get edge by id
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
void requireRecompute()
inform the net about the need for recomputation
void addExplicitTurnaround(std::string id)
add edge id to the list of explicit turnarounds
GNEViewNet * getViewNet() const
get view net
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true) const
get junction by id
bool myShapeEdited
flag to check if element shape is being edited
bool isShapeEdited() const
check if shape is being edited
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
const std::string & getID() const
get ID
Boundary myBoundary
object boundary
void drawJunctionPathChildren(const GUIVisualizationSettings &s, const GNEJunction *junction, const double offset) const
draw junction path child
void incRef(const std::string &debugMsg="")
Increarse reference.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasCommandGroup() const
Check if undoList has command group.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
bool mergeJunctions(GNEJunction *movedJunction, GNEJunction *targetJunction)
try to merge moved junction with another junction in that spot return true if merging did take place
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, GUIGlObjectType objectType, const double extraOffset=0)
draw front attributeCarrier
const GNEViewNetHelper::ObjectsUnderCursor & getObjectsUnderCursor() const
get objects under cursor
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GUIGlID getGlID() const
Returns the numerical id of the object.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
const T getColor(const double value) const
GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings junctionName
GUIVisualizationSizeSettings junctionSize
bool drawBoundaries
enable or disable draw boundaries
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
bool drawJunctionShape
whether the shape of the junction should be drawn
bool drawForPositionSelection
whether drawing is performed for the purpose of selecting objects with a single click
GUIVisualizationTextSettings junctionID
bool drawDottedContour() const
check if dotted contour can be drawn
bool drawMovingGeometryPoint(const double exaggeration, const double radius) const
check if moving geometry point can be draw
GUIVisualizationColorSettings colorSettings
color settings
double scale
information about a lane's width (temporary, used for a single view)
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
GUIColorer junctionColorer
The junction colorer.
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
double angle
The current view rotation angle.
NBEdge * getFrom() const
returns the from-edge (start of the connection)
int getFromLane() const
returns the from-lane
int getTLIndex() const
returns the index within the controlling tls or InvalidTLIndex if this link is unontrolled
static const int InvalidTlIndex
int getToLane() const
returns the to-lane
NBEdge * getTo() const
returns the to-edge (end of the connection)
static const NBConnection InvalidConnection
void removeRoundabout(const NBNode *node)
remove roundabout that contains the given node
The representation of a single edge during network building.
const std::string & getID() const
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
NBEdge * getTurnDestination(bool possibleDestination=false) const
const std::vector< Connection > & getConnections() const
Returns the connections.
A loaded (complete) traffic light logic.
void removeConnection(const NBConnection &conn, bool reconstruct=true)
removes the given connection from the traffic light if recontruct=true, reconstructs the logic and in...
void joinLogic(NBTrafficLightDefinition *def)
join nodes and states from the given logic (append red state)
void addConnection(NBEdge *from, NBEdge *to, int fromLane, int toLane, int linkIndex, int linkIndex2, bool reconstruct=true)
Adds a connection and immediately informs the edges.
void guessMinMaxDuration()
heuristically add minDur and maxDur when switching from tlType fixed to actuated
void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane, bool incoming)
Replaces a removed edge/lane.
NBTrafficLightLogic * getLogic()
Returns the internal logic.
bool haveNetworkCrossings()
notify about style of loaded network (Without Crossings)
NBEdgeCont & getEdgeCont()
A definition of a pedestrian crossing.
EdgeVector edges
The edges being crossed.
Represents a single node (junction) during network building.
RightOfWay getRightOfWay() const
Returns hint on how to compute right of way.
Position getCenter() const
Returns a position that is guaranteed to lie within the node shape.
void reinit(const Position &position, SumoXMLNodeType type, bool updateEdgeGeometries=false)
Resets initial values.
static const double UNSPECIFIED_RADIUS
unspecified lane width
void invalidateIncomingConnections()
invalidate incoming connections
FringeType getFringeType() const
Returns fringe type.
void buildCrossingsAndWalkingAreas()
build crossings, and walkingareas. Also removes invalid loaded crossings if wished
SumoXMLNodeType getType() const
Returns the type of this node.
const std::string & getName() const
Returns intersection name.
void setRightOfWay(RightOfWay rightOfWay)
set method for computing right-of-way
void setCustomShape(const PositionVector &shape)
set the junction shape
static bool isTrafficLight(SumoXMLNodeType type)
return whether the given type is a traffic light
void mirrorX()
mirror coordinates along the x-axis
std::vector< std::pair< Position, std::string > > getEndPoints() const
return list of unique endpoint coordinates of all edges at this node
const std::vector< std::unique_ptr< Crossing > > & getCrossingsIncludingInvalid() const
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
const EdgeVector & getEdges() const
Returns all edges which participate in this node (Edges that start or end at this node)
bool hasCustomShape() const
return whether the shape was set by the user
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
void setRadius(double radius)
set the turning radius
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node)
void setName(const std::string &name)
set intersection name
void removeTrafficLight(NBTrafficLightDefinition *tlDef)
Removes the given traffic light from this node.
const PositionVector & getShape() const
retrieve the junction shape
const Position & getPosition() const
double getRadius() const
Returns the turning radius of this node.
bool isRoundabout() const
return whether this node is part of a roundabout
bool checkIsRemovableReporting(std::string &reason) const
check if node is removable and return reason if not
PositionVector myPoly
the (outer) shape of the junction
void setFringeType(FringeType fringeType)
set method for computing right-of-way
bool isTLControlled() const
Returns whether this node is controlled by any tls.
A traffic light logics which must be computed (only nodes/edges are given)
void setLayout(TrafficLightLayout layout)
sets the layout for the generated signal plan
The base class for traffic light logic definitions.
const std::string & getProgramID() const
Returns the ProgramID.
TrafficLightType getType() const
get the algorithm type (static etc..)
virtual void setProgramID(const std::string &programID)
Sets the programID.
virtual void addNode(NBNode *node)
Adds a node to the traffic light logic.
const std::vector< NBNode * > & getNodes() const
Returns the list of controlled nodes.
SUMOTime getOffset()
Returns the offset.
A container for traffic light definitions and built programs.
const std::map< std::string, NBTrafficLightDefinition * > & getPrograms(const std::string &id) const
Returns all programs for the given tl-id.
bool insert(NBTrafficLightDefinition *logic, bool forceInsert=false)
Adds a logic definition to the dictionary.
void extract(NBTrafficLightDefinition *definition)
Extracts a traffic light definition from myDefinitions but keeps it in myExtracted for eventual * del...
A SUMO-compliant built logic for a traffic light.
static void computeTurnDirectionsForNode(NBNode *node, bool warn)
Computes turnaround destinations for all incoming edges of the given nodes (if any)
virtual void setID(const std::string &newID)
resets the id
const std::string & getID() const
Returns the id.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
static OptionsCont & getOptions()
Retrieves the options.
static bool areParametersValid(const std::string &value, bool report=false, ParameterisedAttrType attrType=ParameterisedAttrType::STRING, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
void setParametersStr(const std::string ¶msString, const std::string kvsep="=", const std::string sep="|")
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
std::string getParametersStr(const std::string kvsep="=", const std::string sep="|") const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
A point in 2D or 3D with translation and scaling methods.
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
static const Position INVALID
used to indicate that a position is valid
double x() const
Returns the x-position.
double z() const
Returns the z-position.
double y() const
Returns the y-position.
void closePolygon()
ensures that the last position equals the first
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
int insertAtClosest(const Position &p, bool interpolateZ)
inserts p between the two closest positions
int indexOfClosest(const Position &p) const
index of the closest position to p
void scaleRelative(double factor)
enlarges/shrinks the polygon by a factor based at the centroid
double area() const
Returns the area (0 for non-closed)
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
bool around(const Position &p, double offset=0) const
Returns the information whether the position vector describes a polygon lying around the given point.
unsigned char alpha() const
Returns the alpha-amount of the color.
static const RGBColor GREEN
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
static StringBijection< SumoXMLNodeType > NodeTypes
node types
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
static StringBijection< TrafficLightLayout > TrafficLightLayouts
traffic light layouts
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
static StringBijection< RightOfWay > RightOfWayValues
righ of way algorithms
static StringBijection< FringeType > FringeTypeValues
fringe types
bool hasString(const std::string &str) const
const std::string & getString(const T key) const
T get(const std::string &str) const
static void drawDottedContourClosedShape(const DottedContourType type, const GUIVisualizationSettings &s, const PositionVector &shape, const double exaggeration)
draw dotted contour for the given closed shape (used by Juctions, shapes and TAZs)
static void drawGeometryPoints(const GUIVisualizationSettings &s, const GNEViewNet *viewNet, const PositionVector &shape, const RGBColor &geometryPointColor, const RGBColor &textColor, const double radius, const double exaggeration)
draw geometry points
static void drawGeometry(const GNEViewNet *viewNet, const Geometry &geometry, const double width)
draw geometry
static void drawMovingHint(const GUIVisualizationSettings &s, const GNEViewNet *viewNet, const PositionVector &shape, const RGBColor &hintColor, const double radius, const double exaggeration)
draw moving hint
static void drawDottedContourCircle(const DottedContourType type, const GUIVisualizationSettings &s, const Position &pos, const double radius, const double exaggeration)
draw dotted contour for the given Position and radius (used by Juctions and POIs)
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
bool editingElevation() const
check if we're editing elevation
RGBColor selectionColor
basic selection color
static const RGBColor editShape
color for edited shapes (Junctions, crossings and connections)
static const double junctionGeometryPointRadius
moving junction geometry point radius
static const double junctionBubbleRadius
junction buuble radius
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
double scaledSize(double scale, double constFactor=0.1) const
get scale size
A structure which describes a connection between edges or lanes.