63 myAmCreateEdgeSource(false),
64 myLogicStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED),
65 myAmResponsible(false),
66 myHasValidLogic(loaded),
67 myAmTLSSelected(false) {
75 if (it->unreferenced()) {
77 WRITE_DEBUG(
"Deleting unreferenced " + it->getTagStr() +
" '" + it->getID() +
"' in GNEJunction destructor");
84 WRITE_DEBUG(
"Deleting NBNode of '" +
getID() +
"' in GNEJunction destructor");
122 if (rebuildNBNodeCrossings) {
129 std::vector<GNECrossing*> retrievedCrossings;
134 retrievedCrossings.push_back(retrievedGNECrossing);
143 retrievedGNECrossing->
incRef();
150 if (it->isAttributeCarrierSelected()) {
151 it->unselectAttributeCarrier();
153 if (it->unreferenced()) {
155 WRITE_DEBUG(
"Deleting unreferenced " + it->getTagStr() +
" in rebuildGNECrossings()");
160 myGNECrossings = retrievedCrossings;
200 FXMenuCommand* mcReplace =
new FXMenuCommand(ret,
"Replace junction by geometry point",
nullptr, &parent,
MID_GNE_JUNCTION_REPLACE);
201 FXMenuCommand* mcSplit =
new FXMenuCommand(ret, (
"Split junction (" +
toString(numEndpoints) +
" end points)").c_str(),
nullptr, &parent,
MID_GNE_JUNCTION_SPLIT);
207 mcCustomShape->disable();
208 mcClearConnections->disable();
209 mcResetConnections->disable();
212 if (handlingSelection) {
213 mcResetCustomShape->setText(
"Reset junction shapes");
217 mcClearConnections->disable();
221 mcResetCustomShape->disable();
227 std::string reason =
"wrong edit mode";
229 mcReplace->setText(mcReplace->getText() +
" (" + reason.c_str() +
")");
230 mcReplace->disable();
232 if (numEndpoints == 1) {
234 mcSplitReconnect->disable();
251 const double EXTENT = 2;
271 double circleWidthSquared = circleWidth * circleWidth;
297 if (color.
alpha() != 0) {
302 if (exaggeration > 1) {
321 if (color.
alpha() != 0) {
341 glTranslated(pos.
x(), pos.
y(),
getType() + 0.1);
343 const double halfWidth = 32 / s.
scale;
344 const double halfHeight = 64 / s.
scale;
372 for (
const auto& j : i->getGNEConnections()) {
378 for (
const auto& j : i->getSortedDemandElementChildrenByType(
SUMO_TAG_ROUTE)) {
382 i->drawPartialRoute(s, j,
this);
389 i->drawPartialRoute(s, j,
this);
392 for (
const auto& j : i->getSortedDemandElementChildrenByType(
SUMO_TAG_TRIP)) {
394 glPushName(j->getGlID());
397 i->drawPartialTripFromTo(s, j,
this);
406 for (
const auto& j : i->getSortedDemandElementChildrenByType(
SUMO_TAG_FLOW)) {
408 glPushName(j->getGlID());
411 i->drawPartialTripFromTo(s, j,
this);
422 i->drawPartialPersonPlan(s, j,
this);
425 i->drawPartialPersonPlan(s, j,
this);
428 i->drawPartialPersonPlan(s, j,
this);
431 i->drawPartialPersonPlan(s, j,
this);
434 i->drawPartialPersonPlan(s, j,
this);
437 i->drawPartialPersonPlan(s, j,
this);
440 i->drawPartialPersonPlan(s, j,
this);
443 i->drawPartialPersonPlan(s, j,
this);
457 std::vector<GNEJunction*>
460 std::set<GNEJunction*> junctions;
462 junctions.insert(i->getGNEJunctionSource());
465 junctions.insert(i->getGNEJunctionDestiny());
467 return std::vector<GNEJunction*>(junctions.begin(), junctions.end());
528 const std::vector<GNEEdge*>&
534 const std::vector<GNEEdge*>&
540 const std::vector<GNEEdge*>&
546 const std::vector<GNECrossing*>&
552 std::vector<GNEConnection*>
554 std::vector<GNEConnection*> connections;
556 for (
auto j : i->getGNEConnections()) {
557 connections.push_back(j);
587 std::set<GNEJunction*> affectedJunctions;
588 std::set<GNEEdge*> affectedEdges;
592 affectedJunctions.insert(i->getGNEJunctionSource());
593 affectedJunctions.insert(i->getGNEJunctionDestiny());
595 for (
auto j : i->getGNEJunctionSource()->getGNEEdges()) {
596 affectedEdges.insert(j);
599 for (
auto j : i->getGNEJunctionDestiny()->getGNEEdges()) {
600 affectedEdges.insert(j);
604 if (extendToNeighbors) {
605 for (
auto i : affectedJunctions) {
609 i->startGeometryMoving(
false);
614 for (
auto i : affectedEdges) {
616 i->startGeometryMoving();
630 std::set<GNEJunction*> affectedJunctions;
631 std::set<GNEEdge*> affectedEdges;
635 affectedJunctions.insert(i->getGNEJunctionSource());
636 affectedJunctions.insert(i->getGNEJunctionDestiny());
638 for (
auto j : i->getGNEJunctionSource()->getGNEEdges()) {
639 affectedEdges.insert(j);
642 for (
auto j : i->getGNEJunctionDestiny()->getGNEEdges()) {
643 affectedEdges.insert(j);
647 if (extendToNeighbors) {
648 for (
auto i : affectedJunctions) {
652 i->endGeometryMoving(
false);
657 for (
auto i : affectedEdges) {
659 i->endGeometryMoving();
672 for (
auto i : junctionNeighbours) {
680 newPosition.
add(offset);
726 assert(undoList != 0);
730 for (EdgeVector::iterator it = incoming.begin(); it != incoming.end(); it++) {
750 std::vector<NBEdge::Connection> connections = srcNBE->
getConnections();
752 for (std::vector<NBEdge::Connection>::reverse_iterator con_it = connections.rbegin(); con_it != connections.rend(); con_it++) {
753 if (lane >= 0 && (*con_it).fromLane != lane) {
756 bool hasTurn = con_it->toEdge == turnEdge;
765 std::vector<NBConnection> removeConnections;
767 removeConnections.push_back(
NBConnection(srcNBE, con.fromLane, con.toEdge, con.toLane));
777 std::vector<NBConnection> removeConnections;
780 std::vector<NBEdge::Connection> connections = srcNBE->getConnections();
781 for (std::vector<NBEdge::Connection>::reverse_iterator con_it = connections.rbegin(); con_it != connections.rend(); con_it++) {
782 if ((*con_it).toEdge == destNBE) {
783 if (lane >= 0 && (*con_it).toLane != lane) {
786 bool hasTurn = srcNBE->getTurnDestination() == destNBE;
793 removeConnections.push_back(
NBConnection(srcNBE, (*con_it).fromLane, destNBE, (*con_it).toLane));
805 if (connections.size() == 0) {
809 for (
auto it : coypOfTls) {
812 if (tlDef !=
nullptr) {
813 std::string newID = tlDef->
getID();
820 undoList->add(
new GNEChange_TLS(
this, replacementDef,
true,
false, newID),
true);
822 const std::vector<NBNode*> copyOfNodes = tlDef->
getNodes();
823 for (
auto it_node : copyOfNodes) {
825 undoList->add(
new GNEChange_TLS(sharing, tlDef,
false),
true);
826 undoList->add(
new GNEChange_TLS(sharing, replacementDef,
true,
false, newID),
true);
844 for (
auto it : coypOfTls) {
847 if (tlDef !=
nullptr) {
848 std::string newID = tlDef->
getID();
851 for (
int i = 0; i < (int)which->
getLanes().size(); ++i) {
855 undoList->add(
new GNEChange_TLS(
this, replacementDef,
true,
false, newID),
true);
857 const std::vector<NBNode*> copyOfNodes = tlDef->
getNodes();
858 for (
auto it_node : copyOfNodes) {
860 undoList->add(
new GNEChange_TLS(sharing, tlDef,
false),
true);
861 undoList->add(
new GNEChange_TLS(sharing, replacementDef,
true,
false, newID),
true);
871 for (EdgeVector::iterator it = incoming.begin(); it != incoming.end(); it++) {
884 for (
auto it : coypOfTls) {
886 if (tlDef !=
nullptr) {
888 std::string newID = tlDef->
getID();
893 replacementDef = repl;
910 replacementDef = repl;
916 undoList->add(
new GNEChange_TLS(
this, replacementDef,
true,
false, newID),
true);
918 const std::vector<NBNode*> copyOfNodes = tlDef->
getNodes();
919 for (
auto it_node : copyOfNodes) {
921 undoList->add(
new GNEChange_TLS(sharing, tlDef,
false),
true);
922 undoList->add(
new GNEChange_TLS(sharing, replacementDef,
true,
false, newID),
true);
936 EdgeSet edgeSet(c->getCrossingEdges().begin(), c->getCrossingEdges().end());
938 if (edgeSet.count(edge->
getNBEdge()) == 1) {
940 if ((c->getCrossingEdges().size() == 1) && (c->getCrossingEdges().front() == edge->
getNBEdge())) {
945 std::vector<std::string> edges = GNEAttributeCarrier::parse<std::vector<std::string>>(c->getAttribute(
SUMO_ATTR_EDGES));
946 edges.erase(std::find(edges.begin(), edges.end(), edge->
getID()));
965 if (i->getCrossingEdges() == crossing->
edges) {
969 if (createIfNoExist) {
973 WRITE_DEBUG(
"Created " + createdGNECrossing->
getTagStr() +
" '" + createdGNECrossing->
getID() +
"' in retrieveGNECrossing()");
976 return createdGNECrossing;
987 for (
auto j : i->getGNEConnections()) {
988 j->markConnectionGeometryDeprecated();
990 if (includingNeighbours) {
991 i->getGNEJunctionSource()->markConnectionsDeprecated(
false);
1025 for (
auto j : i->getGNEConnections()) {
1026 if (j->getNBEdgeConnection().keepClear) {
1066 undoList->
p_begin(
"change keepClear for whole junction");
1068 for (
auto j : i->getGNEConnections()) {
1085 for (
auto it : copyOfTls) {
1091 undoList->add(
new GNEChange_TLS(
this,
nullptr,
true),
true);
1093 }
else if (
getNBNode()->isTLControlled()) {
1097 for (
auto it : copyOfTls) {
1098 undoList->add(
new GNEChange_TLS(
this, it,
false,
false),
true);
1114 for (
auto oldDef : copyOfTls) {
1116 if (oldLoaded !=
nullptr) {
1119 std::vector<NBNode*> nodes = oldDef->getNodes();
1120 for (
auto it : nodes) {
1122 undoList->add(
new GNEChange_TLS(junction, oldDef,
false),
true);
1123 undoList->add(
new GNEChange_TLS(junction, newDef,
true),
true);
1134 assert(copyOfTls.size() > 0);
1137 const bool currentIsSingle = currentTLS->
getNodes().size() == 1;
1138 const bool currentIsLoaded =
dynamic_cast<NBLoadedSUMOTLDef*
>(currentTLS) !=
nullptr;
1139 if (currentIsLoaded) {
1141 dynamic_cast<NBLoadedSUMOTLDef*>(currentTLS)->getLogic());
1144 for (
auto it : copyOfTls) {
1149 const std::map<std::string, NBTrafficLightDefinition*> programs = tlCont.
getPrograms(value);
1150 if (programs.size() > 0) {
1151 for (
auto it : programs) {
1153 if (dynamic_cast<NBOwnTLDef*>(oldTLS) !=
nullptr) {
1157 if (dynamic_cast<NBLoadedSUMOTLDef*>(oldTLS) !=
nullptr &&
1158 dynamic_cast<NBLoadedSUMOTLDef*>(oldTLS)->usingSignalGroups()) {
1161 newTLSJoined->
joinLogic(currentTLSCopy);
1162 undoList->add(
new GNEChange_TLS(
this, newTLSJoined,
true,
true),
true);
1164 undoList->add(
new GNEChange_TLS(
this,
nullptr,
true,
false, value),
true);
1168 const std::vector<NBNode*> copyOfNodes = oldTLS->
getNodes();
1169 for (
auto it_node : copyOfNodes) {
1171 undoList->add(
new GNEChange_TLS(oldJunction, oldTLS,
false),
true);
1172 undoList->add(
new GNEChange_TLS(oldJunction, newTLS,
true),
true);
1177 if (currentIsSingle && currentIsLoaded) {
1180 renamedLogic->
setID(value);
1182 renamedTLS->
setID(value);
1183 undoList->add(
new GNEChange_TLS(
this, renamedTLS,
true,
true),
true);
1186 undoList->add(
new GNEChange_TLS(
this,
nullptr,
true,
false, value),
true);
1189 delete currentTLSCopy;
1207 return canParse<Position>(value);
1210 return canParse<PositionVector>(value);
1212 return canParse<double>(value) && (parse<double>(value) >= -1);
1218 return canParse<bool>(value);
1224 return canParse<bool>(value);
1238 result += i.first +
"=" + i.second +
"|";
1241 if (!result.empty()) {
1248 std::vector<std::pair<std::string, std::string> >
1250 std::vector<std::pair<std::string, std::string> > result;
1253 result.push_back(std::make_pair(i.first, i.second));
1264 std::vector<std::string> parsedValues;
1267 parsedValues.push_back(stValues.
next());
1270 for (
auto i : parsedValues) {
1271 std::vector<std::string> parsedParameters;
1274 parsedParameters.push_back(stParam.
next());
1325 i->clearGNEConnections();
1348 for (
auto it : copyOfTls) {
1364 if (parse<bool>(value)) {
1381 switch (activeScheme) {
1446 std::set<GNEJunction*> affectedJunctions;
1447 std::set<GNEEdge*> affectedEdges;
1451 affectedJunctions.insert(i->getGNEJunctionSource());
1452 affectedJunctions.insert(i->getGNEJunctionDestiny());
1454 for (
auto j : i->getGNEJunctionSource()->getGNEEdges()) {
1455 affectedEdges.insert(j);
1458 for (
auto j : i->getGNEJunctionDestiny()->getGNEEdges()) {
1459 affectedEdges.insert(j);
1463 for (
auto i : affectedEdges) {
1474 if (!bubble && scheme == 0) {
1492 tlCont.
insert(tlDef, forceInsert);
1500 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
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...
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
static StringBijection< RightOfWay > RightOfWayValues
righ of way algorithms
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...
Position getPositionInView() const
Returns position of hierarchical element in view.
SumoXMLTag
Numbers representing SUMO-XML - element names.
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.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
void addIncomingGNEEdge(GNEEdge *edge)
add incoming GNEEdge
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.
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
void guessMinMaxDuration()
heuristically add minDur and maxDur when switching from tlType fixed to actuated
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
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
void setRightOfWay(RightOfWay rightOfWay)
set method for computing right-of-way
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
a flow definitio nusing a from-to edges instead of a route (used by router)
void removeEdgeFromCrossings(GNEEdge *edge, GNEUndoList *undoList)
removes the given edge from all pedestrian crossings
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
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)
unsigned char alpha() const
Returns the alpha-amount of the color.
friend class GNEChange_TLS
Declare friend class.
Stores the information about how to visualize structures.
const std::string & getString(const T key) const
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..)
std::vector< std::pair< Position, std::string > > getEndPoints() const
return list of unique endpoint coordinates of all edges at this node
void removeRoundabout(const NBNode *node)
remove roundabout that contains the given node
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
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)
link,node: the traffic light id responsible for this link
#define WRITE_GLDEBUG(msg)
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.
turn junction into multiple junctions and reconnect them heuristically
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.
bool editingElevation() const
check if we're editing elevation
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 mirrorX()
mirror coordinates along the x-axis
bool hasNext()
returns the information whether further substrings exist
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.
turn junction into geometry node
A class that stores a 2D geometrical boundary.
begin/end of the description of a route
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.
static OptionsCont & getOptions()
Retrieves the options.
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 updateGeometry()
update pre-computed geometry information
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
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
NBEdge * getNBEdge() const
returns the internal NBEdge
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions ...
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
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
How to compute right of way.
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.
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.
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.
RGBColor selectionColor
basic selection color
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
NBEdgeCont & getEdgeCont()
Supermode currentSupermode
the current supermode
double scaledSize(double scale, double constFactor=0.1) const
get scale size
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
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.
friend class GNEChange_Attribute
declare friend class
T get(const std::string &str) const
mode for creating new edges
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
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
const std::string & getID() const
void setFringeType(FringeType fringeType)
set method for computing right-of-way
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 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.
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) ...
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
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
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
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
determines color value
int getToLane() const
returns the to-lane
NBEdge * getTo() const
returns the to-edge (end of the connection)
RightOfWay getRightOfWay() const
Returns hint on how to compute right of way.
A road/street connecting two junctions (netedit-version)
bool showNonInspectedDemandElements(const GNEDemandElement *demandElement) const
check if non inspected element has to be hidden
static const double BUBBLE_RADIUS
constant values for drawing buubles
void reset()
Resets the boundary.
bool showDemandElements() const
check if show demand elements checkbox is enabled
void setID(const std::string &newID)
resets the id
reset junction's connections
double selectionScale
the current selection scaling in NETEDIT (temporary)
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
~GNEJunction()
Destructor.
FringeType getFringeType() const
Returns fringe type.
double getRadius() const
Returns the turning radius of this node.
bool haveNetworkCrossings()
notify about style of loaded network (Without Crossings)
void updateGeometry()
update pre-computed geometry information
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
const std::vector< Connection > & getConnections() const
Returns the connections.
static StringBijection< FringeType > FringeTypeValues
fringe types
void updateGeometryAfterNetbuild(bool rebuildNBNodeCrossings=false)
update pre-computed geometry information without modifying netbuild structures
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node) ...
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
std::vector< GNECrossing * > myGNECrossings
the built crossing objects
RGBColor setColor(const GUIVisualizationSettings &s, bool bubble) const
sets junction color depending on circumstances
const std::string & getTagStr() const
get tag assigned to this object in string format
Demanding mode (Routes, Vehicles etc..)
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 std::vector< NBNode * > & getNodes() const
Returns the list of controlled nodes.
bool isInitialised() const
check if Boundary is Initialised
void updateGeometry()
update pre-computed geometry information
SumoXMLNodeType getType() const
Returns the type of this node.
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions) ...
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
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.
mode for connecting lanes
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
begin/end of the description of a embedded route (used in NETEDIT)
GUIGlID getGlID() const
Returns the numerical id of the object.
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
NetworkEditMode networkEditMode
the current Network edit mode
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
link: the index of the link within the traffic light
GUIVisualizationColorSettings colorSettings
color settings
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.
a single trip definition (used by router)
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.
void mirrorXLeftHand()
temporarily mirror coordinates in lefthand network to compute correct crossing geometries ...
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
std::vector< GNEJunction * > getJunctionNeighbours() const
return GNEJunction neighbours
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
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
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
bool drawBoundaries
enable or disable draw boundaries
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 requireRecompute()
inform the net about the need for recomputation
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void moveJunctionGeometry(const Position &pos)
reposition the node at pos without updating GRID and informs the edges
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.