SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUILaneWrapper Class Reference

A MSLane extended for visualisation purposes. More...

#include <GUILaneWrapper.h>

Inheritance diagram for GUILaneWrapper:
GUIGlObject

Public Member Functions

void drawCrossties (const GUIVisualizationSettings &s) const
 draw crossties for railroads More...
 
virtual void drawGLAdditional (GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
 Draws additional, user-triggered visualisations. More...
 
void drawMarkings (const GUIVisualizationSettings &s) const
 draw lane borders and white markings More...
 
void drawName (const Position &pos, const SUMOReal scale, const GUIVisualizationTextSettings &settings, const SUMOReal angle=0) const
 
SUMOReal firstWaitingTime () const
 
bool forLane (const MSLane &lane) const
 Returns true if the given lane id the lane this wrapper wraps the geometry of. More...
 
SUMOReal getEdgeLaneNumber () const
 
SUMOReal getHalfWidth () const
 
const MSLanegetLane () const
 Returns the represented lane. More...
 
unsigned int getLinkNumber () const
 Returns the number of links. More...
 
const PositionVectorgetShape () const
 
const std::vector< SUMOReal > & getShapeLengths () const
 
const std::vector< SUMOReal > & getShapeRotations () const
 
SUMOReal getStoredEdgeTravelTime () const
 Returns the stored traveltime for the edge of this lane. More...
 
 GUILaneWrapper (MSLane &lane, const PositionVector &shape, unsigned int index)
 Constructor. More...
 
virtual ~GUILaneWrapper ()
 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...
 
Current state retrieval
SUMOReal getNormedHBEFA_CO2Emissions () const
 Returns the sum of last step CO2 emissions normed by the lane's length. More...
 
SUMOReal getNormedHBEFA_COEmissions () const
 Returns the sum of last step CO emissions normed by the lane's length. More...
 
SUMOReal getNormedHBEFA_PMxEmissions () const
 Returns the sum of last step PMx emissions normed by the lane's length. More...
 
SUMOReal getNormedHBEFA_NOxEmissions () const
 Returns the sum of last step NOx emissions normed by the lane's length. More...
 
SUMOReal getNormedHBEFA_HCEmissions () const
 Returns the sum of last step HC emissions normed by the lane's length. More...
 
SUMOReal getNormedHBEFA_FuelConsumption () const
 Returns the sum of last step fuel comsumption normed by the lane's length. More...
 
Atomar getter methods
const std::string & getFullName () const
 Returns the full name appearing in the tool tip. 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...
 
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 Attributes

static StringBijection
< GUIGlObjectType
TypeNames
 associates object types with strings More...
 

Protected Member Functions

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

void drawArrows () const
 
void drawLane2LaneConnections () const
 
void drawLinkNo () const
 helper methods More...
 
void drawLinkRules (const GUINet &net) const
 
void drawTLSLinkNo (const GUINet &net) const
 
SUMOReal getColorValue (size_t activeScheme) const
 gets the color value according to the current scheme index More...
 
 GUILaneWrapper (const GUILaneWrapper &)
 Invalidated copy constructor. More...
 
GUILaneWrapperoperator= (const GUILaneWrapper &)
 Invalidated assignment operator. More...
 
void setColor (const GUIVisualizationSettings &s) const
 sets the color according to the currente settings More...
 

Private Attributes

SUMOReal myHalfLaneWidth
 Half of lane width, for speed-up. More...
 
unsigned int myIndex
 The lane index. More...
 
MSLanemyLane
 The assigned lane. More...
 
SUMOReal myQuarterLaneWidth
 Quarter of lane width, for speed-up. More...
 
const PositionVectormyShape
 The shape of the lane. More...
 
std::vector< SUMORealmyShapeLengths
 The lengths of the shape parts. More...
 
std::vector< SUMORealmyShapeRotations
 The rotations of the shape parts. More...
 

Detailed Description

A MSLane extended for visualisation purposes.

The extensions consist of information about the position of the lane and it's direction. Further, a mechanism to avoid concurrent visualisation and simulation what may cause problems when vehicles disappear is implemented using a mutex.

Definition at line 69 of file GUILaneWrapper.h.

Constructor & Destructor Documentation

GUILaneWrapper::GUILaneWrapper ( MSLane lane,
const PositionVector shape,
unsigned int  index 
)

Constructor.

Parameters
[in]laneThe lane to be represented
[in]shapeThe shape of the lane (!!! this is a member of the lane - no need to give it additionally)

Definition at line 77 of file GUILaneWrapper.cpp.

References Position::distanceTo2D(), MSLane::getWidth(), myHalfLaneWidth, myLane, myQuarterLaneWidth, myShape, myShapeLengths, myShapeRotations, RAD2DEG, SUMOReal, Position::x(), and Position::y().

GUILaneWrapper::~GUILaneWrapper ( )
virtual

Destructor.

Definition at line 101 of file GUILaneWrapper.cpp.

GUILaneWrapper::GUILaneWrapper ( const GUILaneWrapper )
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 187 of file GUIGlObject.cpp.

References GUIGlObject::myParamWindows.

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

Builds entries which allow to copy the name / typed name into the clipboard.

Parameters
in,filled]ret The popup menu to add the entry to
[in]addSeparatorWhether a separator shall be added, too

