GUIBusStop Class Reference

#include <GUIBusStop.h>

Inheritance diagram for GUIBusStop:

MSBusStop GUIGlObject_AbstractAdd MSTrigger GUIGlObject Named

Detailed Description

A lane area vehicles can halt at (gui-version).

This gui-version of a bus-stop extends MSBusStop by methods for displaying and interaction.

See also:
MSBusStop

GUIGlObject_AbstractAdd

GUIGlObject

Definition at line 68 of file GUIBusStop.h.


Public Member Functions

virtual bool active () const throw ()
 Returns the information whether this object is still active.
void drawGLName (const Position2D &p, const std::string &id, SUMOReal nameScale) const
void enter (void *what, SUMOReal beg, SUMOReal end) throw ()
 Called if a vehicle enters this stop.
SUMOReal getBeginLanePosition () const throw ()
 Returns the begin position of this bus stop.
SUMOReal getEndLanePosition () const throw ()
 Returns the end position of this bus stop.
const std::string & getID () const throw ()
 Returns the id.
const MSLanegetLane () const throw ()
 Returns the lane this bus stop is located at.
SUMOReal getLastFreePos () const throw ()
 Returns the last free position on this stop.
 GUIBusStop (const std::string &id, MSNet &net, const std::vector< std::string > &lines, MSLane &lane, SUMOReal frompos, SUMOReal topos) throw ()
 Constructor.
void leaveFrom (void *what) throw ()
 Called if a vehicle leaves this stop.
 ~GUIBusStop () 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.
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.
inherited from GUIGlObject
GUIGlObjectType getType () const throw ()
 Returns the type of the object as coded in GUIGlObjectType.

Static Public Member Functions

static void clearDictionary ()
 Clears the dictionary (the objects will not be deleted).
static GUIGlObject_AbstractAddget (const std::string &name)
 Returns a named object.
static std::vector< GLuint > getIDList ()
 Returns the list of gl-ids of all additional objects.
static const std::vector
< GUIGlObject_AbstractAdd * > & 
getObjectList ()
 Returns the list of all additional objects.

Protected Member Functions

void computeLastFreePos () throw ()
 Computes the last free position on this stop.
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

SUMOReal myBegPos
 The begin position this bus stop is located at.
SUMOReal myEndPos
 The end position this bus stop is located at.
std::map< void *, std::pair
< SUMOReal, SUMOReal > > 
myEndPositions
 A map from objects (vehicles) to the areas they acquire after entering the stop.
GUIGlObjectType myGlType
 The object's type.
std::string myID
 The name of the object.
MSLanemyLane
 The lane this bus stop is located at.
SUMOReal myLastFreePos
 The last free position at this stop (variable).
std::vector< std::string > myLines
 The list of lines that are assigned to this stop.

Static Protected Attributes

static std::vector
< GUIGlObject_AbstractAdd * > 
myObjectList
 The list of all addtional objects currently loaded.
static std::map< std::string,
GUIGlObject_AbstractAdd * > 
myObjects
 Map from names of loaded additional objects to the objects themselves.

Private Attributes

Position2DVector myFGShape
 The shape.
DoubleVector myFGShapeLengths
 The lengths of the shape parts.
DoubleVector myFGShapeRotations
 The rotations of the shape parts.
Position2D myFGSignPos
 The position of the sign.
SUMOReal myFGSignRot
 The rotation of the sign.

Friends

class GUIGlObjectStorage
 Needed to set the id.

Constructor & Destructor Documentation

GUIBusStop::GUIBusStop ( const std::string &  id,
MSNet net,
const std::vector< std::string > &  lines,
MSLane lane,
SUMOReal  frompos,
SUMOReal  topos 
) throw ()

Constructor.

Parameters:
[in] id The id of the bus stop
[in] net The net the bus stop belongs to
[in] lines Names of the bus lines that halt on this bus stop
[in] lane The lane the bus stop is placed on
[in] begPos Begin position of the bus stop on the lane
[in] endPos End position of the bus stop on the lane

Definition at line 71 of file GUIBusStop.cpp.

References Position2D::distanceTo(), Position2DVector::getLineCenter(), Position2DVector::length(), Position2DVector::move2side(), PI, SUMOReal, Position2D::x(), and Position2D::y().

00074         : MSBusStop(id, lines, lane, frompos, topos),
00075         GUIGlObject_AbstractAdd(GUIGlObjectStorage::gIDStorage, "bus_stop:" + id, GLO_TRIGGER) {
00076     myFGShape = lane.getShape();
00077     myFGShape.move2side((SUMOReal) 1.65);
00078     myFGShape = myFGShape.getSubpart(frompos, topos);
00079     myFGShapeRotations.reserve(myFGShape.size()-1);
00080     myFGShapeLengths.reserve(myFGShape.size()-1);
00081     int e = (int) myFGShape.size() - 1;
00082     for (int i=0; i<e; ++i) {
00083         const Position2D &f = myFGShape[i];
00084         const Position2D &s = myFGShape[i+1];
00085         myFGShapeLengths.push_back(f.distanceTo(s));
00086         myFGShapeRotations.push_back((SUMOReal) atan2((s.x()-f.x()), (f.y()-s.y()))*(SUMOReal) 180.0/(SUMOReal) PI);
00087     }
00088     Position2DVector tmp = myFGShape;
00089     tmp.move2side(1.5);
00090     myFGSignPos = tmp.getLineCenter();
00091     myFGSignRot = 0;
00092     if (tmp.length()!=0) {
00093         myFGSignRot = myFGShape.rotationDegreeAtLengthPosition(SUMOReal((myFGShape.length() / 2.)));
00094         myFGSignRot -= 90;
00095     }
00096 }

GUIBusStop::~GUIBusStop (  )  throw ()

Destructor.

Definition at line 99 of file GUIBusStop.cpp.

00099 {}


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(), GUILaneWrapper::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), GUIEmitter::getPopUpMenu(), GUIEdge::getPopUpMenu(), GUIDetectorWrapper::getPopUpMenu(), and 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(), GUILaneWrapper::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), GUIEmitter::getPopUpMenu(), GUIEdge::getPopUpMenu(), GUIDetectorWrapper::getPopUpMenu(), and 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(), GUILaneWrapper::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), GUIEmitter::getPopUpMenu(), GUIEdge::getPopUpMenu(), GUIDetectorWrapper::getPopUpMenu(), and 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(), GUILaneWrapper::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), GUIEmitter::getPopUpMenu(), GUIEdge::getPopUpMenu(), GUIDetectorWrapper::getPopUpMenu(), and 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(), GUILaneWrapper::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), GUIEmitter::getPopUpMenu(), GUIEdge::getPopUpMenu(), GUIDetectorWrapper::getPopUpMenu(), and 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(), GUILaneWrapper::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 GUIGlObject_AbstractAdd::clearDictionary (  )  [static, inherited]

Clears the dictionary (the objects will not be deleted).

!! delete (*i).second;

Definition at line 82 of file GUIGlObject_AbstractAdd.cpp.

References GUIGlObject_AbstractAdd::myObjectList, and GUIGlObject_AbstractAdd::myObjects.

Referenced by GUINet::~GUINet().

00082                                          {
00083     std::map<std::string, GUIGlObject_AbstractAdd*>::iterator i;
00084     for (i=myObjects.begin(); i!=myObjects.end(); i++) {
00086     }
00087     myObjects.clear();
00088     myObjectList.clear();
00089 }

void MSBusStop::computeLastFreePos (  )  throw () [protected, inherited]

Computes the last free position on this stop.

The last free position is the one, the last vehicle ends at. It is stored in myLastFreePos. If no vehicle halts, the last free position gets the value of myEndPos.

Definition at line 95 of file MSBusStop.cpp.

References MSBusStop::myEndPos, MSBusStop::myEndPositions, and MSBusStop::myLastFreePos.

Referenced by MSBusStop::enter(), and MSBusStop::leaveFrom().

00095                                       {
00096     myLastFreePos = myEndPos;
00097     std::map<void*, std::pair<SUMOReal, SUMOReal> >::iterator i;
00098     for (i=myEndPositions.begin(); i!=myEndPositions.end(); i++) {
00099         if (myLastFreePos>(*i).second.second) {
00100             myLastFreePos = (*i).second.second;
00101         }
00102     }
00103 }

void GUIBusStop::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 129 of file GUIBusStop.cpp.

