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 #include <iostream>
40 
41 #include "GNEInspectorFrame.h"
42 #include "GNEConnectorFrame.h"
43 #include "GNESelectorFrame.h"
44 #include "GNEViewParent.h"
45 #include "GNEViewNet.h"
46 #include "GNEChange_Connection.h"
47 #include "GNEUndoList.h"
48 #include "GNENet.h"
49 #include "GNELane.h"
50 #include "GNEConnection.h"
51 #include "GNEInternalLane.h"
52 #include "GNEEdge.h"
53 #include "GNEJunction.h"
54 
55 
56 // ===========================================================================
57 // FOX callback mapping
58 // ===========================================================================
59 FXDEFMAP(GNEConnectorFrame) GNEConnectorFrameMap[] = {
60  FXMAPFUNC(SEL_COMMAND, MID_CANCEL, GNEConnectorFrame::onCmdCancel),
61  FXMAPFUNC(SEL_COMMAND, MID_OK, GNEConnectorFrame::onCmdOK),
68 };
69 
70 // Object implementation
71 FXIMPLEMENT(GNEConnectorFrame, FXVerticalFrame, GNEConnectorFrameMap, ARRAYNUMBER(GNEConnectorFrameMap))
72 
73 // ===========================================================================
74 // static members
75 // ===========================================================================
81 
82 // ===========================================================================
83 // method definitions
84 // ===========================================================================
85 GNEConnectorFrame::GNEConnectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet):
86  GNEFrame(horizontalFrameParent, viewNet, "Edit Connections"),
87  myCurrentLane(0) {
88  // Create groupbox for lane information
90 
91  // Create label for lane description and update it
94 
95  // Create GroupBox for Buttons
96  myGroupBoxModifications = new FXGroupBox(myContentFrame, "Modifications", GUIDesignGroupBoxFrame);
97 
98  // Create "Cancel" button
99  myCancelButton = new FXButton(myGroupBoxModifications, "Cancel\t\tDiscard connection modifications (Esc)",
101  // Create "OK" button
102  mySaveButton = new FXButton(myGroupBoxModifications, "OK\t\tSave connection modifications (Enter)",
104 
105  // Create groupbox for operations
106  myGroupBoxOperations = new FXGroupBox(myContentFrame, "Operations", GUIDesignGroupBoxFrame);
107 
108  // Create "Select Dead Ends" button
109  mySelectDeadEndsButton = new FXButton(myGroupBoxOperations, "Select Dead Ends\t\tSelects all lanes that have no outgoing connection (clears previous selection)",
111  // Create "Select Dead Starts" button
112  mySelectDeadStartsButton = new FXButton(myGroupBoxOperations, "Select Dead Starts\t\tSelects all lanes that have no incoming connection (clears previous selection)",
114  // Create "Select Conflicts" button
115  mySelectConflictsButton = new FXButton(myGroupBoxOperations, "Select Conflicts\t\tSelects all lanes with more than one incoming connection from the same edge (clears previous selection)",
117  // Create "Select Edges which may always pass" button
118  mySelectPassingButton = new FXButton(myGroupBoxOperations, "Select Passing\t\tSelects all lanes with a connection that has has the 'pass' attribute set",
120  // Create "Clear Selected" button
121  myClearSelectedButton = new FXButton(myGroupBoxOperations, "Clear Selected\t\tClears all connections of all selected objects",
123  // Create "Reset Selected" button
124  myResetSelectedButton = new FXButton(myGroupBoxOperations, "Reset Selected\nJunctions\t\tRecomputes connections at all selected junctions",
126 
127  // Create groupbox for selection hints
128  myGroupBoxSelection = new FXGroupBox(myContentFrame, "Selection", GUIDesignGroupBoxFrame);
129 
130  // Selection Hint
131  myHoldShiftLabel = new FXLabel(myGroupBoxSelection, "Hold <SHIFT> while clicking\nto create unyielding\nconnections (pass=true).", 0, GUIDesignLabelLeft);
132  myHoldControlLabel = new FXLabel(myGroupBoxSelection, "Hold <CTRL> while clicking\nto create conflicting\nconnections (i.e. at zipper nodes)", 0, GUIDesignLabelLeft);
133 
134  // init colors here to avoid static order fiasco (https://isocpp.org/wiki/faq/ctors#static-init-order)
136  potentialTargetColor = RGBColor(0, 64, 0, 255);
140 
141 
142  // create groupbox for legend
143  myGroupBoxLegend = new FXGroupBox(myContentFrame, "Legend", GUIDesignGroupBoxFrame);
144 
145  // create source label
146  mySourceLabel = new FXLabel(myGroupBoxLegend, "Source", 0, GUIDesignLabelLeft);
148 
149  // create target label
150  myTargetLabel = new FXLabel(myGroupBoxLegend, "Target", 0, GUIDesignLabelLeft);
152 
153  // create possible target label
154  myPossibleTargetLabel = new FXLabel(myGroupBoxLegend, "Possible Target", 0, GUIDesignLabelLeft);
156 
157  // create target (pass) label
158  myTargetPassLabel = new FXLabel(myGroupBoxLegend, "Target (pass)", 0, GUIDesignLabelLeft);
160 
161  // create conflict label
162  myConflictLabel = new FXLabel(myGroupBoxLegend, "Conflict", 0, GUIDesignLabelLeft);
164 }
165 
166 
168 
169 
170 void
171 GNEConnectorFrame::handleLaneClick(GNELane* lane, bool mayDefinitelyPass, bool allowConflict, bool toggle) {
172  if (myCurrentLane == 0) {
173  myCurrentLane = lane;
175  initTargets();
176  myNumChanges = 0;
177  myViewNet->getUndoList()->p_begin("modify " + toString(SUMO_TAG_CONNECTION) + "s");
178  } else if (myPotentialTargets.count(lane) || allowConflict) {
179  const int fromIndex = myCurrentLane->getIndex();
180  GNEEdge& srcEdge = myCurrentLane->getParentEdge();
181  GNEEdge& destEdge = lane->getParentEdge();
182  std::vector<NBEdge::Connection> connections = srcEdge.getNBEdge()->getConnectionsFromLane(fromIndex);
183  bool changed = false;
184  LaneStatus status = getLaneStatus(connections, lane);
185  if (status == CONFLICTED && allowConflict) {
186  status = UNCONNECTED;
187  }
188  switch (status) {
189  case UNCONNECTED:
190  if (toggle) {
191  // create new connection
192  NBEdge::Connection newCon(fromIndex, destEdge.getNBEdge(), lane->getIndex(), mayDefinitelyPass);
193  myViewNet->getUndoList()->add(new GNEChange_Connection(&srcEdge, newCon, true), true);
194  lane->setSpecialColor(mayDefinitelyPass ? &targetPassColor : &targetColor);
196  }
197  break;
198  case CONNECTED:
199  case CONNECTED_PASS: {
200  // remove connection
201  GNEConnection* con = srcEdge.retrieveConnection(fromIndex, destEdge.getNBEdge(), lane->getIndex());
204  changed = true;
205  break;
206  }
207  case CONFLICTED:
208  myViewNet->setStatusBarText("Another lane from the same edge already connects to that " + toString(SUMO_TAG_LANE));
209  break;
210  }
211  if (changed) {
212  myNumChanges += 1;
213  }
214  } else {
215  myViewNet->setStatusBarText("Invalid target for " + toString(SUMO_TAG_CONNECTION));
216  }
218 }
219 
220 
221 long
222 GNEConnectorFrame::onCmdCancel(FXObject*, FXSelector, void*) {
223  if (myCurrentLane != 0) {
225  if (myNumChanges) {
226  myViewNet->setStatusBarText("Changes reverted");
227  }
228  cleanup();
229  myViewNet->update();
230  }
231  return 1;
232 }
233 
234 
235 long
236 GNEConnectorFrame::onCmdOK(FXObject*, FXSelector, void*) {
237  if (myCurrentLane != 0) {
239  if (myNumChanges) {
240  myViewNet->setStatusBarText("Changes accepted");
241  }
242  cleanup();
243  myViewNet->update();
244  }
245  return 1;
246 }
247 
248 
249 long
250 GNEConnectorFrame::onCmdSelectDeadEnds(FXObject*, FXSelector, void*) {
251  std::vector<GUIGlID> selectIDs;
252  // every edge knows its outgoing connections so we can look at each edge in isolation
253  const std::vector<GNEEdge*> edges = myViewNet->getNet()->retrieveEdges();
254  for (std::vector<GNEEdge*>::const_iterator edge_it = edges.begin(); edge_it != edges.end(); edge_it++) {
255  const GNEEdge::LaneVector& lanes = (*edge_it)->getLanes();
256  for (GNEEdge::LaneVector::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); it_lane++) {
257  if ((*edge_it)->getNBEdge()->getConnectionsFromLane((*it_lane)->getIndex()).size() == 0) {
258  selectIDs.push_back((*it_lane)->getGlID());
259  }
260  }
261  }
263  return 1;
264 }
265 
266 
267 long
268 GNEConnectorFrame::onCmdSelectDeadStarts(FXObject*, FXSelector, void*) {
269  GNENet* net = myViewNet->getNet();
270  std::set<GUIGlID> selectIDs;
271  // every edge knows only its outgoing connections so we look at whole junctions
272  const std::vector<GNEJunction*> junctions = net->retrieveJunctions();
273  for (std::vector<GNEJunction*>::const_iterator junction_it = junctions.begin(); junction_it != junctions.end(); junction_it++) {
274  // first collect all outgoing lanes
275  const EdgeVector& outgoing = (*junction_it)->getNBNode()->getOutgoingEdges();
276  for (EdgeVector::const_iterator it = outgoing.begin(); it != outgoing.end(); it++) {
277  GNEEdge* edge = net->retrieveEdge((*it)->getID());
278  const std::set<GUIGlID> laneIDs = edge->getLaneGlIDs();
279  for (std::set<GUIGlID>::const_iterator lid_it = laneIDs.begin(); lid_it != laneIDs.end(); lid_it++) {
280  selectIDs.insert(*lid_it);
281  }
282  }
283  // then remove all approached lanes
284  const EdgeVector& incoming = (*junction_it)->getNBNode()->getIncomingEdges();
285  for (EdgeVector::const_iterator it = incoming.begin(); it != incoming.end(); it++) {
286  GNEEdge* edge = net->retrieveEdge((*it)->getID());
287  NBEdge* nbe = edge->getNBEdge();
288  const std::vector<NBEdge::Connection>& connections = nbe->getConnections();
289  for (std::vector<NBEdge::Connection>::const_iterator con_it = connections.begin(); con_it != connections.end(); con_it++) {
290  GNEEdge* approachedEdge = net->retrieveEdge(con_it->toEdge->getID());
291  GNELane* approachedLane = approachedEdge->getLanes()[con_it->toLane];
292  selectIDs.erase(approachedLane->getGlID());
293  }
294  }
295  }
297  std::vector<GUIGlID>(selectIDs.begin(), selectIDs.end()),
299  return 1;
300 }
301 
302 
303 long
304 GNEConnectorFrame::onCmdSelectConflicts(FXObject*, FXSelector, void*) {
305  std::vector<GUIGlID> selectIDs;
306  // conflicts happen per edge so we can look at each edge in isolation
307  const std::vector<GNEEdge*> edges = myViewNet->getNet()->retrieveEdges();
308  for (std::vector<GNEEdge*>::const_iterator edge_it = edges.begin(); edge_it != edges.end(); edge_it++) {
309  NBEdge* nbe = (*edge_it)->getNBEdge();
310  const EdgeVector destinations = nbe->getConnectedEdges();
311  const std::vector<NBEdge::Connection>& connections = nbe->getConnections();
312  for (EdgeVector::const_iterator dest_it = destinations.begin(); dest_it != destinations.end(); dest_it++) {
313  GNEEdge* dest = myViewNet->getNet()->retrieveEdge((*dest_it)->getID());
314  const GNEEdge::LaneVector& destLanes = dest->getLanes();
315  for (GNEEdge::LaneVector::const_iterator it_lane = destLanes.begin(); it_lane != destLanes.end(); it_lane++) {
316  const bool isConflicted = count_if(
317  connections.begin(), connections.end(),
318  NBEdge::connections_toedgelane_finder(*dest_it, (int)(*it_lane)->getIndex(), -1)) > 1;
319  if (isConflicted) {
320  selectIDs.push_back((*it_lane)->getGlID());
321  }
322  }
323  }
324 
325  }
327  return 1;
328 }
329 
330 
331 long
332 GNEConnectorFrame::onCmdSelectPass(FXObject*, FXSelector, void*) {
333  std::vector<GUIGlID> selectIDs;
334  const std::vector<GNEEdge*> edges = myViewNet->getNet()->retrieveEdges();
335  for (std::vector<GNEEdge*>::const_iterator edge_it = edges.begin(); edge_it != edges.end(); edge_it++) {
336  GNEEdge* edge = *edge_it;
337  NBEdge* nbe = edge->getNBEdge();
338  const std::vector<NBEdge::Connection>& connections = nbe->getConnections();
339  for (std::vector<NBEdge::Connection>::const_iterator it = connections.begin(); it != connections.end(); ++it) {
340  if (it->mayDefinitelyPass) {
341  GNELane* lane = edge->getLanes()[it->fromLane];
342  selectIDs.push_back(lane->getGlID());
343  }
344  }
345  }
347  return 1;
348 }
349 
350 
351 long
353  onCmdCancel(0, 0, 0);
354  myViewNet->getUndoList()->p_begin("clear connections from selected lanes, edges and " + toString(SUMO_TAG_JUNCTION) + "s");
355  const std::set<GUIGlID> ids = gSelected.getSelected();
356  for (std::set<GUIGlID>::const_iterator it = ids.begin(); it != ids.end(); it++) {
357  GUIGlID id = *it;
359  if (object) {
360  switch (object->getType()) {
361  case GLO_JUNCTION: {
362  GNEJunction* junction = dynamic_cast<GNEJunction*>(object);
363  junction->setLogicValid(false, myViewNet->getUndoList()); // clear connections
364  junction->setLogicValid(false, myViewNet->getUndoList(), GNEAttributeCarrier::MODIFIED); // prevent re-guessing
365  break;
366  }
367  case GLO_EDGE: {
368  const GNEEdge::LaneVector& lanes = dynamic_cast<GNEEdge*>(object)->getLanes();
369  for (GNEEdge::LaneVector::const_iterator l_it = lanes.begin(); l_it != lanes.end(); ++l_it) {
370  removeConnections(*l_it);
371  }
372  break;
373  }
374  case GLO_LANE:
375  removeConnections(dynamic_cast<GNELane*>(object));
376  break;
377  default:
378  break;
379  }
380  }
381  }
383  return 1;
384 }
385 
386 
387 void
389  handleLaneClick(lane, false, false, true); // select as current lane
390  for (std::set<GNELane*>::iterator it = myPotentialTargets.begin(); it != myPotentialTargets.end(); it++) {
391  handleLaneClick(*it, false, false, false); // deselect
392  }
393  onCmdOK(0, 0, 0); // save
394 }
395 
396 
397 long
399  onCmdCancel(0, 0, 0);
400  myViewNet->getUndoList()->p_begin("reset connections from selected lanes");
401  const std::set<GUIGlID> nodeIDs = gSelected.getSelected(GLO_JUNCTION);
402  for (std::set<GUIGlID>::const_iterator nid_it = nodeIDs.begin(); nid_it != nodeIDs.end(); nid_it++) {
404  if (object) {
405  GNEJunction* junction = dynamic_cast<GNEJunction*>(object);
406  if (junction) {
407  junction->setLogicValid(false, myViewNet->getUndoList());
408  } else {
409  throw ProcessError("Wrong object type returned from gIDStorage");
410  }
411  }
412  }
414  return 1;
415 }
416 
417 
418 void
420  if (myCurrentLane == 0) {
421  myLaneDescriptionLabel->setText("No Lane Selected\n");
422  } else {
423  myLaneDescriptionLabel->setText(("Lane id: " + myCurrentLane->getMicrosimID() + "\nNumber of changes: " + toString(myNumChanges)).c_str());
424  }
425 }
426 
427 
428 void
430  // gather potential targets
432 
433  const EdgeVector& outgoing = nbn->getOutgoingEdges();
434  for (EdgeVector::const_iterator it = outgoing.begin(); it != outgoing.end(); it++) {
435  GNEEdge* edge = myViewNet->getNet()->retrieveEdge((*it)->getID());
436  const GNEEdge::LaneVector& lanes = edge->getLanes();
437  for (GNEEdge::LaneVector::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); it_lane++) {
438  myPotentialTargets.insert(*it_lane);
439  }
440  }
441  // set color for existing connections
442  const int fromIndex = myCurrentLane->getIndex();
444  std::vector<NBEdge::Connection> connections = srcEdge->getConnectionsFromLane(fromIndex);
445  for (std::set<GNELane*>::iterator it = myPotentialTargets.begin(); it != myPotentialTargets.end(); it++) {
446  switch (getLaneStatus(connections, *it)) {
447  case CONNECTED:
448  (*it)->setSpecialColor(&targetColor);
449  break;
450  case CONNECTED_PASS:
451  (*it)->setSpecialColor(&targetPassColor);
452  break;
453  case CONFLICTED:
454  (*it)->setSpecialColor(&conflictColor);
455  break;
456  case UNCONNECTED:
457  (*it)->setSpecialColor(&potentialTargetColor);
458  break;
459  }
460  }
461 }
462 
463 
464 void
466  // clean up
467  for (std::set<GNELane*>::iterator it = myPotentialTargets.begin(); it != myPotentialTargets.end(); it++) {
468  (*it)->setSpecialColor(0);
469  }
470  myPotentialTargets.clear();
471  myNumChanges = 0;
473  myCurrentLane = 0;
475 }
476 
477 
479 GNEConnectorFrame::getLaneStatus(const std::vector<NBEdge::Connection>& connections, GNELane* targetLane) {
481  const int fromIndex = myCurrentLane->getIndex();
482  NBEdge* destEdge = targetLane->getParentEdge().getNBEdge();
483  const int toIndex = targetLane->getIndex();
484  std::vector<NBEdge::Connection>::const_iterator con_it = find_if(
485  connections.begin(), connections.end(),
486  NBEdge::connections_finder(fromIndex, destEdge, toIndex));
487  const bool isConnected = con_it != connections.end();
488  if (isConnected) {
489  if (con_it->mayDefinitelyPass) {
490  return CONNECTED_PASS;
491  } else {
492  return CONNECTED;
493  }
494  } else if (srcEdge->hasConnectionTo(destEdge, toIndex)) {
495  return CONFLICTED;
496  } else {
497  return UNCONNECTED;
498  }
499 }
500 
501 
502 /****************************************************************************/
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:805
static RGBColor targetColor
color for the to-lane of a connection
const std::set< GUIGlID > & getSelected() const
Returns the set of ids of all selected objects.
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:164
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:743
begin/end of the description of a junction
begin/end of the description of a single lane
FXButton * mySelectPassingButton
"Select Edges which may always pass"
long onCmdSelectDeadStarts(FXObject *, FXSelector, void *)
Ok-button pressed.
Definition: GUIAppEnum.h:63
FXLabel * myHoldShiftLabel
Selection Hint.
long onCmdSelectPass(FXObject *, FXSelector, void *)
std::set< GUIGlID > getLaneGlIDs()
returns GLIDs of all lanes
Definition: GNEEdge.cpp:533
void setLogicValid(bool valid, GNEUndoList *undoList=0, const std::string &status=GUESSED)
FXLabel * myHoldControlLabel
hold control label
connectio between two lanes
GNEViewParent * getViewParent() const
get the net object
The representation of a single edge during network building.
Definition: NBEdge.h:71
Clear set.
Definition: GUIAppEnum.h:351
std::vector< GNELane * > LaneVector
Definition of the lane&#39;s vector.
Definition: GNEEdge.h:65
FXGroupBox * myGroupBoxSelection
groupbox for selection hints
FXGroupBox * myGroupBoxModifications
GroupBox for Buttons.
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:415
long onCmdClearSelectedConnections(FXObject *, FXSelector, void *)
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:88
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:82
select dead end lanes
Definition: GUIAppEnum.h:666
Cancel-button pressed.
Definition: GUIAppEnum.h:65
void handleIDs(std::vector< GUIGlID > ids, bool selectEdgesEnabled, SetOperation setop=SET_DEFAULT)
apply list of ids to the current selection according to SetOperation,
FXGroupBox * myGroupBoxLegend
group box for legend
FXDEFMAP(GNEConnectorFrame) GNEConnectorFrameMap[]
FXGroupBox * myGroupBoxDescription
Groupbox for description.
FXLabel * myConflictLabel
conflict label
const EdgeVector & getOutgoingEdges() const
Returns this node&#39;s outgoing edges (The edges which start at this node)
Definition: NBNode.h:245
GNEViewNet * myViewNet
the window to inform when the tls is modfied
Definition: GNEFrame.h:95
LaneStatus getLaneStatus(const std::vector< NBEdge::Connection > &connections, GNELane *targetLane)
return the status of toLane
select lanes with connections that have the pass attribute set to &#39;true&#39;
Definition: GUIAppEnum.h:672
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
Definition: NBEdge.cpp:1010
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)
GNEUndoList * getUndoList() const
get the undoList object
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:697
static const RGBColor GREEN
Definition: RGBColor.h:190
int myNumChanges
number of changes
FXGroupBox * myGroupBoxOperations
groupbox for operations
void initTargets()
init targets
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GNEConnectorFrame()
FOX needs this.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:56
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:104
GNEEdge & getParentEdge()
Returns underlying parent edge.
Definition: GNELane.cpp:1078
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:89
void removeConnections(GNELane *lane)
remove connections
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
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:1051
FXButton * myResetSelectedButton
"Reset Selected"
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
Definition: GNEEdge.cpp:165
select lanes that have no connection leading to it
Definition: GUIAppEnum.h:668
static RGBColor sourceColor
color for the from-lane of a connection
FXLabel * myTargetLabel
target label
static const RGBColor MAGENTA
Definition: RGBColor.h:194
FXButton * mySelectDeadStartsButton
"Select Dead Starts" button
static RGBColor targetPassColor
color for the to-lane of a connection with pass attribute
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_MODE_SELECT
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
FXLabel * myPossibleTargetLabel
possible target label
FXButton * mySelectConflictsButton
"Select Conflicts" button
void p_abort()
reverts and discards ALL active command groups
void invalidateTLS(GNEUndoList *undoList, const NBConnection &deletedConnection=NBConnection::InvalidConnection)
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:57
unsigned int GUIGlID
Definition: GUIGlObject.h:50
long onCmdOK(FXObject *, FXSelector, void *)
Reset set.
Definition: GUIAppEnum.h:353
static const RGBColor YELLOW
Definition: RGBColor.h:192
#define GUIDesignButton
Definition: GUIDesigns.h:57
static RGBColor conflictColor
color for a to-lane that cannot be used because another connection conflicts
FXButton * mySaveButton
"OK" button
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
Definition: GNEEdge.cpp:543
static const RGBColor CYAN
Definition: RGBColor.h:193
FXButton * myCancelButton
"Cancel" button
select lanes that are connected from concurrent lanes
Definition: GUIAppEnum.h:670
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:834
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:758
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:219
FXLabel * mySourceLabel
source label
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:861
an edge
FXLabel * myLaneDescriptionLabel
the label that shows the current editing state
LaneStatus
the status of a target lane
GNENet * getNet() const
get the net object
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:121
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.
GUIGlID getGlID() const
Returns the numerical id of the object.
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:357
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
Definition: NBEdge.cpp:1107
GNELane * myCurrentLane
the lane of which connections are to be modified
GNEConnection * retrieveConnection(int fromLane, NBEdge *to, int toLane)
get connection
Definition: GNEEdge.cpp:1012
~GNEConnectorFrame()
Destructor.
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:144
FXLabel * myTargetPassLabel
target pass label
NBEdge * getNBEdge()
returns the internal NBEdge
Definition: GNEEdge.cpp:261
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
FXButton * myClearSelectedButton
"Clear Selected"
NBNode * getNBNode() const
Return net build node.
GUISelectedStorage gSelected
A global holder of selected objects.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void cleanup()
clean up when deselecting current lane
FXButton * mySelectDeadEndsButton
"Select Dead Ends" button
void updateDescription() const
update description
long onCmdResetSelectedConnections(FXObject *, FXSelector, void *)
a junction