SUMO - Simulation of Urban MObility
GNEInternalLane Class Reference

This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routeted to an internal dataTarget and to the editor (hence inheritance from FXDelegator) More...

#include <GNEInternalLane.h>

Inheritance diagram for GNEInternalLane:
Inheritance graph
Collaboration diagram for GNEInternalLane:
Collaboration graph

Public Member Functions

virtual void drawGLAdditional (GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
 Draws additional, user-triggered visualisations. More...
 
void drawName (const Position &pos, const SUMOReal scale, const GUIVisualizationTextSettings &settings, const SUMOReal angle=0) const
 
LinkState getLinkState ()
 whether link state has been modfied More...
 
int getTLIndex () const
 
 GNEInternalLane (GNETLSEditor *editor, const std::string &id, const PositionVector &shape, int tlIndex, LinkState state=LINKSTATE_DEADEND)
 Constructor. More...
 
long onDefault (FXObject *, FXSelector, void *)
 multiplexes message to two targets More...
 
void setLinkState (LinkState state)
 set the linkState (controls drawing color) More...
 
virtual ~GNEInternalLane ()
 Destructor. More...
 
inherited from GUIGlObject
GUIGLObjectPopupMenugetPopUpMenu (GUIMainWindow &app, GUISUMOAbstractView &parent)
 Returns an own popup-menu. More...
 
GUIParameterTableWindowgetParameterWindow (GUIMainWindow &app, GUISUMOAbstractView &parent)
 Returns an own parameter window. More...
 
Boundary getCenteringBoundary () const
 Returns the boundary to which the view shall be centered in order to show the object. More...
 
void drawGL (const GUIVisualizationSettings &s) const
 Draws the object. More...
 
Atomar getter methods
const std::string & getFullName () const
 Returns the full name appearing in the tool tip. More...
 
virtual const std::string & getParentName () const
 Returns the name of the parent object (if any) More...
 
GUIGlID getGlID () const
 Returns the numerical id of the object. More...
 
interfaces to be implemented by derived classes
const std::string & getMicrosimID () const
 Returns the id of the object as known to microsim. More...
 
virtual void setMicrosimID (const std::string &newID)
 Changes the microsimID of the object (happens in NETEDIT) More...
 
GUIGlObjectType getType () const
 Returns the type of the object as coded in GUIGlObjectType. More...
 
Parameter table window I/O
void addParameterTable (GUIParameterTableWindow *w)
 Lets this object know a parameter window showing the object's values was opened. More...
 
void removeParameterTable (GUIParameterTableWindow *w)
 Lets this object know a parameter window showing the object's values was closed. More...
 

Static Public Member Functions

static RGBColor colorForLinksState (FXuint state)
 

Static Public Attributes

static const StringBijection< FXuint > LinkStateNames
 long names for link states More...
 
static StringBijection< GUIGlObjectTypeTypeNames
 associates object types with strings More...
 

Protected Member Functions

 GNEInternalLane ()
 FOX needs this. More...
 
void setPrefix (const std::string &prefix)
 
helper methods for building popup-menus
void buildPopupHeader (GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
 Builds the header. More...
 
void buildCenterPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true)
 Builds an entry which allows to center to the object. More...
 
void buildNameCopyPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true)
 Builds entries which allow to copy the name / typed name into the clipboard. More...
 
void buildSelectionPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true)
 Builds an entry which allows to (de)select the object. More...
 
void buildShowParamsPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true)
 Builds an entry which allows to open the parameter window. More...
 
void buildPositionCopyEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true)
 Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position. More...
 
void buildShowManipulatorPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true)
 Builds an entry which allows to open the manipulator window. More...
 

Private Member Functions

 GNEInternalLane (const GNEInternalLane &)
 Invalidated copy constructor. More...
 
GNEInternalLaneoperator= (const GNEInternalLane &)
 Invalidated assignment operator. More...
 

Static Private Member Functions

static const std::string & longNameForLinkState (FXuint state)
 

Private Attributes

GNETLSEditormyEditor
 the editor to inform about changes More...
 
LinkState myOrigState
 the original state of the link (used for tracking modification) More...
 
GUIGLObjectPopupMenumyPopup
 the created popup More...
 
const PositionVector myShape
 the shape of the edge More...
 
FXuint myState
 the state of the link (used for visualization) More...
 
FXDataTarget myStateTarget
 
