Eclipse SUMO - Simulation of Urban MObility
GNEConnectorFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2011-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The Widget for modifying lane-to-lane connections
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
27 #include <netedit/GNEViewParent.h>
28 #include <netedit/GNEUndoList.h>
29 #include <netedit/GNENet.h>
30 #include <netedit/GNEViewNet.h>
36 
37 #include "GNEConnectorFrame.h"
38 #include "GNESelectorFrame.h"
39 
40 
41 // ===========================================================================
42 // FOX callback mapping
43 // ===========================================================================
44 
45 FXDEFMAP(GNEConnectorFrame::ConnectionModifications) ConnectionModificationsMap[] = {
48 };
49 
50 FXDEFMAP(GNEConnectorFrame::ConnectionOperations) ConnectionOperationsMap[] = {
57 };
58 
59 // Object implementation
60 FXIMPLEMENT(GNEConnectorFrame::ConnectionModifications, FXGroupBox, ConnectionModificationsMap, ARRAYNUMBER(ConnectionModificationsMap))
61 FXIMPLEMENT(GNEConnectorFrame::ConnectionOperations, FXGroupBox, ConnectionOperationsMap, ARRAYNUMBER(ConnectionOperationsMap))
62 
63 
64 // ===========================================================================
65 // method definitions
66 // ===========================================================================
67 
68 // ---------------------------------------------------------------------------
69 // GNEConnectorFrame::CurrentLane - methods
70 // ---------------------------------------------------------------------------
71 
73  FXGroupBox(connectorFrameParent->myContentFrame, "Lane", GUIDesignGroupBoxFrame) {
74  // create lane label
75  myCurrentLaneLabel = new FXLabel(this, "No lane selected", 0, GUIDesignLabelLeft);
76 }
77 
78 
80 
81 
82 void
84  if (laneID.empty()) {
85  myCurrentLaneLabel->setText("No lane selected");
86  } else {
87  myCurrentLaneLabel->setText((std::string("Current Lane: ") + laneID).c_str());
88  }
89 }
90 
91 // ---------------------------------------------------------------------------
92 // GNEConnectorFrame::ConnectionModifications - methods
93 // ---------------------------------------------------------------------------
94 
96  FXGroupBox(connectorFrameParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame),
97  myConnectorFrameParent(connectorFrameParent) {
98 
99  // Create "Cancel" button
100  myCancelButton = new FXButton(this, "Cancel\t\tDiscard connection modifications (Esc)",
102  // Create "OK" button
103  mySaveButton = new FXButton(this, "OK\t\tSave connection modifications (Enter)",
105 
106  // Create checkbox for protect routes
107  myProtectRoutesCheckBox = new FXCheckButton(this, "Protect routes", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
108 }
109 
110 
112 
113 
114 long
119  myConnectorFrameParent->getViewNet()->setStatusBarText("Changes reverted");
120  }
123  }
124  return 1;
125 }
126 
127 
128 long
131  // check if routes has to be protected
132  if (myProtectRoutesCheckBox->isEnabled() && (myProtectRoutesCheckBox->getCheck() == TRUE)) {
134  if (!i->isDemandElementValid()) {
135  FXMessageBox::warning(getApp(), MBOX_OK,
136  "Error saving connection operations", "%s",
137  ("Connection edition cannot be saved because route '" + i->getID() + "' is broken.").c_str());
138  return 1;
139  }
140  }
141  }
142  // finish route editing
145  myConnectorFrameParent->getViewNet()->setStatusBarText("Changes accepted");
146  }
149  }
150  return 1;
151 }
152 
153 // ---------------------------------------------------------------------------
154 // GNEConnectorFrame::ConnectionOperations - methods
155 // ---------------------------------------------------------------------------
156 
158  FXGroupBox(connectorFrameParent->myContentFrame, "Operations", GUIDesignGroupBoxFrame),
159  myConnectorFrameParent(connectorFrameParent) {
160 
161  // Create "Select Dead Ends" button
162  mySelectDeadEndsButton = new FXButton(this, "Select Dead Ends\t\tSelects all lanes that have no outgoing connection (clears previous selection)",
164  // Create "Select Dead Starts" button
165  mySelectDeadStartsButton = new FXButton(this, "Select Dead Starts\t\tSelects all lanes that have no incoming connection (clears previous selection)",
167  // Create "Select Conflicts" button
168  mySelectConflictsButton = new FXButton(this, "Select Conflicts\t\tSelects all lanes with more than one incoming connection from the same edge (clears previous selection)",
170  // Create "Select Edges which may always pass" button
171  mySelectPassingButton = new FXButton(this, "Select Passing\t\tSelects all lanes with a connection that has has the 'pass' attribute set",
173  // Create "Clear Selected" button
174  myClearSelectedButton = new FXButton(this, "Clear Selected\t\tClears all connections of all selected objects",
176  // Create "Reset Selected" button
177  myResetSelectedButton = new FXButton(this, "Reset Selected\t\tRecomputes connections at all selected junctions",
179 }
180 
181 
183 
184 
185 long
187  std::vector<GNEAttributeCarrier*> deadEnds;
188  // every edge knows its outgoing connections so we can look at each edge in isolation
189  const std::vector<GNEEdge*> edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges();
190  for (auto i : edges) {
191  for (auto j : i->getLanes()) {
192  if (i->getNBEdge()->getConnectionsFromLane(j->getIndex()).size() == 0) {
193  deadEnds.push_back(j);
194  }
195  }
196  }
198  return 1;
199 }
200 
201 
202 long
204  std::vector<GNEAttributeCarrier*> deadStarts;
205  // every edge knows only its outgoing connections so we look at whole junctions
206  const std::vector<GNEJunction*> junctions = myConnectorFrameParent->getViewNet()->getNet()->retrieveJunctions();
207  for (auto i : junctions) {
208  // first collect all outgoing lanes
209  for (auto j : i->getNBNode()->getOutgoingEdges()) {
210  GNEEdge* edge = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdge(j->getID());
211  for (auto k : edge->getLanes()) {
212  deadStarts.push_back(k);
213  }
214  }
215  // then remove all approached lanes
216  for (auto j : i->getNBNode()->getIncomingEdges()) {
217  GNEEdge* edge = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdge(j->getID());
218  for (auto k : edge->getNBEdge()->getConnections()) {
219  deadStarts.push_back(myConnectorFrameParent->getViewNet()->getNet()->retrieveEdge(k.toEdge->getID())->getLanes()[k.toLane]);
220  }
221  }
222  }
224  return 1;
225 }
226 
227 
228 long
230  std::vector<GNEAttributeCarrier*> conflicts;
231  // conflicts happen per edge so we can look at each edge in isolation
232  const std::vector<GNEEdge*> edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges();
233  for (auto i : edges) {
234  const EdgeVector destinations = i->getNBEdge()->getConnectedEdges();
235  for (auto j : destinations) {
236  GNEEdge* dest = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdge(j->getID());
237  for (auto k : dest->getLanes()) {
238  const bool isConflicted = count_if(i->getNBEdge()->getConnections().begin(), i->getNBEdge()->getConnections().end(),
239  NBEdge::connections_toedgelane_finder(j, (int)(k)->getIndex(), -1)) > 1;
240  if (isConflicted) {
241  conflicts.push_back(k);
242  }
243  }
244  }
245 
246  }
248  return 1;
249 }
250 
251 
252 long
254  std::vector<GNEAttributeCarrier*> pass;
255  const std::vector<GNEEdge*> edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges();
256  for (auto i : edges) {
257  for (auto j : i->getNBEdge()->getConnections()) {
258  if (j.mayDefinitelyPass) {
259  pass.push_back(i->getLanes()[j.fromLane]);
260  }
261  }
262  }
264  return 1;
265 }
266 
267 
268 long
271  myConnectorFrameParent->getViewNet()->getUndoList()->p_begin("clear connections from selected lanes, edges and " + toString(SUMO_TAG_JUNCTION) + "s");
272  // clear junction's connection
273  auto junctions = myConnectorFrameParent->getViewNet()->getNet()->retrieveJunctions(true);
274  for (auto i : junctions) {
275  i->setLogicValid(false, myConnectorFrameParent->getViewNet()->getUndoList()); // clear connections
276  i->setLogicValid(false, myConnectorFrameParent->getViewNet()->getUndoList(), GNEAttributeCarrier::FEATURE_MODIFIED); // prevent re-guessing
277  }
278  // clear edge's connection
279  auto edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges(true);
280  for (auto i : edges) {
281  for (auto j : i->getLanes()) {
283  }
284  }
285  // clear lane's connection
286  auto lanes = myConnectorFrameParent->getViewNet()->getNet()->retrieveLanes(true);
287  for (auto i : lanes) {
288  myConnectorFrameParent->removeConnections(dynamic_cast<GNELane*>(i));
289  }
291  return 1;
292 }
293 
294 
295 long
298  myConnectorFrameParent->getViewNet()->getUndoList()->p_begin("reset connections from selected lanes");
299  auto junctions = myConnectorFrameParent->getViewNet()->getNet()->retrieveJunctions(true);
300  for (auto i : junctions) {
301  i->setLogicValid(false, myConnectorFrameParent->getViewNet()->getUndoList());
302  }
304  return 1;
305 }
306 
307 // ---------------------------------------------------------------------------
308 // GNEConnectorFrame::ConnectionSelection - methods
309 // ---------------------------------------------------------------------------
310 
312  FXGroupBox(connectorFrameParent->myContentFrame, "Selection", GUIDesignGroupBoxFrame) {
313  // create Selection Hint
314  myHoldShiftLabel = new FXLabel(this, "Hold <SHIFT> while clicking\nto create unyielding\nconnections (pass=true).", 0, GUIDesignLabelFrameInformation);
315  myHoldControlLabel = new FXLabel(this, "Hold <CTRL> while clicking\nto create conflicting\nconnections (i.e. at zipper\nnodes or with incompatible\npermissions)", 0, GUIDesignLabelFrameInformation);
316 }
317 
318 
320 
321 // ---------------------------------------------------------------------------
322 // GNEConnectorFrame::ConnectionLegend - methods
323 // ---------------------------------------------------------------------------
324 
326  FXGroupBox(connectorFrameParent->myContentFrame, "Legend", GUIDesignGroupBoxFrame),
327  mySourceColor(RGBColor::CYAN),
328  myTargetColor(RGBColor::GREEN),
329  myPotentialTargetColor(RGBColor(0, 64, 0, 255)),
330  myTargetPassColor(RGBColor::MAGENTA),
331  myConflictColor(RGBColor::YELLOW) {
332 
333  // create source label
334  mySourceLabel = new FXLabel(this, "Source lane", 0, GUIDesignLabelLeft);
336 
337  // create target label
338  myTargetLabel = new FXLabel(this, "Target lane", 0, GUIDesignLabelLeft);
340 
341  // create possible target label
342  myPossibleTargetLabel = new FXLabel(this, "Possible Target", 0, GUIDesignLabelLeft);
344 
345  // create target (pass) label
346  myTargetPassLabel = new FXLabel(this, "Target (pass)", 0, GUIDesignLabelLeft);
348 
349  // create conflict label
350  myConflictLabel = new FXLabel(this, "Conflict", 0, GUIDesignLabelLeft);
352 }
353 
354 
356 
357 
358 const RGBColor&
360  return mySourceColor;
361 }
362 
363 
364 const RGBColor&
366  return myTargetColor;
367 }
368 
369 
370 const RGBColor&
372  return myPotentialTargetColor;
373 }
374 
375 
376 const RGBColor&
378  return myTargetPassColor;
379 }
380 
381 
382 const RGBColor&
384  return myConflictColor;
385 }
386 
387 // ---------------------------------------------------------------------------
388 // GNEConnectorFrame - methods
389 // ---------------------------------------------------------------------------
390 
391 GNEConnectorFrame::GNEConnectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet):
392  GNEFrame(horizontalFrameParent, viewNet, "Edit Connections"),
394  // create current lane modul
395  myCurrentLane = new CurrentLane(this);
396 
397  // create connection modifications modul
399 
400  // create connection operations modul
402 
403  // create connection selection modul
405 
406  // create connection legend modul
408 }
409 
410 
412 
413 
414 void
416  // build connection
418 }
419 
420 
424 }
425 
426 
427 void
429  // select lane as current lane
430  buildConnection(lane, false, false, true); // select as current lane
431  // iterate over all potential targets
432  for (auto i : myPotentialTargets) {
433  // remove connections using the apropiate parameters in function "buildConnection"
434  buildConnection(i, false, false, false);
435  }
436  // save modifications
438 }
439 
440 
441 void
442 GNEConnectorFrame::buildConnection(GNELane* lane, bool mayDefinitelyPass, bool allowConflict, bool toggle) {
443  if (myCurrentEditedLane == 0) {
444  myCurrentEditedLane = lane;
446  initTargets();
447  myNumChanges = 0;
448  myViewNet->getUndoList()->p_begin("modify " + toString(SUMO_TAG_CONNECTION) + "s");
449  } else if (myPotentialTargets.count(lane)
451  const int fromIndex = myCurrentEditedLane->getIndex();
453  GNEEdge& destEdge = lane->getParentEdge();
454  std::vector<NBEdge::Connection> connections = srcEdge.getNBEdge()->getConnectionsFromLane(fromIndex);
455  bool changed = false;
456  LaneStatus status = getLaneStatus(connections, lane);
457  if (status == CONFLICTED && allowConflict) {
458  status = UNCONNECTED;
459  }
460  switch (status) {
461  case UNCONNECTED:
462  if (toggle) {
463  // create new connection
464  NBEdge::Connection newCon(fromIndex, destEdge.getNBEdge(), lane->getIndex(), mayDefinitelyPass);
465  // if the connection was previously deleted (by clicking the same lane twice), restore all values
467  // fromLane must be the same, only check toLane
468  if (c.toEdge == destEdge.getNBEdge() && c.toLane == lane->getIndex()) {
469  newCon = c;
470  newCon.mayDefinitelyPass = mayDefinitelyPass;
471  }
472  }
473  NBConnection newNBCon(srcEdge.getNBEdge(), fromIndex, destEdge.getNBEdge(), lane->getIndex(), newCon.tlLinkIndex);
474  myViewNet->getUndoList()->add(new GNEChange_Connection(&srcEdge, newCon, false, true), true);
477  }
478  break;
479  case CONNECTED:
480  case CONNECTED_PASS: {
481  // remove connection
482  GNEConnection* con = srcEdge.retrieveGNEConnection(fromIndex, destEdge.getNBEdge(), lane->getIndex());
483  myDeletedConnections.push_back(con->getNBEdgeConnection());
486  changed = true;
487  break;
488  }
489  case CONFLICTED:
490  SVCPermissions fromPermissions = srcEdge.getNBEdge()->getPermissions(fromIndex);
491  SVCPermissions toPermissions = destEdge.getNBEdge()->getPermissions(lane->getIndex());
492  if ((fromPermissions & toPermissions) == SVC_PEDESTRIAN) {
493  myViewNet->setStatusBarText("Pedestrian connections are generated automatically");
494  } else if ((fromPermissions & toPermissions) == 0) {
495  myViewNet->setStatusBarText("Incompatible vehicle class permissions");
496  } else {
497  myViewNet->setStatusBarText("Another lane from the same edge already connects to that lane");
498  }
499  break;
500  }
501  if (changed) {
502  myNumChanges += 1;
503  }
504  } else {
505  myViewNet->setStatusBarText("Invalid target for " + toString(SUMO_TAG_CONNECTION));
506  }
508 }
509 
510 
511 void
513  // gather potential targets
515 
516  for (auto it : nbn->getOutgoingEdges()) {
517  GNEEdge* edge = myViewNet->getNet()->retrieveEdge(it->getID());
518  for (auto it_lane : edge->getLanes()) {
519  myPotentialTargets.insert(it_lane);
520  }
521  }
522  // set color for existing connections
523  std::vector<NBEdge::Connection> connections = myCurrentEditedLane->getParentEdge().getNBEdge()->getConnectionsFromLane(myCurrentEditedLane->getIndex());
524  for (auto it : myPotentialTargets) {
525  switch (getLaneStatus(connections, it)) {
526  case CONNECTED:
527  it->setSpecialColor(&myConnectionLegend->getTargetColor());
528  break;
529  case CONNECTED_PASS:
530  it->setSpecialColor(&myConnectionLegend->getTargetPassColor());
531  break;
532  case CONFLICTED:
533  it->setSpecialColor(&myConnectionLegend->getConflictColor());
534  break;
535  case UNCONNECTED:
536  it->setSpecialColor(&myConnectionLegend->getPotentialTargetColor());
537  break;
538  }
539  }
540 }
541 
542 
543 void
545  // restore colors of potential targets
546  for (auto it : myPotentialTargets) {
547  it->setSpecialColor(0);
548  }
549  // clear attributes
550  myPotentialTargets.clear();
551  myNumChanges = 0;
553  myCurrentEditedLane = nullptr;
554  myDeletedConnections.clear();
556 }
557 
558 
560 GNEConnectorFrame::getLaneStatus(const std::vector<NBEdge::Connection>& connections, GNELane* targetLane) {
562  const int fromIndex = myCurrentEditedLane->getIndex();
563  NBEdge* destEdge = targetLane->getParentEdge().getNBEdge();
564  const int toIndex = targetLane->getIndex();
565  std::vector<NBEdge::Connection>::const_iterator con_it = find_if(
566  connections.begin(), connections.end(),
567  NBEdge::connections_finder(fromIndex, destEdge, toIndex));
568  const bool isConnected = con_it != connections.end();
569  if (isConnected) {
570  if (con_it->mayDefinitelyPass) {
571  return CONNECTED_PASS;
572  } else {
573  return CONNECTED;
574  }
575  } else if (srcEdge->hasConnectionTo(destEdge, toIndex)
576  || (srcEdge->getPermissions(fromIndex) & destEdge->getPermissions(toIndex) & ~SVC_PEDESTRIAN) == 0) {
577  return CONFLICTED;
578  } else {
579  return UNCONNECTED;
580  }
581 }
582 
583 /****************************************************************************/
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1212
static const std::string FEATURE_MODIFIED
feature has been manually modified (implies approval)
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1164
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:184
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:1020
ConnectionModifications * getConnectionModifications() const
get pointer to ConnectionModifications modul
long onCmdSelectPass(FXObject *, FXSelector, void *)
Called when the user presses the select pass button.
FXLabel * myTargetPassLabel
target pass label
select lanes that have no connection leading to it
Definition: GUIAppEnum.h:701
GNEConnectorFrame * myConnectorFrameParent
pointer to connectorFrame parent
begin/end of the description of a junction
void update() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:292
bool controlKeyPressed() const
check if CONTROL key was pressed during click
long onCmdResetSelectedConnections(FXObject *, FXSelector, void *)
Called when the user presses the reset selected connections button.
FXButton * mySelectDeadStartsButton
"Select Dead Starts" button
const RGBColor & getSourceColor() const
get color for the from-lane of a connection
void handleIDs(const std::vector< GNEAttributeCarrier *> &ACs, ModificationMode::SetOperation setop=ModificationMode::SET_DEFAULT)
apply list of ids to the current selection according to SetOperation,
static const NBConnection InvalidConnection
Definition: NBConnection.h:121
FXButton * myClearSelectedButton
"Clear Selected"
connectio between two lanes
RGBColor myConflictColor
color for a to-lane that cannot be used because another connection conflicts
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:921
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
The representation of a single edge during network building.
Definition: NBEdge.h:86
ConnectionLegend * myConnectionLegend
ConnectionLegend modul.
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:584
FXButton * mySelectPassingButton
"Select Edges which may always pass"
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
FXLabel * myHoldControlLabel
hold control label
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:73
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
Definition: NBEdge.h:218
FXCheckButton * myProtectRoutesCheckBox
protect routes checkbox
RGBColor myTargetPassColor
color for the to-lane of a connection with pass attribute
FXButton * myResetSelectedButton
"Reset Selected"
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:133
RGBColor myPotentialTargetColor
color for potential to-lane targets (currently unconnected)
FXLabel * myCurrentLaneLabel
Label for current Lane.
const EdgeVector & getOutgoingEdges() const
Returns this node&#39;s outgoing edges (The edges which start at this node)
Definition: NBNode.h:264
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
GNEConnectorFrame * myConnectorFrameParent
pointer to connectorFrame parent
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:120
LaneStatus getLaneStatus(const std::vector< NBEdge::Connection > &connections, GNELane *targetLane)
return the status of toLane
ConnectionSelection(GNEConnectorFrame *connectorFrameParent)
constructor
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:625
NBEdge::Connection & getNBEdgeConnection() const
get Edge::Connection
FXLabel * myConflictLabel
conflict label
select lanes with connections that have the pass attribute set to &#39;true&#39;
Definition: GUIAppEnum.h:705
RGBColor myTargetColor
color for the to-lane of a connection
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:933
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:733
int myNumChanges
number of changes
void initTargets()
init targets
RGBColor mySourceColor
color for the from-lane of a connection
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:123
GNEEdge & getParentEdge()
Returns underlying parent edge.
Definition: GNELane.cpp:1292
long onCmdSelectConflicts(FXObject *, FXSelector, void *)
Called when the user presses the select conflicts button.
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:80
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:131
FXLabel * myPossibleTargetLabel
possible target label
void removeConnections(GNELane *lane)
remove connections
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:1170
const RGBColor & getTargetPassColor() const
get color for the to-lane of a connection with pass attribute
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
Definition: GNEEdge.cpp:505
C++ TraCI client API implementation.
ConnectionLegend(GNEConnectorFrame *connectorFrameParent)
constructor
GNEConnection * retrieveGNEConnection(int fromLane, NBEdge *to, int toLane, bool createIfNoExist=true)
get GNEConnection if exist, and if not create it if create is enabled
Definition: GNEEdge.cpp:1831
long onCmdCancelModifications(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:840
class used to group all variables related with objects under cursor after a click over view ...
FXButton * mySelectConflictsButton
"Select Conflicts" button
ConnectionModifications * myConnectionModifications
ConnectionModifications modul.
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn&#39;t)
const RGBColor & getPotentialTargetColor() const
get color for potential to-lane targets (currently unconnected)
FXLabel * myHoldShiftLabel
Selection Hint.
FXDEFMAP(GNEConnectorFrame::ConnectionModifications) ConnectionModificationsMap[]
const RGBColor & getTargetColor() const
get color for the to-lane of a connection
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_NMODE_SELECT
const GNEViewNetHelper::KeyPressed & getKeyPressed() const
get Key Pressed modul
Definition: GNEViewNet.cpp:423
const std::string getID() const
function to support debugging
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:210
GNEJunction * getGNEJunctionSource() const
returns the source-junction
Definition: GNEEdge.cpp:499
void p_abort()
reverts and discards ALL active command groups
Definition: GNEUndoList.cpp:94
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:3441
const RGBColor & getConflictColor() const
get color for a to-lane that cannot be used because another connection conflicts
void setSpecialColor(const RGBColor *Color2, double colorValue=std::numeric_limits< double >::max())
Definition: GNELane.cpp:927
long onCmdClearSelectedConnections(FXObject *, FXSelector, void *)
Called when the user presses the clear selected connections button.
std::vector< NBEdge::Connection > myDeletedConnections
vector of connections deleted in the current editing step
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
bool shiftKeyPressed() const
check if SHIFT key was pressed during click
ConnectionSelection * myConnectionSelection
ConnectionSelection modul.
select lanes that are connected from concurrent lanes
Definition: GUIAppEnum.h:703
void handleLaneClick(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
either sets the current lane or toggles the connection of the
void buildConnection(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...
#define GUIDesignButton
Definition: GUIDesigns.h:66
long onCmdSaveModifications(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any connection modifications.
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:924
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1151
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:255
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:35
long onCmdSelectDeadEnds(FXObject *, FXSelector, void *)
Called when the user presses the select dead ends button.
Ok-button pressed.
Definition: GUIAppEnum.h:213
FXButton * mySelectDeadEndsButton
"Select Dead Ends" button
Cancel-button pressed.
Definition: GUIAppEnum.h:215
LaneStatus
the status of a target lane
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:927
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:114
Represents a single node (junction) during network building.
Definition: NBNode.h:68
attribute edited
Definition: GUIAppEnum.h:619
std::vector< Connection > getConnectionsFromLane(int lane, NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
Definition: NBEdge.cpp:1127
ConnectionOperations * myConnectionOperations
ConnectionOperations modul.
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:482
~GNEConnectorFrame()
Destructor.
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:165
void updateCurrentLaneLabel(const std::string &laneID)
set current junction label
NBNode * getNBNode() const
Return net build node.
GNEConnectorFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void cleanup()
clean up when deselecting current lane
Clear set.
Definition: GUIAppEnum.h:501
Reset set.
Definition: GUIAppEnum.h:503
void invalidateTLS(GNEUndoList *undoList, const NBConnection &deletedConnection=NBConnection::InvalidConnection, const NBConnection &addedConnection=NBConnection::InvalidConnection)
long onCmdSelectDeadStarts(FXObject *, FXSelector, void *)
Called when the user presses the select dead starts button.
GNELane * myCurrentEditedLane
the lane of which connections are to be modified
CurrentLane * myCurrentLane
CurrentLane modul.