Definition at line 134 of file GUIGlObject.cpp.

References MID_COPY_NAME, and MID_COPY_TYPED_NAME.

Referenced by GUIDetectorWrapper::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon::getPopUpMenu(), GUIPerson::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), getPopUpMenu(), GUIBusStop::getPopUpMenu(), GUIVehicle::getPopUpMenu(), and GUIEdge::getPopUpMenu().

void GUIGlObject::buildPopupHeader ( GUIGLObjectPopupMenu ret,
GUIMainWindow app,
bool  addSeparator = true 
)
protectedinherited
void GUIGlObject::buildPositionCopyEntry ( GUIGLObjectPopupMenu ret,
bool  addSeparator = true 
)
protectedinherited

Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.

Parameters
in,filled]ret The popup menu to add the entry to
[in]addSeparatorWhether a separator shall be added, too

Definition at line 166 of file GUIGlObject.cpp.

References GeoConvHelper::getFinal(), MID_COPY_CURSOR_GEOPOSITION, and MID_COPY_CURSOR_POSITION.

Referenced by GUIDetectorWrapper::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon::getPopUpMenu(), GUIPerson::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), getPopUpMenu(), GUIBusStop::getPopUpMenu(), GUIVehicle::getPopUpMenu(), GUIEdge::getPopUpMenu(), and GUINet::getPopUpMenu().

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

Builds an entry which allows to open the manipulator window.

Parameters
in,filled]ret The popup menu to add the entry to
[in]addSeparatorWhether a separator shall be added, too

Definition at line 178 of file GUIGlObject.cpp.

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

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

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

Builds an entry which allows to open the parameter window.

Parameters
in,filled]ret The popup menu to add the entry to
[in]addSeparatorWhether a separator shall be added, too

Definition at line 157 of file GUIGlObject.cpp.

References GUIIconSubSys::getIcon(), ICON_APP_TABLE, and MID_SHOWPARS.

Referenced by GUIDetectorWrapper::getPopUpMenu(), GUIPerson::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), getPopUpMenu(), GUIBusStop::getPopUpMenu(), GUIVehicle::getPopUpMenu(), GUIEdge::getPopUpMenu(), and GUINet::getPopUpMenu().

void GUILaneWrapper::drawCrossties ( const GUIVisualizationSettings s) const

draw crossties for railroads

Definition at line 507 of file GUILaneWrapper.cpp.

References getShape(), MSGlobals::gUseMesoSim, myShapeLengths, myShapeRotations, setColor(), and SUMOReal.

Referenced by drawGL().

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 GUIVehicle, and GUIPerson.

Definition at line 182 of file GUIGlObject.h.

References UNUSED_PARAMETER.

void GUILaneWrapper::drawLinkNo ( ) const
private
void GUILaneWrapper::drawMarkings ( const GUIVisualizationSettings s) const
void GUILaneWrapper::drawTLSLinkNo ( const GUINet net) const
private
SUMOReal GUILaneWrapper::firstWaitingTime ( ) const

Definition at line 608 of file GUILaneWrapper.cpp.

References myLane, and MSLane::myVehicles.

Referenced by getColorValue().

bool GUILaneWrapper::forLane ( const MSLane lane) const

Returns true if the given lane id the lane this wrapper wraps the geometry of.

Definition at line 105 of file GUILaneWrapper.cpp.

References myLane.

Referenced by GUIEdge::lane_wrapper_finder::operator()().

Boundary GUILaneWrapper::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 572 of file GUILaneWrapper.cpp.

References Boundary::add(), Boundary::grow(), and myShape.

SUMOReal GUILaneWrapper::getEdgeLaneNumber ( ) const

Definition at line 616 of file GUILaneWrapper.cpp.

References MSLane::getEdge(), MSEdge::getLanes(), myLane, and SUMOReal.

Referenced by getColorValue().

SUMOReal GUILaneWrapper::getHalfWidth ( ) const
inline

Definition at line 153 of file GUILaneWrapper.h.

References myHalfLaneWidth.

Referenced by drawMarkings().

const MSLane& GUILaneWrapper::getLane ( ) const
inline

Returns the represented lane.

Returns
The lane represented by this wrapper

Definition at line 128 of file GUILaneWrapper.h.

References myLane.

Referenced by drawArrows(), drawGL(), drawLane2LaneConnections(), drawLinkNo(), drawLinkRules(), drawTLSLinkNo(), getColorValue(), and getStoredEdgeTravelTime().

unsigned int GUILaneWrapper::getLinkNumber ( ) const

Returns the number of links.

Definition at line 590 of file GUILaneWrapper.cpp.

References MSLane::getLinkCont(), and myLane.

Referenced by drawArrows(), drawLane2LaneConnections(), drawLinkNo(), drawLinkRules(), and drawTLSLinkNo().

const std::string& GUIGlObject::getMicrosimID ( ) const
inlineinherited

Returns the id of the object as known to microsim.

Returns
The id of the object

Definition at line 146 of file GUIGlObject.h.

References GUIGlObject::myMicrosimID.

Referenced by GUIGlObject::createFullName(), GUIGlObject::drawName(), GUIDialog_GLObjChooser::GUIDialog_GLObjChooser(), and GUIGLObjectPopupMenu::onCmdCopyName().

SUMOReal GUILaneWrapper::getNormedHBEFA_CO2Emissions ( ) const

Returns the sum of last step CO2 emissions normed by the lane's length.

Returns
CO2 emissions of vehicles on this lane during the last step, normed by the lane length

Definition at line 623 of file GUILaneWrapper.cpp.

References MSLane::getHBEFA_CO2Emissions(), MSLane::getLength(), and myLane.

Referenced by getColorValue().

SUMOReal GUILaneWrapper::getNormedHBEFA_COEmissions ( ) const

Returns the sum of last step CO emissions normed by the lane's length.

Returns
CO emissions of vehicles on this lane during the last step, normed by the lane length

Definition at line 629 of file GUILaneWrapper.cpp.

References MSLane::getHBEFA_COEmissions(), MSLane::getLength(), and myLane.

Referenced by getColorValue().

SUMOReal GUILaneWrapper::getNormedHBEFA_FuelConsumption ( ) const

Returns the sum of last step fuel comsumption normed by the lane's length.

Returns
Fuel comsumption of vehicles on this lane during the last step, normed by the lane length

Definition at line 653 of file GUILaneWrapper.cpp.

References MSLane::getHBEFA_FuelConsumption(), MSLane::getLength(), and myLane.

Referenced by getColorValue().

SUMOReal GUILaneWrapper::getNormedHBEFA_HCEmissions ( ) const

Returns the sum of last step HC emissions normed by the lane's length.

Returns
HC emissions of vehicles on this lane during the last step, normed by the lane length

Definition at line 647 of file GUILaneWrapper.cpp.

References MSLane::getHBEFA_HCEmissions(), MSLane::getLength(), and myLane.

Referenced by getColorValue().

SUMOReal GUILaneWrapper::getNormedHBEFA_NOxEmissions ( ) const

