![]() |
SUMO - Simulation of Urban MObility
|
#include <GNEConnectorFrame.h>
Public Member Functions | |
FXFont * | getFrameHeaderFont () const |
get font of the header's frame More... | |
FXLabel * | getFrameHeaderLabel () const |
get the label for the frame's header More... | |
GNEViewNet * | getViewNet () const |
get view net More... | |
GNEConnectorFrame (FXComposite *parent, GNEViewNet *viewNet) | |
FOX-declaration. 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... | |
void | hide () |
hide Frame More... | |
void | show () |
show Frame More... | |
~GNEConnectorFrame () | |
Destructor. More... | |
FOX-callbacks | |
Called when the user presses the OK-Button saves any connection modifications | |
long | onCmdOK (FXObject *, FXSelector, void *) |
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 | |
GNEConnectorFrame () | |
FOX needs this. More... | |
Protected Attributes | |
FXVerticalFrame * | myContentFrame |
the panel to hold all member widgets More... | |
FXFont * | myFrameHeaderFont |
Font for the Header. More... | |
FXLabel * | myFrameHeaderLabel |
the label for the frame's header More... | |
GNEViewNet * | myViewNet |
the window to inform when the tls is modfied More... | |
Private Types | |
enum | LaneStatus { UNCONNECTED, CONNECTED, CONNECTED_PASS, CONFLICTED } |
the status of a target lane More... | |
Private Member Functions | |
void | buildIinternalLanes (NBNode *node) |
builds internal lanes for the given node More... | |
void | cleanup () |
clean up when deselecting current lane More... | |
LaneStatus | getLaneStatus (const std::vector< NBEdge::Connection > &connections, GNELane *targetLane) |
return the status of toLane More... | |
int | getTLLLinkNumber (const std::vector< NBEdge::Connection > &connections, GNELane *targetLane) |
void | initTargets () |
init targets More... | |
void | removeConnections (GNELane *lane) |
remove connections More... | |
void | updateDescription () const |
update description More... | |
Private Attributes | |
GNELane * | myCurrentLane |
the lane of which connections are to be modified More... | |
FXLabel * | myDescription |
the label that shows the current editing state More... | |
std::map< int, GNEInternalLane * > | myInternalLanes |
the internal lanes belonging the the current junction indexed by their tl-index More... | |
int | myNumChanges |
number of changes More... | |
std::set< GNELane * > | myPotentialTargets |
the set of lanes to which the current lane may be connected More... | |
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... | |
The Widget for modifying selections of network-elements
Definition at line 47 of file GNEConnectorFrame.h.
|
private |
the status of a target lane
Enumerator | |
---|---|
UNCONNECTED | |
CONNECTED | |
CONNECTED_PASS | |
CONFLICTED |
Definition at line 99 of file GNEConnectorFrame.h.
GNEConnectorFrame::GNEConnectorFrame | ( | FXComposite * | parent, |
GNEViewNet * | viewNet | ||
) |
FOX-declaration.
Constructor parent FXFrame in which this GNEFrame is placed viewNet viewNet that uses this GNEFrame
Definition at line 89 of file GNEConnectorFrame.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.
GNEConnectorFrame::~GNEConnectorFrame | ( | ) |
Destructor.
Definition at line 172 of file GNEConnectorFrame.cpp.
|
inlineprotected |
FOX needs this.
Definition at line 94 of file GNEConnectorFrame.h.
|
private |
builds internal lanes for the given node
Definition at line 549 of file GNEConnectorFrame.cpp.
References SUMORTree::addAdditionalGLObject(), NBNode::computeInternalLaneShape(), Named::getID(), NBNode::getIncomingEdges(), NBNode::getLinkState(), GNEViewNet::getNet(), GNENet::getVisualisationSpeedUp(), myInternalLanes, GNEFrame::myViewNet, NUM_POINTS, SUMORTree::removeAdditionalGLObject(), and toString().
Referenced by cleanup(), and handleLaneClick().
|
private |
clean up when deselecting current lane
Definition at line 497 of file GNEConnectorFrame.cpp.
References buildIinternalLanes(), myCurrentLane, myNumChanges, myPotentialTargets, GNELane::setSpecialColor(), and updateDescription().
Referenced by onCmdCancel(), and onCmdOK().
|
inherited |
get font of the header's frame
Definition at line 94 of file GNEFrame.cpp.
References GNEFrame::myFrameHeaderFont.
|
inherited |
get the label for the frame's header
Definition at line 88 of file GNEFrame.cpp.
References GNEFrame::myFrameHeaderLabel.
Referenced by GNEInspectorFrame::inspect().
|
private |
return the status of toLane
Definition at line 512 of file GNEConnectorFrame.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 536 of file GNEConnectorFrame.cpp.
References GNELane::getIndex(), GNEEdge::getNBEdge(), GNELane::getParentEdge(), and myCurrentLane.
Referenced by handleLaneClick().
|
inherited |
get view net
Definition at line 82 of file GNEFrame.cpp.
References GNEFrame::myViewNet.
Referenced by GNEInspectorFrame::AttrInput::onCmdSetAttribute().
void GNEConnectorFrame::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 195 of file GNEConnectorFrame.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(), GNEViewNet::getUndoList(), initTargets(), GNEJunction::invalidateTLS(), NBConnection::InvalidConnection, myCurrentLane, myNumChanges, myPotentialTargets, GNEFrame::myViewNet, GNEUndoList::p_begin(), potentialTargetColor, GNENet::retrieveJunction(), GNELane::setSpecialColor(), GNEViewNet::setStatusBarText(), sourceColor, targetColor, targetPassColor, UNCONNECTED, and updateDescription().
Referenced by GNEViewNet::onLeftBtnPress(), and removeConnections().
|
virtual |
hide Frame
Implements GNEFrame.
Definition at line 186 of file GNEConnectorFrame.cpp.
References GNEViewNet::getViewParent(), GNEViewParent::hideFramesArea(), and GNEFrame::myViewNet.
Referenced by GNEViewNet::updateModeSpecificControls().
|
private |
init targets
Definition at line 461 of file GNEConnectorFrame.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, GNEFrame::myViewNet, potentialTargetColor, GNENet::retrieveEdge(), targetColor, targetPassColor, and UNCONNECTED.
Referenced by handleLaneClick().
long GNEConnectorFrame::onCmdCancel | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Called when the user presses the Cancel-button discards any connection modifications.
Definition at line 252 of file GNEConnectorFrame.cpp.
References cleanup(), GNEViewNet::getUndoList(), myCurrentLane, myNumChanges, GNEFrame::myViewNet, GNEUndoList::p_abort(), and GNEViewNet::setStatusBarText().
Referenced by GNEViewNet::abortOperation(), onCmdClearSelectedConnections(), and onCmdResetSelectedConnections().
long GNEConnectorFrame::onCmdClearSelectedConnections | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Definition at line 382 of file GNEConnectorFrame.cpp.
References GUIGlObjectStorage::getObjectBlocking(), GUISelectedStorage::getSelected(), GUIGlObject::getType(), GNEViewNet::getUndoList(), GUIGlObjectStorage::gIDStorage, GLO_EDGE, GLO_JUNCTION, GLO_LANE, gSelected, GNEAttributeCarrier::MODIFIED, GNEFrame::myViewNet, onCmdCancel(), GNEUndoList::p_begin(), GNEUndoList::p_end(), removeConnections(), and GNEJunction::setLogicValid().
long GNEConnectorFrame::onCmdOK | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Definition at line 266 of file GNEConnectorFrame.cpp.
References cleanup(), GNEViewNet::getUndoList(), myCurrentLane, myNumChanges, GNEFrame::myViewNet, GNEUndoList::p_end(), and GNEViewNet::setStatusBarText().
Referenced by GNEViewNet::hotkeyEnter(), and removeConnections().
long GNEConnectorFrame::onCmdResetSelectedConnections | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Definition at line 428 of file GNEConnectorFrame.cpp.
References GUIGlObjectStorage::getObjectBlocking(), GUISelectedStorage::getSelected(), GNEViewNet::getUndoList(), GUIGlObjectStorage::gIDStorage, GLO_JUNCTION, gSelected, GNEFrame::myViewNet, onCmdCancel(), GNEUndoList::p_begin(), GNEUndoList::p_end(), and GNEJunction::setLogicValid().
long GNEConnectorFrame::onCmdSelectConflicts | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Definition at line 334 of file GNEConnectorFrame.cpp.
References NBEdge::getConnectedEdges(), NBEdge::getConnections(), GNEEdge::getLanes(), GNEViewNet::getNet(), GNEViewParent::getSelectorFrame(), GNEViewNet::getViewParent(), GNESelectorFrame::handleIDs(), GNEFrame::myViewNet, GNENet::retrieveEdge(), GNENet::retrieveEdges(), and GNESelectorFrame::SET_REPLACE.
long GNEConnectorFrame::onCmdSelectDeadEnds | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Called when the user presses the Corresponding-button.
Definition at line 280 of file GNEConnectorFrame.cpp.
References GNEViewNet::getNet(), GNEViewParent::getSelectorFrame(), GNEViewNet::getViewParent(), GNESelectorFrame::handleIDs(), GNEFrame::myViewNet, GNENet::retrieveEdges(), and GNESelectorFrame::SET_REPLACE.
long GNEConnectorFrame::onCmdSelectDeadStarts | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Definition at line 298 of file GNEConnectorFrame.cpp.
References NBEdge::getConnections(), GUIGlObject::getGlID(), GNEEdge::getLaneGlIDs(), GNEEdge::getLanes(), GNEEdge::getNBEdge(), GNEViewNet::getNet(), GNEViewParent::getSelectorFrame(), GNEViewNet::getViewParent(), GNESelectorFrame::handleIDs(), GNEFrame::myViewNet, GNENet::retrieveEdge(), GNENet::retrieveJunctions(), and GNESelectorFrame::SET_REPLACE.
long GNEConnectorFrame::onCmdSelectPass | ( | FXObject * | , |
FXSelector | , | ||
void * | |||
) |
Definition at line 362 of file GNEConnectorFrame.cpp.
References NBEdge::getConnections(), GUIGlObject::getGlID(), GNEEdge::getLanes(), GNEEdge::getNBEdge(), GNEViewNet::getNet(), GNEViewParent::getSelectorFrame(), GNEViewNet::getViewParent(), GNESelectorFrame::handleIDs(), GNEFrame::myViewNet, GNENet::retrieveEdges(), and GNESelectorFrame::SET_REPLACE.
|
private |
remove connections
Definition at line 418 of file GNEConnectorFrame.cpp.
References handleLaneClick(), myPotentialTargets, and onCmdOK().
Referenced by onCmdClearSelectedConnections().
|
virtual |
show Frame
Implements GNEFrame.
Definition at line 177 of file GNEConnectorFrame.cpp.
References GNEViewNet::getViewParent(), GNEFrame::myViewNet, and GNEViewParent::showFramesArea().
Referenced by GNEViewNet::updateModeSpecificControls().
|
private |
update description
Definition at line 449 of file GNEConnectorFrame.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 128 of file GNEConnectorFrame.h.
Referenced by initTargets().
|
protectedinherited |
the panel to hold all member widgets
Definition at line 94 of file GNEFrame.h.
Referenced by GNEFrame::GNEFrame().
|
private |
the lane of which connections are to be modified
Definition at line 110 of file GNEConnectorFrame.h.
Referenced by cleanup(), getLaneStatus(), getTLLLinkNumber(), handleLaneClick(), initTargets(), onCmdCancel(), onCmdOK(), and updateDescription().
|
private |
the label that shows the current editing state
Definition at line 107 of file GNEConnectorFrame.h.
Referenced by updateDescription().
|
protectedinherited |
Font for the Header.
Definition at line 88 of file GNEFrame.h.
Referenced by GNEFrame::getFrameHeaderFont(), GNEFrame::GNEFrame(), and GNEFrame::~GNEFrame().
|
protectedinherited |
the label for the frame's header
Definition at line 91 of file GNEFrame.h.
Referenced by GNEFrame::getFrameHeaderLabel(), GNEFrame::GNEFrame(), and GNESelectorFrame::selectionUpdated().
|
private |
the internal lanes belonging the the current junction indexed by their tl-index
Definition at line 119 of file GNEConnectorFrame.h.
Referenced by buildIinternalLanes().
|
private |
number of changes
Definition at line 116 of file GNEConnectorFrame.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 113 of file GNEConnectorFrame.h.
Referenced by cleanup(), handleLaneClick(), initTargets(), and removeConnections().
|
protectedinherited |
the window to inform when the tls is modfied
Definition at line 85 of file GNEFrame.h.
Referenced by GNEAdditionalFrame::addAdditional(), buildIinternalLanes(), GNETLSEditorFrame::buildIinternalLanes(), GNETLSEditorFrame::editJunction(), GNEAdditionalFrame::generateID(), GNESelectorFrame::getMatches(), GNEFrame::getViewNet(), GNETLSEditorFrame::handleChange(), GNESelectorFrame::handleIDs(), handleLaneClick(), GNETLSEditorFrame::handleMultiChange(), hide(), GNETLSEditorFrame::hide(), GNESelectorFrame::hide(), GNEInspectorFrame::hide(), GNEAdditionalFrame::hide(), initTargets(), onCmdCancel(), GNETLSEditorFrame::onCmdCancel(), GNESelectorFrame::onCmdClear(), onCmdClearSelectedConnections(), GNEInspectorFrame::onCmdCopyTemplate(), GNETLSEditorFrame::onCmdDefCreate(), GNETLSEditorFrame::onCmdDefDelete(), GNETLSEditorFrame::onCmdDefSwitch(), GNESelectorFrame::onCmdInvert(), GNESelectorFrame::onCmdLoad(), onCmdOK(), GNETLSEditorFrame::onCmdOK(), GNETLSEditorFrame::onCmdPhaseSwitch(), onCmdResetSelectedConnections(), GNESelectorFrame::onCmdScaleSelection(), onCmdSelectConflicts(), onCmdSelectDeadEnds(), onCmdSelectDeadStarts(), onCmdSelectPass(), GNEInspectorFrame::onCmdSetBlocking(), GNEAdditionalFrame::removeAdditional(), show(), GNETLSEditorFrame::show(), GNESelectorFrame::show(), GNEInspectorFrame::show(), and GNEAdditionalFrame::show().
|
staticprivate |
color for potential to-lane targets (currently unconnected)
Definition at line 134 of file GNEConnectorFrame.h.
Referenced by handleLaneClick(), and initTargets().
|
staticprivate |
color for the from-lane of a connection
Definition at line 122 of file GNEConnectorFrame.h.
Referenced by handleLaneClick().
|
staticprivate |
color for the to-lane of a connection
Definition at line 125 of file GNEConnectorFrame.h.
Referenced by handleLaneClick(), and initTargets().
|
staticprivate |
color for the to-lane of a connection with pass attribute
Definition at line 131 of file GNEConnectorFrame.h.
Referenced by handleLaneClick(), and initTargets().