int myTlIndex
 the tl-index of this lane More...
 
FXDataTarget stateTarget
 data target for selection state More...
 
computed only once (for performance) in updateGeometry()
std::vector< SUMORealmyShapeRotations
 The rotations of the shape parts. More...
 
std::vector< SUMORealmyShapeLengths
 The lengths of the shape parts. More...
 

Static Private Attributes

static StringBijection< FXuint >::Entry linkStateNamesValues []
 

Detailed Description

This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routeted to an internal dataTarget and to the editor (hence inheritance from FXDelegator)

Definition at line 53 of file GNEInternalLane.h.

Constructor & Destructor Documentation

GNEInternalLane::GNEInternalLane ( GNETLSEditor editor,
const std::string &  id,
const PositionVector shape,
int  tlIndex,
LinkState  state = LINKSTATE_DEADEND 
)

Constructor.

Parameters
[in]editorThe editor to notify about changes
[in]idThe id of this internal lane
[in]shapeThe shape of the lane
[in]tlIndexThe tl-index of the lane

Definition at line 98 of file GNEInternalLane.cpp.

References Position::distanceTo2D(), myShape, myShapeLengths, myShapeRotations, PI, SUMOReal, Position::x(), and Position::y().

GNEInternalLane::~GNEInternalLane ( )
virtual

Destructor.

Definition at line 126 of file GNEInternalLane.cpp.

GNEInternalLane::GNEInternalLane ( )
protected

FOX needs this.

Definition at line 120 of file GNEInternalLane.cpp.

GNEInternalLane::GNEInternalLane ( const GNEInternalLane )
private

Invalidated copy constructor.

Member Function Documentation

void GUIGlObject::addParameterTable ( GUIParameterTableWindow w)
inherited

Lets this object know a parameter window showing the object's values was opened.

Parameters
[in]wThe opened parameter window

Definition at line 189 of file GUIGlObject.cpp.

References GUIGlObject::myParamWindows.

void GUIGlObject::buildShowManipulatorPopupEntry ( GUIGLObjectPopupMenu ret,
bool  addSeparator = true 
)
protectedinherited

Builds an entry which allows to open the manipulator window.

Parameters

Definition at line 180 of file GUIGlObject.cpp.

References GUIIconSubSys::getIcon(), ICON_MANIP, and MID_MANIP.

Referenced by GUILaneSpeedTrigger::getPopUpMenu(), and GUITriggeredRerouter::getPopUpMenu().

RGBColor GNEInternalLane::colorForLinksState ( FXuint  state)
static

Definition at line 206 of file GNEInternalLane.cpp.

References getLinkColor(), and LINKSTATE_TL_YELLOW_MINOR.

Referenced by drawGL(), getPopUpMenu(), and GNELane::getPopUpMenu().

void GNEInternalLane::drawGL ( const GUIVisualizationSettings s) const
virtual

Draws the object.

Parameters
[in]sThe settings for the current view (may influence drawing)
See also
GUIGlObject::drawGL

Implements GUIGlObject.

Definition at line 150 of file GNEInternalLane.cpp.

References colorForLinksState(), GLHelper::drawBoxLines(), GLHelper::drawLine(), GUIGlObject::getGlID(), GLO_JUNCTION, myShape, myShapeLengths, myShapeRotations, myState, GUIVisualizationSettings::scale, and GLHelper::setColor().

virtual void GUIGlObject::drawGLAdditional ( GUISUMOAbstractView *const  parent,
const GUIVisualizationSettings s 
) const
inlinevirtualinherited

Draws additional, user-triggered visualisations.

Parameters
[in]parentThe view
[in]sThe settings for the current view (may influence drawing)

Reimplemented in GUIBaseVehicle, GUIPerson, and GUIContainer.

Definition at line 190 of file GUIGlObject.h.

References SUMOReal, and UNUSED_PARAMETER.

Boundary GNEInternalLane::getCenteringBoundary ( ) const
virtual

Returns the boundary to which the view shall be centered in order to show the object.

Returns
The boundary the object is within
See also
GUIGlObject::getCenteringBoundary

Implements GUIGlObject.

Definition at line 198 of file GNEInternalLane.cpp.

References PositionVector::getBoxBoundary(), Boundary::grow(), and myShape.

GUIGlID GUIGlObject::getGlID ( ) const
inlineinherited

Returns the numerical id of the object.

Returns
This object's gl-id