References GLHelper::drawBoxLines(), GLHelper::drawFilledCircle(), GUIGlObject_AbstractAdd::drawGLName(), getCenteringBoundary(), GUIGlObject::getGlID(), getMicrosimID(), myFGShape, myFGShapeLengths, myFGShapeRotations, myFGSignPos, myFGSignRot, MSBusStop::myLines, pfdkGetStringWidth(), pfDrawString(), pfSetPosition(), pfSetScale(), SUMOReal, Position2D::x(), and Position2D::y().

00129                                                                   {
00130     // (optional) set id
00131     if (s.needsGlID) {
00132         glPushName(getGlID());
00133     }
00134     glTranslated(0, 0, -.03);
00135     // draw the area
00136     glColor3d(76./255., 170./255., 50./255.);
00137     size_t i;
00138     GLHelper::drawBoxLines(myFGShape, myFGShapeRotations, myFGShapeLengths, 1.0);
00139     // draw the lines
00140     if (s.scale*s.addExaggeration>=10) {
00141         glTranslated(0, 0, -.01);
00142         glColor3d(76./255., 170./255., 50./255.);
00143         for (i=0; i!=myLines.size(); ++i) {
00144             glPushMatrix();
00145             glTranslated(myFGSignPos.x(), myFGSignPos.y(), 0);
00146             glRotated(180, 1, 0, 0);
00147             glRotated(myFGSignRot, 0, 0, 1);
00148             glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
00149             pfSetPosition(0, 0);
00150             pfSetScale(1.f);
00151             glScaled(s.addExaggeration, s.addExaggeration, 1);
00152             glTranslated(1.2, -(double)i, 0);
00153             pfDrawString(myLines[i].c_str());
00154             glPopMatrix();
00155         }
00156         glTranslated(0, 0, .01);
00157     }
00158 
00159     // draw the sign
00160     glPushMatrix();
00161     glTranslated(myFGSignPos.x(), myFGSignPos.y(), 0);
00162     int noPoints = 9;
00163     if (s.scale*s.addExaggeration>25) {
00164         noPoints = (int)(9.0 + (s.scale*s.addExaggeration) / 10.0);
00165         if (noPoints>36) {
00166             noPoints = 36;
00167         }
00168     }
00169     glScaled(s.addExaggeration, s.addExaggeration, 1);
00170     glColor3d(76./255., 170./255., 50./255.);
00171     GLHelper::drawFilledCircle((SUMOReal) 1.1, noPoints);
00172     if (s.scale*s.addExaggeration>=10) {
00173         glTranslated(0, 0, -.01);
00174         glColor3d(255./255., 235./255., 0./255.);
00175         GLHelper::drawFilledCircle((SUMOReal) 0.9, noPoints);
00176         glTranslated(0, 0, .01);
00177         // draw the H
00178         // not if scale to low
00179         if (s.scale*s.addExaggeration>=4.5) {
00180             glColor3d(76./255., 170./255., 50./255.);
00181             glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
00182             glRotated(180, 1, 0, 0);
00183             glRotated(myFGSignRot, 0, 0, 1);
00184             glTranslated(0, 0, .02);
00185             pfSetPosition(0, 0);
00186             pfSetScale(1.6f);
00187             SUMOReal w = pfdkGetStringWidth("H");
00188             glTranslated(-w/2., 0.4, 0);
00189             pfDrawString("H");
00190             glTranslated(0, 0, -.02);
00191         }
00192     }
00193     glPopMatrix();
00194     glTranslated(0, 0, .03);
00195     // (optional) draw name
00196     if (s.drawAddName) {
00197         drawGLName(getCenteringBoundary().getCenter(), getMicrosimID(), s.addNameSize / s.scale);
00198     }
00199     // (optional) clear id
00200     if (s.needsGlID) {
00201         glPopName();
00202     }
00203 }

void GUIGlObject_AbstractAdd::drawGLName ( const Position2D p,
const std::string &  id,
SUMOReal  nameScale 
) const [inherited]

Definition at line 120 of file GUIGlObject_AbstractAdd.cpp.

References pfdkGetStringWidth(), pfDrawString(), pfSetPosition(), pfSetScale(), SUMOReal, Position2D::x(), and Position2D::y().

