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

#include <GUIJunctionWrapper.h>

Inheritance diagram for GUIJunctionWrapper:
GUIGlObject

Public Member Functions

virtual void drawGLAdditional (GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
 Draws additional, user-triggered visualisations.
void drawName (const Position &pos, const SUMOReal scale, const GUIVisualizationTextSettings &settings, const SUMOReal angle=0) const
Boundary getBoundary () const
 Returns the boundary of the junction.
const MSJunctiongetJunction () const
 Returns the represented junction.
 GUIJunctionWrapper (MSJunction &junction)
 Constructor.
bool isInner () const
 whether this is an inner junction (a waiting spot for crossing a "real" junction)
virtual ~GUIJunctionWrapper ()
 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.
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.

Private Member Functions

 GUIJunctionWrapper (const GUIJunctionWrapper &)
 Invalidated copy constructor.
GUIJunctionWrapperoperator= (const GUIJunctionWrapper &)
 Invalidated assignment operator.

Private Attributes

Boundary myBoundary
 The represented junction's boundary.
bool myIsInner
 whether this wraps an instance of MSInternalJunction
MSJunctionmyJunction
 A reference to the represented junction.
SUMOReal myMaxSize
 The maximum size (in either x-, or y-dimension) for determining whether to draw or not.

Detailed Description

As MSJunctions do not have a graphical representation but a complex inheritance tree, this class is used to encapsulate the geometry of an abstract junction and to be used as a gl-object.

In the case the represented junction's shape is empty, the boundary is computed using the junction's position to which an offset of 1m to each side is added.

Definition at line 68 of file GUIJunctionWrapper.h.

Constructor & Destructor Documentation

GUIJunctionWrapper::GUIJunctionWrapper ( MSJunction junction)

Constructor.

Parameters
in,changed]idStorage The storage to retrieve the gl-id from
[in]junctionThe represented junction

Definition at line 65 of file GUIJunctionWrapper.cpp.

References PositionVector::getBoxBoundary(), Boundary::getHeight(), MSJunction::getPosition(), MSJunction::getShape(), Boundary::getWidth(), MAX2(), myBoundary, myIsInner, myJunction, myMaxSize, Position::x(), and Position::y().

GUIJunctionWrapper::~GUIJunctionWrapper ( )
virtual

Destructor.

Definition at line 83 of file GUIJunctionWrapper.cpp.

GUIJunctionWrapper::GUIJunctionWrapper ( const GUIJunctionWrapper )
private

Invalidated copy constructor.

Member Function Documentation

void GUIGlObject::addParameterTable ( GUIParameterTableWindow w)
inherited

Lets this object know a parameter window showing the object's values was opened.

Parameters
[in]wThe opened parameter window

Definition at line 187 of file GUIGlObject.cpp.

References GUIGlObject::myParamWindows.

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

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

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

Definition at line 134 of file GUIGlObject.cpp.

References MID_COPY_NAME, and MID_COPY_TYPED_NAME.

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

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

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

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

Definition at line 166 of file GUIGlObject.cpp.

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

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

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

Builds an entry which allows to open the manipulator window.

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

Definition at line 178 of file GUIGlObject.cpp.

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

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

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

Builds an entry which allows to open the parameter window.

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

Definition at line 157 of file GUIGlObject.cpp.

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

Referenced by GUIDetectorWrapper::getPopUpMenu(), GUIPerson::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUICalibrator::getPopUpMenu(), GUIVehicle::getPopUpMenu(), GUIBusStop::getPopUpMenu(), GUIEdge::getPopUpMenu(), GUINet::getPopUpMenu(), and GUILane::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, and GUIPerson.

Definition at line 182 of file GUIGlObject.h.

References UNUSED_PARAMETER.

Boundary GUIJunctionWrapper::getBoundary ( ) const
inline

Returns the boundary of the junction.

Returns
This junction's boundary

Definition at line 125 of file GUIJunctionWrapper.h.

References myBoundary.

Referenced by GUINet::initGUIStructures().

Boundary GUIJunctionWrapper::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 107 of file GUIJunctionWrapper.cpp.

References Boundary::grow(), and myBoundary.

const MSJunction& GUIJunctionWrapper::getJunction ( ) const
inline

Returns the represented junction.

Returns
The junction itself

Definition at line 137 of file GUIJunctionWrapper.h.

References myJunction.

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

GUIParameterTableWindow * GUIJunctionWrapper::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 100 of file GUIJunctionWrapper.cpp.

GUIGLObjectPopupMenu * GUIJunctionWrapper::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 87 of file GUIJunctionWrapper.cpp.

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

bool GUIJunctionWrapper::isInner ( ) const
inline

whether this is an inner junction (a waiting spot for crossing a "real" junction)

Definition at line 130 of file GUIJunctionWrapper.h.

References myIsInner.

GUIJunctionWrapper& GUIJunctionWrapper::operator= ( const GUIJunctionWrapper )
private

Invalidated assignment operator.

void GUIGlObject::removeParameterTable ( GUIParameterTableWindow w)
inherited

Lets this object know a parameter window showing the object's values was closed.

Parameters
[in]wThe closed parameter window

Definition at line 193 of file GUIGlObject.cpp.

References GUIGlObject::myParamWindows.

Referenced by GUIParameterTableWindow::~GUIParameterTableWindow().

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

Changes the microsimID of the object (happens in NETEDIT)

Definition at line 108 of file GUIGlObject.cpp.

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

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

Field Documentation

Boundary GUIJunctionWrapper::myBoundary
private

The represented junction's boundary.

Definition at line 158 of file GUIJunctionWrapper.h.

Referenced by getBoundary(), getCenteringBoundary(), and GUIJunctionWrapper().

bool GUIJunctionWrapper::myIsInner
private

whether this wraps an instance of MSInternalJunction

Definition at line 161 of file GUIJunctionWrapper.h.

Referenced by drawGL(), GUIJunctionWrapper(), and isInner().

MSJunction& GUIJunctionWrapper::myJunction
private

A reference to the represented junction.

Definition at line 152 of file GUIJunctionWrapper.h.

Referenced by drawGL(), getJunction(), and GUIJunctionWrapper().

SUMOReal GUIJunctionWrapper::myMaxSize
private

The maximum size (in either x-, or y-dimension) for determining whether to draw or not.

Definition at line 155 of file GUIJunctionWrapper.h.

Referenced by drawGL(), and GUIJunctionWrapper().

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: