GUILaneWrapper Class Reference

#include <GUILaneWrapper.h>

Inheritance diagram for GUILaneWrapper:

GUIGlObject

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.


Public Member Functions

virtual bool active () const throw ()
 Returns the information whether this object is still active.
void drawBordersGL (const GUIVisualizationSettings &s) const throw ()
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
const MSLanegetLane () const throw ()
 Returns the represented lane.
MSEdge::EdgeBasicFunction getPurpose () const
const Position2DVectorgetShape () const
const DoubleVectorgetShapeLengths () const
const DoubleVectorgetShapeRotations () const
 GUILaneWrapper (GUIGlObjectStorage &idStorage, MSLane &lane, const Position2DVector &shape) throw ()
 Constructor.
virtual ~GUILaneWrapper () throw ()
 Destructor.
inherited from GUIGlObject
void drawGL (const GUIVisualizationSettings &s) const throw ()
 Draws the object.
Boundary getCenteringBoundary () const throw ()
 Returns the boundary to which the view shall be centered in order to show the object.
const std::string & getMicrosimID () const throw ()
 Returns the id of the object as known to microsim.
GUIParameterTableWindowgetParameterWindow (GUIMainWindow &app, GUISUMOAbstractView &parent) throw ()
 Returns an own parameter window.
GUIGLObjectPopupMenugetPopUpMenu (GUIMainWindow &app, GUISUMOAbstractView &parent) throw ()
 Returns an own popup-menu.
GUIGlObjectType getType () const throw ()
 Returns the type of the object as coded in GUIGlObjectType.
Atomar getter methods
const std::string & getFullName () const throw ()
 Returns the full name appearing in the tool tip.
GLuint getGlID () const throw ()
 Returns the numerical id of the object.
access to a lane's links
MSLink::LinkDirection getLinkDirection (unsigned int pos) const
 Returns the direction of the numbered link.
MSLanegetLinkLane (unsigned int pos) const
 Returns the lane approached by the numbered link.
unsigned int getLinkNumber () const
 Returns the number of links.
int getLinkRespondIndex (unsigned int pos) const
 Returns the numbered link's respond (junction) index.
MSLink::LinkState getLinkState (unsigned int pos) const throw ()
 Returns the state of the numbered link.
unsigned int getLinkTLID (const GUINet &net, unsigned int pos) const
 Returns the tl-logic's gl-id the numbered link is controlled by.
int getLinkTLIndex (const GUINet &net, unsigned int pos) const
 Returns the numbered link's tls index.
Current state retrieval
SUMOReal getNormedHBEFA_CO2Emissions () const throw ()
 Returns the sum of last step CO2 emissions normed by the lane's length.
SUMOReal getNormedHBEFA_COEmissions () const throw ()
 Returns the sum of last step CO emissions normed by the lane's length.
SUMOReal getNormedHBEFA_FuelConsumption () const throw ()
 Returns the sum of last step fuel comsumption normed by the lane's length.
SUMOReal getNormedHBEFA_HCEmissions () const throw ()
 Returns the sum of last step HC emissions normed by the lane's length.
SUMOReal getNormedHBEFA_NOxEmissions () const throw ()
 Returns the sum of last step NOx emissions normed by the lane's length.
SUMOReal getNormedHBEFA_PMxEmissions () const throw ()
 Returns the sum of last step PMx emissions normed by the lane's length.

Static Public Member Functions

static SUMOReal getOverallMaxSpeed ()
 Returns the fastest known lane speed.

Protected Member Functions

helper methods for building popup-menus
void buildCenterPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true) throw ()
 Builds an entry which allows to center to the object.
void buildNameCopyPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true) throw ()
 Builds entries which allow to copy the name / typed name into the clipboard.
void buildPopupHeader (GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true) throw ()
 Builds the header.
void buildPositionCopyEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true) throw ()
 Builds an entry which allows to copy the cursor position.
void buildSelectionPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true) throw ()
 Builds an entry which allows to (de)select the object.
void buildShowManipulatorPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true) throw ()
 Builds an entry which allows to open the manipulator window.
void buildShowParamsPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true) throw ()
 Builds an entry which allows to open the parameter window.

Protected Attributes

MSLanemyLane
 The assigned lane.
const Position2DVectormyShape
 The shape of the lane.
DoubleVector myShapeLengths
 The lengths of the shape parts.
DoubleVector myShapeRotations
 The rotations of the shape parts.
SUMOReal myVisLength

Static Protected Attributes

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

Private Member Functions

 GUILaneWrapper (const GUILaneWrapper &)
 Invalidated copy constructor.
GUILaneWrapperoperator= (const GUILaneWrapper &)
 Invalidated assignment operator.

Friends

class GUIGlObjectStorage
 Needed to set the id.

Data Structures

class  Colorer

Constructor & Destructor Documentation

GUILaneWrapper::GUILaneWrapper ( GUIGlObjectStorage idStorage,
MSLane lane,
const Position2DVector shape 
) throw ()

Constructor.

Parameters:
[in] idStorage The storage of gl-ids to get the one for this lane representation from
[in] lane The lane to be represented
[in] shape The shape of the lane (!!! this is a member of the lane - no need to give it additionally)

Definition at line 72 of file GUILaneWrapper.cpp.

References Position2D::distanceTo(), PI, SUMOReal, Position2D::x(), and Position2D::y().

00074         : GUIGlObject(idStorage, "lane:"+lane.getID()),
00075         myLane(lane), myShape(shape) {
00076     SUMOReal x1 = shape[0].x();
00077     SUMOReal y1 = shape[0].y();
00078     SUMOReal x2 = shape[-1].x();
00079     SUMOReal y2 = shape[-1].y();
00080     SUMOReal length = myLane.getLength();
00081     // also the virtual length is set in here
00082     myVisLength = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
00083     // check maximum speed
00084     if (myAllMaxSpeed<lane.getMaxSpeed()) {
00085         myAllMaxSpeed = lane.getMaxSpeed();
00086     }
00087     //
00088     myShapeRotations.reserve(myShape.size()-1);
00089     myShapeLengths.reserve(myShape.size()-1);
00090     int e = (int) myShape.size() - 1;
00091     for (int i=0; i<e; ++i) {
00092         const Position2D &f = myShape[i];
00093         const Position2D &s = myShape[i+1];
00094         myShapeLengths.push_back(f.distanceTo(s));
00095         myShapeRotations.push_back((SUMOReal) atan2((s.x()-f.x()), (f.y()-s.y()))*(SUMOReal) 180.0/(SUMOReal) PI);
00096     }
00097 }

GUILaneWrapper::~GUILaneWrapper (  )  throw () [virtual]

Destructor.

Definition at line 100 of file GUILaneWrapper.cpp.

00100 {}

GUILaneWrapper::GUILaneWrapper ( const GUILaneWrapper  )  [private]

Invalidated copy constructor.


Member Function Documentation

virtual bool GUIGlObject::active (  )  const throw () [inline, virtual, inherited]

Returns the information whether this object is still active.

Returns:
Whether this object is active (always true in this case)

Reimplemented in GUIVehicle.

Definition at line 171 of file GUIGlObject.h.

Referenced by GLObjectValuePassConnector< std::pair< int, MSPhaseDefinition > >::updateEachTimestep().

00171                                         {
00172         return true;
00173     }

void GUIGlObject::buildCenterPopupEntry ( GUIGLObjectPopupMenu ret,
bool  addSeparator = true 
) throw () [protected, inherited]

Builds an entry which allows to center to the object.

Parameters:
in,filled] ret The popup menu to add the entry to
[in] app The application, needed for callbacks
[in] addSeparator Whether a separator shall be added, too

Definition at line 86 of file GUIGlObject.cpp.

References GUIIconSubSys::getIcon(), ICON_RECENTERVIEW, and MID_CENTER.

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

00087                                                               {
00088     new FXMenuCommand(ret, "Center", GUIIconSubSys::getIcon(ICON_RECENTERVIEW), ret, MID_CENTER);
00089     if (addSeparator) {
00090         new FXMenuSeparator(ret);
00091     }
00092 }

void GUIGlObject::buildNameCopyPopupEntry ( GUIGLObjectPopupMenu ret,
bool  addSeparator = true 
) throw () [protected, inherited]

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] app The application, needed for callbacks
[in] addSeparator Whether a separator shall be added, too

Definition at line 96 of file GUIGlObject.cpp.

References MID_COPY_NAME, and MID_COPY_TYPED_NAME.

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

00097                                                                 {
00098     new FXMenuCommand(ret, "Copy name to clipboard", 0, ret, MID_COPY_NAME);
00099     new FXMenuCommand(ret, "Copy typed name to clipboard", 0, ret, MID_COPY_TYPED_NAME);
00100     if (addSeparator) {
00101         new FXMenuSeparator(ret);
00102     }
00103 }

void GUIGlObject::buildPopupHeader ( GUIGLObjectPopupMenu ret,
GUIMainWindow app,
bool  addSeparator = true 
) throw () [protected, inherited]

Builds the header.

Parameters:
in,filled] ret The popup menu to add the entry to
[in] app The application, needed for callbacks
[in] addSeparator Whether a separator shall be added, too

Definition at line 75 of file GUIGlObject.cpp.

References GUIGlObject::getFullName().

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

00077                                                          {
00078     new MFXMenuHeader(ret, app.getBoldFont(), getFullName().c_str(), 0, 0, 0);
00079     if (addSeparator) {
00080         new FXMenuSeparator(ret);
00081     }
00082 }

void GUIGlObject::buildPositionCopyEntry ( GUIGLObjectPopupMenu ret,
bool  addSeparator = true 
) throw () [protected, inherited]

Builds an entry which allows to copy the cursor position.

Parameters:
in,filled] ret The popup menu to add the entry to
[in] app The application, needed for callbacks
[in] addSeparator Whether a separator shall be added, too

Definition at line 131 of file GUIGlObject.cpp.

References MID_COPY_CURSOR_POSITION.

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

00132                                                                {
00133     new FXMenuCommand(ret, "Copy cursor position to clipboard", 0, ret, MID_COPY_CURSOR_POSITION);
00134     if (addSeparator) {
00135         new FXMenuSeparator(ret);
00136     }
00137 }

void GUIGlObject::buildSelectionPopupEntry ( GUIGLObjectPopupMenu ret,
bool  addSeparator = true 
) throw () [protected, inherited]

Builds an entry which allows to (de)select the object.

Parameters:
in,filled] ret The popup menu to add the entry to
[in] app The application, needed for callbacks
[in] addSeparator Whether a separator shall be added, too

Definition at line 107 of file GUIGlObject.cpp.

References GUIGlObject::getGlID(), GUIIconSubSys::getIcon(), GUIGlObject::getType(), gSelected, ICON_FLAG_MINUS, ICON_FLAG_PLUS, GUISelectedStorage::isSelected(), MID_ADDSELECT, and MID_REMOVESELECT.

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

00108                                                                  {
00109     if (gSelected.isSelected(getType(), getGlID())) {
00110         new FXMenuCommand(ret, "Remove From Selected", GUIIconSubSys::getIcon(ICON_FLAG_MINUS), ret, MID_REMOVESELECT);
00111     } else {
00112         new FXMenuCommand(ret, "Add To Selected", GUIIconSubSys::getIcon(ICON_FLAG_PLUS), ret, MID_ADDSELECT);
00113     }
00114     if (addSeparator) {
00115         new FXMenuSeparator(ret);
00116     }
00117 }

void GUIGlObject::buildShowManipulatorPopupEntry ( GUIGLObjectPopupMenu ret,
bool  addSeparator = true 
) throw () [protected, inherited]

Builds an entry which allows to open the manipulator window.

Parameters:
in,filled] ret The popup menu to add the entry to
[in] app The application, needed for callbacks
[in] addSeparator Whether a separator shall be added, too

Definition at line 141 of file GUIGlObject.cpp.

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

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

00142                                    {
00143     new FXMenuCommand(ret, "Open Manipulator...",
00144                       GUIIconSubSys::getIcon(ICON_MANIP), ret, MID_MANIP);
00145     if (addSeparator) {
00146         new FXMenuSeparator(ret);
00147     }
00148 }

void GUIGlObject::buildShowParamsPopupEntry ( GUIGLObjectPopupMenu ret,
bool  addSeparator = true 
) throw () [protected, inherited]

Builds an entry which allows to open the parameter window.

Parameters:
in,filled] ret The popup menu to add the entry to
[in] app The application, needed for callbacks
[in] addSeparator Whether a separator shall be added, too

Definition at line 121 of file GUIGlObject.cpp.

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

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

00122                                                                   {
00123     new FXMenuCommand(ret, "Show Parameter", GUIIconSubSys::getIcon(ICON_APP_TABLE), ret, MID_SHOWPARS);
00124     if (addSeparator) {
00125         new FXMenuSeparator(ret);
00126     }
00127 }

void GUILaneWrapper::drawBordersGL ( const GUIVisualizationSettings s  )  const throw ()

Definition at line 474 of file GUILaneWrapper.cpp.

References myShape, myShapeLengths, myShapeRotations, Position2DVector::size(), and SUMOReal.

00474                                                                              {
00475 #ifdef HAVE_MESOSIM
00476     if (!MSGlobals::gUseMesoSim)
00477 #endif
00478         s.laneColorer.setGlColor(*this);
00479     // check whether lane boundaries shall be drawn
00480     int e = (int) myShape.size() - 1;
00481     for (int i=0; i<e; i++) {
00482         glPushMatrix();
00483         glTranslated(myShape[i].x(), myShape[i].y(), 0);
00484         glRotated(myShapeRotations[i], 0, 0, 1);
00485         for (SUMOReal t=0; t<myShapeLengths[i]; t+=6) {
00486             glBegin(GL_QUADS);
00487             glVertex2d(-1.8, -t);
00488             glVertex2d(-1.8, -t-3.);
00489             glVertex2d(1.0, -t-3.);
00490             glVertex2d(1.0, -t);
00491             glEnd();
00492         }
00493         glPopMatrix();
00494     }
00495 }

void GUILaneWrapper::drawGL ( const GUIVisualizationSettings s  )  const throw () [virtual]

Draws the object.

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

Implements GUIGlObject.

Definition at line 403 of file GUILaneWrapper.cpp.

References GLHelper::drawBoxLines(), GLHelper::drawLine(), MSEdge::EDGEFUNCTION_INTERNAL, GUIGlObject::getGlID(), MSNet::getInstance(), getPurpose(), MSLane::getVehiclesSecure(), myLane, myShape, myShapeLengths, myShapeRotations, MSLane::releaseVehicles(), ROWdrawAction_drawArrows(), ROWdrawAction_drawLane2LaneConnections(), ROWdrawAction_drawLinkNo(), ROWdrawAction_drawLinkRules(), ROWdrawAction_drawTLSLinkNo(), SUMO_const_halfLaneWidth, and SUMO_const_quarterLaneWidth.

00403                                                                       {
00404     // set lane color
00405 #ifdef HAVE_MESOSIM
00406     if (!MSGlobals::gUseMesoSim)
00407 #endif
00408         s.laneColorer.setGlColor(*this);
00409     // (optional) set id
00410     if (s.needsGlID) {
00411         glPushName(getGlID());
00412     }
00413     // draw lane
00414     // check whether it is not too small
00415     if (s.scale<1.) {
00416         GLHelper::drawLine(myShape);
00417         // (optional) clear id
00418         if (s.needsGlID) {
00419             glPopName();
00420         }
00421     } else {
00422         if (getPurpose()!=MSEdge::EDGEFUNCTION_INTERNAL) {
00423             glTranslated(0, 0, .005);
00424             GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, SUMO_const_halfLaneWidth);
00425             glTranslated(0, 0, -.005);
00426         } else {
00427             GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, SUMO_const_quarterLaneWidth);
00428         }
00429         // (optional) clear id
00430         if (s.needsGlID) {
00431             glPopName();
00432         }
00433         // draw ROWs (not for inner lanes)
00434         if (getPurpose()!=MSEdge::EDGEFUNCTION_INTERNAL) {// !!! getPurpose()
00435             glTranslated(0, 0, -.02);
00436             GUINet *net = (GUINet*) MSNet::getInstance();
00437             ROWdrawAction_drawLinkRules(*net, *this, s.needsGlID);
00438             if (s.showLinkDecals) {
00439                 ROWdrawAction_drawArrows(*this, s.needsGlID);
00440             }
00441             if (s.showLane2Lane) {
00442                 // this should be independent to the geometry:
00443                 //  draw from end of first to the begin of second
00444                 ROWdrawAction_drawLane2LaneConnections(*this);
00445             }
00446             glTranslated(0, 0, .02);
00447             if (s.drawLinkJunctionIndex) {
00448                 glTranslated(0, 0, -.03);
00449                 ROWdrawAction_drawLinkNo(*this);
00450                 glTranslated(0, 0, .03);
00451             }
00452             if (s.drawLinkTLIndex) {
00453                 glTranslated(0, 0, -.03);
00454                 ROWdrawAction_drawTLSLinkNo(*net, *this);
00455                 glTranslated(0, 0, .03);
00456             }
00457         }
00458     }
00459     // draw vehicles
00460     if (s.scale>s.minVehicleSize) {
00461         // retrieve vehicles from lane; disallow simulation
00462         const MSLane::VehCont &vehicles = myLane.getVehiclesSecure();
00463         for (MSLane::VehCont::const_iterator v=vehicles.begin(); v!=vehicles.end(); ++v) {
00464             static_cast<const GUIVehicle*const>(*v)->drawGL(s);
00465         }
00466         // allow lane simulation
00467         myLane.releaseVehicles();
00468     }
00469     glPopMatrix();
00470 }

SUMOReal GUILaneWrapper::firstWaitingTime (  )  const

Definition at line 610 of file GUILaneWrapper.cpp.

References myLane, and MSLane::myVehicles.

Referenced by GUILaneWrapper::Colorer::getColorValue().

00610                                        {
00611     return myLane.myVehicles.size()==0
00612            ? 0
00613            : (*(myLane.myVehicles.end()-1))->getWaitingSeconds();
00614 }

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

References myLane.

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

00116                                                 {
00117     return (&myLane)==(&lane);
00118 }

Boundary GUILaneWrapper::getCenteringBoundary (  )  const throw () [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 538 of file GUILaneWrapper.cpp.

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

00538                                                    {
00539     Boundary b;
00540     b.add(myShape[0]);
00541     b.add(myShape[-1]);
00542     b.grow(20);
00543     return b;
00544 }

SUMOReal GUILaneWrapper::getEdgeLaneNumber (  )  const

Definition at line 618 of file GUILaneWrapper.cpp.

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

Referenced by GUILaneWrapper::Colorer::getColorValue().

00618                                         {
00619     return (SUMOReal) myLane.getEdge().getLanes().size();
00620 }

const std::string& GUIGlObject::getFullName (  )  const throw () [inline, inherited]

GLuint GUIGlObject::getGlID (  )  const throw () [inline, inherited]

const MSLane& GUILaneWrapper::getLane (  )  const throw () [inline]

Returns the represented lane.

Returns:
The lane represented by this wrapper

Definition at line 144 of file GUILaneWrapper.h.

References myLane.

Referenced by GUILaneWrapper::Colorer::getColorValue().

00144                                           {
00145         return myLane;
00146     }

MSLink::LinkDirection GUILaneWrapper::getLinkDirection ( unsigned int  pos  )  const

Returns the direction of the numbered link.

Definition at line 568 of file GUILaneWrapper.cpp.

References MSLane::getLinkCont(), and myLane.

Referenced by ROWdrawAction_drawArrows().

00568                                                        {
00569     return myLane.getLinkCont()[pos]->getDirection();
00570 }

MSLane * GUILaneWrapper::getLinkLane ( unsigned int  pos  )  const

Returns the lane approached by the numbered link.

Definition at line 574 of file GUILaneWrapper.cpp.

References MSLane::getLinkCont(), and myLane.

Referenced by ROWdrawAction_drawLane2LaneConnections().

00574                                                   {
00575     return myLane.getLinkCont()[pos]->getLane();
00576 }

unsigned int GUILaneWrapper::getLinkNumber (  )  const

Returns the number of links.

Definition at line 556 of file GUILaneWrapper.cpp.

References MSLane::getLinkCont(), and myLane.

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

00556                                     {
00557     return (unsigned int) myLane.getLinkCont().size();
00558 }

int GUILaneWrapper::getLinkRespondIndex ( unsigned int  pos  )  const

Returns the numbered link's respond (junction) index.

Definition at line 580 of file GUILaneWrapper.cpp.

References MSLane::getLinkCont(), and myLane.

Referenced by ROWdrawAction_drawLinkNo().

00580                                                           {
00581     return myLane.getLinkCont()[pos]->getRespondIndex();
00582 }

MSLink::LinkState GUILaneWrapper::getLinkState ( unsigned int  pos  )  const throw ()

Returns the state of the numbered link.

Definition at line 562 of file GUILaneWrapper.cpp.

References MSLane::getLinkCont(), and myLane.

Referenced by ROWdrawAction_drawArrows(), ROWdrawAction_drawLane2LaneConnections(), and ROWdrawAction_drawLinkRules().

00562                                                            {
00563     return myLane.getLinkCont()[pos]->getState();
00564 }

unsigned int GUILaneWrapper::getLinkTLID ( const GUINet net,
unsigned int  pos 
) const

Returns the tl-logic's gl-id the numbered link is controlled by.

Definition at line 598 of file GUILaneWrapper.cpp.

References MSLane::getLinkCont(), GUINet::getLinkTLID(), and myLane.

Referenced by ROWdrawAction_drawLinkRules().

00598                                                                      {
00599     return net.getLinkTLID(myLane.getLinkCont()[pos]);
00600 }

int GUILaneWrapper::getLinkTLIndex ( const GUINet net,
unsigned int  pos 
) const

Returns the numbered link's tls index.

Definition at line 604 of file GUILaneWrapper.cpp.

References MSLane::getLinkCont(), GUINet::getLinkTLIndex(), and myLane.

Referenced by ROWdrawAction_drawTLSLinkNo().

00604                                                                         {
00605     return net.getLinkTLIndex(myLane.getLinkCont()[pos]);
00606 }

const std::string & GUILaneWrapper::getMicrosimID (  )  const throw () [virtual]

Returns the id of the object as known to microsim.

Returns:
The id of the lane
See also:
GUIGlObject::getMicrosimID

Implements GUIGlObject.

Definition at line 532 of file GUILaneWrapper.cpp.

References MSLane::getID(), and myLane.

00532                                             {
00533     return myLane.getID();
00534 }

SUMOReal GUILaneWrapper::getNormedHBEFA_CO2Emissions (  )  const throw ()

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

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

Referenced by GUILaneWrapper::Colorer::getColorValue().

00625                                                           {
00626     return myLane.getHBEFA_CO2Emissions() / myLane.getLength();
00627 }

SUMOReal GUILaneWrapper::getNormedHBEFA_COEmissions (  )  const throw ()

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

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

Referenced by GUILaneWrapper::Colorer::getColorValue().

00631                                                          {
00632     return myLane.getHBEFA_COEmissions() / myLane.getLength();
00633 }

SUMOReal GUILaneWrapper::getNormedHBEFA_FuelConsumption (  )  const throw ()

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

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

Referenced by GUILaneWrapper::Colorer::getColorValue().

00655                                                              {
00656     return myLane.getHBEFA_FuelConsumption() / myLane.getLength();
00657 }

SUMOReal GUILaneWrapper::getNormedHBEFA_HCEmissions (  )  const throw ()

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

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

Referenced by GUILaneWrapper::Colorer::getColorValue().

00649                                                          {
00650     return myLane.getHBEFA_HCEmissions() / myLane.getLength();
00651 }

SUMOReal GUILaneWrapper::getNormedHBEFA_NOxEmissions (  )  const throw ()

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

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

Referenced by GUILaneWrapper::Colorer::getColorValue().

00643                                                           {
00644     return myLane.getHBEFA_NOxEmissions() / myLane.getLength();
00645 }

SUMOReal GUILaneWrapper::getNormedHBEFA_PMxEmissions (  )  const throw ()

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

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

Referenced by GUILaneWrapper::Colorer::getColorValue().

00637                                                           {
00638     return myLane.getHBEFA_PMxEmissions() / myLane.getLength();
00639 }

SUMOReal GUILaneWrapper::getOverallMaxSpeed (  )  [static]

Returns the fastest known lane speed.

Definition at line 110 of file GUILaneWrapper.cpp.

References myAllMaxSpeed.

00110                                    {
00111     return myAllMaxSpeed;
00112 }

GUIParameterTableWindow * GUILaneWrapper::getParameterWindow ( GUIMainWindow app,
GUISUMOAbstractView parent 
) throw () [virtual]

Returns an own parameter window.

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

Implements GUIGlObject.

Definition at line 518 of file GUILaneWrapper.cpp.

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

00519                                                                   {
00520     GUIParameterTableWindow *ret =
00521         new GUIParameterTableWindow(app, *this, 2);
00522     // add items
00523     ret->mkItem("maxspeed [m/s]", false, myLane.getMaxSpeed());
00524     ret->mkItem("length [m]", false, myLane.getLength());
00525     // close building
00526     ret->closeBuilding();
00527     return ret;
00528 }

GUIGLObjectPopupMenu * GUILaneWrapper::getPopUpMenu ( GUIMainWindow app,
GUISUMOAbstractView parent 
) throw () [virtual]

Returns an own popup-menu.

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

Implements GUIGlObject.

Definition at line 499 of file GUILaneWrapper.cpp.

References GUIGlObject::buildCenterPopupEntry(), GUIGlObject::buildNameCopyPopupEntry(), GUIGlObject::buildPopupHeader(), GUIGlObject::buildPositionCopyEntry(), GUIGlObject::buildSelectionPopupEntry(), GUIGlObject::buildShowParamsPopupEntry(), myShape, Position2DVector::nearest_position_on_line_to_point(), SUMOReal, and toString().

00500                                                                   {
00501     GUIGLObjectPopupMenu *ret = new GUIGLObjectPopupMenu(app, parent, *this);
00502     buildPopupHeader(ret, app);
00503     buildCenterPopupEntry(ret);
00504     //
00505     buildNameCopyPopupEntry(ret);
00506     buildSelectionPopupEntry(ret);
00507     //
00508     buildShowParamsPopupEntry(ret, false);
00509     SUMOReal pos = myShape.nearest_position_on_line_to_point(parent.getPositionInformation());
00510     new FXMenuCommand(ret, ("pos: " + toString(pos)).c_str(), 0, 0, 0);
00511     new FXMenuSeparator(ret);
00512     buildPositionCopyEntry(ret, false);
00513     return ret;
00514 }

MSEdge::EdgeBasicFunction GUILaneWrapper::getPurpose (  )  const

returns the purpose (source, sink, normal) of the parent edge

Definition at line 104 of file GUILaneWrapper.cpp.

References MSEdge::getPurpose(), MSLane::myEdge, and myLane.

Referenced by drawGL().

00104                                  {
00105     return myLane.myEdge->getPurpose();
00106 }

const Position2DVector & GUILaneWrapper::getShape (  )  const

const DoubleVector & GUILaneWrapper::getShapeLengths (  )  const

Definition at line 592 of file GUILaneWrapper.cpp.

References myShapeLengths.

Referenced by GUIViewTraffic::draw(), and GUIEmitter::drawGL().

00592                                       {
00593     return myShapeLengths;
00594 }

const DoubleVector & GUILaneWrapper::getShapeRotations (  )  const

Definition at line 586 of file GUILaneWrapper.cpp.

References myShapeRotations.

Referenced by GUIViewTraffic::draw(), and GUIEmitter::drawGL().

00586                                         {
00587     return myShapeRotations;
00588 }

GUIGlObjectType GUILaneWrapper::getType (  )  const throw () [inline, virtual]

Returns the type of the object as coded in GUIGlObjectType.

Returns:
GLO_LANE (is a lane)
See also:
GUIGlObject::getType

GUIGlObjectType

Implements GUIGlObject.

Definition at line 119 of file GUILaneWrapper.h.

References GLO_LANE.

Referenced by GUILaneWrapper::Colorer::getColorValue().

00119                                             {
00120         return GLO_LANE;
00121     }

GUILaneWrapper& GUILaneWrapper::operator= ( const GUILaneWrapper  )  [private]

Invalidated assignment operator.


Friends And Related Function Documentation

friend class GUIGlObjectStorage [friend, inherited]

Needed to set the id.

Reimplemented in GUI_E2_ZS_CollectorOverLanes::MyWrapper.

Definition at line 111 of file GUIGlObject.h.


Field Documentation

SUMOReal GUILaneWrapper::myAllMaxSpeed = 0 [static, protected]

The maximum velocity over all lanes.

Definition at line 266 of file GUILaneWrapper.h.

Referenced by getOverallMaxSpeed().

The shape of the lane.

Definition at line 257 of file GUILaneWrapper.h.

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

The lengths of the shape parts.

Definition at line 263 of file GUILaneWrapper.h.

Referenced by drawBordersGL(), drawGL(), and getShapeLengths().

The rotations of the shape parts.

Definition at line 260 of file GUILaneWrapper.h.

Referenced by drawBordersGL(), drawGL(), and getShapeRotations().

SUMOReal GUILaneWrapper::myVisLength [protected]

the visualisation length; As sources and sinks may be shorter/longer as their visualisation length, a second length information is necessary

Definition at line 251 of file GUILaneWrapper.h.


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

Generated on Wed May 5 00:06:44 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6