Referenced by GUILaneSpeedTrigger::drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUIEmitter::drawGL(), GUIE3Collector::MyWrapper::drawGL(), drawGL(), and GUI_E2_ZS_Collector::MyWrapper::drawGL().

00120                                                                                                       {
00121     glPolygonOffset(0, -6);
00122     glPushMatrix();
00123     glTranslated(p.x(), p.y(), 0);
00124     glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
00125     pfSetPosition(0, 0);
00126     pfSetScale(nameScale);
00127     SUMOReal w = pfdkGetStringWidth(id.c_str());
00128     glRotated(180, 1, 0, 0);
00129     glTranslated(-w/2., 0.4, 0);
00130     pfDrawString(id.c_str());
00131     glPopMatrix();
00132 }

void MSBusStop::enter ( void *  what,
SUMOReal  beg,
SUMOReal  end 
) throw () [inherited]

Called if a vehicle enters this stop.

Stores the position of the entering vehicle in myEndPositions.

Recomputes the free space using "computeLastFreePos" then.

Parameters:
[in] what The vehicle that enters the bus stop
[in] beg The begin halting position of the vehicle
[in] what The end halting position of the vehicle
See also:
computeLastFreePos

Definition at line 74 of file MSBusStop.cpp.

References MSBusStop::computeLastFreePos(), and MSBusStop::myEndPositions.

Referenced by MSVehicle::processNextStop().

00074                                                                {
00075     myEndPositions[what] = std::pair<SUMOReal, SUMOReal>(beg, end);
00076     computeLastFreePos();
00077 }

GUIGlObject_AbstractAdd * GUIGlObject_AbstractAdd::get ( const std::string &  name  )  [static, inherited]

Returns a named object.

Definition at line 93 of file GUIGlObject_AbstractAdd.cpp.

References GUIGlObject_AbstractAdd::myObjects.

00093                                                   {
00094     std::map<std::string, GUIGlObject_AbstractAdd*>::iterator i =
00095         myObjects.find(name);
00096     if (i==myObjects.end()) {
00097         return 0;
00098     }
00099     return (*i).second;
00100 }

SUMOReal MSBusStop::getBeginLanePosition (  )  const throw () [inherited]

Returns the begin position of this bus stop.

Returns:
The position the bus stop begins at

Definition at line 62 of file MSBusStop.cpp.

References MSBusStop::myBegPos.

Referenced by MSVehicle::processNextStop().

00062                                               {
00063     return myBegPos;
00064 }

Boundary GUIBusStop::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 207 of file GUIBusStop.cpp.

References Position2DVector::getBoxBoundary(), Boundary::grow(), and myFGShape.

Referenced by drawGL().

00207                                                {
00208     Boundary b = myFGShape.getBoxBoundary();
00209     b.grow(20);
00210     return b;
00211 }

SUMOReal MSBusStop::getEndLanePosition (  )  const throw () [inherited]

Returns the end position of this bus stop.

Returns:
The position the bus stop ends at

Definition at line 68 of file MSBusStop.cpp.

References MSBusStop::myEndPos.

Referenced by MSNet::getBusStopID(), and MSRouteHandler::myStartElement().

00068                                             {
00069     return myEndPos;
00070 }

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

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

const std::string& Named::getID (  )  const throw () [inline, inherited]

Returns the id.

Returns:
The stored id

Definition at line 59 of file Named.h.

References Named::myID.

Referenced by RORouteDef_Alternatives::addAlternative(), MSRouteProbe::addRoute(), MSEmitter::MSEmitter_FileTriggeredChild::buildAndScheduleFlowVehicle(), MSCalibrator::MSCalibrator_FileTriggeredChild::buildAndScheduleFlowVehicle(), RORouteDef_Complete::buildCurrentRoute(), ODDistrictHandler::closeDistrict(), NBTrafficLightDefinition::collectLinks(), NBTrafficLightDefinition::compute(), GUIPointOfInterest::drawGL(), MSInductLoop::enterDetectorByMove(), MSVTypeProbe::execute(), MSNet::getBusStopID(), GUITriggeredRerouter::getMicrosimID(), GUIPointOfInterest::getMicrosimID(), GUILaneSpeedTrigger::getMicrosimID(), GUIInductLoop::MyWrapper::getMicrosimID(), GUIEmitter::getMicrosimID(), getMicrosimID(), GUI_E2_ZS_Collector::MyWrapper::getMicrosimID(), traci::TraCIServer::handlePoiDomain(), RORDLoader_SUMOBase::myCharacters(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), MSTriggeredRerouter::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSEmitter::MSEmitter_FileTriggeredChild::myStartElement(), MSCalibrator::MSCalibrator_FileTriggeredChild::myStartElement(), NBLoadedTLDef::SignalGroup::patchTYellow(), TraCIServerAPI_Vehicle::processGet(), MSVehicle::replaceRoute(), MSVehicle::saveState(), NBOwnTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), RORDLoader_SUMOBase::startRoute(), GUIEmitter::GUIEmitterChild_UserTriggeredChild::wrappedExecute(), NBTrafficLightLogic::writeXML(), MSRouteProbe::writeXMLOutput(), MSInductLoop::writeXMLOutput(), MSE2Collector::writeXMLOutput(), and MSVehicle::~MSVehicle().

