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

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 (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...
 
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 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

GNELanemyCurrentLane
 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...
 

Detailed Description

The Widget for modifying selections of network-elements

Definition at line 47 of file GNEConnectorFrame.h.

Member Enumeration Documentation

the status of a target lane

Enumerator
UNCONNECTED 
CONNECTED 
CONNECTED_PASS 
CONFLICTED 

Definition at line 99 of file GNEConnectorFrame.h.

Constructor & Destructor Documentation

GNEConnectorFrame::GNEConnectorFrame ( FXComposite *  parent,
GNEViewNet viewNet 
)
GNEConnectorFrame::~GNEConnectorFrame ( )

Destructor.

Definition at line 172 of file GNEConnectorFrame.cpp.

GNEConnectorFrame::GNEConnectorFrame ( )
inlineprotected

FOX needs this.

Definition at line 94 of file GNEConnectorFrame.h.

Member Function Documentation

void GNEConnectorFrame::cleanup ( )
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().

FXFont * GNEFrame::getFrameHeaderFont ( ) const
inherited

get font of the header's frame

Definition at line 94 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderFont.

FXLabel * GNEFrame::getFrameHeaderLabel ( ) const
inherited

get the label for the frame's header

Definition at line 88 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderLabel.

Referenced by GNEInspectorFrame::inspect().

GNEConnectorFrame::LaneStatus GNEConnectorFrame::getLaneStatus ( const std::vector< NBEdge::Connection > &  connections,
GNELane targetLane 
)
private
int GNEConnectorFrame::getTLLLinkNumber ( const std::vector< NBEdge::Connection > &  connections,
GNELane targetLane 
)
private
GNEViewNet * GNEFrame::getViewNet ( ) const
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)

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 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().

void GNEConnectorFrame::hide ( )
virtual
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::onCmdOK ( FXObject *  ,
FXSelector  ,
void *   
)
long GNEConnectorFrame::onCmdSelectDeadEnds ( FXObject *  ,
FXSelector  ,
void *   
)
void GNEConnectorFrame::removeConnections ( GNELane lane)
private

remove connections

Definition at line 418 of file GNEConnectorFrame.cpp.

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

Referenced by onCmdClearSelectedConnections().

void GNEConnectorFrame::show ( )
virtual
void GNEConnectorFrame::updateDescription ( ) const
private

update description

Definition at line 449 of file GNEConnectorFrame.cpp.

References GUIGlObject::getMicrosimID(), myCurrentLane, myDescription, myNumChanges, and toString().

Referenced by cleanup(), and handleLaneClick().

Field Documentation

RGBColor GNEConnectorFrame::conflictColor
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().

FXVerticalFrame* GNEFrame::myContentFrame
protectedinherited

the panel to hold all member widgets

Definition at line 94 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

GNELane* GNEConnectorFrame::myCurrentLane
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().

FXLabel* GNEConnectorFrame::myDescription
private

the label that shows the current editing state

Definition at line 107 of file GNEConnectorFrame.h.

Referenced by updateDescription().

FXFont* GNEFrame::myFrameHeaderFont
protectedinherited

Font for the Header.

Definition at line 88 of file GNEFrame.h.

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

FXLabel* GNEFrame::myFrameHeaderLabel
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().

std::map<int, GNEInternalLane*> GNEConnectorFrame::myInternalLanes
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().

int GNEConnectorFrame::myNumChanges
private

number of changes

Definition at line 116 of file GNEConnectorFrame.h.

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

std::set<GNELane*> GNEConnectorFrame::myPotentialTargets
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().

RGBColor GNEConnectorFrame::potentialTargetColor
staticprivate

color for potential to-lane targets (currently unconnected)

Definition at line 134 of file GNEConnectorFrame.h.

Referenced by handleLaneClick(), and initTargets().

RGBColor GNEConnectorFrame::sourceColor
staticprivate

color for the from-lane of a connection

Definition at line 122 of file GNEConnectorFrame.h.

Referenced by handleLaneClick().

RGBColor GNEConnectorFrame::targetColor
staticprivate

color for the to-lane of a connection

Definition at line 125 of file GNEConnectorFrame.h.

Referenced by handleLaneClick(), and initTargets().

RGBColor GNEConnectorFrame::targetPassColor
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().


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