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

virtual void drawGLAdditional (GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
 Draws additional, user-triggered visualisations.
void drawMarkings (const GUIVisualizationSettings &s) const
 draw lane borders and white markings
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.
SUMOReal getEdgeLaneNumber () const
SUMOReal getHalfWidth () const
const MSLanegetLane () const
 Returns the represented lane.
unsigned int getLinkNumber () const
 Returns the number of links.
const PositionVectorgetShape () const
const std::vector< SUMOReal > & getShapeLengths () const
const std::vector< SUMOReal > & getShapeRotations () const
 GUILaneWrapper (MSLane &lane, const PositionVector &shape, unsigned int index)
 Constructor.
virtual ~GUILaneWrapper ()
 Destructor.
inherited from GUIGlObject
GUIGLObjectPopupMenugetPopUpMenu (GUIMainWindow &app, GUISUMOAbstractView &parent)
 Returns an own popup-menu.
GUIParameterTableWindowgetParameterWindow (GUIMainWindow &app, GUISUMOAbstractView &parent)
 Returns an own parameter window.
Boundary getCenteringBoundary () const
 Returns the boundary to which the view shall be centered in order to show the object.
void drawGL (const GUIVisualizationSettings &s) const
 Draws the object.
Current state retrieval
SUMOReal getNormedHBEFA_CO2Emissions () const
 Returns the sum of last step CO2 emissions normed by the lane's length.
SUMOReal getNormedHBEFA_COEmissions () const
 Returns the sum of last step CO emissions normed by the lane's length.
SUMOReal getNormedHBEFA_PMxEmissions () const
 Returns the sum of last step PMx emissions normed by the lane's length.
SUMOReal getNormedHBEFA_NOxEmissions () const
 Returns the sum of last step NOx emissions normed by the lane's length.
SUMOReal getNormedHBEFA_HCEmissions () const
 Returns the sum of last step HC emissions normed by the lane's length.
SUMOReal getNormedHBEFA_FuelConsumption () const
 Returns the sum of last step fuel comsumption normed by the lane's length.
Atomar getter methods
const std::string & getFullName () const
 Returns the full name appearing in the tool tip.
GUIGlID getGlID () const
 Returns the numerical id of the object.
interfaces to be implemented by derived classes
const std::string & getMicrosimID () const
 Returns the id of the object as known to microsim.
void setMicrosimID (const std::string &newID)
 Changes the microsimID of the object (happens in NETEDIT)
GUIGlObjectType getType () const
 Returns the type of the object as coded in GUIGlObjectType.
Parameter table window I/O
void addParameterTable (GUIParameterTableWindow *w)
 Lets this object know a parameter window showing the object's values was opened.
void removeParameterTable (GUIParameterTableWindow *w)
 Lets this object know a parameter window showing the object's values was closed.

Static Public Attributes

static StringBijection
< GUIGlObjectType
TypeNames
 associates object types with strings

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.
void buildCenterPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true)
 Builds an entry which allows to center to the object.
void buildNameCopyPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true)
 Builds entries which allow to copy the name / typed name into the clipboard.
void buildSelectionPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true)
 Builds an entry which allows to (de)select the object.
void buildShowParamsPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true)
 Builds an entry which allows to open the parameter window.
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.
void buildShowManipulatorPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true)
 Builds an entry which allows to open the manipulator window.

Protected Attributes

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

Static Protected Attributes

static SUMOReal myAllMaxSpeed = 0
 The maximum velocity over all lanes.

Private Member Functions

SUMOReal getColorValue (size_t activeScheme) const
 gets the color value according to the current scheme index
 GUILaneWrapper (const GUILaneWrapper &)
 Invalidated copy constructor.
GUILaneWrapperoperator= (const GUILaneWrapper &)
 Invalidated assignment operator.
void ROWdrawAction_drawArrows () const
void ROWdrawAction_drawLane2LaneConnections () const
void ROWdrawAction_drawLinkNo () const
 helper methods
void ROWdrawAction_drawLinkRules (const GUINet &net) const
void ROWdrawAction_drawTLSLinkNo (const GUINet &net) const
void setColor (const GUIVisualizationSettings &s) const
 sets the color according to the currente settings

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 64 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 83 of file GUILaneWrapper.cpp.

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

GUILaneWrapper::~GUILaneWrapper ( )
virtual

Destructor.

Definition at line 103 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 191 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 138 of file GUIGlObject.cpp.

References MID_COPY_NAME, and MID_COPY_TYPED_NAME.

Referenced by GUIDetectorWrapper::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), getPopUpMenu(), GUIVehicle::getPopUpMenu(), GUIBusStop::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 170 of file GUIGlObject.cpp.

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