00059                                            {
00060         return myID;
00061     }

std::vector< GLuint > GUIGlObject_AbstractAdd::getIDList (  )  [static, inherited]

Returns the list of gl-ids of all additional objects.

Definition at line 110 of file GUIGlObject_AbstractAdd.cpp.

References GUIGlObject_AbstractAdd::myObjectList.

Referenced by FXIMPLEMENT().

00110                                    {
00111     std::vector<GLuint> ret;
00112     for (std::vector<GUIGlObject_AbstractAdd*>::iterator i=myObjectList.begin(); i!=myObjectList.end(); ++i) {
00113         ret.push_back((*i)->getGlID());
00114     }
00115     return ret;
00116 }

const MSLane & MSBusStop::getLane (  )  const throw () [inherited]

Returns the lane this bus stop is located at.

Returns:
Reference to the lane the bus stop is located at

Definition at line 56 of file MSBusStop.cpp.

References MSBusStop::myLane.

Referenced by MSNet::getBusStopID(), and MSRouteHandler::myStartElement().

00056                                  {
00057     return myLane;
00058 }

SUMOReal MSBusStop::getLastFreePos (  )  const throw () [inherited]

Returns the last free position on this stop.

Returns:
The last free position of this bus stop

Definition at line 81 of file MSBusStop.cpp.

References MSBusStop::myLastFreePos.

Referenced by MSVehicle::getBestLanes(), MSVehicle::processNextStop(), and MSVehicle::rebuildContinuationsFor().

00081                                         {
00082     return myLastFreePos;
00083 }

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

Returns the id of the object as known to microsim.

Returns:
The id of the bus stop
See also:
GUIGlObject::getMicrosimID

Implements GUIGlObject.

Definition at line 123 of file GUIBusStop.cpp.

References Named::getID().

Referenced by drawGL().

00123                                         {
00124     return getID();
00125 }

const std::vector< GUIGlObject_AbstractAdd * > & GUIGlObject_AbstractAdd::getObjectList (  )  [static, inherited]

Returns the list of all additional objects.

Definition at line 104 of file GUIGlObject_AbstractAdd.cpp.

References GUIGlObject_AbstractAdd::myObjectList.

Referenced by GUINet::initGUIStructures().

00104                                        {
00105     return myObjectList;
00106 }

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

Returns an own parameter window.

Bus stops have no parameter windows (yet).

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 (always 0 in this case)
See also:
GUIGlObject::getParameterWindow

Implements GUIGlObject.

Definition at line 116 of file GUIBusStop.cpp.

00117                                                               {
00118     return 0;
00119 }

GUIGLObjectPopupMenu * GUIBusStop::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 103 of file GUIBusStop.cpp.

References GUIGlObject::buildCenterPopupEntry(), GUIGlObject::buildNameCopyPopupEntry(), GUIGlObject::buildPopupHeader(), GUIGlObject::buildPositionCopyEntry(), and GUIGlObject::buildSelectionPopupEntry().

00104                                                               {
00105     GUIGLObjectPopupMenu *ret = new GUIGLObjectPopupMenu(app, parent, *this);
00106     buildPopupHeader(ret, app);
00107     buildCenterPopupEntry(ret);
00108     buildNameCopyPopupEntry(ret);
00109     buildSelectionPopupEntry(ret);
00110     buildPositionCopyEntry(ret, false);
00111     return ret;
00112 }

