SUMO - Simulation of Urban MObility
GNEConnectorFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
7 // The Widget for modifying lane-to-lane connections
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2011-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
31 #ifdef HAVE_VERSION_H
32 #include <version.h>
33 #endif
34 
35 #include <iostream>
44 
45 #include "GNEInspectorFrame.h"
46 #include "GNEConnectorFrame.h"
47 #include "GNESelectorFrame.h"
48 #include "GNEViewParent.h"
49 #include "GNEViewNet.h"
50 #include "GNEChange_Connection.h"
51 #include "GNEUndoList.h"
52 #include "GNENet.h"
53 #include "GNELane.h"
54 #include "GNEConnection.h"
55 #include "GNEInternalLane.h"
56 #include "GNEEdge.h"
57 #include "GNEJunction.h"
58 
59 #ifdef CHECK_MEMORY_LEAKS
60 #include <foreign/nvwa/debug_new.h>
61 #endif // CHECK_MEMORY_LEAKS
62 
63 
64 // ===========================================================================
65 // FOX callback mapping
66 // ===========================================================================
67 FXDEFMAP(GNEConnectorFrame) GNEConnectorFrameMap[] = {
68  FXMAPFUNC(SEL_COMMAND, MID_CANCEL, GNEConnectorFrame::onCmdCancel),
69  FXMAPFUNC(SEL_COMMAND, MID_OK, GNEConnectorFrame::onCmdOK),
76 };
77 
78 // Object implementation
79 FXIMPLEMENT(GNEConnectorFrame, FXVerticalFrame, GNEConnectorFrameMap, ARRAYNUMBER(GNEConnectorFrameMap))
80 
81 // ===========================================================================
82 // static members
83 // ===========================================================================
84 RGBColor GNEConnectorFrame::sourceColor;
85 RGBColor GNEConnectorFrame::potentialTargetColor;
86 RGBColor GNEConnectorFrame::targetColor;
87 RGBColor GNEConnectorFrame::targetPassColor;
88 RGBColor GNEConnectorFrame::conflictColor;
89 
90 // ===========================================================================
91 // method definitions
92 // ===========================================================================
93 GNEConnectorFrame::GNEConnectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet):
94  GNEFrame(horizontalFrameParent, viewNet, "Edit Connections"),
95  myCurrentLane(0) {
96  // Create groupbox for lane information
97  myGroupBoxDescription = new FXGroupBox(myContentFrame, "Lane", GUIDesignGroupBoxFrame);
98 
99  // Create label for lane description and update it
100  myLaneDescriptionLabel = new FXLabel(myGroupBoxDescription, "", 0, GUIDesignLabelLeft);
101  updateDescription();
102 
103  // Create GroupBox for Buttons
104  myGroupBoxModifications = new FXGroupBox(myContentFrame, "Modifications", GUIDesignGroupBoxFrame);
105 
106  // Create "Cancel" button
107  myCancelButton = new FXButton(myGroupBoxModifications, "Cancel\t\tDiscard connection modifications (Esc)",
109  // Create "OK" button
110  mySaveButton = new FXButton(myGroupBoxModifications, "OK\t\tSave connection modifications (Enter)",
112 
113  // Create groupbox for operations
114  myGroupBoxOperations = new FXGroupBox(myContentFrame, "Operations", GUIDesignGroupBoxFrame);
115 
116  // Create "Select Dead Ends" button
117  mySelectDeadEndsButton = new FXButton(myGroupBoxOperations, "Select Dead Ends\t\tSelects all lanes that have no outgoing connection (clears previous selection)",
119  // Create "Select Dead Starts" button
120  mySelectDeadStartsButton = new FXButton(myGroupBoxOperations, "Select Dead Starts\t\tSelects all lanes that have no incoming connection (clears previous selection)",
122  // Create "Select Conflicts" button
123  mySelectConflictsButton = new FXButton(myGroupBoxOperations, "Select Conflicts\t\tSelects all lanes with more than one incoming connection from the same edge (clears previous selection)",
125  // Create "Select Edges which may always pass" button
126  mySelectPassingButton = new FXButton(myGroupBoxOperations, "Select Passing\t\tSelects all lanes with a connection that has has the 'pass' attribute set",
128  // Create "Clear Selected" button
129  myClearSelectedButton = new FXButton(myGroupBoxOperations, "Clear Selected\t\tClears all connections of all selected objects",
131  // Create "Reset Selected" button
132  myResetSelectedButton = new FXButton(myGroupBoxOperations, "Reset Selected\nJunctions\t\tRecomputes connections at all selected junctions",
134 
135  // Create groupbox for selection hints
136  myGroupBoxSelection = new FXGroupBox(myContentFrame, "Selection", GUIDesignGroupBoxFrame);
137 
138  // Selection Hint
139  myHoldShiftLabel = new FXLabel(myGroupBoxSelection, "Hold <SHIFT> while clicking\nto create unyielding\nconnections (pass=true).", 0, GUIDesignLabelLeft);
140  myHoldControlLabel = new FXLabel(myGroupBoxSelection, "Hold <CTRL> while clicking\nto create conflicting\nconnections (i.e. at zipper nodes)", 0, GUIDesignLabelLeft);
141 
142  // init colors here to avoid static order fiasco (https://isocpp.org/wiki/faq/ctors#static-init-order)
143  sourceColor = RGBColor::CYAN;
144  potentialTargetColor = RGBColor(0, 64, 0, 255);
145  targetColor = RGBColor::GREEN;
146  targetPassColor = RGBColor::MAGENTA;
147  conflictColor = RGBColor::YELLOW;
148 
149 
150  // create groupbox for legend
151  myGroupBoxLegend = new FXGroupBox(myContentFrame, "Legend", GUIDesignGroupBoxFrame);
152 
153  // create source label
154  mySourceLabel = new FXLabel(myGroupBoxLegend, "Source", 0, GUIDesignLabelLeft);
155  mySourceLabel->setBackColor(MFXUtils::getFXColor(sourceColor));
156 
157  // create target label
158  myTargetLabel = new FXLabel(myGroupBoxLegend, "Target", 0, GUIDesignLabelLeft);
159  myTargetLabel->setBackColor(MFXUtils::getFXColor(targetColor));
160 
161  // create possible target label
162  myPossibleTargetLabel = new FXLabel(myGroupBoxLegend, "Possible Target", 0, GUIDesignLabelLeft);
163  myPossibleTargetLabel->setBackColor(MFXUtils::getFXColor(potentialTargetColor));
164 
165  // create target (pass) label
166  myTargetPassLabel = new FXLabel(myGroupBoxLegend, "Target (pass)", 0, GUIDesignLabelLeft);
167  myTargetPassLabel->setBackColor(MFXUtils::getFXColor(targetPassColor));
168 
169  // create conflict label
170  myConflictLabel = new FXLabel(myGroupBoxLegend, "Conflict", 0, GUIDesignLabelLeft);
171  myConflictLabel->setBackColor(MFXUtils::getFXColor(conflictColor));
172 }
173 
174 
176 
177 
178 void
179 GNEConnectorFrame::handleLaneClick(GNELane* lane, bool mayDefinitelyPass, bool allowConflict, bool toggle) {
180  if (myCurrentLane == 0) {
181  myCurrentLane = lane;
183  initTargets();
184  myNumChanges = 0;
185  myViewNet->getUndoList()->p_begin("modify " + toString(SUMO_TAG_CONNECTION) + "s");
186  } else if (myPotentialTargets.count(lane) || allowConflict) {
187  const int fromIndex = myCurrentLane->getIndex();
188  GNEEdge& srcEdge = myCurrentLane->getParentEdge();
189  GNEEdge& destEdge = lane->getParentEdge();
190  std::vector<NBEdge::Connection> connections = srcEdge.getNBEdge()->getConnectionsFromLane(fromIndex);
191  bool changed = false;
192  LaneStatus status = getLaneStatus(connections, lane);
193  if (status == CONFLICTED && allowConflict) {
194  status = UNCONNECTED;
195  }
196  switch (status) {
197  case UNCONNECTED:
198  if (toggle) {
199  // create new connection
200  NBEdge::Connection newCon(fromIndex, destEdge.getNBEdge(), lane->getIndex(), mayDefinitelyPass);
201  myViewNet->getUndoList()->add(new GNEChange_Connection(&srcEdge, newCon, true), true);
202  lane->setSpecialColor(mayDefinitelyPass ? &targetPassColor : &targetColor);
204  }
205  break;
206  case CONNECTED:
207  case CONNECTED_PASS: {
208  // remove connection
209  GNEConnection* con = srcEdge.retrieveConnection(fromIndex, destEdge.getNBEdge(), lane->getIndex());
212  changed = true;
213  break;
214  }
215  case CONFLICTED:
216  myViewNet->setStatusBarText("Another lane from the same edge already connects to that " + toString(SUMO_TAG_LANE));
217  break;
218  }
219  if (changed) {
220  myNumChanges += 1;
221  }
222  } else {
223  myViewNet->setStatusBarText("Invalid target for " + toString(SUMO_TAG_CONNECTION));
224  }
226 }
227 
228 
229 long
230 GNEConnectorFrame::onCmdCancel(FXObject*, FXSelector, void*) {
231  if (myCurrentLane != 0) {
233  if (myNumChanges) {
234  myViewNet->setStatusBarText("Changes reverted");
235  }
236  cleanup();
237  myViewNet->update();
238  }
239  return 1;
240 }
241 
242 
243 long
244 GNEConnectorFrame::onCmdOK(FXObject*, FXSelector, void*) {
245  if (myCurrentLane != 0) {
247  if (myNumChanges) {
248  myViewNet->setStatusBarText("Changes accepted");
249  }
250  cleanup();
251  myViewNet->update();
252  }
253  return 1;
254 }
255 
256 
257 long
258 GNEConnectorFrame::onCmdSelectDeadEnds(FXObject*, FXSelector, void*) {
259  std::vector<GUIGlID> selectIDs;
260  // every edge knows its outgoing connections so we can look at each edge in isolation
261  const std::vector<GNEEdge*> edges = myViewNet->getNet()->retrieveEdges();
262  for (std::vector<GNEEdge*>::const_iterator edge_it = edges.begin(); edge_it != edges.end(); edge_it++) {
263  const GNEEdge::LaneVector& lanes = (*edge_it)->getLanes();
264  for (GNEEdge::LaneVector::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); it_lane++) {
265  if ((*edge_it)->getNBEdge()->getConnectionsFromLane((*it_lane)->getIndex()).size() == 0) {
266  selectIDs.push_back((*it_lane)->getGlID());
267  }
268  }
269  }
271  return 1;
272 }
273 
274 
275 long
276 GNEConnectorFrame::onCmdSelectDeadStarts(FXObject*, FXSelector, void*) {
277  GNENet* net = myViewNet->getNet();
278  std::set<GUIGlID> selectIDs;
279  // every edge knows only its outgoing connections so we look at whole junctions
280  const std::vector<GNEJunction*> junctions = net->retrieveJunctions();
281  for (std::vector<GNEJunction*>::const_iterator junction_it = junctions.begin(); junction_it != junctions.end(); junction_it++) {
282  // first collect all outgoing lanes
283  const EdgeVector& outgoing = (*junction_it)->getNBNode()->getOutgoingEdges();
284  for (EdgeVector::const_iterator it = outgoing.begin(); it != outgoing.end(); it++) {
285  GNEEdge* edge = net->retrieveEdge((*it)->getID());
286  const std::set<GUIGlID> laneIDs = edge->getLaneGlIDs();
287  for (std::set<GUIGlID>::const_iterator lid_it = laneIDs.begin(); lid_it != laneIDs.end(); lid_it++) {
288  selectIDs.insert(*lid_it);
289  }
290  }
291  // then remove all approached lanes
292  const EdgeVector& incoming = (*junction_it)->getNBNode()->getIncomingEdges();
293  for (EdgeVector::const_iterator it = incoming.begin(); it != incoming.end(); it++) {
294  GNEEdge* edge = net->retrieveEdge((*it)->getID());
295  NBEdge* nbe = edge->getNBEdge();
296  const std::vector<NBEdge::Connection>& connections = nbe->getConnections();
297  for (std::vector<NBEdge::Connection>::const_iterator con_it = connections.begin(); con_it != connections.end(); con_it++) {
298  GNEEdge* approachedEdge = net->retrieveEdge(con_it->toEdge->getID());
299  GNELane* approachedLane = approachedEdge->getLanes()[con_it->toLane];
300  selectIDs.erase(approachedLane->getGlID());
301  }
302  }
303  }
305  std::vector<GUIGlID>(selectIDs.begin(), selectIDs.end()),
307  return 1;
308 }
309 
310 
311 long
312 GNEConnectorFrame::onCmdSelectConflicts(FXObject*, FXSelector, void*) {
313  std::vector<GUIGlID> selectIDs;
314  // conflicts happen per edge so we can look at each edge in isolation
315  const std::vector<GNEEdge*> edges = myViewNet->getNet()->retrieveEdges();
316  for (std::vector<GNEEdge*>::const_iterator edge_it = edges.begin(); edge_it != edges.end(); edge_it++) {
317  NBEdge* nbe = (*edge_it)->getNBEdge();
318  const EdgeVector destinations = nbe->getConnectedEdges();
319  const std::vector<NBEdge::Connection>& connections = nbe->getConnections();
320  for (EdgeVector::const_iterator dest_it = destinations.begin(); dest_it != destinations.end(); dest_it++) {
321  GNEEdge* dest = myViewNet->getNet()->retrieveEdge((*dest_it)->getID());
322  const GNEEdge::LaneVector& destLanes = dest->getLanes();
323  for (GNEEdge::LaneVector::const_iterator it_lane = destLanes.begin(); it_lane != destLanes.end(); it_lane++) {
324  const bool isConflicted = count_if(
325  connections.begin(), connections.end(),
326  NBEdge::connections_toedgelane_finder(*dest_it, (int)(*it_lane)->getIndex(), -1)) > 1;
327  if (isConflicted) {
328  selectIDs.push_back((*it_lane)->getGlID());
329  }
330  }
331  }
332 
333  }
335  return 1;
336 }
337 
338 
339 long
340 GNEConnectorFrame::onCmdSelectPass(FXObject*, FXSelector, void*) {
341  std::vector<GUIGlID> selectIDs;
342  const std::vector<GNEEdge*> edges = myViewNet->getNet()->retrieveEdges();
343  for (std::vector<GNEEdge*>::const_iterator edge_it = edges.begin(); edge_it != edges.end(); edge_it++) {
344  GNEEdge* edge = *edge_it;
345  NBEdge* nbe = edge->getNBEdge();
346  const std::vector<NBEdge::Connection>& connections = nbe->getConnections();
347  for (std::vector<NBEdge::Connection>::const_iterator it = connections.begin(); it != connections.end(); ++it) {
348  if (it->mayDefinitelyPass) {
349  GNELane* lane = edge->getLanes()[it->fromLane];
350  selectIDs.push_back(lane->getGlID());
351  }
352  }
353  }
355  return 1;
356 }
357 
358 
359 long
361  onCmdCancel(0, 0, 0);
362  myViewNet->getUndoList()->p_begin("clear connections from selected lanes, edges and " + toString(SUMO_TAG_JUNCTION) + "s");
363  const std::set<GUIGlID> ids = gSelected.getSelected();
364  for (std::set<GUIGlID>::const_iterator it = ids.begin(); it != ids.end(); it++) {
365  GUIGlID id = *it;
367  if (object) {
368  switch (object->getType()) {
369  case GLO_JUNCTION: {
370  GNEJunction* junction = dynamic_cast<GNEJunction*>(object);
371  junction->setLogicValid(false, myViewNet->getUndoList()); // clear connections
372  junction->setLogicValid(false, myViewNet->getUndoList(), GNEAttributeCarrier::MODIFIED); // prevent re-guessing
373  break;
374  }
375  case GLO_EDGE: {
376  const GNEEdge::LaneVector& lanes = dynamic_cast<GNEEdge*>(object)->getLanes();
377  for (GNEEdge::LaneVector::const_iterator l_it = lanes.begin(); l_it != lanes.end(); ++l_it) {
378  removeConnections(*l_it);
379  }
380  break;
381  }
382  case GLO_LANE:
383  removeConnections(dynamic_cast<GNELane*>(object));
384  break;
385  default:
386  break;
387  }
388  }
389  }
391  return 1;
392 }
393 
394 
395 void
397  handleLaneClick(lane, false, false, true); // select as current lane
398  for (std::set<GNELane*>::iterator it = myPotentialTargets.begin(); it != myPotentialTargets.end(); it++) {
399  handleLaneClick(*it, false, false, false); // deselect
400  }
401  onCmdOK(0, 0, 0); // save
402 }
403 
404 
405 long
407  onCmdCancel(0, 0, 0);
408  myViewNet->getUndoList()->p_begin("reset connections from selected lanes");
409  const std::set<GUIGlID> nodeIDs = gSelected.getSelected(GLO_JUNCTION);
410  for (std::set<GUIGlID>::const_iterator nid_it = nodeIDs.begin(); nid_it != nodeIDs.end(); nid_it++) {
412  if (object) {
413  GNEJunction* junction = dynamic_cast<GNEJunction*>(object);
414  if (junction) {
415  junction->setLogicValid(false, myViewNet->getUndoList());
416  } else {
417  throw ProcessError("Wrong object type returned from gIDStorage");
418  }
419  }
420  }
422  return 1;
423 }
424 
425 
426 void
428  if (myCurrentLane == 0) {
429  myLaneDescriptionLabel->setText("No Lane Selected\n");
430  } else {
431  myLaneDescriptionLabel->setText(("Lane id: " + myCurrentLane->getMicrosimID() + "\nNumber of changes: " + toString(myNumChanges)).c_str());
432  }
433 }
434 
435 
436 void
438  // gather potential targets
440 
441  const EdgeVector& outgoing = nbn->getOutgoingEdges();
442  for (EdgeVector::const_iterator it = outgoing.begin(); it != outgoing.end(); it++) {
443  GNEEdge* edge = myViewNet->getNet()->retrieveEdge((*it)->getID());
444  const GNEEdge::LaneVector& lanes = edge->getLanes();
445  for (GNEEdge::LaneVector::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); it_lane++) {
446  myPotentialTargets.insert(*it_lane);
447  }
448  }
449  // set color for existing connections
450  const int fromIndex = myCurrentLane->getIndex();
452  std::vector<NBEdge::Connection> connections = srcEdge->getConnectionsFromLane(fromIndex);
453  for (std::set<GNELane*>::iterator it = myPotentialTargets.begin(); it != myPotentialTargets.end(); it++) {
454  switch (getLaneStatus(connections, *it)) {
455  case CONNECTED:
456  (*it)->setSpecialColor(&targetColor);
457  break;
458  case CONNECTED_PASS:
459  (*it)->setSpecialColor(&targetPassColor);
460  break;
461  case CONFLICTED:
462  (*it)->setSpecialColor(&conflictColor);
463  break;
464  case UNCONNECTED:
465  (*it)->setSpecialColor(&potentialTargetColor);
466  break;
467  }
468  }
469 }
470 
471 
472 void
474  // clean up
475  for (std::set<GNELane*>::iterator it = myPotentialTargets.begin(); it != myPotentialTargets.end(); it++) {
476  (*it)->setSpecialColor(0);
477  }
478  myPotentialTargets.clear();
479  myNumChanges = 0;
481  myCurrentLane = 0;
483 }
484 
485 
487 GNEConnectorFrame::getLaneStatus(const std::vector<NBEdge::Connection>& connections, GNELane* targetLane) {
489  const int fromIndex = myCurrentLane->getIndex();
490  NBEdge* destEdge = targetLane->getParentEdge().getNBEdge();
491  const int toIndex = targetLane->getIndex();
492  std::vector<NBEdge::Connection>::const_iterator con_it = find_if(
493  connections.begin(), connections.end(),
494  NBEdge::connections_finder(fromIndex, destEdge, toIndex));
495  const bool isConnected = con_it != connections.end();
496  if (isConnected) {
497  if (con_it->mayDefinitelyPass) {
498  return CONNECTED_PASS;
499  } else {
500  return CONNECTED;
501  }
502  } else if (srcEdge->hasConnectionTo(destEdge, toIndex)) {
503  return CONFLICTED;
504  } else {
505  return UNCONNECTED;
506  }
507 }
508 
509 
510 /****************************************************************************/
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:794
static RGBColor targetColor
color for the to-lane of a connection
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:157
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:732
begin/end of the description of a junction
begin/end of the description of a single lane
long onCmdSelectDeadStarts(FXObject *, FXSelector, void *)
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
Definition: NBEdge.cpp:936
long onCmdSelectPass(FXObject *, FXSelector, void *)
std::set< GUIGlID > getLaneGlIDs()
returns GLIDs of all lanes
Definition: GNEEdge.cpp:469
void setLogicValid(bool valid, GNEUndoList *undoList=0, const std::string &status=GUESSED)
connectio between two lanes
The representation of a single edge during network building.
Definition: NBEdge.h:71
std::vector< GNELane * > LaneVector
Definition of the lane&#39;s vector.
Definition: GNEEdge.h:62
NBNode * getNBNode() const
Return net build node.
std::set< GNELane * > myPotentialTargets
the set of lanes to which the current lane may be connected
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:407
long onCmdClearSelectedConnections(FXObject *, FXSelector, void *)
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:87
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
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...
Definition: GNEUndoList.cpp:86
select lanes that are connected from concurrent lanes
Definition: GUIAppEnum.h:653
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:983
FXDEFMAP(GNEConnectorFrame) GNEConnectorFrameMap[]
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:659
GUIGlID getGlID() const
Returns the numerical id of the object.
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:995
GNEViewNet * myViewNet
the window to inform when the tls is modfied
Definition: GNEFrame.h:92
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1033
LaneStatus getLaneStatus(const std::vector< NBEdge::Connection > &connections, GNELane *targetLane)
return the status of toLane
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
const EdgeVector & getOutgoingEdges() const
Returns this node&#39;s outgoing edges (The edges which start at this node)
Definition: NBNode.h:245
static RGBColor potentialTargetColor
color for potential to-lane targets (currently unconnected)
void handleLaneClick(GNELane *lane, bool mayDefinitelyPass, bool allowConflict, bool toggle)
either sets the current lane or toggles the connection of the current lane to this lane (if they shar...
long onCmdSelectConflicts(FXObject *, FXSelector, void *)
static const std::string MODIFIED
feature has been manually modified (implies approval)
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static const RGBColor GREEN
Definition: RGBColor.h:190
int myNumChanges
number of changes
const std::set< GUIGlID > & getSelected() const
Returns the set of ids of all selected objects.
void initTargets()
init targets
bool hasConnectionTo(NBEdge *destEdge, int destLane, int fromLane=-1) const
Retrieves info about a connection to a certain lane of a certain edge.
Definition: NBEdge.cpp:977
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:55
GNEEdge & getParentEdge()
Returns underlying parent edge.
Definition: GNELane.cpp:1027
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.
Definition: GNEUndoList.cpp:93
select lanes that have no connection leading to it
Definition: GUIAppEnum.h:651
void removeConnections(GNELane *lane)
remove connections
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
select dead end lanes
Definition: GUIAppEnum.h:649
static RGBColor sourceColor
color for the from-lane of a connection
static const RGBColor MAGENTA
Definition: RGBColor.h:194
static RGBColor targetPassColor
color for the to-lane of a connection with pass attribute
Ok-button pressed.
Definition: GUIAppEnum.h:63
void p_abort()
reverts and discards ALL active command groups
void invalidateTLS(GNEUndoList *undoList, const NBConnection &deletedConnection=NBConnection::InvalidConnection)
Cancel-button pressed.
Definition: GUIAppEnum.h:65
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:54
unsigned int GUIGlID
Definition: GUIGlObject.h:50
long onCmdOK(FXObject *, FXSelector, void *)
void updateDescription() const
update description
static const RGBColor YELLOW
Definition: RGBColor.h:192
#define GUIDesignButton
Definition: GUIDesigns.h:66
Clear set.
Definition: GUIAppEnum.h:349
static RGBColor conflictColor
color for a to-lane that cannot be used because another connection conflicts
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
Definition: GNEEdge.cpp:479
static const RGBColor CYAN
Definition: RGBColor.h:193
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:747
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:204
select lanes with connections that have the pass attribute set to &#39;true&#39;
Definition: GUIAppEnum.h:655
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:41
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
void setSpecialColor(const RGBColor *Color2)
Definition: GNELane.cpp:818
an edge
Reset set.
Definition: GUIAppEnum.h:351
FXLabel * myLaneDescriptionLabel
the label that shows the current editing state
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:989
void handleIDs(std::vector< GUIGlID > ids, bool selectEdges, SetOperation setop=SET_DEFAULT)
apply list of ids to the current selection according to SetOperation,
LaneStatus
the status of a target lane
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:125
Represents a single node (junction) during network building.
Definition: NBNode.h:75
long onCmdSelectDeadEnds(FXObject *, FXSelector, void *)
Called when the user presses the Corresponding-button.
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:345
GNELane * myCurrentLane
the lane of which connections are to be modified
GNEConnection * retrieveConnection(int fromLane, NBEdge *to, int toLane)
get connection
Definition: GNEEdge.cpp:922
~GNEConnectorFrame()
Destructor.
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:139
NBEdge * getNBEdge()
returns the internal NBEdge
Definition: GNEEdge.cpp:258
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
GUISelectedStorage gSelected
A global holder of selected objects.
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:810
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void cleanup()
clean up when deselecting current lane
long onCmdResetSelectedConnections(FXObject *, FXSelector, void *)
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_MODE_SELECT
a junction
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
Definition: GNEEdge.cpp:162