![]() |
SUMO - Simulation of Urban MObility
|
#include <GNEConnector.h>


Public Member Functions | |
| FXFont * | getHeaderFont () |
| GNEConnector (FXComposite *parent, GNEViewNet *updateTarget, GNEUndoList *undoList) | |
| Constructor. More... | |
| 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 share a junction) More... | |
| ~GNEConnector () | |
| Destructor. More... | |
FOX-callbacks | |
| long | onCmdOK (FXObject *, FXSelector, void *) |
| Called when the user presses the OK-Button saves any connection modifications. More... | |
| long | onCmdCancel (FXObject *, FXSelector, void *) |
| Called when the user presses the Cancel-button discards any connection modifications. More... | |
| long | onCmdSelectDeadEnds (FXObject *, FXSelector, void *) |
| Called when the user presses the Corresponding-button. More... | |
| long | onCmdSelectDeadStarts (FXObject *, FXSelector, void *) |
| long | onCmdSelectConflicts (FXObject *, FXSelector, void *) |
| long | onCmdSelectPass (FXObject *, FXSelector, void *) |
| long | onCmdClearSelectedConnections (FXObject *, FXSelector, void *) |
| long | onCmdResetSelectedConnections (FXObject *, FXSelector, void *) |
Protected Member Functions | |
| GNEConnector () | |
| FOX needs this. More... | |
Private Types | |
| enum | LaneStatus { UNCONNECTED, CONNECTED, CONNECTED_PASS, CONFLICTED } |
| the status of a target lane More... | |
Private Member Functions | |
| void | buildIinternalLanes (NBNode *node) |
| void | cleanup () |
| LaneStatus | getLaneStatus (const std::vector< NBEdge::Connection > &connections, GNELane *targetLane) |
| unsigned int | getTLLLinkNumber (const std::vector< NBEdge::Connection > &connections, GNELane *targetLane) |
| void | initTargets () |
| void | removeConnections (GNELane *lane) |
| void | updateDescription () const |
Private Attributes | |
| FXVerticalFrame * | myContentFrame |
| the panel to hold all member widgets More... | |
| GNELane * | myCurrentLane |
| the lane of which connections are to be modified More... | |
| FXLabel * | myDescription |
| the label that shows the current editing state More... | |
| FXFont * | myHeaderFont |
| Font for the widget. More... | |
| std::map< int, GNEInternalLane * > | myInternalLanes |
| the internal lanes belonging the the current junction indexed by their tl-index More... | |
| unsigned int | myNumChanges |
| std::set< GNELane * > | myPotentialTargets |
| the set of lanes to which the current lane may be connected More... | |
| GNEUndoList * | myUndoList |
| GNEViewNet * | myUpdateTarget |
Static Private Attributes | |
| static RGBColor | conflictColor |
| color for a to-lane that cannot be used because another connection conflicts More... | |
| static RGBColor | potentialTargetColor |
| color for potential to-lane targets (currently unconnected) More... | |
| static RGBColor | sourceColor |
| color for the from-lane of a connection More... | |
| static RGBColor | targetColor |
| color for the to-lane of a connection More... | |
| static RGBColor | targetPassColor |
| color for the to-lane of a connection with pass attribute More... | |
| static const int | WIDTH = 140 |
The Widget for modifying selections of network-elements
Definition at line 53 of file GNEConnector.h.
|
private |
the status of a target lane
| Enumerator | |
|---|---|
| UNCONNECTED | |
| CONNECTED | |
| CONNECTED_PASS | |
| CONFLICTED | |
Definition at line 108 of file GNEConnector.h.
| GNEConnector::GNEConnector | ( | FXComposite * | parent, |
| GNEViewNet * | updateTarget, | ||
| GNEUndoList * | undoList | ||
| ) |
Constructor.
| [in] | parent | The parent window |
Definition at line 88 of file GNEConnector.cpp.
References RGBColor::CYAN, MFXUtils::getFXColor(), RGBColor::GREEN, RGBColor::MAGENTA, MID_CANCEL, MID_CHOOSEN_CLEAR, MID_CHOOSEN_RESET, MID_GNE_SELECT_CONFLICTS, MID_GNE_SELECT_DEAD_ENDS, MID_GNE_SELECT_DEAD_STARTS, MID_GNE_SELECT_PASS, MID_OK, and RGBColor::YELLOW.
| GNEConnector::~GNEConnector | ( | ) |
|
inlineprotected |
FOX needs this.
Definition at line 103 of file GNEConnector.h.
|
private |
Definition at line 538 of file GNEConnector.cpp.
References SUMORTree::addAdditionalGLObject(), NBNode::computeInternalLaneShape(), Named::getID(), NBNode::getIncomingEdges(), NBNode::getLinkState(), GNEViewNet::getNet(), GNENet::getVisualisationSpeedUp(), myInternalLanes, myUpdateTarget, SUMORTree::removeAdditionalGLObject(), and toString().
Referenced by cleanup(), and handleLaneClick().
|
private |
Definition at line 486 of file GNEConnector.cpp.
References buildIinternalLanes(), myCurrentLane, myNumChanges, myPotentialTargets, GNELane::setSpecialColor(), and updateDescription().
Referenced by onCmdCancel(), and onCmdOK().
|
inline |
Definition at line 68 of file GNEConnector.h.
References handleLaneClick(), myHeaderFont, onCmdCancel(), onCmdClearSelectedConnections(), onCmdOK(), onCmdResetSelectedConnections(), onCmdSelectConflicts(), onCmdSelectDeadEnds(), onCmdSelectDeadStarts(), and onCmdSelectPass().
|
private |
Definition at line 501 of file GNEConnector.cpp.
References CONFLICTED, CONNECTED, CONNECTED_PASS, GNELane::getIndex(), GNEEdge::getNBEdge(), GNELane::getParentEdge(), NBEdge::hasConnectionTo(), myCurrentLane, and UNCONNECTED.
Referenced by handleLaneClick(), and initTargets().
|
private |
Definition at line 525 of file GNEConnector.cpp.
References GNELane::getIndex(), GNEEdge::getNBEdge(), GNELane::getParentEdge(), and myCurrentLane.
Referenced by handleLaneClick().
| void GNEConnector::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 share a junction)
| [in] | lane | Either the lane to set as current lane, or the destination from current lane |
| [in] | mayDefinitelyPass | Whether new connections shall have the pass attribute set |
| [in] | toggle | Whether non-existing connections shall be created |
Definition at line 183 of file GNEConnector.cpp.
References buildIinternalLanes(), CONFLICTED, CONNECTED, CONNECTED_PASS, NBEdge::getConnectionsFromLane(), GNEEdge::getDest(), GNELane::getIndex(), getLaneStatus(), GUIGlObject::getMicrosimID(), GNEEdge::getNBEdge(), GNEViewNet::getNet(), GNELane::getParentEdge(), getTLLLinkNumber(), NBEdge::getToNode(), initTargets(), GNEJunction::invalidateTLS(), NBConnection::InvalidConnection, myCurrentLane, myNumChanges, myPotentialTargets, myUndoList, myUpdateTarget, GNEUndoList::p_begin(), potentialTargetColor, GNENet::retrieveJunction(), GNELane::setSpecialColor(), GNEViewNet::setStatusBarText(), sourceColor, targetColor, targetPassColor, UNCONNECTED, and updateDescription().
Referenced by getHeaderFont(), GNEViewNet::onLeftBtnPress(), and removeConnections().
|
private |
Definition at line 450 of file GNEConnector.cpp.
References conflictColor, CONFLICTED, CONNECTED, CONNECTED_PASS, NBEdge::getConnectionsFromLane(), GNEEdge::getDest(), GNELane::getIndex(), GNEEdge::getLanes(), getLaneStatus(), GNEEdge::getNBEdge(), GNEJunction::getNBNode(), GNEViewNet::getNet(), NBNode::getOutgoingEdges(), GNELane::getParentEdge(), myCurrentLane, myPotentialTargets, myUpdateTarget, potentialTargetColor, GNENet::retrieveEdge(), targetColor, targetPassColor, and UNCONNECTED.
Referenced by handleLaneClick().
| long GNEConnector::onCmdCancel | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Called when the user presses the Cancel-button discards any connection modifications.
Definition at line 241 of file GNEConnector.cpp.
References cleanup(), myCurrentLane, myNumChanges, myUndoList, myUpdateTarget, GNEUndoList::p_abort(), and GNEViewNet::setStatusBarText().
Referenced by GNEViewNet::abortOperation(), getHeaderFont(), onCmdClearSelectedConnections(), and onCmdResetSelectedConnections().
| long GNEConnector::onCmdClearSelectedConnections | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Definition at line 371 of file GNEConnector.cpp.
References GUIGlObjectStorage::getObjectBlocking(), GUISelectedStorage::getSelected(), GUIGlObject::getType(), GUIGlObjectStorage::gIDStorage, GLO_EDGE, GLO_JUNCTION, GLO_LANE, gSelected, GNEAttributeCarrier::MODIFIED, myUndoList, onCmdCancel(), GNEUndoList::p_begin(), GNEUndoList::p_end(), removeConnections(), and GNEJunction::setLogicValid().
Referenced by getHeaderFont().
| long GNEConnector::onCmdOK | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Called when the user presses the OK-Button saves any connection modifications.
Definition at line 255 of file GNEConnector.cpp.
References cleanup(), myCurrentLane, myNumChanges, myUndoList, myUpdateTarget, GNEUndoList::p_end(), and GNEViewNet::setStatusBarText().
Referenced by getHeaderFont(), GNEViewNet::hotkeyEnter(), and removeConnections().
| long GNEConnector::onCmdResetSelectedConnections | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Definition at line 417 of file GNEConnector.cpp.
References GUIGlObjectStorage::getObjectBlocking(), GUISelectedStorage::getSelected(), GUIGlObjectStorage::gIDStorage, GLO_JUNCTION, gSelected, myUndoList, onCmdCancel(), GNEUndoList::p_begin(), GNEUndoList::p_end(), and GNEJunction::setLogicValid().
Referenced by getHeaderFont().
| long GNEConnector::onCmdSelectConflicts | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Definition at line 323 of file GNEConnector.cpp.
References NBEdge::getConnectedEdges(), NBEdge::getConnections(), GNEEdge::getLanes(), GNEViewNet::getNet(), GNEViewNet::getSelector(), GNESelector::handleIDs(), myUpdateTarget, GNENet::retrieveEdge(), GNENet::retrieveEdges(), and GNESelector::SET_REPLACE.
Referenced by getHeaderFont().
| long GNEConnector::onCmdSelectDeadEnds | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Called when the user presses the Corresponding-button.
Definition at line 269 of file GNEConnector.cpp.
References GNEViewNet::getNet(), GNEViewNet::getSelector(), GNESelector::handleIDs(), myUpdateTarget, GNENet::retrieveEdges(), and GNESelector::SET_REPLACE.
Referenced by getHeaderFont().
| long GNEConnector::onCmdSelectDeadStarts | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Definition at line 287 of file GNEConnector.cpp.
References NBEdge::getConnections(), GUIGlObject::getGlID(), GNEEdge::getLaneGlIDs(), GNEEdge::getLanes(), GNEEdge::getNBEdge(), GNEViewNet::getNet(), GNEViewNet::getSelector(), GNESelector::handleIDs(), myUpdateTarget, GNENet::retrieveEdge(), GNENet::retrieveJunctions(), and GNESelector::SET_REPLACE.
Referenced by getHeaderFont().
| long GNEConnector::onCmdSelectPass | ( | FXObject * | , |
| FXSelector | , | ||
| void * | |||
| ) |
Definition at line 351 of file GNEConnector.cpp.
References NBEdge::getConnections(), GUIGlObject::getGlID(), GNEEdge::getLanes(), GNEEdge::getNBEdge(), GNEViewNet::getNet(), GNEViewNet::getSelector(), GNESelector::handleIDs(), myUpdateTarget, GNENet::retrieveEdges(), and GNESelector::SET_REPLACE.
Referenced by getHeaderFont().
|
private |
Definition at line 407 of file GNEConnector.cpp.
References handleLaneClick(), myPotentialTargets, and onCmdOK().
Referenced by onCmdClearSelectedConnections().
|
private |
Definition at line 438 of file GNEConnector.cpp.
References GUIGlObject::getMicrosimID(), myCurrentLane, myDescription, myNumChanges, and toString().
Referenced by cleanup(), and handleLaneClick().
|
staticprivate |
color for a to-lane that cannot be used because another connection conflicts
Definition at line 147 of file GNEConnector.h.
Referenced by initTargets().
|
private |
the panel to hold all member widgets
Definition at line 116 of file GNEConnector.h.
|
private |
the lane of which connections are to be modified
Definition at line 125 of file GNEConnector.h.
Referenced by cleanup(), getLaneStatus(), getTLLLinkNumber(), handleLaneClick(), initTargets(), onCmdCancel(), onCmdOK(), and updateDescription().
|
private |
the label that shows the current editing state
Definition at line 122 of file GNEConnector.h.
Referenced by updateDescription().
|
private |
Font for the widget.
Definition at line 119 of file GNEConnector.h.
Referenced by getHeaderFont(), and ~GNEConnector().
|
private |
the internal lanes belonging the the current junction indexed by their tl-index
Definition at line 138 of file GNEConnector.h.
Referenced by buildIinternalLanes().
|
private |
Definition at line 132 of file GNEConnector.h.
Referenced by cleanup(), handleLaneClick(), onCmdCancel(), onCmdOK(), and updateDescription().
|
private |
the set of lanes to which the current lane may be connected
Definition at line 128 of file GNEConnector.h.
Referenced by cleanup(), handleLaneClick(), initTargets(), and removeConnections().
|
private |
Definition at line 130 of file GNEConnector.h.
Referenced by handleLaneClick(), onCmdCancel(), onCmdClearSelectedConnections(), onCmdOK(), and onCmdResetSelectedConnections().
|
private |
Definition at line 135 of file GNEConnector.h.
Referenced by buildIinternalLanes(), handleLaneClick(), initTargets(), onCmdCancel(), onCmdOK(), onCmdSelectConflicts(), onCmdSelectDeadEnds(), onCmdSelectDeadStarts(), and onCmdSelectPass().
|
staticprivate |
color for potential to-lane targets (currently unconnected)
Definition at line 151 of file GNEConnector.h.
Referenced by handleLaneClick(), and initTargets().
|
staticprivate |
color for the from-lane of a connection
Definition at line 143 of file GNEConnector.h.
Referenced by handleLaneClick().
|
staticprivate |
color for the to-lane of a connection
Definition at line 145 of file GNEConnector.h.
Referenced by handleLaneClick(), and initTargets().
|
staticprivate |
color for the to-lane of a connection with pass attribute
Definition at line 149 of file GNEConnector.h.
Referenced by handleLaneClick(), and initTargets().
|
staticprivate |
Definition at line 140 of file GNEConnector.h.