GUIGlObjectType GUIGlObject_AbstractAdd::getType (  )  const throw () [virtual, inherited]

Returns the type of the object as coded in GUIGlObjectType.

Returns:
The type of the object
See also:
GUIGlObjectType

Implements GUIGlObject.

Reimplemented in GUIDetectorWrapper.

Definition at line 76 of file GUIGlObject_AbstractAdd.cpp.

References GUIGlObject_AbstractAdd::myGlType.

00076                                                {
00077     return myGlType;
00078 }

void MSBusStop::leaveFrom ( void *  what  )  throw () [inherited]

Called if a vehicle leaves this stop.

Removes the position of the vehicle from myEndPositions.

Recomputes the free space using "computeLastFreePos" then.

Parameters:
[in] what The vehicle that leaves the bus stop
See also:
computeLastFreePos

Definition at line 87 of file MSBusStop.cpp.

References MSBusStop::computeLastFreePos(), and MSBusStop::myEndPositions.

00087                                        {
00088     assert(myEndPositions.find(what)!=myEndPositions.end());
00089     myEndPositions.erase(myEndPositions.find(what));
00090     computeLastFreePos();
00091 }


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 MSBusStop::myBegPos [protected, inherited]

The begin position this bus stop is located at.

Definition at line 154 of file MSBusStop.h.

Referenced by MSBusStop::getBeginLanePosition().

SUMOReal MSBusStop::myEndPos [protected, inherited]

The end position this bus stop is located at.

Definition at line 157 of file MSBusStop.h.

Referenced by MSBusStop::computeLastFreePos(), and MSBusStop::getEndLanePosition().

std::map<void*, std::pair<SUMOReal, SUMOReal> > MSBusStop::myEndPositions [protected, inherited]

A map from objects (vehicles) to the areas they acquire after entering the stop.

Definition at line 148 of file MSBusStop.h.

Referenced by MSBusStop::computeLastFreePos(), MSBusStop::enter(), and MSBusStop::leaveFrom().

The shape.

Definition at line 148 of file GUIBusStop.h.

Referenced by drawGL(), and getCenteringBoundary().

The lengths of the shape parts.

Definition at line 145 of file GUIBusStop.h.

Referenced by drawGL().

The rotations of the shape parts.

Definition at line 142 of file GUIBusStop.h.

Referenced by drawGL().

The position of the sign.

Definition at line 151 of file GUIBusStop.h.

Referenced by drawGL().

SUMOReal GUIBusStop::myFGSignRot [private]

The rotation of the sign.

Definition at line 154 of file GUIBusStop.h.

Referenced by drawGL().

The object's type.

Definition at line 85 of file GUIGlObject_AbstractAdd.h.

Referenced by GUIGlObject_AbstractAdd::getType().

std::string Named::myID [protected, inherited]

MSLane& MSBusStop::myLane [protected, inherited]

The lane this bus stop is located at.

Definition at line 151 of file MSBusStop.h.

Referenced by MSBusStop::getLane().

SUMOReal MSBusStop::myLastFreePos [protected, inherited]

The last free position at this stop (variable).

Definition at line 160 of file MSBusStop.h.

Referenced by MSBusStop::computeLastFreePos(), and MSBusStop::getLastFreePos().

std::vector<std::string> MSBusStop::myLines [protected, inherited]

The list of lines that are assigned to this stop.

Definition at line 145 of file MSBusStop.h.

Referenced by drawGL().

std::vector< GUIGlObject_AbstractAdd * > GUIGlObject_AbstractAdd::myObjectList [static, protected, inherited]

The list of all addtional objects currently loaded.

Definition at line 92 of file GUIGlObject_AbstractAdd.h.

Referenced by GUIGlObject_AbstractAdd::clearDictionary(), GUIGlObject_AbstractAdd::getIDList(), and GUIGlObject_AbstractAdd::getObjectList().

std::map< std::string, GUIGlObject_AbstractAdd * > GUIGlObject_AbstractAdd::myObjects [static, protected, inherited]

Map from names of loaded additional objects to the objects themselves.

Definition at line 89 of file GUIGlObject_AbstractAdd.h.

Referenced by GUIGlObject_AbstractAdd::clearDictionary(), and GUIGlObject_AbstractAdd::get().


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

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