SUMO - Simulation of Urban MObility
GUIContainer Class Reference

#include <GUIContainer.h>

Inheritance diagram for GUIContainer:
MSContainer GUIGlObject

Data Structures

class  GUIContainerPopupMenu
 

Public Types

typedef std::vector< MSContainerStage * > MSContainerPlan
 the structure holding the plan of a container More...
 
enum  StageType { DRIVING = 0, WAITING = 1, TRANSHIP = 2 }
 

Public Member Functions

void drawName (const Position &pos, const SUMOReal scale, const GUIVisualizationTextSettings &settings, const SUMOReal angle=0) const
 
MSContainerStagegetCurrentStage () const
 Return the current stage. More...
 
std::string getCurrentStageDescription () const
 Returns the current stage description as a string. More...
 
StageType getCurrentStageType () const
 the current stage type of the container More...
 
virtual MSContainerStopgetDepartContainerStop () const
 
SUMOTime getDesiredDepart () const
 Returns the desired departure time. More...
 
const MSEdgegetDestination () const
 Returns the current destination. More...
 
const MSEdgegetEdge () const
 Returns the current edge. More...
 
const MSEdgegetFromEdge () const
 Returns the departure edge. More...
 
const std::string & getID () const
 returns the container id More...
 
const MSEdgegetNextDestination () const
 Returns the destination after the current destination. More...
 
const SUMOVehicleParametergetParameter () const
 
const MSVehicleTypegetVehicleType () const
 
 GUIContainer (const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSContainer::MSContainerPlan *plan)
 Constructor. More...
 
bool isWaiting4Vehicle () const
 Whether the container waits for a vehicle. More...
 
bool isWaitingFor (const std::string &line) const
 Whether the container waits for a vehicle of the line specified. More...
 
bool proceed (MSNet *net, SUMOTime time)
 
void routeOutput (OutputDevice &os) const
 Called on writing vehroute output. More...
 
void setDeparted (SUMOTime now)
 logs depart time of the current stage More...
 
void setPositionInVehicle (const Position &pos)
 
void tripInfoOutput (OutputDevice &os) const
 Called on writing tripinfo output. More...
 
 ~GUIContainer ()
 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...
 
virtual void drawGLAdditional (GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
 Draws additionally triggered visualisations. More...
 
inherited from MSContainer with added locking
SUMOReal getEdgePos () const
 return the offset from the start of the current edge More...
 
Position getPosition () const
 return the Network coordinate of the container More...
 
SUMOReal getAngle () const
 return the current angle of the container More...
 
SUMOReal getWaitingSeconds () const
 the time this container spent waiting in seconds More...
 
SUMOReal getSpeed () const
 the current speed of the container 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...
 

Data Fields

const MSEdgelastDestination
 the last destination of the route of the container More...
 
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
 Enabled visualisations, per view. More...
 

Static Public Attributes

static const SUMOReal ROADSIDE_OFFSET
 the offset for computing container positions when standing at an edge More...
 
static StringBijection< GUIGlObjectTypeTypeNames
 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...
 

Protected Attributes

const SUMOVehicleParametermyParameter
 the plan of the container More...
 
MSContainerPlanmyPlan
 the plan of the container More...
 
MSContainerPlan::iterator myStep
 the iterator over the route More...
 
const MSVehicleTypemyVType
 This container's type. (mainly used for drawing related information Note sure if it is really necessary. More...
 
bool myWriteEvents
 Whether events shall be written. More...
 

Private Member Functions

SUMOReal getColorValue (size_t activeScheme) const
 gets the color value according to the current scheme index More...
 
void setColor (const GUIVisualizationSettings &s) const
 sets the color according to the currente settings More...
 
bool setFunctionalColor (size_t activeScheme) const
 sets the color according to the current scheme index and some vehicle function More...
 
drawing helper methods
void drawAction_drawAsPoly (const GUIVisualizationSettings &s) const
 
void drawAction_drawAsImage (const GUIVisualizationSettings &s) const
 

Private Attributes

MFXMutex myLock
 The mutex used to avoid concurrent updates of the vehicle buffer. More...
 
Position myPositionInVehicle
 The position of a container while riding a vehicle. More...
 

Detailed Description

Definition at line 59 of file GUIContainer.h.

Member Typedef Documentation

typedef std::vector<MSContainerStage*> MSContainer::MSContainerPlan
inherited

the structure holding the plan of a container

Definition at line 553 of file MSContainer.h.

Member Enumeration Documentation

enum MSContainer::StageType
inherited
Enumerator
DRIVING 
WAITING 
TRANSHIP 

Definition at line 71 of file MSContainer.h.

Constructor & Destructor Documentation

GUIContainer::GUIContainer ( const SUMOVehicleParameter pars,
const MSVehicleType vtype,
MSContainer::MSContainerPlan plan 
)

Constructor.

Definition at line 110 of file GUIContainer.cpp.

GUIContainer::~GUIContainer ( )

destructor

Definition at line 116 of file GUIContainer.cpp.

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

References GUIGlObject::myParamWindows.

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

Builds an entry which allows to open the manipulator window.

Parameters

Definition at line 179 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
void GUIContainer::drawAction_drawAsPoly ( const GUIVisualizationSettings s) const
private
void GUIContainer::drawGLAdditional ( GUISUMOAbstractView *const  parent,
const GUIVisualizationSettings s 
) const
virtual

Draws additionally triggered visualisations.

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

Reimplemented from GUIGlObject.

Definition at line 197 of file GUIContainer.cpp.

References GUIGlObject::getGlID().

SUMOReal GUIContainer::getAngle ( ) const
virtual

return the current angle of the container

Reimplemented from MSContainer.

Definition at line 345 of file GUIContainer.cpp.

References MSContainer::getAngle(), and myLock.

Referenced by drawAction_drawAsPoly(), getParameterWindow(), and setFunctionalColor().

Boundary GUIContainer::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 157 of file GUIContainer.cpp.

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

SUMOReal GUIContainer::getColorValue ( size_t  activeScheme) const
private

gets the color value according to the current scheme index

Definition at line 303 of file GUIContainer.cpp.

References MSContainer::getCurrentStageType(), GUIGlObject::getGlID(), getSpeed(), getWaitingSeconds(), GLO_CONTAINER, gSelected, GUISelectedStorage::isSelected(), MSContainer::isWaiting4Vehicle(), and SUMOReal.

Referenced by setColor().

MSContainerStage* MSContainer::getCurrentStage ( ) const
inlineinherited

Return the current stage.

Definition at line 641 of file MSContainer.h.

References MSContainer::myStep.

Referenced by MSEdge::container_by_position_sorter::operator()().

std::string MSContainer::getCurrentStageDescription ( ) const
inlineinherited

Returns the current stage description as a string.

Definition at line 636 of file MSContainer.h.

Referenced by getParameterWindow().

StageType MSContainer::getCurrentStageType ( ) const
inlineinherited

the current stage type of the container

Definition at line 631 of file MSContainer.h.

Referenced by getColorValue(), and getPosition().

MSContainerStop * MSContainer::getDepartContainerStop ( ) const
virtualinherited

Definition at line 540 of file MSContainer.cpp.

SUMOTime MSContainer::getDesiredDepart ( ) const
inherited

Returns the desired departure time.

Definition at line 505 of file MSContainer.cpp.

References SUMOVehicleParameter::depart, and MSContainer::myParameter.

Referenced by MSContainerControl::erase(), and MSContainer::routeOutput().

SUMOReal GUIContainer::getEdgePos ( ) const
virtual

return the offset from the start of the current edge

Reimplemented from MSContainer.

Definition at line 323 of file GUIContainer.cpp.

References MSContainer::getEdgePos(), and myLock.

Referenced by getParameterWindow(), and getPosition().

const MSEdge* MSContainer::getFromEdge ( ) const
inlineinherited

Returns the departure edge.

Definition at line 611 of file MSContainer.h.

Referenced by getParameterWindow(), and MSContainer::MSContainerStage_Driving::routeOutput().

GUIGlID GUIGlObject::getGlID ( ) const
inlineinherited

Returns the numerical id of the object.

Returns
This object's gl-id

Definition at line 115 of file GUIGlObject.h.

References GUIGlObject::myGlID.

Referenced by GUIGlObject::buildSelectionPopupEntry(), GUINet::createTLWrapper(), drawGL(), GUIPerson::drawGL(), GUIPolygon::drawGL(), GUILaneSpeedTrigger::drawGL(), GUICalibrator::drawGL(), GUIPointOfInterest::drawGL(), GUIJunctionWrapper::drawGL(), GUIVehicle::drawGL(), GUIContainerStop::drawGL(), GUIBusStop::drawGL(), GUIEdge::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GUILane::drawGL(), drawGLAdditional(), GUIPerson::drawGLAdditional(), GUIVehicle::drawGLAdditional(), GUILane::drawLinkRule(), GUIJunctionWrapper::getColorValue(), getColorValue(), GUIPerson::getColorValue(), GUILane::getColorValue(), GUIVehicle::getColorValue(), GUIEdge::getIDs(), GUISUMOAbstractView::getObjectAtPosition(), GUISUMOAbstractView::getObjectsAtPosition(), GUIVehicle::getPopUpMenu(), GUILane::getScaleValue(), GUIDialog_GLObjChooser::GUIDialog_GLObjChooser(), GUIGlChildWindow::isSelected(), GUISUMOViewParent::isSelected(), GUISelectedStorage::loadIDs(), GUIGLObjectPopupMenu::onCmdAddSelected(), GUIGLObjectPopupMenu::onCmdCenter(), GUIApplicationWindow::onCmdEditChosen(), GUIGLObjectPopupMenu::onCmdRemoveSelected(), GUIVehicle::GUIVehiclePopupMenu::onCmdStartTrack(), GUISUMOAbstractView::removeAdditionalGLVisualisation(), GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::removeObject(), GUIVehicle::selectBlockingFoes(), and GUIGlObject::~GUIGlObject().

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().

const MSEdge& MSContainer::getNextDestination ( ) const
inlineinherited

Returns the destination after the current destination.

Definition at line 601 of file MSContainer.h.

const SUMOVehicleParameter& MSContainer::getParameter ( ) const
inlineinherited

Definition at line 677 of file MSContainer.h.

References MSContainer::myParameter.

Referenced by setFunctionalColor().

GUIParameterTableWindow * GUIContainer::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 136 of file GUIContainer.cpp.

References GUIParameterTableWindow::closeBuilding(), getAngle(), MSContainer::getCurrentStageDescription(), MSContainer::getDestination(), MSContainer::getEdge(), getEdgePos(), MSContainer::getFromEdge(), MSContainer::getID(), getSpeed(), getWaitingSeconds(), and GUIParameterTableWindow::mkItem().

GUIGLObjectPopupMenu * GUIContainer::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 121 of file GUIContainer.cpp.

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

SUMOReal GUIContainer::getSpeed ( ) const
virtual

the current speed of the container

Reimplemented from MSContainer.

Definition at line 359 of file GUIContainer.cpp.

References MSContainer::getSpeed(), and myLock.

Referenced by getColorValue(), and getParameterWindow().

const MSVehicleType& MSContainer::getVehicleType ( ) const
inlineinherited
SUMOReal GUIContainer::getWaitingSeconds ( ) const
virtual

the time this container spent waiting in seconds

Reimplemented from MSContainer.

Definition at line 352 of file GUIContainer.cpp.

References MSContainer::getWaitingSeconds(), and myLock.

Referenced by getColorValue(), and getParameterWindow().

bool MSContainer::isWaiting4Vehicle ( ) const
inlineinherited
bool MSContainer::isWaitingFor ( const std::string &  line) const
inlineinherited

Whether the container waits for a vehicle of the line specified.

Definition at line 668 of file MSContainer.h.

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

References GUIGlObject::myParamWindows.

Referenced by GUIParameterTableWindow::~GUIParameterTableWindow().

void MSContainer::routeOutput ( OutputDevice os) const
inherited

Called on writing vehroute output.

Parameters
[in]osThe stream to write the information into
Exceptions
IOErrornot yet implemented

Definition at line 552 of file MSContainer.cpp.

References MSContainer::getDesiredDepart(), MSContainer::MSContainerStage_Waiting::getUntil(), MSContainer::myPlan, and MSContainer::WAITING.

Referenced by MSContainerControl::erase().

void GUIContainer::setColor ( const GUIVisualizationSettings s) const
private
void MSContainer::setDeparted ( SUMOTime  now)
inherited

logs depart time of the current stage

Definition at line 510 of file MSContainer.cpp.

bool GUIContainer::setFunctionalColor ( size_t  activeScheme) const
private

sets the color according to the current scheme index and some vehicle function

Definition at line 264 of file GUIContainer.cpp.

References RGBColor::fromHSV(), getAngle(), MSContainer::getParameter(), MSContainer::getVehicleType(), GLHelper::setColor(), SUMOReal, VEHPARS_COLOR_SET, and VTYPEPARS_COLOR_SET.

Referenced by setColor().

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

Changes the microsimID of the object (happens in NETEDIT)

Definition at line 109 of file GUIGlObject.cpp.

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

void GUIContainer::setPositionInVehicle ( const Position pos)
inline

Definition at line 118 of file GUIContainer.h.

References myPositionInVehicle.

Referenced by GUIVehicle::drawGL().

void GUIGlObject::setPrefix ( const std::string &  prefix)
protectedinherited
void MSContainer::tripInfoOutput ( OutputDevice os) const
inherited

Called on writing tripinfo output.

Parameters
[in]osThe stream to write the information into
Exceptions
IOErrornot yet implemented

Definition at line 545 of file MSContainer.cpp.

References MSContainer::myPlan.

Referenced by MSContainerControl::erase().

Field Documentation

const MSEdge* MSContainer::lastDestination
inherited

the last destination of the route of the container

Definition at line 556 of file MSContainer.h.

Referenced by MSContainer::MSContainer().

std::map<GUISUMOAbstractView*, int> GUIContainer::myAdditionalVisualizations

Enabled visualisations, per view.

Definition at line 181 of file GUIContainer.h.

Referenced by getPopUpMenu().

MFXMutex GUIContainer::myLock
mutableprivate

The mutex used to avoid concurrent updates of the vehicle buffer.

Definition at line 188 of file GUIContainer.h.

Referenced by getAngle(), getEdgePos(), getPosition(), getSpeed(), and getWaitingSeconds().

const SUMOVehicleParameter* MSContainer::myParameter
protectedinherited

the plan of the container

Definition at line 560 of file MSContainer.h.

Referenced by MSContainer::getDesiredDepart(), MSContainer::getID(), MSContainer::getParameter(), and MSContainer::~MSContainer().

MSContainerPlan* MSContainer::myPlan
protectedinherited
Position GUIContainer::myPositionInVehicle
private

The position of a container while riding a vehicle.

Definition at line 191 of file GUIContainer.h.

Referenced by getPosition(), and setPositionInVehicle().

MSContainerPlan::iterator MSContainer::myStep
protectedinherited

the iterator over the route

Definition at line 570 of file MSContainer.h.

Referenced by MSContainer::getCurrentStage(), MSContainer::MSContainer(), and MSContainer::proceed().

const MSVehicleType* MSContainer::myVType
protectedinherited

This container's type. (mainly used for drawing related information Note sure if it is really necessary.

Definition at line 564 of file MSContainer.h.

Referenced by MSContainer::getVehicleType().

bool MSContainer::myWriteEvents
protectedinherited

Whether events shall be written.

Definition at line 573 of file MSContainer.h.

const SUMOReal MSContainer::ROADSIDE_OFFSET
staticinherited

the offset for computing container positions when standing at an edge

Definition at line 78 of file MSContainer.h.

Referenced by MSContainer::MSContainerStage_Driving::getPosition(), and MSContainer::MSContainerStage_Waiting::getPosition().

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: