70 myAmCreateEdgeSource(false),
71 myLogicStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED),
72 myAmResponsible(false),
73 myHasValidLogic(loaded),
74 myAmTLSSelected(false) {
84 if (it->unreferenced()) {
86 WRITE_DEBUG(
"Deleting unreferenced " +
toString(it->getTag()) +
" '" + it->getID() +
"' in GNEJunction destructor");
93 WRITE_DEBUG(
"Deleting NBNode of '" +
getID() +
"' in GNEJunction destructor");
106 const double EXTENT = 2;
127 if (rebuildNBNodeCrossings) {
137 std::vector<GNECrossing*> retrievedCrossings;
142 retrievedCrossings.push_back(retrievedGNECrossing);
144 std::vector<GNECrossing*>::iterator retrievedExists = std::find(myGNECrossings.begin(), myGNECrossings.end(), retrievedGNECrossing);
145 if (retrievedExists != myGNECrossings.end()) {
146 myGNECrossings.erase(retrievedExists);
153 retrievedGNECrossing->
incRef();
161 for (
auto it : myGNECrossings) {
164 if (it->isAttributeCarrierSelected()) {
165 it->unselectAttributeCarrier();
167 if (it->unreferenced()) {
169 WRITE_DEBUG(
"Deleting unreferenced " +
toString(it->getTag()) +
" in rebuildGNECrossings()");
174 myGNECrossings = retrievedCrossings;
197 FXMenuCommand* mcReplace =
new FXMenuCommand(ret,
"Replace junction by geometry point", 0, &parent,
MID_GNE_JUNCTION_REPLACE);
198 FXMenuCommand* mcSplit =
new FXMenuCommand(ret, (
"Split junction (" +
toString(numEndpoints) +
" end points)").c_str(), 0, &parent,
MID_GNE_JUNCTION_SPLIT);
205 mcCustomShape->disable();
206 mcClearConnections->disable();
207 mcResetConnections->disable();
211 mcClearConnections->disable();
215 mcResetCustomShape->disable();
221 std::string reason =
"wrong edit mode";
223 mcReplace->setText(mcReplace->getText() +
" (" + reason.c_str() +
")");
224 mcReplace->disable();
226 if (numEndpoints == 1) {
259 double circleWidthSquared = circleWidth * circleWidth;
276 glGetFloatv(GL_CURRENT_COLOR, color);
282 if (exaggeration > 1) {
300 glGetFloatv(GL_CURRENT_COLOR, color);
320 glTranslated(pos.
x(), pos.
y(),
getType() + 0.1);
322 const double halfWidth = 32 / s.
scale;
323 const double halfHeight = 64 / s.
scale;
357 std::vector<GNEJunction*>
360 std::set<GNEJunction*> junctions;
362 junctions.insert(i->getGNEJunctionSource());
365 junctions.insert(i->getGNEJunctionDestiny());
367 return std::vector<GNEJunction*>(junctions.begin(), junctions.end());
428 const std::vector<GNEEdge*>&
434 const std::vector<GNEEdge*>&
440 const std::vector<GNEEdge*>&
446 const std::vector<GNECrossing*>&
452 std::vector<GNEConnection*>
454 std::vector<GNEConnection*> connections;
456 for (
auto j : i->getGNEConnections()) {
457 connections.push_back(j);
487 std::set<GNEJunction*> affectedJunctions;
488 std::set<GNEEdge*> affectedEdges;
492 affectedJunctions.insert(i->getGNEJunctionSource());
493 affectedJunctions.insert(i->getGNEJunctionDestiny());
495 for (
auto j : i->getGNEJunctionSource()->getGNEEdges()) {
496 affectedEdges.insert(j);
499 for (
auto j : i->getGNEJunctionDestiny()->getGNEEdges()) {
500 affectedEdges.insert(j);
504 if (extendToNeighbors) {
505 for (
auto i : affectedJunctions) {
509 i->startGeometryMoving(
false);
514 for (
auto i : affectedEdges) {
516 i->startGeometryMoving();
530 std::set<GNEJunction*> affectedJunctions;
531 std::set<GNEEdge*> affectedEdges;
535 affectedJunctions.insert(i->getGNEJunctionSource());
536 affectedJunctions.insert(i->getGNEJunctionDestiny());
538 for (
auto j : i->getGNEJunctionSource()->getGNEEdges()) {
539 affectedEdges.insert(j);
542 for (
auto j : i->getGNEJunctionDestiny()->getGNEEdges()) {
543 affectedEdges.insert(j);
547 if (extendToNeighbors) {
548 for (
auto i : affectedJunctions) {
552 i->endGeometryMoving(
false);
557 for (
auto i : affectedEdges) {
559 i->endGeometryMoving();
571 for (
auto i : junctionNeighbours) {
578 newPosition.
add(offset);
600 std::set<GNEJunction*> affectedJunctions;
601 std::set<GNEEdge*> affectedEdges;
605 affectedJunctions.insert(i->getGNEJunctionSource());
606 affectedJunctions.insert(i->getGNEJunctionDestiny());
608 for (
auto j : i->getGNEJunctionSource()->getGNEEdges()) {
609 affectedEdges.insert(j);
612 for (
auto j : i->getGNEJunctionDestiny()->getGNEEdges()) {
613 affectedEdges.insert(j);
618 for (
auto i : affectedJunctions) {
620 i->updateGeometry(updateGrid);
624 for (
auto i : affectedEdges) {
626 i->updateGeometry(updateGrid);
650 assert(undoList != 0);
654 for (EdgeVector::iterator it = incoming.begin(); it != incoming.end(); it++) {
674 std::vector<NBEdge::Connection> connections = srcNBE->
getConnections();
676 for (std::vector<NBEdge::Connection>::reverse_iterator con_it = connections.rbegin(); con_it != connections.rend(); con_it++) {
677 if (lane >= 0 && (*con_it).fromLane != lane) {
680 bool hasTurn = con_it->toEdge == turnEdge;
689 std::vector<NBConnection> removeConnections;
691 removeConnections.push_back(
NBConnection(srcNBE, con.fromLane, con.toEdge, con.toLane));
701 std::vector<NBConnection> removeConnections;
704 std::vector<NBEdge::Connection> connections = srcNBE->getConnections();
705 for (std::vector<NBEdge::Connection>::reverse_iterator con_it = connections.rbegin(); con_it != connections.rend(); con_it++) {
706 if ((*con_it).toEdge == destNBE) {
707 if (lane >= 0 && (*con_it).toLane != lane) {
710 bool hasTurn = srcNBE->getTurnDestination() == destNBE;
717 removeConnections.push_back(
NBConnection(srcNBE, (*con_it).fromLane, destNBE, (*con_it).toLane));
729 if (connections.size() == 0) {
733 for (
auto it : coypOfTls) {
737 std::string newID = tlDef->
getID();
744 undoList->add(
new GNEChange_TLS(
this, replacementDef,
true,
false, newID),
true);
746 const std::vector<NBNode*> copyOfNodes = tlDef->
getNodes();
747 for (
auto it_node : copyOfNodes) {
749 undoList->add(
new GNEChange_TLS(sharing, tlDef,
false),
true);
750 undoList->add(
new GNEChange_TLS(sharing, replacementDef,
true,
false, newID),
true);
768 for (
auto it : coypOfTls) {
772 std::string newID = tlDef->
getID();
775 for (
int i = 0; i < (int)which->
getLanes().size(); ++i) {
779 undoList->add(
new GNEChange_TLS(
this, replacementDef,
true,
false, newID),
true);
781 const std::vector<NBNode*> copyOfNodes = tlDef->
getNodes();
782 for (
auto it_node : copyOfNodes) {
784 undoList->add(
new GNEChange_TLS(sharing, tlDef,
false),
true);
785 undoList->add(
new GNEChange_TLS(sharing, replacementDef,
true,
false, newID),
true);
795 for (EdgeVector::iterator it = incoming.begin(); it != incoming.end(); it++) {
808 for (
auto it : coypOfTls) {
812 std::string newID = tlDef->
getID();
817 replacementDef = repl;
834 replacementDef = repl;
840 undoList->add(
new GNEChange_TLS(
this, replacementDef,
true,
false, newID),
true);
842 const std::vector<NBNode*> copyOfNodes = tlDef->
getNodes();
843 for (
auto it_node : copyOfNodes) {
845 undoList->add(
new GNEChange_TLS(sharing, tlDef,
false),
true);
846 undoList->add(
new GNEChange_TLS(sharing, replacementDef,
true,
false, newID),
true);
860 EdgeSet edgeSet(c->getCrossingEdges().begin(), c->getCrossingEdges().end());
862 if (edgeSet.count(edge->
getNBEdge()) == 1) {
864 if ((c->getCrossingEdges().size() == 1) && (c->getCrossingEdges().front() == edge->
getNBEdge())) {
869 std::vector<std::string> edges = GNEAttributeCarrier::parse<std::vector<std::string>>(c->getAttribute(
SUMO_ATTR_EDGES));
870 edges.erase(std::find(edges.begin(), edges.end(), edge->
getID()));
889 if (i->getCrossingEdges() == crossing->
edges) {
893 if (createIfNoExist) {
902 return createdGNECrossing;
913 for (
auto j : i->getGNEConnections()) {
914 j->markConnectionGeometryDeprecated();
916 if (includingNeighbours) {
917 i->getGNEJunctionSource()->markConnectionsDeprecated(
false);
951 for (
auto j : i->getGNEConnections()) {
952 if (j->getNBEdgeConnection().keepClear) {
987 undoList->
p_begin(
"change keepClear for whole junction");
989 for (
auto j : i->getGNEConnections()) {
1006 for (
auto it : copyOfTls) {
1014 }
else if (
getNBNode()->isTLControlled()) {
1018 for (
auto it : copyOfTls) {
1019 undoList->add(
new GNEChange_TLS(
this, it,
false,
false),
true);
1030 assert(copyOfTls.size() > 0);
1033 const bool currentIsSingle = currentTLS->
getNodes().size() == 1;
1035 if (currentIsLoaded) {
1037 dynamic_cast<NBLoadedSUMOTLDef*>(currentTLS)->getLogic());
1040 for (
auto it : copyOfTls) {
1045 const std::map<std::string, NBTrafficLightDefinition*> programs = tlCont.
getPrograms(value);
1046 if (programs.size() > 0) {
1047 for (
auto it : programs) {
1049 if (dynamic_cast<NBOwnTLDef*>(oldTLS) != 0) {
1053 if (dynamic_cast<NBLoadedSUMOTLDef*>(oldTLS) != 0 &&
1054 dynamic_cast<NBLoadedSUMOTLDef*>(oldTLS)->usingSignalGroups()) {
1057 newTLSJoined->
joinLogic(currentTLSCopy);
1058 undoList->add(
new GNEChange_TLS(
this, newTLSJoined,
true,
true),
true);
1060 undoList->add(
new GNEChange_TLS(
this, 0,
true,
false, value),
true);
1064 const std::vector<NBNode*> copyOfNodes = oldTLS->
getNodes();
1065 for (
auto it_node : copyOfNodes) {
1067 undoList->add(
new GNEChange_TLS(oldJunction, oldTLS,
false),
true);
1068 undoList->add(
new GNEChange_TLS(oldJunction, newTLS,
true),
true);
1073 if (currentIsSingle && currentIsLoaded) {
1076 renamedLogic->
setID(value);
1078 renamedTLS->
setID(value);
1079 undoList->add(
new GNEChange_TLS(
this, renamedTLS,
true,
true),
true);
1082 undoList->add(
new GNEChange_TLS(
this, 0,
true,
false, value),
true);
1085 delete currentTLSCopy;
1112 return canParse<double>(value);
1118 return canParse<bool>(value);
1120 return canParse<bool>(value);
1180 result += i.first +
"=" + i.second +
"|";
1183 if (!result.empty()) {
1190 std::vector<std::pair<std::string, std::string> >
1192 std::vector<std::pair<std::string, std::string> > result;
1195 result.push_back(std::make_pair(i.first, i.second));
1206 std::vector<std::string> parsedValues;
1209 parsedValues.push_back(stValues.
next());
1212 for (
auto i : parsedValues) {
1213 std::vector<std::string> parsedParameters;
1216 parsedParameters.push_back(stParam.
next());
1260 i->clearGNEConnections();
1279 for (
auto it : copyOfTls) {
1289 if (parse<bool>(value)) {
1319 double circleWidthSquared = circleWidth * circleWidth;
1325 }
else if (drawShape) {
1395 myNet->
retrieveEdge(i->getID())->updateJunctionPosition(
this, orig, updateGrid);
1417 tlCont.
insert(tlDef, forceInsert);
1425 if (tlDef->
getNodes().size() == 1) {
GUIVisualizationSizeSettings junctionSize
bool getKeepClear() const
Returns the keepClear flag.
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
bool myAmResponsible
whether we are responsible for deleting myNBNode
bool around(const Position &p, double offset=0) const
Returns the information whether the position vector describes a polygon lying around the given point...
GUIVisualizationTextSettings junctionName
const std::map< std::string, NBTrafficLightDefinition * > & getPrograms(const std::string &id) const
Returns all programs for the given tl-id.
void removeConnection(const NBConnection &conn, bool reconstruct=true)
removes the given connection from the traffic light if recontruct=true, reconstructs the logic and in...
bool myHasValidLogic
whether this junctions logic is valid
void setResponsible(bool newVal)
set responsibility for deleting internal strctures
std::vector< GNEConnection * > getGNEConnections() const
Returns all GNEConnections vinculated with this junction.
static const std::string FEATURE_MODIFIED
feature has been manually modified (implies approval)
double myMaxSize
The maximum size (in either x-, or y-dimension) for determining whether to draw or not...
const GNEAttributeCarrier * getACUnderCursor() const
get AttributeCarrier under cursor
Position getPositionInView() const
Return current position.
std::string myLogicStatus
modification status of the junction logic (all connections across this junction)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
A structure which describes a connection between edges or lanes.
void addIncomingGNEEdge(GNEEdge *edge)
add incoming GNEEdge
static StringBijection< SumoXMLNodeType > NodeTypes
node types
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
double scale
information about a lane's width (temporary, used for a single view)
Whether vehicles must keep the junction clear.
const std::vector< GNEEdge * > & getGNEOutgoingEdges() const
Returns incoming GNEEdges.
GNENet * myNet
the net to inform about updates
virtual void addNode(NBNode *node)
Adds a node to the traffic light logic.
void moveJunctionGeometry(const Position &pos, bool updateGrid)
reposition the node at pos and informs the edges
void removeIncomingGNEEdge(GNEEdge *edge)
remove incoming GNEEdge
double z() const
Returns the z-position.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
begin/end of the description of a junction
void add(const Position &pos)
Adds the given position to this one.
PositionVector myPoly
the (outer) shape of the junction
void markAsCreateEdgeSource()
marks as first junction in createEdge-mode
void removeEdgeFromCrossings(GNEEdge *edge, GNEUndoList *undoList)
removes the given edge from all pedestrian crossings
NBNetBuilder * getNetBuilder() const
get net builder
A loaded (complete) traffic light logic.
bool myAmCreateEdgeSource
whether this junction is the first junction for a newly creatededge
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
static const NBConnection InvalidConnection
A container for traffic light definitions and built programs.
A SUMO-compliant built logic for a traffic light.
std::vector< GNEEdge * > myGNEIncomingEdges
vector with the incomings GNEEdges vinculated with this junction
void reinit(const Position &position, SumoXMLNodeType type, bool updateEdgeGeometries=false)
Resets initial values.
bool isValid(SumoXMLAttr key, const std::string &value)
friend class GNEChange_TLS
Declare friend class.
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
bool hasCustomShape() const
return whether the shape was set by the user
The representation of a single edge during network building.
TrafficLightType getType() const
get the algorithm type (static etc..)
void unsetParameter(const std::string &key)
Removes a parameter.
double x() const
Returns the x-position.
The base class for traffic light logic definitions.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void removeTLSConnections(std::vector< NBConnection > &connections, GNEUndoList *undoList)
remove the given connections from all traffic light definitions of this junction
link,node: the traffic light id responsible for this link
double getWidth() const
Returns the width of the boudary (x-axis)
std::string getGenericParametersStr() const
return generic parameters in string format
A NBNetBuilder extended by visualisation and editing capabilities.
NBEdge * getTurnDestination(bool possibleDestination=false) const
static void drawFilledPoly(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
int editMode
the current NETEDIT mode (temporary)
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 addExplicitTurnaround(std::string id)
add edge id to the list of explicit turnarounds
NBEdge * getFrom() const
returns the from-edge (start of the connection)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void selectTLS(bool selected)
notify the junction of being selected in tls-mode. (used to control drawing)
const std::string & getID() const
Returns the id.
bool myAmTLSSelected
whether this junction is selected in tls-mode
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void removeTrafficLight(NBTrafficLightDefinition *tlDef)
Removes the given traffic light from this node.
void setCustomShape(const PositionVector &shape)
set the junction shape
void startGeometryMoving(bool extendToNeighbors=true)
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
void extract(NBTrafficLightDefinition *definition)
Extracts a traffic light definition from myDefinitions but keeps it in myExtracted for eventual * del...
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
void removeTrafficLight(NBTrafficLightDefinition *tlDef)
removes a traffic light
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.
Boundary getBoundary() const
Returns the boundary of the junction.
turn junction into geometry node
A class that stores a 2D geometrical boundary.
void markConnectionsDeprecated(bool includingNeighbours)
mark connections as deprecated
Boundary myMovingGeometryBoundary
boundary used during moving of elements
void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane)
Replaces a removed edge/lane.
link: the index of the opposite direction link of a pedestrian crossing
whether a feature has been loaded,guessed,modified or approved
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
double area() const
Returns the area (0 for non-closed)
SUMOTime getOffset()
Returns the offset.
void renameJunction(GNEJunction *junction, const std::string &newID)
updates the map and reserves new id
static void drawFilledPolyTesselated(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
void removeOutgoingGNEEdge(GNEEdge *edge)
remove outgoing GNEEdge
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
void updateGeometry(bool updateGrid)
update pre-computed geometry information
void setRadius(double radius)
set the turning radius
std::string getAttribute(SumoXMLAttr key) const
bool isTLControlled() const
Returns whether this node is controlled by any tls.
void invalidateIncomingConnections()
invalidate incoming connections
void mouseOverObject(const GUIVisualizationSettings &s) const
method for check if mouse is over objects
static const int InvalidTlIndex
The turning radius at an intersection in m.
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
std::set< NBEdge * > EdgeSet
container for unique edges
void removeConnectionsFrom(GNEEdge *edge, GNEUndoList *undoList, bool updateTLS, int lane=-1)
remove all connections from the given edge
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool hasCommandGroup() const
Check if undoList has command group.
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
bool updateGenericParameter(const std::string &oldKey, const std::string &newKey)
update generic parameter
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
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
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
bool isLogicValid()
whether this junction has a valid logic
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
void buildCrossingsAndWalkingAreas()
build crossings, and walkingareas. Also removes invalid loaded crossings if wished ...
void addConnection(NBEdge *from, NBEdge *to, int fromLane, int toLane, int linkIndex, bool reconstruct=true)
Adds a connection and immediately informs the edges.
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
friend class GNEChange_Attribute
declare friend class
T get(const std::string &str) const
void updateGeometry(bool updateGrid)
Update the boundary of the junction.
Boundary myJunctionBoundary
junction boundary
static std::vector< Position > drawFilledCircleReturnVertices(double width, int steps=8)
Draws a filled circle around (0,0) returning circle vertex.
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
registers completed movement with the undoList
static const std::string FEATURE_GUESSED
feature has been reguessed (may still be unchanged be we can't tell (yet)
const EdgeVector & getEdges() const
Returns all edges which participate in this node (Edges that start or end at this node) ...
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
turn junction into multiple junctions
NBTrafficLightLogic * getLogic()
Returns the internal logic.
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
node: the type of traffic light
edge: the shape in xml-definition
Boundary & grow(double by)
extends the boundary by the given amount
GUIColorer junctionColorer
The junction colorer.
void removeConnectionsTo(GNEEdge *edge, GNEUndoList *undoList, bool updateTLS, int lane=-1)
remove all connections to the given edge
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
std::vector< GNEEdge * > myGNEEdges
vector with the GNEEdges vinculated with this junction
const std::string getID() const
function to support debugging
void unMarkAsCreateEdgeSource()
removes mark as first junction in createEdge-mode
void setProgramID(const std::string &programID)
Sets the programID.
const T getColor(const double value) const
const std::string & getProgramID() const
Returns the ProgramID.
void incRef(const std::string &debugMsg="")
Increarse reference.
double getColorValue(const GUIVisualizationSettings &s, bool bubble) const
determines color value
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
NBNode & myNBNode
A reference to the represented junction.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void selectAttributeCarrier(bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
void setKeepClear(bool keepClear)
set the keepClear flag
bool checkIsRemovableReporting(std::string &reason) const
check if node is removable and return reason if not
static void computeTurnDirectionsForNode(NBNode *node, bool warn)
Computes turnaround destinations for all incoming edges of the given nodes (if any) ...
begin/end of the description of an edge
void joinLogic(NBTrafficLightDefinition *def)
join nodes and states from the given logic (append red state)
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
EditMode getCurrentEditMode() const
get the current edit mode
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
const PositionVector & getShape() const
retrieve the junction shape
int getToLane() const
returns the to-lane
NBEdge * getTo() const
returns the to-edge (end of the connection)
A road/street connecting two junctions (netedit-version)
static const double BUBBLE_RADIUS
constant values for drawing buubles
void reset()
Resets the boundary.
bool removeGenericParameter(const std::string &key)
remove generic parameter
void setID(const std::string &newID)
resets the id
reset junction's connections
bool updateGenericParameterValue(const std::string &key, const std::string &newValue)
update value generic parameter
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
double selectionScale
the current selection scaling in NETEDIT (temporary)
void setACUnderCursor(const GNEAttributeCarrier *AC)
set attributeCarrier under cursor
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
~GNEJunction()
Destructor.
double getRadius() const
Returns the turning radius of this node.
bool haveNetworkCrossings()
notify about style of loaded network (Without Crossings)
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.
double getHeight() const
Returns the height of the boundary (y-axis)
static void drawShapeDottedContour(const int type, const PositionVector &shape, const double width)
draw a dotted contour around the given Non closed shape with certain width
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node) ...
void setColor(const GUIVisualizationSettings &s, bool bubble) const
sets junction color depending on circumstances
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
std::vector< GNECrossing * > myGNECrossings
the built crossing objects
std::vector< Position > getEndPoints() const
return list of unique endpoint coordinates of all edges at this node
void scaleRelative(double factor)
enlarges/shrinks the polygon by a factor based at the centroid
void updateShapesAndGeometries(bool updateGrid)
update shapes of all elements associated to the junction
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
const std::vector< NBNode * > & getNodes() const
Returns the list of controlled nodes.
bool isInitialised() const
check if Boundary is Initialised
SumoXMLNodeType getType() const
Returns the type of this node.
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
static int getCircleResolution(const GUIVisualizationSettings &settings)
function to calculate circle resolution for all circles drawn in drawGL(...) functions ...
std::vector< GNEEdge * > myGNEOutgoingEdges
vector with the outgoings GNEEdges vinculated with this junction
void replaceIncomingConnections(GNEEdge *which, GNEEdge *by, GNEUndoList *undoList)
replace one edge by another in all tls connections
bool addGenericParameter(const std::string &key, const std::string &value)
add generic parameter
const Position & getPosition() const
EdgeVector edges
The edges being crossed.
int getFromLane() const
returns the from-lane
Represents a single node (junction) during network building.
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
GUIGlID getGlID() const
Returns the numerical id of the object.
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
A definition of a pedestrian crossing.
GNEJunction(NBNode &nbn, GNENet *net, bool loaded=false)
Constructor.
bool insert(NBTrafficLightDefinition *logic, bool forceInsert=false)
Adds a logic definition to the dictionary.
void rebuildGNECrossings(bool rebuildNBNodeCrossings=true)
rebuilds crossing objects for this junction
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
link: the index of the link within the traffic light
const std::vector< Crossing * > & getCrossingsIncludingInvalid() const
bool drawJunctionShape
whether the shape of the junction should be drawn
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
static const RGBColor selectionColor
int getTLIndex() const
returns the index within the controlling tls or InvalidTLIndex if this link is unontrolled ...
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
mode for connecting lanes
mode for creating new edges
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
GNECrossing * retrieveGNECrossing(NBNode::Crossing *crossing, bool createIfNoExist=true)
get GNECrossing if exist, and if not create it if create is enabled
NBEdge * getNBEdge()
returns the internal NBEdge
std::vector< GNEJunction * > getJunctionNeighbours() const
return GNEJunction neighbours
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
A traffic light logics which must be computed (only nodes/edges are given)
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
void closePolygon()
ensures that the last position equals the first
NBNode * getNBNode() const
Return net build node.
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
void setLogicValid(bool valid, GNEUndoList *undoList, const std::string &status=FEATURE_GUESSED)
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
static bool isTrafficLight(SumoXMLNodeType type)
return whether the given type is a traffic light
static PositionVector parseShapeReporting(const std::string &shpdef, const std::string &objecttype, const char *objectid, bool &ok, bool allowEmpty, bool report=true)
Builds a PositionVector from a string representation, reporting occurred errors.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
void requireRecompute()
inform the net about the need for recomputation
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void invalidateTLS(GNEUndoList *undoList, const NBConnection &deletedConnection=NBConnection::InvalidConnection, const NBConnection &addedConnection=NBConnection::InvalidConnection)
void addTrafficLight(NBTrafficLightDefinition *tlDef, bool forceInsert)
adds a traffic light
clear junction's connections
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
void markAsModified(GNEUndoList *undoList)
prevent re-guessing connections at this junction
GNEViewNet * getViewNet() const
get view net
void endGeometryMoving(bool extendToNeighbors=true)
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
void clearParameter()
Clears the parameter map.
SumoXMLTag getTag() const
get XML Tag assigned to this object