Referenced by GUIDetectorWrapper::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), getPopUpMenu(), GUIVehicle::getPopUpMenu(), GUIBusStop::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 182 of file GUIGlObject.cpp.

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

Referenced by GUITriggeredRerouter::getPopUpMenu(), and GUILaneSpeedTrigger::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 161 of file GUIGlObject.cpp.

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

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

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.

Definition at line 182 of file GUIGlObject.h.

References UNUSED_PARAMETER.

void GUILaneWrapper::drawMarkings ( const GUIVisualizationSettings s) const
SUMOReal GUILaneWrapper::firstWaitingTime ( ) const

Definition at line 565 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 107 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 529 of file GUILaneWrapper.cpp.

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

SUMOReal GUILaneWrapper::getEdgeLaneNumber ( ) const

Definition at line 573 of file GUILaneWrapper.cpp.

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

Referenced by getColorValue().

SUMOReal GUILaneWrapper::getHalfWidth ( ) const
inline

Definition at line 146 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 123 of file GUILaneWrapper.h.

References myLane.

Referenced by drawGL(), getColorValue(), ROWdrawAction_drawArrows(), ROWdrawAction_drawLane2LaneConnections(), ROWdrawAction_drawLinkNo(), ROWdrawAction_drawLinkRules(), and ROWdrawAction_drawTLSLinkNo().

unsigned int GUILaneWrapper::getLinkNumber ( ) const
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 580 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 586 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 610 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 604 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 598 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 592 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 515 of file GUILaneWrapper.cpp.

References GUIParameterTableWindow::closeBuilding(), MSLane::getLength(), MSLane::getMaxSpeed(), GUIParameterTableWindow::mkItem(), and myLane.

GUIGLObjectPopupMenu * GUILaneWrapper::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 496 of file GUILaneWrapper.cpp.

References GUIGlObject::buildCenterPopupEntry(), GUIGlObject::buildNameCopyPopupEntry(), GUIGlObject::buildPopupHeader(), GUIGlObject::buildPositionCopyEntry(), GUIGlObject::buildSelectionPopupEntry(), GUIGlObject::buildShowParamsPopupEntry(), GUISUMOAbstractView::getPositionInformation(), myShape, PositionVector::nearest_position_on_line_to_point2D(), SUMOReal, and toString().

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

Definition at line 559 of file GUILaneWrapper.cpp.

References myShapeLengths.

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

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

Definition at line 553 of file GUILaneWrapper.cpp.

References myShapeRotations.

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

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 197 of file GUIGlObject.cpp.

References GUIGlObject::myParamWindows.

Referenced by GUIParameterTableWindow::~GUIParameterTableWindow().

void GUILaneWrapper::ROWdrawAction_drawLinkNo ( ) const
private
void GUILaneWrapper::ROWdrawAction_drawTLSLinkNo ( const GUINet net) const
private
void GUILaneWrapper::setColor ( const GUIVisualizationSettings s) const
private

sets the color according to the currente settings

Definition at line 616 of file GUILaneWrapper.cpp.

References GUIColorer::getActive(), GUIColorScheme::getColor(), getColorValue(), GUIColorer::getScheme(), and GUIVisualizationSettings::laneColorer.

Referenced by drawGL(), and drawMarkings().

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

Changes the microsimID of the object (happens in NETEDIT)

Definition at line 112 of file GUIGlObject.cpp.

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

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

Field Documentation

SUMOReal GUILaneWrapper::myAllMaxSpeed = 0
staticprotected

The maximum velocity over all lanes.

Definition at line 214 of file GUILaneWrapper.h.

SUMOReal GUILaneWrapper::myHalfLaneWidth
protected

Half of lane width, for speed-up.

Definition at line 208 of file GUILaneWrapper.h.

Referenced by drawGL(), getHalfWidth(), GUILaneWrapper(), and ROWdrawAction_drawLinkRules().

unsigned int GUILaneWrapper::myIndex
protected

The lane index.

Definition at line 217 of file GUILaneWrapper.h.

Referenced by drawMarkings().

SUMOReal GUILaneWrapper::myQuarterLaneWidth
protected

Quarter of lane width, for speed-up.

Definition at line 211 of file GUILaneWrapper.h.

Referenced by drawGL(), and GUILaneWrapper().

const PositionVector& GUILaneWrapper::myShape
protected

The shape of the lane.

Definition at line 199 of file GUILaneWrapper.h.

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

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

The lengths of the shape parts.

Definition at line 205 of file GUILaneWrapper.h.

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

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

The rotations of the shape parts.

Definition at line 202 of file GUILaneWrapper.h.

Referenced by 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: