SUMO - Simulation of Urban MObility
|
#include <GUIJunctionWrapper.h>
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 MSJunction & | getJunction () 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 | |
GUIGLObjectPopupMenu * | getPopUpMenu (GUIMainWindow &app, GUISUMOAbstractView &parent) |
Returns an own popup-menu. | |
GUIParameterTableWindow * | getParameterWindow (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. | |
Protected Attributes | |
Boundary | myBoundary |
The represented junction's boundary. | |
MSJunction & | myJunction |
A reference to the represented junction. | |
SUMOReal | myMaxSize |
The maximum size (in either x-, or y-dimension) for determining whether to draw or not. | |
Private Member Functions | |
GUIJunctionWrapper (const GUIJunctionWrapper &) | |
Invalidated copy constructor. | |
GUIJunctionWrapper & | operator= (const GUIJunctionWrapper &) |
Invalidated assignment operator. | |
Private Attributes | |
bool | myIsInner |
whether this wraps an instance of MSInternalJunction |
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 63 of file GUIJunctionWrapper.h.
GUIJunctionWrapper::GUIJunctionWrapper | ( | MSJunction & | junction | ) |
Constructor.
in,changed] | idStorage The storage to retrieve the gl-id from | |
[in] | junction | The represented junction |
Definition at line 67 of file GUIJunctionWrapper.cpp.
References PositionVector::getBoxBoundary(), Boundary::getHeight(), MSJunction::getPosition(), MSJunction::getShape(), Boundary::getWidth(), MAX2(), myBoundary, myIsInner, myJunction, myMaxSize, PositionVector::size(), Position::x(), and Position::y().
GUIJunctionWrapper::~GUIJunctionWrapper | ( | ) | [virtual] |
Destructor.
Definition at line 85 of file GUIJunctionWrapper.cpp.
GUIJunctionWrapper::GUIJunctionWrapper | ( | const GUIJunctionWrapper & | ) | [private] |
Invalidated copy constructor.
void GUIGlObject::addParameterTable | ( | GUIParameterTableWindow * | w | ) | [inherited] |
Lets this object know a parameter window showing the object's values was opened.
[in] | w | The opened parameter window |
Definition at line 191 of file GUIGlObject.cpp.
References GUIGlObject::myParamWindows.
void GUIGlObject::buildCenterPopupEntry | ( | GUIGLObjectPopupMenu * | ret, |
bool | addSeparator = true |
||
) | [protected, inherited] |
Builds an entry which allows to center to the object.
in,filled] | ret The popup menu to add the entry to | |
[in] | addSeparator | Whether a separator shall be added, too |
Definition at line 129 of file GUIGlObject.cpp.
References GUIIconSubSys::getIcon(), ICON_RECENTERVIEW, and MID_CENTER.
Referenced by GUIDetectorWrapper::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), getPopUpMenu(), GUILaneWrapper::getPopUpMenu(), GUIVehicle::getPopUpMenu(), GUIBusStop::getPopUpMenu(), GUIEdge::getPopUpMenu(), and GUINet::getPopUpMenu().
void GUIGlObject::buildNameCopyPopupEntry | ( | GUIGLObjectPopupMenu * | ret, |
bool | addSeparator = true |
||
) | [protected, inherited] |
Builds entries which allow to copy the name / typed name into the clipboard.
in,filled] | ret The popup menu to add the entry to | |
[in] | addSeparator | Whether a separator shall be added, too |
Definition at line 138 of file GUIGlObject.cpp.
References MID_COPY_NAME, and MID_COPY_TYPED_NAME.
Referenced by GUIDetectorWrapper::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), getPopUpMenu(), GUILaneWrapper::getPopUpMenu(), GUIVehicle::getPopUpMenu(), GUIBusStop::getPopUpMenu(), and GUIEdge::getPopUpMenu().
void GUIGlObject::buildPopupHeader | ( | GUIGLObjectPopupMenu * | ret, |
GUIMainWindow & | app, | ||
bool | addSeparator = true |
||
) | [protected, inherited] |
Builds the header.
in,filled] | ret The popup menu to add the entry to | |
[in] | addSeparator | Whether a separator shall be added, too |
Definition at line 119 of file GUIGlObject.cpp.
References GUIMainWindow::getBoldFont(), and GUIGlObject::getFullName().
Referenced by GUIDetectorWrapper::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), getPopUpMenu(), GUILaneWrapper::getPopUpMenu(), GUIVehicle::getPopUpMenu(), GUIBusStop::getPopUpMenu(), GUIEdge::getPopUpMenu(), and GUINet::getPopUpMenu().
void GUIGlObject::buildPositionCopyEntry | ( | GUIGLObjectPopupMenu * | ret, |
bool | addSeparator = true |
||
) | [protected, inherited] |
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
in,filled] | ret The popup menu to add the entry to | |
[in] | addSeparator | Whether a separator shall be added, too |
Definition at line 170 of file GUIGlObject.cpp.
References GeoConvHelper::getFinal(), MID_COPY_CURSOR_GEOPOSITION, and MID_COPY_CURSOR_POSITION.
Referenced by GUIDetectorWrapper::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), getPopUpMenu(), GUILaneWrapper::getPopUpMenu(), GUIVehicle::getPopUpMenu(), GUIBusStop::getPopUpMenu(), GUIEdge::getPopUpMenu(), and GUINet::getPopUpMenu().
void GUIGlObject::buildSelectionPopupEntry | ( | GUIGLObjectPopupMenu * | ret, |
bool | addSeparator = true |
||
) | [protected, inherited] |
Builds an entry which allows to (de)select the object.
in,filled] | ret The popup menu to add the entry to | |
[in] | addSeparator | Whether a separator shall be added, too |
Definition at line 148 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 GUIDetectorWrapper::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), getPopUpMenu(), GUILaneWrapper::getPopUpMenu(), GUIVehicle::getPopUpMenu(), GUIBusStop::getPopUpMenu(), and GUIEdge::getPopUpMenu().
void GUIGlObject::buildShowManipulatorPopupEntry | ( | GUIGLObjectPopupMenu * | ret, |
bool | addSeparator = true |
||
) | [protected, inherited] |
Builds an entry which allows to open the manipulator window.
in,filled] | ret The popup menu to add the entry to | |
[in] | addSeparator | Whether a separator shall be added, too |
Definition at line 182 of file GUIGlObject.cpp.
References GUIIconSubSys::getIcon(), ICON_MANIP, and MID_MANIP.
Referenced by GUITriggeredRerouter::getPopUpMenu(), and GUILaneSpeedTrigger::getPopUpMenu().
void GUIGlObject::buildShowParamsPopupEntry | ( | GUIGLObjectPopupMenu * | ret, |
bool | addSeparator = true |
||
) | [protected, inherited] |
Builds an entry which allows to open the parameter window.
in,filled] | ret The popup menu to add the entry to | |
[in] | addSeparator | Whether a separator shall be added, too |
Definition at line 161 of file GUIGlObject.cpp.
References GUIIconSubSys::getIcon(), ICON_APP_TABLE, and MID_SHOWPARS.
Referenced by GUIDetectorWrapper::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUILaneWrapper::getPopUpMenu(), GUIVehicle::getPopUpMenu(), GUIEdge::getPopUpMenu(), and GUINet::getPopUpMenu().
void GUIJunctionWrapper::drawGL | ( | const GUIVisualizationSettings & | s | ) | const [virtual] |
Draws the object.
[in] | s | The settings for the current view (may influence drawing) |
Implements GUIGlObject.
Definition at line 117 of file GUIJunctionWrapper.cpp.
References GLHelper::drawFilledPoly(), GUIGlObject::drawName(), GUIGlObject::getGlID(), MSJunction::getPosition(), MSJunction::getShape(), GUIGlObject::getType(), GUIVisualizationSettings::internalJunctionName, GUIVisualizationSettings::junctionName, myIsInner, myJunction, myMaxSize, and GUIVisualizationSettings::scale.
virtual void GUIGlObject::drawGLAdditional | ( | GUISUMOAbstractView *const | parent, |
const GUIVisualizationSettings & | s | ||
) | const [inline, virtual, inherited] |
Draws additional, user-triggered visualisations.
[in] | parent | The view |
[in] | s | The settings for the current view (may influence drawing) |
Reimplemented in GUIVehicle.
Definition at line 182 of file GUIGlObject.h.
References UNUSED_PARAMETER.
void GUIGlObject::drawName | ( | const Position & | pos, |
const SUMOReal | scale, | ||
const GUIVisualizationTextSettings & | settings, | ||
const SUMOReal | angle = 0 |
||
) | const [inherited] |
Definition at line 218 of file GUIGlObject.cpp.
References GUIVisualizationTextSettings::color, GLHelper::drawText(), GUIGlObject::getMicrosimID(), GLO_MAX, GUIVisualizationTextSettings::show, and GUIVisualizationTextSettings::size.
Referenced by GUIPointOfInterest::drawGL(), GUILaneSpeedTrigger::drawGL(), drawGL(), GUIVehicle::drawGL(), GUIBusStop::drawGL(), and GUIEdge::drawGL().
Boundary GUIJunctionWrapper::getBoundary | ( | ) | const [inline] |
Returns the boundary of the junction.
Definition at line 120 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.
Implements GUIGlObject.
Definition at line 109 of file GUIJunctionWrapper.cpp.
References Boundary::grow(), and myBoundary.
const std::string& GUIGlObject::getFullName | ( | ) | const [inline, inherited] |
Returns the full name appearing in the tool tip.
Definition at line 107 of file GUIGlObject.h.
References GUIGlObject::myFullName.
Referenced by GUIGlObject::buildPopupHeader(), GUIGlObject_AbstractAdd::GUIGlObject_AbstractAdd(), GUIGLObjectPopupMenu::onCmdCopyTypedName(), GUIParam_PopupMenuInterface::onCmdOpenTracker(), GUITriggeredRerouter::openManipulator(), GUILaneSpeedTrigger::openManipulator(), GUIDialog_GLChosenEditor::rebuildList(), GUISelectedStorage::save(), and GUISUMOAbstractView::showToolTipFor().
GUIGlID GUIGlObject::getGlID | ( | ) | const [inline, inherited] |
Returns the numerical id of the object.
Definition at line 115 of file GUIGlObject.h.
References GUIGlObject::myGlID.
Referenced by GUIGlObject::buildSelectionPopupEntry(), GUINet::createTLWrapper(), GUIPolygon::drawGL(), GUIPointOfInterest::drawGL(), GUITriggeredRerouter::drawGL(), GUILaneSpeedTrigger::drawGL(), drawGL(), GUILaneWrapper::drawGL(), GUIVehicle::drawGL(), GUIBusStop::drawGL(), GUIEdge::drawGL(), GUIVehicle::drawGLAdditional(), GUILaneWrapper::getColorValue(), GUIEdge::getIDs(), GUISUMOAbstractView::getObjectAtPosition(), GUIVehicle::getPopUpMenu(), GUIDialog_GLObjChooser::GUIDialog_GLObjChooser(), GUIGlChildWindow::isSelected(), GUISUMOViewParent::isSelected(), GUISelectedStorage::loadIDs(), GUIGLObjectPopupMenu::onCmdAddSelected(), GUIGLObjectPopupMenu::onCmdCenter(), GUIGLObjectPopupMenu::onCmdRemoveSelected(), GUIVehicle::GUIVehiclePopupMenu::onCmdStartTrack(), GUISUMOAbstractView::removeAdditionalGLVisualisation(), GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::removeObject(), GUILaneWrapper::ROWdrawAction_drawLinkRules(), and GUIGlObject::~GUIGlObject().
const MSJunction& GUIJunctionWrapper::getJunction | ( | ) | const [inline] |
Returns the represented junction.
Definition at line 132 of file GUIJunctionWrapper.h.
References myJunction.
const std::string& GUIGlObject::getMicrosimID | ( | ) | const [inline, inherited] |
Returns the id of the object as known to microsim.
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.
[in] | app | The application needed to build the parameter window |
[in] | parent | The parent window needed to build the parameter window |
Implements GUIGlObject.
Definition at line 102 of file GUIJunctionWrapper.cpp.
GUIGLObjectPopupMenu * GUIJunctionWrapper::getPopUpMenu | ( | GUIMainWindow & | app, |
GUISUMOAbstractView & | parent | ||
) | [virtual] |
Returns an own popup-menu.
[in] | app | The application needed to build the popup-menu |
[in] | parent | The parent window needed to build the popup-menu |
Implements GUIGlObject.
Definition at line 89 of file GUIJunctionWrapper.cpp.
References GUIGlObject::buildCenterPopupEntry(), GUIGlObject::buildNameCopyPopupEntry(), GUIGlObject::buildPopupHeader(), GUIGlObject::buildPositionCopyEntry(), and GUIGlObject::buildSelectionPopupEntry().
GUIGlObjectType GUIGlObject::getType | ( | ) | const [inline, inherited] |
Returns the type of the object as coded in GUIGlObjectType.
Definition at line 159 of file GUIGlObject.h.
References GUIGlObject::myGLObjectType.
Referenced by GUIGlObject::buildSelectionPopupEntry(), GUITriggeredRerouter::drawGL(), GUILaneSpeedTrigger::drawGL(), drawGL(), GUILaneWrapper::drawGL(), GUIVehicle::drawGL(), GUIBusStop::drawGL(), GUIVehicle::drawGLAdditional(), GUILaneWrapper::getColorValue(), GUISUMOAbstractView::getObjectAtPosition(), GUIGlChildWindow::isSelected(), GUISUMOViewParent::isSelected(), GUISelectedStorage::loadIDs(), and GUISelectedStorage::toggleSelection().
bool GUIJunctionWrapper::isInner | ( | ) | const [inline] |
whether this is an inner junction (a waiting spot for crossing a "real" junction)
Definition at line 125 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.
[in] | w | The closed parameter window |
Definition at line 197 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 112 of file GUIGlObject.cpp.
References GUIGlObject::createFullName(), GUIGlObject::myFullName, and GUIGlObject::myMicrosimID.
void GUIGlObject::setPrefix | ( | const std::string & | prefix | ) | [protected, inherited] |
Definition at line 206 of file GUIGlObject.cpp.
References GUIGlObject::createFullName(), GUIGlObject::myFullName, and GUIGlObject::myPrefix.
Boundary GUIJunctionWrapper::myBoundary [protected] |
The represented junction's boundary.
Definition at line 145 of file GUIJunctionWrapper.h.
Referenced by getBoundary(), getCenteringBoundary(), and GUIJunctionWrapper().
bool GUIJunctionWrapper::myIsInner [private] |
whether this wraps an instance of MSInternalJunction
Definition at line 156 of file GUIJunctionWrapper.h.
Referenced by drawGL(), GUIJunctionWrapper(), and isInner().
MSJunction& GUIJunctionWrapper::myJunction [protected] |
A reference to the represented junction.
Definition at line 139 of file GUIJunctionWrapper.h.
Referenced by drawGL(), getJunction(), and GUIJunctionWrapper().
SUMOReal GUIJunctionWrapper::myMaxSize [protected] |
The maximum size (in either x-, or y-dimension) for determining whether to draw or not.
Definition at line 142 of file GUIJunctionWrapper.h.
Referenced by drawGL(), and GUIJunctionWrapper().
StringBijection< GUIGlObjectType > GUIGlObject::TypeNames [static, inherited] |
associates object types with strings
Definition at line 99 of file GUIGlObject.h.