Returns the sum of last step NOx emissions normed by the lane's length.

Returns
NOx emissions of vehicles on this lane during the last step, normed by the lane length

Definition at line 641 of file GUILaneWrapper.cpp.

References MSLane::getHBEFA_NOxEmissions(), MSLane::getLength(), and myLane.

Referenced by getColorValue().

SUMOReal GUILaneWrapper::getNormedHBEFA_PMxEmissions ( ) const

Returns the sum of last step PMx emissions normed by the lane's length.

Returns
PMx emissions of vehicles on this lane during the last step, normed by the lane length

Definition at line 635 of file GUILaneWrapper.cpp.

References MSLane::getHBEFA_PMxEmissions(), MSLane::getLength(), and myLane.

Referenced by getColorValue().

GUIParameterTableWindow * GUILaneWrapper::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 555 of file GUILaneWrapper.cpp.

References GUIParameterTableWindow::closeBuilding(), getAllowedVehicleClassNames(), MSLane::getEdge(), MSLane::getLength(), MSLane::getPermissions(), MSLane::getSpeedLimit(), getStoredEdgeTravelTime(), MSEdge::getStreetName(), GUIParameterTableWindow::mkItem(), and myLane.

GUIGLObjectPopupMenu * GUILaneWrapper::getPopUpMenu ( GUIMainWindow app,
GUISUMOAbstractView parent 
)
virtual
const std::vector< SUMOReal > & GUILaneWrapper::getShapeLengths ( ) const

Definition at line 602 of file GUILaneWrapper.cpp.

References myShapeLengths.

Referenced by GUIVehicle::draw(), and drawMarkings().

const std::vector< SUMOReal > & GUILaneWrapper::getShapeRotations ( ) const

Definition at line 596 of file GUILaneWrapper.cpp.

References myShapeRotations.

Referenced by GUIVehicle::draw(), and drawMarkings().

SUMOReal GUILaneWrapper::getStoredEdgeTravelTime ( ) const
GUILaneWrapper& GUILaneWrapper::operator= ( const GUILaneWrapper )
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 193 of file GUIGlObject.cpp.

References GUIGlObject::myParamWindows.

Referenced by GUIParameterTableWindow::~GUIParameterTableWindow().

void GUILaneWrapper::setColor ( const GUIVisualizationSettings s) const
private
void GUIGlObject::setMicrosimID ( const std::string &  newID)
inherited

Changes the microsimID of the object (happens in NETEDIT)

Definition at line 108 of file GUIGlObject.cpp.

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

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

Field Documentation

SUMOReal GUILaneWrapper::myHalfLaneWidth
private

Half of lane width, for speed-up.

Definition at line 240 of file GUILaneWrapper.h.

Referenced by drawGL(), drawLinkRules(), drawMarkings(), getHalfWidth(), and GUILaneWrapper().

unsigned int GUILaneWrapper::myIndex
private

The lane index.

Definition at line 246 of file GUILaneWrapper.h.

Referenced by drawMarkings().

SUMOReal GUILaneWrapper::myQuarterLaneWidth
private

Quarter of lane width, for speed-up.

Definition at line 243 of file GUILaneWrapper.h.

Referenced by drawGL(), drawMarkings(), and GUILaneWrapper().

const PositionVector& GUILaneWrapper::myShape
private

The shape of the lane.

Definition at line 231 of file GUILaneWrapper.h.

Referenced by drawGL(), getCenteringBoundary(), getPopUpMenu(), getShape(), and GUILaneWrapper().

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

The lengths of the shape parts.

Definition at line 237 of file GUILaneWrapper.h.

Referenced by drawCrossties(), drawGL(), drawMarkings(), getShapeLengths(), and GUILaneWrapper().

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

The rotations of the shape parts.

Definition at line 234 of file GUILaneWrapper.h.

Referenced by drawCrossties(), drawGL(), drawMarkings(), getShapeRotations(), and GUILaneWrapper().

StringBijection< GUIGlObjectType > GUIGlObject::TypeNames
staticinherited

associates object types with strings

Definition at line 99 of file GUIGlObject.h.


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