 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
65 myAmCreateEdgeSource(false),
66 myLogicStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED),
67 myAmResponsible(false),
68 myHasValidLogic(loaded),
69 myAmTLSSelected(false) {
77 if (crossing->unreferenced()) {
79 WRITE_DEBUG(
"Deleting unreferenced " + crossing->getTagStr() +
" '" + crossing->getID() +
"' in GNEJunction destructor");
86 WRITE_DEBUG(
"Deleting NBNode of '" +
getID() +
"' in GNEJunction destructor");
131 if (rebuildNBNodeCrossings) {
138 std::vector<GNECrossing*> retrievedCrossings;
143 retrievedCrossings.push_back(retrievedGNECrossing);
152 retrievedGNECrossing->
incRef();
159 if (crossing->isAttributeCarrierSelected()) {
160 crossing->unselectAttributeCarrier();
162 if (crossing->unreferenced()) {
164 WRITE_DEBUG(
"Deleting unreferenced " + crossing->getTagStr() +
" in rebuildGNECrossings()");
211 FXMenuCommand* mcReplace =
new FXMenuCommand(ret,
"Replace junction by geometry point",
nullptr, &parent,
MID_GNE_JUNCTION_REPLACE);
212 FXMenuCommand* mcSplit =
new FXMenuCommand(ret, (
"Split junction (" +
toString(numEndpoints) +
" end points)").c_str(),
nullptr, &parent,
MID_GNE_JUNCTION_SPLIT);
218 mcCustomShape->disable();
219 mcClearConnections->disable();
220 mcResetConnections->disable();
223 if (handlingSelection) {
224 mcResetCustomShape->setText(
"Reset junction shapes");
228 mcClearConnections->disable();
232 mcResetCustomShape->disable();
238 std::string reason =
"wrong edit mode";
240 mcReplace->setText(mcReplace->getText() +
" (" + reason.c_str() +
")");
241 mcReplace->disable();
243 if (numEndpoints == 1) {
245 mcSplitReconnect->disable();
263 const double EXTENT = 2;
282 if (junctionExaggeration > 0) {
284 const double circleWidth =
BUBBLE_RADIUS * junctionExaggeration;
285 const double circleWidthSquared = circleWidth * circleWidth;
314 if (junctionShapeColor.
alpha() != 0) {
322 if (junctionExaggeration > 1) {
328 if (junctionShape.
around(mousePosition)) {
352 if (bubbleColor.
alpha() != 0) {
403 std::vector<GNEJunction*>
406 std::set<GNEJunction*> junctions;
408 junctions.insert(i->getGNEJunctionSource());
411 junctions.insert(i->getGNEJunctionDestiny());
413 return std::vector<GNEJunction*>(junctions.begin(), junctions.end());
474 const std::vector<GNEEdge*>&
480 const std::vector<GNEEdge*>&
486 const std::vector<GNEEdge*>&
492 const std::vector<GNECrossing*>&
498 std::vector<GNEConnection*>
500 std::vector<GNEConnection*> connections;
502 for (
const auto& j : i->getGNEConnections()) {
503 connections.push_back(j);
533 std::set<GNEJunction*> affectedJunctions;
534 std::set<GNEEdge*> affectedEdges;
538 affectedJunctions.insert(edge->getGNEJunctionSource());
539 affectedJunctions.insert(edge->getGNEJunctionDestiny());
541 for (
const auto& junctionSourceEdge : edge->getGNEJunctionSource()->getGNEEdges()) {
542 affectedEdges.insert(junctionSourceEdge);
545 for (
const auto& junctionDestinyEdge : edge->getGNEJunctionDestiny()->getGNEEdges()) {
546 affectedEdges.insert(junctionDestinyEdge);
550 if (extendToNeighbors) {
551 for (
const auto& affectedJunction : affectedJunctions) {
553 if (affectedJunction !=
this) {
555 affectedJunction->startGeometryMoving(
false);
560 for (
const auto& edge : affectedEdges) {
562 edge->startGeometryMoving();
576 std::set<GNEJunction*> affectedJunctions;
577 std::set<GNEEdge*> affectedEdges;
581 affectedJunctions.insert(edge->getGNEJunctionSource());
582 affectedJunctions.insert(edge->getGNEJunctionDestiny());
584 for (
const auto& junctionSourceEdge : edge->getGNEJunctionSource()->getGNEEdges()) {
585 affectedEdges.insert(junctionSourceEdge);
588 for (
const auto& junctionDestinyEdge : edge->getGNEJunctionDestiny()->getGNEEdges()) {
589 affectedEdges.insert(junctionDestinyEdge);
593 if (extendToNeighbors) {
594 for (
const auto& affectedJunction : affectedJunctions) {
596 if (affectedJunction !=
this) {
598 affectedJunction->endGeometryMoving(
false);
603 for (
const auto& affectedEdge : affectedEdges) {
605 affectedEdge->endGeometryMoving();
617 newPosition.
add(offset);
662 assert(undoList != 0);
666 for (EdgeVector::iterator it = incoming.begin(); it != incoming.end(); it++) {
686 std::vector<NBEdge::Connection> connections = srcNBE->
getConnections();
688 for (std::vector<NBEdge::Connection>::reverse_iterator con_it = connections.rbegin(); con_it != connections.rend(); con_it++) {
689 if (lane >= 0 && (*con_it).fromLane != lane) {
692 bool hasTurn = con_it->toEdge == turnEdge;
701 std::vector<NBConnection> removeConnections;
703 removeConnections.push_back(
NBConnection(srcNBE, con.fromLane, con.toEdge, con.toLane));
713 std::vector<NBConnection> removeConnections;
716 std::vector<NBEdge::Connection> connections = srcNBE->getConnections();
717 for (std::vector<NBEdge::Connection>::reverse_iterator con_it = connections.rbegin(); con_it != connections.rend(); con_it++) {
718 if ((*con_it).toEdge == destNBE) {
719 if (lane >= 0 && (*con_it).toLane != lane) {
722 bool hasTurn = srcNBE->getTurnDestination() == destNBE;
729 removeConnections.push_back(
NBConnection(srcNBE, (*con_it).fromLane, destNBE, (*con_it).toLane));
741 if (connections.size() > 0) {
743 for (
const auto& TLS : coypOfTls) {
746 if (tlDef !=
nullptr) {
747 std::string newID = tlDef->
getID();
754 undoList->add(
new GNEChange_TLS(
this, replacementDef,
true,
false, newID),
true);
756 const std::vector<NBNode*> copyOfNodes = tlDef->
getNodes();
757 for (
const auto& node : copyOfNodes) {
759 undoList->add(
new GNEChange_TLS(sharing, tlDef,
false),
true);
760 undoList->add(
new GNEChange_TLS(sharing, replacementDef,
true,
false, newID),
true);
779 for (
const auto& TLS : coypOfTls) {
782 if (tlDef !=
nullptr) {
783 std::string newID = tlDef->
getID();
786 for (
int i = 0; i < (int)which->
getLanes().size(); ++i) {
790 undoList->add(
new GNEChange_TLS(
this, replacementDef,
true,
false, newID),
true);
792 const std::vector<NBNode*> copyOfNodes = tlDef->
getNodes();
793 for (
const auto& node : copyOfNodes) {
795 undoList->add(
new GNEChange_TLS(sharing, tlDef,
false),
true);
796 undoList->add(
new GNEChange_TLS(sharing, replacementDef,
true,
false, newID),
true);
806 for (EdgeVector::iterator it = incoming.begin(); it != incoming.end(); it++) {
819 for (
const auto& TLS : coypOfTls) {
821 if (tlDef !=
nullptr) {
823 std::string newID = tlDef->
getID();
828 replacementDef = repl;
845 replacementDef = repl;
851 undoList->add(
new GNEChange_TLS(
this, replacementDef,
true,
false, newID),
true);
853 const std::vector<NBNode*> copyOfNodes = tlDef->
getNodes();
854 for (
const auto& node : copyOfNodes) {
856 undoList->add(
new GNEChange_TLS(sharing, tlDef,
false),
true);
857 undoList->add(
new GNEChange_TLS(sharing, replacementDef,
true,
false, newID),
true);
871 EdgeSet edgeSet(c->getCrossingEdges().begin(), c->getCrossingEdges().end());
873 if (edgeSet.count(edge->
getNBEdge()) == 1) {
875 if ((c->getCrossingEdges().size() == 1) && (c->getCrossingEdges().front() == edge->
getNBEdge())) {
880 std::vector<std::string> edges = GNEAttributeCarrier::parse<std::vector<std::string>>(c->getAttribute(
SUMO_ATTR_EDGES));
881 edges.erase(std::find(edges.begin(), edges.end(), edge->
getID()));
900 if (crossing->getCrossingEdges() == NBNodeCrossing->
edges) {
904 if (createIfNoExist) {
908 WRITE_DEBUG(
"Created " + createdGNECrossing->
getTagStr() +
" '" + createdGNECrossing->
getID() +
"' in retrieveGNECrossing()");
911 return createdGNECrossing;
922 for (
const auto& j : i->getGNEConnections()) {
923 j->markConnectionGeometryDeprecated();
925 if (includingNeighbours) {
926 i->getGNEJunctionSource()->markConnectionsDeprecated(
false);
965 for (
const auto& j : i->getGNEConnections()) {
966 if (j->getNBEdgeConnection().keepClear) {
1005 undoList->
p_begin(
"change keepClear for whole junction");
1007 for (
const auto& j : i->getGNEConnections()) {
1023 for (
const auto& TLS : copyOfTls) {
1029 undoList->add(
new GNEChange_TLS(
this,
nullptr,
true),
true);
1031 }
else if (
getNBNode()->isTLControlled()) {
1035 for (
const auto& TLS : copyOfTls) {
1036 undoList->add(
new GNEChange_TLS(
this, TLS,
false,
false),
true);
1052 for (
const auto& TLS : copyOfTls) {
1054 if (oldLoaded !=
nullptr) {
1057 std::vector<NBNode*> nodes = TLS->getNodes();
1058 for (
const auto& node : nodes) {
1060 undoList->add(
new GNEChange_TLS(junction, TLS,
false),
true);
1061 undoList->add(
new GNEChange_TLS(junction, TLS,
true),
true);
1072 assert(copyOfTls.size() > 0);
1075 const bool currentIsSingle = currentTLS->
getNodes().size() == 1;
1076 const bool currentIsLoaded = dynamic_cast<NBLoadedSUMOTLDef*>(currentTLS) !=
nullptr;
1077 if (currentIsLoaded) {
1079 dynamic_cast<NBLoadedSUMOTLDef*>(currentTLS)->getLogic());
1082 for (
const auto& TLS : copyOfTls) {
1087 const std::map<std::string, NBTrafficLightDefinition*> programs = tlCont.
getPrograms(value);
1088 if (programs.size() > 0) {
1089 for (
const auto& TLSProgram : programs) {
1091 if (dynamic_cast<NBOwnTLDef*>(oldTLS) !=
nullptr) {
1095 if (dynamic_cast<NBLoadedSUMOTLDef*>(oldTLS) !=
nullptr &&
1096 dynamic_cast<NBLoadedSUMOTLDef*>(oldTLS)->usingSignalGroups()) {
1099 newTLSJoined->
joinLogic(currentTLSCopy);
1100 undoList->add(
new GNEChange_TLS(
this, newTLSJoined,
true,
true),
true);
1102 undoList->add(
new GNEChange_TLS(
this,
nullptr,
true,
false, value),
true);
1106 std::vector<NBNode*> copyOfNodes = oldTLS->
getNodes();
1107 for (
const auto& node : copyOfNodes) {
1109 undoList->add(
new GNEChange_TLS(oldJunction, oldTLS,
false),
true);
1110 undoList->add(
new GNEChange_TLS(oldJunction, newTLS,
true),
true);
1115 if (currentIsSingle && currentIsLoaded) {
1117 NBTrafficLightLogic* renamedLogic = dynamic_cast<NBLoadedSUMOTLDef*>(currentTLSCopy)->getLogic();
1118 renamedLogic->
setID(value);
1120 renamedTLS->
setID(value);
1121 undoList->add(
new GNEChange_TLS(
this, renamedTLS,
true,
true),
true);
1124 undoList->add(
new GNEChange_TLS(
this,
nullptr,
true,
false, value),
true);
1127 delete currentTLSCopy;
1145 return canParse<Position>(value);
1148 return canParse<PositionVector>(value);
1150 return canParse<double>(value) && (parse<double>(value) >= -1);
1156 return canParse<bool>(value);
1162 return canParse<bool>(value);
1180 if (i->getGNEConnections().size() > 0) {
1208 glTranslated(pos.
x(), pos.
y(),
getType() + 0.1);
1210 const double halfWidth = 32 / s.
scale;
1211 const double halfHeight = 64 / s.
scale;
1223 for (
const auto& connection : incomingEdge->getGNEConnections()) {
1224 connection->drawGL(s);
1227 for (
const auto& lane : incomingEdge->getLanes()) {
1228 for (
const auto& additional : lane->getChildAdditionals()) {
1230 lane->drawPartialE2DetectorPlan(s, additional,
this);
1237 for (
const auto& route : incomingEdge->getChildDemandElementsSortedByType(
SUMO_TAG_ROUTE)) {
1241 incomingEdge->drawPartialRoute(s, route,
this);
1244 for (
const auto& embeddedRoute : incomingEdge->getChildDemandElementsSortedByType(
SUMO_TAG_EMBEDDEDROUTE)) {
1248 incomingEdge->drawPartialRoute(s, embeddedRoute,
this);
1251 for (
const auto& trip : incomingEdge->getChildDemandElementsSortedByType(
SUMO_TAG_TRIP)) {
1253 glPushName(trip->getGlID());
1256 incomingEdge->drawPartialTripFromTo(s, trip,
this);
1265 for (
const auto& flow : incomingEdge->getChildDemandElementsSortedByType(
SUMO_TAG_FLOW)) {
1267 glPushName(flow->getGlID());
1270 incomingEdge->drawPartialTripFromTo(s, flow,
this);
1281 incomingEdge->drawPartialPersonPlan(s, personTripFromTo,
this);
1284 incomingEdge->drawPartialPersonPlan(s, personTripBusStop,
this);
1286 for (
const auto& walkEdges : incomingEdge->getChildDemandElementsSortedByType(
SUMO_TAG_WALK_EDGES)) {
1287 incomingEdge->drawPartialPersonPlan(s, walkEdges,
this);
1289 for (
const auto& walkFromTo : incomingEdge->getChildDemandElementsSortedByType(
SUMO_TAG_WALK_FROMTO)) {
1290 incomingEdge->drawPartialPersonPlan(s, walkFromTo,
this);
1292 for (
const auto& walkBusStop : incomingEdge->getChildDemandElementsSortedByType(
SUMO_TAG_WALK_BUSSTOP)) {
1293 incomingEdge->drawPartialPersonPlan(s, walkBusStop,
this);
1295 for (
const auto& walkRoute : incomingEdge->getChildDemandElementsSortedByType(
SUMO_TAG_WALK_ROUTE)) {
1296 incomingEdge->drawPartialPersonPlan(s, walkRoute,
this);
1298 for (
const auto& rideFromTo : incomingEdge->getChildDemandElementsSortedByType(
SUMO_TAG_RIDE_FROMTO)) {
1299 incomingEdge->drawPartialPersonPlan(s, rideFromTo,
this);
1301 for (
const auto& rideBusStop : incomingEdge->getChildDemandElementsSortedByType(
SUMO_TAG_RIDE_BUSSTOP)) {
1302 incomingEdge->drawPartialPersonPlan(s, rideBusStop,
this);
1344 i->clearGNEConnections();
1368 for (
const auto& TLS : copyOfTls) {
1380 if (parse<bool>(value)) {
1397 switch (activeScheme) {
1462 std::set<GNEJunction*> affectedJunctions;
1463 std::set<GNEEdge*> affectedEdges;
1467 affectedJunctions.insert(edge->getGNEJunctionSource());
1468 affectedJunctions.insert(edge->getGNEJunctionDestiny());
1470 for (
const auto& junctionSourceEdge : edge->getGNEJunctionSource()->getGNEEdges()) {
1471 affectedEdges.insert(junctionSourceEdge);
1474 for (
const auto& junctionDestinyEdge : edge->getGNEJunctionDestiny()->getGNEEdges()) {
1475 affectedEdges.insert(junctionDestinyEdge);
1479 for (
const auto& affectedEdge : affectedEdges) {
1490 if (!bubble && scheme == 0) {
1508 tlCont.
insert(tlDef, forceInsert);
1516 if (tlDef->
getNodes().size() == 1) {
unsigned char alpha() const
Returns the alpha-amount of the color.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static const double BUBBLE_RADIUS
constant values for drawing buubles
const static NBConnection InvalidConnection
Position getPositionInView() const
Returns position of hierarchical element in view.
bool drawForPositionSelection
whether drawing is performed for the purpose of selecting objects with a single click
void markConnectionsDeprecated(bool includingNeighbours)
mark connections as deprecated
void unMarkAsCreateEdgeSource()
removes mark as first junction in createEdge-mode
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
bool isLogicValid()
whether this junction has a valid logic
void mirrorXLeftHand()
temporarily mirror coordinates in lefthand network to compute correct crossing geometries
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
determines color value
const std::map< std::string, NBTrafficLightDefinition * > & getPrograms(const std::string &id) const
Returns all programs for the given tl-id.
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
void drawJunctionChilds(const GUIVisualizationSettings &s) const
draw junction childs
const std::string getID() const
function to support debugging
int getTLIndex() const
returns the index within the controlling tls or InvalidTLIndex if this link is unontrolled
bool checkIsRemovableReporting(std::string &reason) const
check if node is removable and return reason if not
GUIVisualizationSizeSettings junctionSize
node: the type of traffic light
A container for traffic light definitions and built programs.
#define WRITE_GLDEBUG(msg)
bool myAmTLSSelected
whether this junction is selected in tls-mode
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
registers completed movement with the undoList
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
void setRightOfWay(RightOfWay rightOfWay)
set method for computing right-of-way
const std::string & getString(const T key) const
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
double z() const
Returns the z-position.
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
void removeEdgeFromCrossings(GNEEdge *edge, GNEUndoList *undoList)
removes the given edge from all pedestrian crossings
bool drawBoundaries
enable or disable draw boundaries
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 removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
A NBNetBuilder extended by visualisation and editing capabilities.
std::vector< GNEJunction * > getJunctionNeighbours() const
return GNEJunction neighbours
std::string myLogicStatus
modification status of the junction logic (all connections across this junction)
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
void updateGeometryAfterNetbuild(bool rebuildNBNodeCrossings=false)
update pre-computed geometry information without modifying netbuild structures
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
const std::vector< GNEEdge * > & getGNEOutgoingEdges() const
Returns incoming GNEEdges.
static StringBijection< RightOfWay > RightOfWayValues
righ of way algorithms
std::vector< GNEConnection * > getGNEConnections() const
Returns all GNEConnections vinculated with this junction.
NBEdge * getFrom() const
returns the from-edge (start of the connection)
void guessMinMaxDuration()
heuristically add minDur and maxDur when switching from tlType fixed to actuated
link,node: the traffic light id responsible for this link
void removeIncomingGNEEdge(GNEEdge *edge)
remove incoming GNEEdge
void scaleRelative(double factor)
enlarges/shrinks the polygon by a factor based at the centroid
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
const static int InvalidTlIndex
NBEdge * getTo() const
returns the to-edge (end of the connection)
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
A traffic light logics which must be computed (only nodes/edges are given)
static OptionsCont & getOptions()
Retrieves the options.
SumoXMLNodeType getType() const
Returns the type of this node.
bool showDemandElements() const
check if show demand elements checkbox is enabled
void markAsModified(GNEUndoList *undoList)
prevent re-guessing connections at this junction
SUMOTime getOffset()
Returns the offset.
NBTrafficLightLogic * getLogic()
Returns the internal logic.
mode for creating new edges
bool myHasValidLogic
whether this junctions logic is valid
std::vector< GNEEdge * > myGNEEdges
vector with the GNEEdges vinculated with this junction
void setResponsible(bool newVal)
set responsibility for deleting internal strctures
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
turn junction into multiple junctions and reconnect them heuristically
void addExplicitTurnaround(std::string id)
add edge id to the list of explicit turnarounds
double myMaxSize
The maximum size (in either x-, or y-dimension) for determining whether to draw or not.
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.
static void drawFilledPoly(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
reset junction's connections
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
SumoXMLTag
Numbers representing SUMO-XML - element names.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
std::vector< GNEEdge * > myGNEIncomingEdges
vector with the incomings GNEEdges vinculated with this junction
turn junction into geometry node
void setProgramID(const std::string &programID)
Sets the programID.
NBEdgeCont & getEdgeCont()
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
void startGeometryMoving(bool extendToNeighbors=true)
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
clear junction's connections
double scaledSize(double scale, double constFactor=0.1) const
get scale size
void updateGeometry()
update pre-computed geometry information (including crossings)
The representation of a single edge during network building.
GUIVisualizationTextSettings junctionName
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
GUIColorer junctionColorer
The junction colorer.
A road/street connecting two junctions (netedit-version)
friend class GNEChange_Attribute
declare friend class
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
const Position & getPosition() const
NBNode * getNBNode() const
Return net build node.
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
static const std::string FEATURE_GUESSED
feature has been reguessed (may still be unchanged be we can't tell (yet)
static void computeTurnDirectionsForNode(NBNode *node, bool warn)
Computes turnaround destinations for all incoming edges of the given nodes (if any)
NBNetBuilder * getNetBuilder() const
get net builder
void reset()
Resets the boundary.
whether a feature has been loaded,guessed,modified or approved
bool isTLControlled() const
Returns whether this node is controlled by any tls.
void extract(NBTrafficLightDefinition *definition)
Extracts a traffic light definition from myDefinitions but keeps it in myExtracted for eventual * del...
NBNode * myNBNode
A reference to the represented junction.
TrafficLightType getType() const
get the algorithm type (static etc..)
a flow definitio nusing a from-to edges instead of a route (used by router)
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
void invalidateTLS(GNEUndoList *undoList, const NBConnection &deletedConnection=NBConnection::InvalidConnection, const NBConnection &addedConnection=NBConnection::InvalidConnection)
void markAsCreateEdgeSource()
marks as first junction in createEdge-mode
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Whether vehicles must keep the junction clear.
std::string getAttribute(SumoXMLAttr key) const
void invalidateIncomingConnections()
invalidate incoming connections
void drawTLSIcon(const GUIVisualizationSettings &s) const
draw TLS icon
void removeTrafficLight(NBTrafficLightDefinition *tlDef)
removes a traffic light
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
NBEdge * getNBEdge() const
returns the internal NBEdge
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
bool around(const Position &p, double offset=0) const
Returns the information whether the position vector describes a polygon lying around the given point.
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
link: the index of the opposite direction link of a pedestrian crossing
void addIncomingGNEEdge(GNEEdge *edge)
add incoming GNEEdge
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
double getRadius() const
Returns the turning radius of this node.
GNEJunction(GNENet *net, NBNode *nbn, bool loaded=false)
Constructor.
T get(const std::string &str) const
std::vector< std::pair< Position, std::string > > getEndPoints() const
return list of unique endpoint coordinates of all edges at this node
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
void mirrorX()
mirror coordinates along the x-axis
std::set< NBEdge * > EdgeSet
container for unique edges
static std::vector< Position > drawFilledCircleReturnVertices(double width, int steps=8)
Draws a filled circle around (0,0) returning circle vertex.
void closePolygon()
ensures that the last position equals the first
void removeTrafficLight(NBTrafficLightDefinition *tlDef)
Removes the given traffic light from this node.
GUIGlID getGlID() const
Returns the numerical id of the object.
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
A class that stores a 2D geometrical boundary.
int getToLane() const
returns the to-lane
static void drawShapeDottedContourAroundClosedShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape)
draw a dotted contour around the given closed shape with certain width
void renameJunction(GNEJunction *junction, const std::string &newID)
updates the map and reserves new id
begin/end of the description of an edge
parameters "key1=value1|key2=value2|...|keyN=valueN"
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
double scale
information about a lane's width (temporary, used for a single view)
Network mode (Edges, junctions, etc..)
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
Supermode currentSupermode
the current supermode
A point in 2D or 3D with translation and scaling methods.
const std::vector< NBNode * > & getNodes() const
Returns the list of controlled nodes.
mode for connecting lanes
double x() const
Returns the x-position.
void endGeometryMoving(bool extendToNeighbors=true)
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
static void drawFilledPolyTesselated(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
double selectionScale
the current selection scaling in NETEDIT (temporary)
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
bool editingElevation() const
check if we're editing elevation
const EdgeVector & getEdges() const
Returns all edges which participate in this node (Edges that start or end at this node)
void setCustomShape(const PositionVector &shape)
set the junction shape
void addOutgoingGNEEdge(GNEEdge *edge)
add outgoing GNEEdge
bool myAmCreateEdgeSource
whether this junction is the first junction for a newly creatededge
void rebuildGNECrossings(bool rebuildNBNodeCrossings=true)
rebuilds crossing objects for this junction
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
void setRadius(double radius)
set the turning radius
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
~GNEJunction()
Destructor.
const std::vector< Crossing * > & getCrossingsIncludingInvalid() const
void removeConnectionsFrom(GNEEdge *edge, GNEUndoList *undoList, bool updateTLS, int lane=-1)
remove all connections from the given edge
void setLogicValid(bool valid, GNEUndoList *undoList, const std::string &status=FEATURE_GUESSED)
GNEViewNet * getViewNet() const
get view net
bool hasCustomShape() const
return whether the shape was set by the user
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
an e2 detector over multiple lanes (used by Netedit)
GUIVisualizationColorSettings colorSettings
color settings
The turning radius at an intersection in m.
RGBColor selectionColor
basic selection color
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
bool haveNetworkCrossings()
notify about style of loaded network (Without Crossings)
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
void addTrafficLight(NBTrafficLightDefinition *tlDef, bool forceInsert)
adds a traffic light
void setParametersStr(const std::string ¶msString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane)
Replaces a removed edge/lane.
bool showNonInspectedDemandElements(const GNEDemandElement *demandElement) const
check if non inspected element has to be hidden
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
const PositionVector & getShape() const
retrieve the junction shape
NBTrafficLightLogicCont & getTLLogicCont()
returns the tllcont of the underlying netbuilder
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
double y() const
Returns the y-position.
void requireRecompute()
inform the net about the need for recomputation
void moveJunctionGeometry(const Position &pos)
reposition the node at pos without updating GRID and informs the edges
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
bool hasCommandGroup() const
Check if undoList has command group.
link: the index of the link within the traffic light
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
Demanding mode (Routes, Vehicles etc..)
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node)
static const std::string FEATURE_MODIFIED
feature has been manually modified (implies approval)
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
FringeType getFringeType() const
Returns fringe type.
RGBColor setColor(const GUIVisualizationSettings &s, bool bubble) const
sets junction color depending on circumstances
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void incRef(const std::string &debugMsg="")
Increarse reference.
std::vector< GNECrossing * > myGNECrossings
the built crossing objects
const std::string & getProgramID() const
Returns the ProgramID.
How to compute right of way.
static bool isTrafficLight(SumoXMLNodeType type)
return whether the given type is a traffic light
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
virtual void addNode(NBNode *node)
Adds a node to the traffic light logic.
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
EdgeVector edges
The edges being crossed.
GNENet * myNet
the net to inform about updates
begin/end of the description of a route
void setFringeType(FringeType fringeType)
set method for computing right-of-way
static StringBijection< FringeType > FringeTypeValues
fringe types
void updateGeometry()
update pre-computed geometry information
void selectTLS(bool selected)
notify the junction of being selected in tls-mode. (used to control drawing)
bool hasString(const std::string &str) const
void add(const Position &pos)
Adds the given position to this one.
bool isInitialised() const
check if Boundary is Initialised
void updateGeometry()
update pre-computed geometry information
bool isValid(SumoXMLAttr key, const std::string &value)
bool isAttributeEnabled(SumoXMLAttr key) const
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Boundary & grow(double by)
extends the boundary by the given amount
turn junction into multiple junctions
friend class GNEChange_TLS
Declare friend class.
PositionVector myPoly
the (outer) shape of the junction
void removeRoundabout(const NBNode *node)
remove roundabout that contains the given node
void selectAttributeCarrier(bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
A SUMO-compliant built logic for a traffic light.
const std::string & getTagStr() const
get tag assigned to this object in string format
bool drawJunctionShape
whether the shape of the junction should be drawn
Represents a single node (junction) during network building.
Stores the information about how to visualize structures.
void removeConnectionsTo(GNEEdge *edge, GNEUndoList *undoList, bool updateTLS, int lane=-1)
remove all connections to the given edge
A definition of a pedestrian crossing.
A structure which describes a connection between edges or lanes.
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
bool insert(NBTrafficLightDefinition *logic, bool forceInsert=false)
Adds a logic definition to the dictionary.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
begin/end of the description of a embedded route (used in NETEDIT)
void removeTLSConnections(std::vector< NBConnection > &connections, GNEUndoList *undoList)
remove the given connections from all traffic light definitions of this junction
void replaceIncomingConnections(GNEEdge *which, GNEEdge *by, GNEUndoList *undoList)
replace one edge by another in all tls connections
double area() const
Returns the area (0 for non-closed)
edge: the shape in xml-definition
RightOfWay getRightOfWay() const
Returns hint on how to compute right of way.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
NetworkEditMode networkEditMode
the current Network edit mode
const PositionVector & getJunctionShape() const
const std::string & getID() const
Returns the id.
const T getColor(const double value) const
const std::vector< Connection > & getConnections() const
Returns the connections.
int getFromLane() const
returns the from-lane
void buildCrossingsAndWalkingAreas()
build crossings, and walkingareas. Also removes invalid loaded crossings if wished
void joinLogic(NBTrafficLightDefinition *def)
join nodes and states from the given logic (append red state)
std::vector< GNEEdge * > myGNEOutgoingEdges
vector with the outgoings GNEEdges vinculated with this junction
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
a single trip definition (used by router)
static StringBijection< SumoXMLNodeType > NodeTypes
node types
void reinit(const Position &position, SumoXMLNodeType type, bool updateEdgeGeometries=false)
Resets initial values.
The base class for traffic light logic definitions.
void removeOutgoingGNEEdge(GNEEdge *edge)
remove outgoing GNEEdge
begin/end of the description of a junction
void setID(const std::string &newID)
resets the id
GNECrossing * retrieveGNECrossing(NBNode::Crossing *NBNodeCrossing, bool createIfNoExist=true)
get GNECrossing if exist, and if not create it if create is enabled
bool myAmResponsible
whether we are responsible for deleting myNBNode
Boundary myMovingGeometryBoundary
boundary used during moving of elements
NBEdge * getTurnDestination(bool possibleDestination=false) const
const std::string & getID() const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
A loaded (complete) traffic light logic.