SUMO - Simulation of Urban MObility
GNEConnector Class Reference

#include <GNEConnector.h>

Inheritance diagram for GNEConnector:
Inheritance graph
Collaboration diagram for GNEConnector:
Collaboration graph

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

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
 

Detailed Description

The Widget for modifying selections of network-elements

Definition at line 53 of file GNEConnector.h.

Member Enumeration Documentation

the status of a target lane

Enumerator
UNCONNECTED 
CONNECTED 
CONNECTED_PASS 
CONFLICTED 

Definition at line 108 of file GNEConnector.h.

Constructor & Destructor Documentation

GNEConnector::GNEConnector ( FXComposite *  parent,
GNEViewNet updateTarget,
GNEUndoList undoList 
)
GNEConnector::~GNEConnector ( )

Destructor.

Definition at line 177 of file GNEConnector.cpp.

References myHeaderFont.

GNEConnector::GNEConnector ( )
inlineprotected

FOX needs this.

Definition at line 103 of file GNEConnector.h.

Member Function Documentation

void GNEConnector::cleanup ( )
private
GNEConnector::LaneStatus GNEConnector::getLaneStatus ( const std::vector< NBEdge::Connection > &  connections,
GNELane targetLane 
)
private
unsigned int GNEConnector::getTLLLinkNumber ( const std::vector< NBEdge::Connection > &  connections,
GNELane targetLane 
)
private
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)

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

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

void GNEConnector::removeConnections ( GNELane lane)
private

Definition at line 407 of file GNEConnector.cpp.

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

Referenced by onCmdClearSelectedConnections().

void GNEConnector::updateDescription ( ) const
private

Field Documentation

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

FXVerticalFrame* GNEConnector::myContentFrame
private

the panel to hold all member widgets

Definition at line 116 of file GNEConnector.h.

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

FXLabel* GNEConnector::myDescription
private

the label that shows the current editing state

Definition at line 122 of file GNEConnector.h.

Referenced by updateDescription().

FXFont* GNEConnector::myHeaderFont
private

Font for the widget.

Definition at line 119 of file GNEConnector.h.

Referenced by getHeaderFont(), and ~GNEConnector().

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

unsigned int GNEConnector::myNumChanges
private

Definition at line 132 of file GNEConnector.h.

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

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

GNEUndoList* GNEConnector::myUndoList
private
RGBColor GNEConnector::potentialTargetColor
staticprivate

color for potential to-lane targets (currently unconnected)

Definition at line 151 of file GNEConnector.h.

Referenced by handleLaneClick(), and initTargets().

RGBColor GNEConnector::sourceColor
staticprivate

color for the from-lane of a connection

Definition at line 143 of file GNEConnector.h.

Referenced by handleLaneClick().

RGBColor GNEConnector::targetColor
staticprivate

color for the to-lane of a connection

Definition at line 145 of file GNEConnector.h.

Referenced by handleLaneClick(), and initTargets().

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

const int GNEConnector::WIDTH = 140
staticprivate

Definition at line 140 of file GNEConnector.h.


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