Definition at line 123 of file GUIGlObject.h.

Referenced by GNENet::addReversedEdge(), GUIMessageWindow::appendMsg(), GUIGlObject::buildSelectionPopupEntry(), GUINet::createTLWrapper(), GNENet::deleteEdge(), GNENet::deleteJunction(), GNENet::deleteLane(), GNECrossing::drawGL(), drawGL(), GUIContainer::drawGL(), GUIPerson::drawGL(), GUIPolygon::drawGL(), GUIInstantInductLoop::MyWrapper::drawGL(), GUILaneSpeedTrigger::drawGL(), GUICalibrator::drawGL(), GUIPointOfInterest::drawGL(), GNEJunction::drawGL(), GUIJunctionWrapper::drawGL(), GNEEdge::drawGL(), GUIE3Collector::MyWrapper::drawGL(), GNELane::drawGL(), GUI_E2_ZS_Collector::MyWrapper::drawGL(), GUIContainerStop::drawGL(), GUIBusStop::drawGL(), GUIChargingStation::drawGL(), GNEPoly::drawGL(), GUIEdge::drawGL(), GUIBaseVehicle::drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GUILane::drawGL(), GUIContainer::drawGLAdditional(), GUIPerson::drawGLAdditional(), GUIBaseVehicle::drawGLAdditional(), GUILane::drawLinkRule(), GUIVehicle::getColorValue(), GUIJunctionWrapper::getColorValue(), GUIContainer::getColorValue(), GNELane::getColorValue(), GUIPerson::getColorValue(), GUILane::getColorValue(), GNEJunction::getColorValue(), GUIEdge::getIDs(), GNEEdge::getLaneGlIDs(), GUISUMOAbstractView::getObjectAtPosition(), GUISUMOAbstractView::getObjectsAtPosition(), GUIPerson::getPopUpMenu(), GNELane::getPopUpMenu(), GUIBaseVehicle::getPopUpMenu(), GUILane::getScaleValue(), GUIDialog_GLObjChooser::GUIDialog_GLObjChooser(), GNESelector::handleIDs(), GNETLSEditor::handleMultiChange(), GUIGlChildWindow::isSelected(), GNEViewParent::isSelected(), GUISUMOViewParent::isSelected(), GUISelectedStorage::loadIDs(), GNEViewNet::mergeJunctions(), GUIViewTraffic::onCmdAddRerouter(), GUIGLObjectPopupMenu::onCmdAddSelected(), GUIGLObjectPopupMenu::onCmdCenter(), GUIViewTraffic::onCmdCloseEdge(), GUIViewTraffic::onCmdCloseLane(), GNEViewNet::onCmdDuplicateLane(), GUIApplicationWindow::onCmdEditChosen(), GUIGLObjectPopupMenu::onCmdRemoveSelected(), GNEConnector::onCmdSelectDeadStarts(), GNEConnector::onCmdSelectPass(), GUIPerson::GUIPersonPopupMenu::onCmdStartTrack(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdStartTrack(), GNEViewNet::onCmdStraightenEdges(), GNEViewNet::onLeftBtnPress(), GUISUMOAbstractView::removeAdditionalGLVisualisation(), GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::removeObject(), GUIVehicle::selectBlockingFoes(), GNEJunction::setColor(), GUIMessageWindow::setCursorPos(), and GUIGlObject::~GUIGlObject().

LinkState GNEInternalLane::getLinkState ( )
inline

whether link state has been modfied

Definition at line 114 of file GNEInternalLane.h.

References myState, and onDefault().

Referenced by GNETLSEditor::handleChange().

GUIParameterTableWindow * GNEInternalLane::getParameterWindow ( GUIMainWindow app,
GUISUMOAbstractView parent 
)
virtual

Returns an own parameter window.

Parameters
[in]appThe application needed to build the parameter window
[in]parentThe parent window needed to build the parameter window
Returns
The built parameter window
See also
GUIGlObject::getParameterWindow

Implements GUIGlObject.

Definition at line 186 of file GNEInternalLane.cpp.

References GUIParameterTableWindow::closeBuilding().

virtual const std::string& GUIGlObject::getParentName ( ) const
inlinevirtualinherited

Returns the name of the parent object (if any)

Returns
This object's parent id

Reimplemented in GUILane, and GNELane.

Definition at line 115 of file GUIGlObject.h.

References StringUtils::emptyString.

Referenced by GUIGLObjectPopupMenu::onCmdCopyEdgeName().

GUIGLObjectPopupMenu * GNEInternalLane::getPopUpMenu ( GUIMainWindow app,
GUISUMOAbstractView parent 
)
virtual

Returns an own popup-menu.

Parameters
[in]appThe application needed to build the popup-menu
[in]parentThe parent window needed to build the popup-menu
Returns
The built popup-menu
See also
GUIGlObject::getPopUpMenu

Implements GUIGlObject.

Definition at line 168 of file GNEInternalLane.cpp.

References GUIGlObject::buildPopupHeader(), colorForLinksState(), StringBijection< T >::get(), MFXUtils::getFXColor(), StringBijection< T >::getStrings(), LinkStateNames, myEditor, myOrigState, and myPopup.

int GNEInternalLane::getTLIndex ( ) const
inline

Definition at line 123 of file GNEInternalLane.h.

References myTlIndex.

Referenced by GNETLSEditor::handleChange().

GUIGlObjectType GUIGlObject::getType ( ) const
inlineinherited

Returns the type of the object as coded in GUIGlObjectType.

Returns
The type of the object
See also
GUIGlObjectType

Definition at line 167 of file GUIGlObject.h.

Referenced by GUIGlObject::buildSelectionPopupEntry(), GUIVehicle::drawAction_drawRailCarriages(), GUIPerson::drawAction_drawWalkingareaPath(), GUIContainer::drawGL(), GUIPerson::drawGL(), GUIInstantInductLoop::MyWrapper::drawGL(), GUILaneSpeedTrigger::drawGL(), GUICalibrator::drawGL(), GNEJunction::drawGL(), GUIJunctionWrapper::drawGL(), GUIE3Collector::MyWrapper::drawGL(), GNELane::drawGL(), GUI_E2_ZS_Collector::MyWrapper::drawGL(), GUIContainerStop::drawGL(), GUIBusStop::drawGL(), GUIChargingStation::drawGL(), GUIEdge::drawGL(), GUIBaseVehicle::drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GUILane::drawGL(), GUIPerson::drawGLAdditional(), GUIBaseVehicle::drawGLAdditional(), GUIJunctionWrapper::getColorValue(), GNELane::getColorValue(), GUILane::getColorValue(), GNEJunction::getColorValue(), GNEViewNet::getEdgeAtCursorPosition(), GNEViewNet::getEdgesAtCursorPosition(), GNEViewNet::getJunctionAtCursorPosition(), GNEViewNet::getLaneAtCurserPosition(), GUISUMOAbstractView::getObjectAtPosition(), GUISUMOAbstractView::getObjectsAtPosition(), GUILane::getScaleValue(), GNESelector::handleIDs(), GUIGlChildWindow::isSelected(), GNEViewParent::isSelected(), GUISUMOViewParent::isSelected(), GUISelectedStorage::loadIDs(), GNEViewNet::mergeJunctions(), GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdBegin2TrackPhases(), GNEConnector::onCmdClearSelectedConnections(), GUIGLObjectPopupMenu::onCmdCopyEdgeName(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdHideAllRoutes(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdHideBestLanes(), GUIPerson::GUIPersonPopupMenu::onCmdHideCurrentRoute(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdHideCurrentRoute(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdHideLFLinkItems(), GUIPerson::GUIPersonPopupMenu::onCmdHideWalkingareaPath(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowAllRoutes(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowBestLanes(), GUIPerson::GUIPersonPopupMenu::onCmdShowCurrentRoute(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowCurrentRoute(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowFoes(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowLFLinkItems(), GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdShowPhases(), GUIPerson::GUIPersonPopupMenu::onCmdShowWalkingareaPath(), GUIPerson::GUIPersonPopupMenu::onCmdStartTrack(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdStartTrack(), GUIPerson::GUIPersonPopupMenu::onCmdStopTrack(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdStopTrack(), GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdSwitchTLS2Off(), GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdSwitchTLSLogic(), GNEViewNet::onLeftBtnPress(), LayeredRTree::selectLayer(), GNEJunction::setColor(), and GUISelectedStorage::toggleSelection().

static const std::string& GNEInternalLane::longNameForLinkState ( FXuint  state)
staticprivate
long GNEInternalLane::onDefault ( FXObject *  obj,
FXSelector  sel,
void *  data 
)
GNEInternalLane& GNEInternalLane::operator= ( const GNEInternalLane )
private

Invalidated assignment operator.

void GUIGlObject::removeParameterTable ( GUIParameterTableWindow w)
inherited

Lets this object know a parameter window showing the object's values was closed.

Parameters
[in]wThe closed parameter window

Definition at line 195 of file GUIGlObject.cpp.

References GUIGlObject::myParamWindows.

Referenced by GUIParameterTableWindow::~GUIParameterTableWindow().

void GNEInternalLane::setLinkState ( LinkState  state)
inline

set the linkState (controls drawing color)

Definition at line 108 of file GNEInternalLane.h.

References myOrigState, and myState.

void GUIGlObject::setMicrosimID ( const std::string &  newID)
virtualinherited

Changes the microsimID of the object (happens in NETEDIT)

Reimplemented in GNEEdge.

Definition at line 110 of file GUIGlObject.cpp.

References GUIGlObject::createFullName(), GUIGlObject::myFullName, and GUIGlObject::myMicrosimID.

Referenced by GNENet::renameJunction(), GNELane::setIndex(), and GNEEdge::setMicrosimID().

void GUIGlObject::setPrefix ( const std::string &  prefix)
protectedinherited

Field Documentation

const StringBijection< FXuint > GNEInternalLane::LinkStateNames
static

long names for link states

Definition at line 128 of file GNEInternalLane.h.

Referenced by getPopUpMenu(), and GNELane::getPopUpMenu().

StringBijection< FXuint >::Entry GNEInternalLane::linkStateNamesValues
staticprivate
Initial value:
= {
{ "Green-Major", LINKSTATE_TL_GREEN_MAJOR },
{ "Green-Minor", LINKSTATE_TL_GREEN_MINOR },
{ "Yellow-Major", LINKSTATE_TL_YELLOW_MAJOR },
{ "Yellow-Minor", LINKSTATE_TL_YELLOW_MINOR },
{ "Red", LINKSTATE_TL_RED },
{ "Red-Yellow", LINKSTATE_TL_REDYELLOW },
{ "Stop", LINKSTATE_STOP },
{ "Off-Blinking", LINKSTATE_TL_OFF_BLINKING },
}
Note
: msvc10 does not approve of allocating empty arrays

Definition at line 170 of file GNEInternalLane.h.

GNETLSEditor* GNEInternalLane::myEditor
private

the editor to inform about changes

Definition at line 162 of file GNEInternalLane.h.

Referenced by getPopUpMenu(), and onDefault().

LinkState GNEInternalLane::myOrigState
private

the original state of the link (used for tracking modification)

Definition at line 156 of file GNEInternalLane.h.

Referenced by getPopUpMenu(), and setLinkState().

GUIGLObjectPopupMenu* GNEInternalLane::myPopup
private

the created popup

Definition at line 168 of file GNEInternalLane.h.

Referenced by getPopUpMenu(), and onDefault().

const PositionVector GNEInternalLane::myShape
private

the shape of the edge

Definition at line 140 of file GNEInternalLane.h.

Referenced by drawGL(), getCenteringBoundary(), and GNEInternalLane().

std::vector<SUMOReal> GNEInternalLane::myShapeLengths
private

The lengths of the shape parts.

Definition at line 148 of file GNEInternalLane.h.

Referenced by drawGL(), and GNEInternalLane().

std::vector<SUMOReal> GNEInternalLane::myShapeRotations
private

The rotations of the shape parts.

Definition at line 145 of file GNEInternalLane.h.

Referenced by drawGL(), and GNEInternalLane().

FXuint GNEInternalLane::myState
private

the state of the link (used for visualization)

Definition at line 152 of file GNEInternalLane.h.

Referenced by drawGL(), getLinkState(), onDefault(), and setLinkState().

FXDataTarget GNEInternalLane::myStateTarget
private

Definition at line 153 of file GNEInternalLane.h.

Referenced by onDefault().

int GNEInternalLane::myTlIndex
private

the tl-index of this lane

Definition at line 165 of file GNEInternalLane.h.

Referenced by getTLIndex().

FXDataTarget GNEInternalLane::stateTarget
private

data target for selection state

Definition at line 159 of file GNEInternalLane.h.

StringBijection< GUIGlObjectType > GUIGlObject::TypeNames
staticinherited

associates object types with strings

Definition at line 100 of file GUIGlObject.h.


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