SUMO - Simulation of Urban MObility
GNEConnectorFrame Class Reference

#include <GNEConnectorFrame.h>

Inheritance diagram for GNEConnectorFrame:
Inheritance graph
Collaboration diagram for GNEConnectorFrame:
Collaboration graph

Public Member Functions

void focusUpperElement ()
 focus upper element of frame More...
 
FXFont * getFrameHeaderFont () const
 get font of the header's frame More...
 
FXLabel * getFrameHeaderLabel () const
 get the label for the frame's header More...
 
GNEViewNetgetViewNet () const
 get view net More...
 
 GNEConnectorFrame (FXHorizontalFrame *horizontalFrameParent, 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...
 
virtual void hide ()
 hide Frame More...
 
void setFrameWidth (int width)
 set width of GNEFrame More...
 
virtual 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
 Vertical frame that holds all widgets of frame. More...
 
FXFont * myFrameHeaderFont
 Font for the Header. More...
 
FXLabel * myFrameHeaderLabel
 the label for the frame's header More...
 
FXHorizontalFrame * myHeaderFrame
 fame for header elements More...
 
FXHorizontalFrame * myHeaderLeftFrame
 fame for left header elements More...
 
FXHorizontalFrame * myHeaderRightFrame
 fame for right header elements More...
 
GNEViewNetmyViewNet
 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 cleanup ()
 clean up when deselecting current lane More...
 
LaneStatus getLaneStatus (const std::vector< NBEdge::Connection > &connections, GNELane *targetLane)
 return the status of toLane More...
 
void initTargets ()
 init targets More...
 
void removeConnections (GNELane *lane)
 remove connections More...
 
void updateDescription () const
 update description More...
 

Private Attributes

FXButton * myCancelButton
 "Cancel" button More...
 
FXButton * myClearSelectedButton
 "Clear Selected" More...
 
FXLabel * myConflictLabel
 conflict label More...
 
GNELanemyCurrentLane
 the lane of which connections are to be modified More...
 
FXGroupBox * myGroupBoxDescription
 Groupbox for description. More...
 
FXGroupBox * myGroupBoxLegend
 group box for legend More...
 
FXGroupBox * myGroupBoxModifications
 GroupBox for Buttons. More...
 
FXGroupBox * myGroupBoxOperations
 groupbox for operations More...
 
FXGroupBox * myGroupBoxSelection
 groupbox for selection hints More...
 
FXLabel * myHoldControlLabel
 hold control label More...
 
FXLabel * myHoldShiftLabel
 Selection Hint. More...
 
std::map< int, GNEInternalLane * > myInternalLanes
 the internal lanes belonging the the current junction indexed by their tl-index More...
 
FXLabel * myLaneDescriptionLabel
 the label that shows the current editing state More...
 
int myNumChanges
 number of changes More...
 
FXLabel * myPossibleTargetLabel
 possible target label More...
 
std::set< GNELane * > myPotentialTargets
 the set of lanes to which the current lane may be connected More...
 
FXButton * myResetSelectedButton
 "Reset Selected" More...
 
FXButton * mySaveButton
 "OK" button More...
 
FXButton * mySelectConflictsButton
 "Select Conflicts" button More...
 
FXButton * mySelectDeadEndsButton
 "Select Dead Ends" button More...
 
FXButton * mySelectDeadStartsButton
 "Select Dead Starts" button More...
 
FXButton * mySelectPassingButton
 "Select Edges which may always pass" More...
 
FXLabel * mySourceLabel
 source label More...
 
FXLabel * myTargetLabel
 target label More...
 
FXLabel * myTargetPassLabel
 target pass label 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...
 

Detailed Description

The Widget for modifying selections of network-elements

Definition at line 47 of file GNEConnectorFrame.h.

Member Enumeration Documentation

◆ LaneStatus

the status of a target lane

Enumerator
UNCONNECTED 
CONNECTED 
CONNECTED_PASS 
CONFLICTED 

Definition at line 93 of file GNEConnectorFrame.h.

Constructor & Destructor Documentation

◆ GNEConnectorFrame() [1/2]

◆ ~GNEConnectorFrame()

GNEConnectorFrame::~GNEConnectorFrame ( )

Destructor.

Definition at line 167 of file GNEConnectorFrame.cpp.

◆ GNEConnectorFrame() [2/2]

GNEConnectorFrame::GNEConnectorFrame ( )
inlineprotected

FOX needs this.

Definition at line 88 of file GNEConnectorFrame.h.

Member Function Documentation

◆ cleanup()

void GNEConnectorFrame::cleanup ( )
private

clean up when deselecting current lane

Definition at line 465 of file GNEConnectorFrame.cpp.

References myCurrentLane, myNumChanges, myPotentialTargets, GNELane::setSpecialColor(), and updateDescription().

Referenced by onCmdCancel(), and onCmdOK().

◆ focusUpperElement()

void GNEFrame::focusUpperElement ( )
inherited

◆ getFrameHeaderFont()

FXFont * GNEFrame::getFrameHeaderFont ( ) const
inherited

get font of the header's frame

Definition at line 135 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderFont.

◆ getFrameHeaderLabel()

FXLabel * GNEFrame::getFrameHeaderLabel ( ) const
inherited

get the label for the frame's header

Definition at line 129 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderLabel.

Referenced by GNEInspectorFrame::inspectMultisection().

◆ getLaneStatus()

GNEConnectorFrame::LaneStatus GNEConnectorFrame::getLaneStatus ( const std::vector< NBEdge::Connection > &  connections,
GNELane targetLane 
)
private

◆ getViewNet()

◆ handleLaneClick()

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)

Parameters
[in]laneEither the lane to set as current lane, or the destination from current lane
[in]mayDefinitelyPassWhether new connections shall have the pass attribute set
[in]toggleWhether non-existing connections shall be created

Definition at line 171 of file GNEConnectorFrame.cpp.

References CONFLICTED, CONNECTED, CONNECTED_PASS, GNENet::deleteConnection(), NBEdge::getConnectionsFromLane(), GNEEdge::getGNEJunctionDestiny(), GNELane::getIndex(), getLaneStatus(), GNEEdge::getNBEdge(), GNEViewNet::getNet(), GNELane::getParentEdge(), GNEViewNet::getUndoList(), initTargets(), GNEJunction::invalidateTLS(), myCurrentLane, myNumChanges, myPotentialTargets, GNEFrame::myViewNet, GNEUndoList::p_begin(), potentialTargetColor, GNEEdge::retrieveConnection(), GNELane::setSpecialColor(), GNEViewNet::setStatusBarText(), sourceColor, SUMO_TAG_CONNECTION, SUMO_TAG_LANE, targetColor, targetPassColor, toString(), UNCONNECTED, and updateDescription().

Referenced by GNEViewNet::onLeftBtnPress(), and removeConnections().

◆ hide()

◆ initTargets()

◆ onCmdCancel()

long GNEConnectorFrame::onCmdCancel ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Cancel-button discards any connection modifications.

Definition at line 222 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().

◆ onCmdClearSelectedConnections()

◆ onCmdOK()

long GNEConnectorFrame::onCmdOK ( FXObject *  ,
FXSelector  ,
void *   
)

◆ onCmdResetSelectedConnections()

◆ onCmdSelectConflicts()

◆ onCmdSelectDeadEnds()

long GNEConnectorFrame::onCmdSelectDeadEnds ( FXObject *  ,
FXSelector  ,
void *   
)

◆ onCmdSelectDeadStarts()

◆ onCmdSelectPass()

◆ removeConnections()

void GNEConnectorFrame::removeConnections ( GNELane lane)
private

remove connections

Definition at line 388 of file GNEConnectorFrame.cpp.

References handleLaneClick(), myPotentialTargets, and onCmdOK().

Referenced by onCmdClearSelectedConnections().

◆ setFrameWidth()

void GNEFrame::setFrameWidth ( int  width)
inherited

set width of GNEFrame

Definition at line 116 of file GNEFrame.cpp.

References GNEFrame::myScrollWindowsContents.

◆ show()

◆ updateDescription()

void GNEConnectorFrame::updateDescription ( ) const
private

Field Documentation

◆ conflictColor

RGBColor GNEConnectorFrame::conflictColor
staticprivate

color for a to-lane that cannot be used because another connection conflicts

Definition at line 182 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame(), and initTargets().

◆ myCancelButton

FXButton* GNEConnectorFrame::myCancelButton
private

"Cancel" button

Definition at line 110 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myClearSelectedButton

FXButton* GNEConnectorFrame::myClearSelectedButton
private

"Clear Selected"

Definition at line 131 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myConflictLabel

FXLabel* GNEConnectorFrame::myConflictLabel
private

conflict label

Definition at line 161 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myContentFrame

FXVerticalFrame* GNEFrame::myContentFrame
protectedinherited

Vertical frame that holds all widgets of frame.

Definition at line 104 of file GNEFrame.h.

Referenced by GNEConnectorFrame(), GNECrossingFrame::GNECrossingFrame(), GNEFrame::GNEFrame(), and GNEInspectorFrame::inspectMultisection().

◆ myCurrentLane

GNELane* GNEConnectorFrame::myCurrentLane
private

the lane of which connections are to be modified

Definition at line 164 of file GNEConnectorFrame.h.

Referenced by cleanup(), getLaneStatus(), handleLaneClick(), initTargets(), onCmdCancel(), onCmdOK(), and updateDescription().

◆ myFrameHeaderFont

FXFont* GNEFrame::myFrameHeaderFont
protectedinherited

Font for the Header.

Definition at line 98 of file GNEFrame.h.

Referenced by GNEFrame::getFrameHeaderFont(), GNEFrame::GNEFrame(), and GNEFrame::~GNEFrame().

◆ myFrameHeaderLabel

FXLabel* GNEFrame::myFrameHeaderLabel
protectedinherited

the label for the frame's header

Definition at line 101 of file GNEFrame.h.

Referenced by GNEFrame::focusUpperElement(), GNEFrame::getFrameHeaderLabel(), GNEFrame::GNEFrame(), and GNESelectorFrame::selectionUpdated().

◆ myGroupBoxDescription

FXGroupBox* GNEConnectorFrame::myGroupBoxDescription
private

Groupbox for description.

Definition at line 101 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myGroupBoxLegend

FXGroupBox* GNEConnectorFrame::myGroupBoxLegend
private

group box for legend

Definition at line 146 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myGroupBoxModifications

FXGroupBox* GNEConnectorFrame::myGroupBoxModifications
private

GroupBox for Buttons.

Definition at line 107 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myGroupBoxOperations

FXGroupBox* GNEConnectorFrame::myGroupBoxOperations
private

groupbox for operations

Definition at line 116 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myGroupBoxSelection

FXGroupBox* GNEConnectorFrame::myGroupBoxSelection
private

groupbox for selection hints

Definition at line 137 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myHeaderFrame

FXHorizontalFrame* GNEFrame::myHeaderFrame
protectedinherited

fame for header elements

Definition at line 107 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

◆ myHeaderLeftFrame

FXHorizontalFrame* GNEFrame::myHeaderLeftFrame
protectedinherited

◆ myHeaderRightFrame

FXHorizontalFrame* GNEFrame::myHeaderRightFrame
protectedinherited

fame for right header elements

Definition at line 113 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

◆ myHoldControlLabel

FXLabel* GNEConnectorFrame::myHoldControlLabel
private

hold control label

Definition at line 143 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myHoldShiftLabel

FXLabel* GNEConnectorFrame::myHoldShiftLabel
private

Selection Hint.

Definition at line 140 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myInternalLanes

std::map<int, GNEInternalLane*> GNEConnectorFrame::myInternalLanes
private

the internal lanes belonging the the current junction indexed by their tl-index

Definition at line 173 of file GNEConnectorFrame.h.

◆ myLaneDescriptionLabel

FXLabel* GNEConnectorFrame::myLaneDescriptionLabel
private

the label that shows the current editing state

Definition at line 104 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame(), and updateDescription().

◆ myNumChanges

int GNEConnectorFrame::myNumChanges
private

number of changes

Definition at line 170 of file GNEConnectorFrame.h.

Referenced by cleanup(), handleLaneClick(), onCmdCancel(), onCmdOK(), and updateDescription().

◆ myPossibleTargetLabel

FXLabel* GNEConnectorFrame::myPossibleTargetLabel
private

possible target label

Definition at line 155 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myPotentialTargets

std::set<GNELane*> GNEConnectorFrame::myPotentialTargets
private

the set of lanes to which the current lane may be connected

Definition at line 167 of file GNEConnectorFrame.h.

Referenced by cleanup(), handleLaneClick(), initTargets(), and removeConnections().

◆ myResetSelectedButton

FXButton* GNEConnectorFrame::myResetSelectedButton
private

"Reset Selected"

Definition at line 134 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ mySaveButton

FXButton* GNEConnectorFrame::mySaveButton
private

"OK" button

Definition at line 113 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ mySelectConflictsButton

FXButton* GNEConnectorFrame::mySelectConflictsButton
private

"Select Conflicts" button

Definition at line 125 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ mySelectDeadEndsButton

FXButton* GNEConnectorFrame::mySelectDeadEndsButton
private

"Select Dead Ends" button

Definition at line 119 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ mySelectDeadStartsButton

FXButton* GNEConnectorFrame::mySelectDeadStartsButton
private

"Select Dead Starts" button

Definition at line 122 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ mySelectPassingButton

FXButton* GNEConnectorFrame::mySelectPassingButton
private

"Select Edges which may always pass"

Definition at line 128 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ mySourceLabel

FXLabel* GNEConnectorFrame::mySourceLabel
private

source label

Definition at line 149 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myTargetLabel

FXLabel* GNEConnectorFrame::myTargetLabel
private

target label

Definition at line 152 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myTargetPassLabel

FXLabel* GNEConnectorFrame::myTargetPassLabel
private

target pass label

Definition at line 158 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame().

◆ myViewNet

GNEViewNet* GNEFrame::myViewNet
protectedinherited

◆ potentialTargetColor

RGBColor GNEConnectorFrame::potentialTargetColor
staticprivate

color for potential to-lane targets (currently unconnected)

Definition at line 188 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame(), handleLaneClick(), and initTargets().

◆ sourceColor

RGBColor GNEConnectorFrame::sourceColor
staticprivate

color for the from-lane of a connection

Definition at line 176 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame(), and handleLaneClick().

◆ targetColor

RGBColor GNEConnectorFrame::targetColor
staticprivate

color for the to-lane of a connection

Definition at line 179 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame(), handleLaneClick(), and initTargets().

◆ targetPassColor

RGBColor GNEConnectorFrame::targetPassColor
staticprivate

color for the to-lane of a connection with pass attribute

Definition at line 185 of file GNEConnectorFrame.h.

Referenced by GNEConnectorFrame(), handleLaneClick(), and initTargets().


The documentation for this class was generated from the following files: