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-2018 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 
29 #include <netedit/GNEViewParent.h>
30 #include <netedit/GNEUndoList.h>
31 #include <netedit/GNENet.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 
107 
109 
110 
111 long
116  myConnectorFrameParent->getViewNet()->setStatusBarText("Changes reverted");
117  }
119  myConnectorFrameParent->getViewNet()->update();
120  }
121  return 1;
122 }
123 
124 
125 long
130  myConnectorFrameParent->getViewNet()->setStatusBarText("Changes accepted");
131  }
133  myConnectorFrameParent->getViewNet()->update();
134  }
135  return 1;
136 }
137 
138 // ---------------------------------------------------------------------------
139 // GNEConnectorFrame::ConnectionOperations - methods
140 // ---------------------------------------------------------------------------
141 
143  FXGroupBox(connectorFrameParent->myContentFrame, "Operations", GUIDesignGroupBoxFrame),
144  myConnectorFrameParent(connectorFrameParent) {
145 
146  // Create "Select Dead Ends" button
147  mySelectDeadEndsButton = new FXButton(this, "Select Dead Ends\t\tSelects all lanes that have no outgoing connection (clears previous selection)",
149  // Create "Select Dead Starts" button
150  mySelectDeadStartsButton = new FXButton(this, "Select Dead Starts\t\tSelects all lanes that have no incoming connection (clears previous selection)",
152  // Create "Select Conflicts" button
153  mySelectConflictsButton = new FXButton(this, "Select Conflicts\t\tSelects all lanes with more than one incoming connection from the same edge (clears previous selection)",
155  // Create "Select Edges which may always pass" button
156  mySelectPassingButton = new FXButton(this, "Select Passing\t\tSelects all lanes with a connection that has has the 'pass' attribute set",
158  // Create "Clear Selected" button
159  myClearSelectedButton = new FXButton(this, "Clear Selected\t\tClears all connections of all selected objects",
161  // Create "Reset Selected" button
162  myResetSelectedButton = new FXButton(this, "Reset Selected\t\tRecomputes connections at all selected junctions",
164 }
165 
166 
168 
169 
170 long
172  std::vector<GNEAttributeCarrier*> deadEnds;
173  // every edge knows its outgoing connections so we can look at each edge in isolation
174  const std::vector<GNEEdge*> edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges();
175  for (auto i : edges) {
176  for (auto j : i->getLanes()) {
177  if (i->getNBEdge()->getConnectionsFromLane(j->getIndex()).size() == 0) {
178  deadEnds.push_back(j);
179  }
180  }
181  }
183  return 1;
184 }
185 
186 
187 long
189  std::vector<GNEAttributeCarrier*> deadStarts;
190  // every edge knows only its outgoing connections so we look at whole junctions
191  const std::vector<GNEJunction*> junctions = myConnectorFrameParent->getViewNet()->getNet()->retrieveJunctions();
192  for (auto i : junctions) {
193  // first collect all outgoing lanes
194  for (auto j : i->getNBNode()->getOutgoingEdges()) {
195  GNEEdge* edge = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdge(j->getID());
196  for (auto k : edge->getLanes()) {
197  deadStarts.push_back(k);
198  }
199  }
200  // then remove all approached lanes
201  for (auto j : i->getNBNode()->getIncomingEdges()) {
202  GNEEdge* edge = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdge(j->getID());
203  for (auto k : edge->getNBEdge()->getConnections()) {
204  deadStarts.push_back(myConnectorFrameParent->getViewNet()->getNet()->retrieveEdge(k.toEdge->getID())->getLanes()[k.toLane]);
205  }
206  }
207  }
209  return 1;
210 }
211 
212 
213 long
215  std::vector<GNEAttributeCarrier*> conflicts;
216  // conflicts happen per edge so we can look at each edge in isolation
217  const std::vector<GNEEdge*> edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges();
218  for (auto i : edges) {
219  const EdgeVector destinations = i->getNBEdge()->getConnectedEdges();
220  for (auto j : destinations) {
221  GNEEdge* dest = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdge(j->getID());
222  for (auto k : dest->getLanes()) {
223  const bool isConflicted = count_if(i->getNBEdge()->getConnections().begin(), i->getNBEdge()->getConnections().end(),
224  NBEdge::connections_toedgelane_finder(j, (int)(k)->getIndex(), -1)) > 1;
225  if (isConflicted) {
226  conflicts.push_back(k);
227  }
228  }
229  }
230 
231  }
233  return 1;
234 }
235 
236 
237 long
239  std::vector<GNEAttributeCarrier*> pass;
240  const std::vector<GNEEdge*> edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges();
241  for (auto i : edges) {
242  for (auto j : i->getNBEdge()->getConnections()) {
243  if (j.mayDefinitelyPass) {
244  pass.push_back(i->getLanes()[j.fromLane]);
245  }
246  }
247  }
249  return 1;
250 }
251 
252 
253 long
256  myConnectorFrameParent->getViewNet()->getUndoList()->p_begin("clear connections from selected lanes, edges and " + toString(SUMO_TAG_JUNCTION) + "s");
257  // clear junction's connection
258  auto junctions = myConnectorFrameParent->getViewNet()->getNet()->retrieveJunctions(true);
259  for (auto i : junctions) {
260  i->setLogicValid(false, myConnectorFrameParent->getViewNet()->getUndoList()); // clear connections
261  i->setLogicValid(false, myConnectorFrameParent->getViewNet()->getUndoList(), GNEAttributeCarrier::FEATURE_MODIFIED); // prevent re-guessing
262  }
263  // clear edge's connection
264  auto edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges(true);
265  for (auto i : edges) {
266  for (auto j : i->getLanes()) {
268  }
269  }
270  // clear lane's connection
271  auto lanes = myConnectorFrameParent->getViewNet()->getNet()->retrieveLanes(true);
272  for (auto i : lanes) {
273  myConnectorFrameParent->removeConnections(dynamic_cast<GNELane*>(i));
274  }
276  return 1;
277 }
278 
279 
280 long
283  myConnectorFrameParent->getViewNet()->getUndoList()->p_begin("reset connections from selected lanes");
284  auto junctions = myConnectorFrameParent->getViewNet()->getNet()->retrieveJunctions(true);
285  for (auto i : junctions) {
286  i->setLogicValid(false, myConnectorFrameParent->getViewNet()->getUndoList());
287  }
289  return 1;
290 }
291 
292 // ---------------------------------------------------------------------------
293 // GNEConnectorFrame::ConnectionSelection - methods
294 // ---------------------------------------------------------------------------
295 
297  FXGroupBox(connectorFrameParent->myContentFrame, "Selection", GUIDesignGroupBoxFrame) {
298  // create Selection Hint
299  myHoldShiftLabel = new FXLabel(this, "Hold <SHIFT> while clicking\nto create unyielding\nconnections (pass=true).", 0, GUIDesignLabelFrameInformation);
300  myHoldControlLabel = new FXLabel(this, "Hold <CTRL> while clicking\nto create conflicting\nconnections (i.e. at zipper\nnodes or with incompatible\npermissions)", 0, GUIDesignLabelFrameInformation);
301 }
302 
303 
305 
306 // ---------------------------------------------------------------------------
307 // GNEConnectorFrame::ConnectionLegend - methods
308 // ---------------------------------------------------------------------------
309 
311  FXGroupBox(connectorFrameParent->myContentFrame, "Legend", GUIDesignGroupBoxFrame),
312  mySourceColor(RGBColor::CYAN),
313  myTargetColor(RGBColor::GREEN),
314  myPotentialTargetColor(RGBColor(0, 64, 0, 255)),
315  myTargetPassColor(RGBColor::MAGENTA),
316  myConflictColor(RGBColor::YELLOW) {
317 
318  // create source label
319  mySourceLabel = new FXLabel(this, "Source lane", 0, GUIDesignLabelLeft);
321 
322  // create target label
323  myTargetLabel = new FXLabel(this, "Target lane", 0, GUIDesignLabelLeft);
325 
326  // create possible target label
327  myPossibleTargetLabel = new FXLabel(this, "Possible Target", 0, GUIDesignLabelLeft);
329 
330  // create target (pass) label
331  myTargetPassLabel = new FXLabel(this, "Target (pass)", 0, GUIDesignLabelLeft);
333 
334  // create conflict label
335  myConflictLabel = new FXLabel(this, "Conflict", 0, GUIDesignLabelLeft);
337 }
338 
339 
341 
342 
343 const RGBColor&
345  return mySourceColor;
346 }
347 
348 
349 const RGBColor&
351  return myTargetColor;
352 }
353 
354 
355 const RGBColor&
357  return myPotentialTargetColor;
358 }
359 
360 
361 const RGBColor&
363  return myTargetPassColor;
364 }
365 
366 
367 const RGBColor&
369  return myConflictColor;
370 }
371 
372 // ---------------------------------------------------------------------------
373 // GNEConnectorFrame - methods
374 // ---------------------------------------------------------------------------
375 
376 GNEConnectorFrame::GNEConnectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet):
377  GNEFrame(horizontalFrameParent, viewNet, "Edit Connections"),
379  // create current lane modul
380  myCurrentLane = new CurrentLane(this);
381 
382  // create connection modifications modul
384 
385  // create connection operations modul
387 
388  // create connection selection modul
390 
391  // create connection legend modul
393 }
394 
395 
397 
398 
399 void
401  // build connection
403 }
404 
405 
409 }
410 
411 
412 void
414  // select lane as current lane
415  buildConnection(lane, false, false, true); // select as current lane
416  // iterate over all potential targets
417  for (auto i : myPotentialTargets) {
418  // remove connections using the apropiate parameters in function "buildConnection"
419  buildConnection(i, false, false, false);
420  }
421  // save modifications
423 }
424 
425 
426 void
427 GNEConnectorFrame::buildConnection(GNELane* lane, bool mayDefinitelyPass, bool allowConflict, bool toggle) {
428  if (myCurrentEditedLane == 0) {
429  myCurrentEditedLane = lane;
431  initTargets();
432  myNumChanges = 0;
433  myViewNet->getUndoList()->p_begin("modify " + toString(SUMO_TAG_CONNECTION) + "s");
434  } else if (myPotentialTargets.count(lane)
436  const int fromIndex = myCurrentEditedLane->getIndex();
438  GNEEdge& destEdge = lane->getParentEdge();
439  std::vector<NBEdge::Connection> connections = srcEdge.getNBEdge()->getConnectionsFromLane(fromIndex);
440  bool changed = false;
441  LaneStatus status = getLaneStatus(connections, lane);
442  if (status == CONFLICTED && allowConflict) {
443  status = UNCONNECTED;
444  }
445  switch (status) {
446  case UNCONNECTED:
447  if (toggle) {
448  // create new connection
449  NBEdge::Connection newCon(fromIndex, destEdge.getNBEdge(), lane->getIndex(), mayDefinitelyPass);
450  // if the connection was previously deleted (by clicking the same lane twice), restore all values
452  // fromLane must be the same, only check toLane
453  if (c.toEdge == destEdge.getNBEdge() && c.toLane == lane->getIndex()) {
454  newCon = c;
455  newCon.mayDefinitelyPass = mayDefinitelyPass;
456  }
457  }
458  NBConnection newNBCon(srcEdge.getNBEdge(), fromIndex, destEdge.getNBEdge(), lane->getIndex(), newCon.tlLinkIndex);
459  myViewNet->getUndoList()->add(new GNEChange_Connection(&srcEdge, newCon, false, true), true);
462  }
463  break;
464  case CONNECTED:
465  case CONNECTED_PASS: {
466  // remove connection
467  GNEConnection* con = srcEdge.retrieveGNEConnection(fromIndex, destEdge.getNBEdge(), lane->getIndex());
468  myDeletedConnections.push_back(con->getNBEdgeConnection());
471  changed = true;
472  break;
473  }
474  case CONFLICTED:
475  SVCPermissions fromPermissions = srcEdge.getNBEdge()->getPermissions(fromIndex);
476  SVCPermissions toPermissions = destEdge.getNBEdge()->getPermissions(lane->getIndex());
477  if ((fromPermissions & toPermissions) == SVC_PEDESTRIAN) {
478  myViewNet->setStatusBarText("Pedestrian connections are generated automatically");
479  } else if ((fromPermissions & toPermissions) == 0) {
480  myViewNet->setStatusBarText("Incompatible vehicle class permissions");
481  } else {
482  myViewNet->setStatusBarText("Another lane from the same edge already connects to that lane");
483  }
484  break;
485  }
486  if (changed) {
487  myNumChanges += 1;
488  }
489  } else {
490  myViewNet->setStatusBarText("Invalid target for " + toString(SUMO_TAG_CONNECTION));
491  }
493 }
494 
495 
496 void
498  // gather potential targets
500 
501  for (auto it : nbn->getOutgoingEdges()) {
502  GNEEdge* edge = myViewNet->getNet()->retrieveEdge(it->getID());
503  for (auto it_lane : edge->getLanes()) {
504  myPotentialTargets.insert(it_lane);
505  }
506  }
507  // set color for existing connections
508  std::vector<NBEdge::Connection> connections = myCurrentEditedLane->getParentEdge().getNBEdge()->getConnectionsFromLane(myCurrentEditedLane->getIndex());
509  for (auto it : myPotentialTargets) {
510  switch (getLaneStatus(connections, it)) {
511  case CONNECTED:
512  it->setSpecialColor(&myConnectionLegend->getTargetColor());
513  break;
514  case CONNECTED_PASS:
515  it->setSpecialColor(&myConnectionLegend->getTargetPassColor());
516  break;
517  case CONFLICTED:
518  it->setSpecialColor(&myConnectionLegend->getConflictColor());
519  break;
520  case UNCONNECTED:
521  it->setSpecialColor(&myConnectionLegend->getPotentialTargetColor());
522  break;
523  }
524  }
525 }
526 
527 
528 void
530  // restore colors of potential targets
531  for (auto it : myPotentialTargets) {
532  it->setSpecialColor(0);
533  }
534  // clear attributes
535  myPotentialTargets.clear();
536  myNumChanges = 0;
538  myCurrentEditedLane = nullptr;
539  myDeletedConnections.clear();
541 }
542 
543 
545 GNEConnectorFrame::getLaneStatus(const std::vector<NBEdge::Connection>& connections, GNELane* targetLane) {
547  const int fromIndex = myCurrentEditedLane->getIndex();
548  NBEdge* destEdge = targetLane->getParentEdge().getNBEdge();
549  const int toIndex = targetLane->getIndex();
550  std::vector<NBEdge::Connection>::const_iterator con_it = find_if(
551  connections.begin(), connections.end(),
552  NBEdge::connections_finder(fromIndex, destEdge, toIndex));
553  const bool isConnected = con_it != connections.end();
554  if (isConnected) {
555  if (con_it->mayDefinitelyPass) {
556  return CONNECTED_PASS;
557  } else {
558  return CONNECTED;
559  }
560  } else if (srcEdge->hasConnectionTo(destEdge, toIndex)
561  || (srcEdge->getPermissions(fromIndex) & destEdge->getPermissions(toIndex) & ~SVC_PEDESTRIAN) == 0) {
562  return CONFLICTED;
563  } else {
564  return UNCONNECTED;
565  }
566 }
567 
568 /****************************************************************************/
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
Definition: GNENet.cpp:1092
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:1044
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:160
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:900
ConnectionModifications * getConnectionModifications() const
get pointer to ConnectionModifications modul
long onCmdSelectPass(FXObject *, FXSelector, void *)
Called when the user presses the select pass button.
is a pedestrian
FXLabel * myTargetPassLabel
target pass label
select lanes that have no connection leading to it
Definition: GUIAppEnum.h:579
const KeyPressed & getKeyPressed() const
get Key Pressed modul
GNEConnectorFrame * myConnectorFrameParent
pointer to connectorFrame parent
begin/end of the description of a junction
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
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:65
ConnectionLegend * myConnectionLegend
ConnectionLegend modul.
std::set< GNELane * > myPotentialTargets
the set of lanes to which the current lane may be connected
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn&#39;t)
Definition: GNEViewNet.cpp:367
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
Definition: GNENet.cpp:540
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:47
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:197
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:1720
void handleLaneClick(const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
either sets the current lane or toggles the connection of the
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:255
GNEConnectorFrame * myConnectorFrameParent
pointer to connectorFrame parent
GNEViewNet * myViewNet
View Net for changes.
Definition: GNEFrame.h:612
LaneStatus getLaneStatus(const std::vector< NBEdge::Connection > &connections, GNELane *targetLane)
return the status of toLane
ConnectionSelection(GNEConnectorFrame *connectorFrameParent)
constructor
NBEdge::Connection & getNBEdgeConnection() const
get Edge::Connection
std::vector< Connection > getConnectionsFromLane(int lane) const
Returns connections from a given lane.
Definition: NBEdge.cpp:1117
FXLabel * myConflictLabel
conflict label
select lanes with connections that have the pass attribute set to &#39;true&#39;
Definition: GUIAppEnum.h:583
RGBColor myTargetColor
color for the to-lane of a connection
GNEUndoList * getUndoList() const
get the undoList object
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:757
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:49
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:615
GNEEdge & getParentEdge()
Returns underlying parent edge.
Definition: GNELane.cpp:1260
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
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:1158
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:464
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:1541
long onCmdCancelModifications(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
FXButton * mySelectConflictsButton
"Select Conflicts" button
bool controlKeyPressed() const
check if CONTROL key was pressed during click
Definition: GNEViewNet.cpp:475
ConnectionModifications * myConnectionModifications
ConnectionModifications modul.
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_MODE_SELECT
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:184
GNEJunction * getGNEJunctionSource() const
returns the source-junction
Definition: GNEEdge.cpp:458
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:3331
const RGBColor & getConflictColor() const
get color for a to-lane that cannot be used because another connection conflicts
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
ConnectionSelection * myConnectionSelection
ConnectionSelection modul.
select lanes that are connected from concurrent lanes
Definition: GUIAppEnum.h:581
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:54
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
Definition: GNEEdge.cpp:873
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:867
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1031
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:227
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:34
void setSpecialColor(const RGBColor *Color2)
Definition: GNELane.cpp:982
long onCmdSelectDeadEnds(FXObject *, FXSelector, void *)
Called when the user presses the select dead ends button.
Ok-button pressed.
Definition: GUIAppEnum.h:56
FXButton * mySelectDeadEndsButton
"Select Dead Ends" button
Cancel-button pressed.
Definition: GUIAppEnum.h:58
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:114
Represents a single node (junction) during network building.
Definition: NBNode.h:68
ConnectionOperations * myConnectionOperations
ConnectionOperations modul.
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:727
~GNEConnectorFrame()
Destructor.
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:145
void updateCurrentLaneLabel(const std::string &laneID)
set current junction label
NBEdge * getNBEdge()
returns the internal NBEdge
Definition: GNEEdge.cpp:613
bool shiftKeyPressed() const
check if SHIFT key was pressed during click
Definition: GNEViewNet.cpp:465
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:352
Reset set.
Definition: GUIAppEnum.h:354
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.