#include <GUIJunctionWrapper.h>

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 61 of file GUIJunctionWrapper.h.
Public Member Functions | |
| virtual bool | active () const throw () |
| Returns the information whether this object is still active. | |
| Boundary | getBoundary () const throw () |
| Returns the boundary of the junction. | |
| GUIJunctionWrapper (GUIGlObjectStorage &idStorage, MSJunction &junction) throw () | |
| Constructor. | |
| virtual | ~GUIJunctionWrapper () 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. | |
| GUIParameterTableWindow * | getParameterWindow (GUIMainWindow &app, GUISUMOAbstractView &parent) throw () |
| Returns an own parameter window. | |
| GUIGLObjectPopupMenu * | getPopUpMenu (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. | |
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 | |
| 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. | |
Friends | |
| class | GUIGlObjectStorage |
| Needed to set the id. | |
| GUIJunctionWrapper::GUIJunctionWrapper | ( | GUIGlObjectStorage & | idStorage, | |
| MSJunction & | junction | |||
| ) | throw () |
Constructor.
| in,changed] | idStorage The storage to retrieve the gl-id from | |
| [in] | junction | The represented junction |
Definition at line 54 of file GUIJunctionWrapper.cpp.
References MAX2(), Position2D::x(), and Position2D::y().
00056 : GUIGlObject(idStorage, "junction:"+junction.getID()), 00057 myJunction(junction) { 00058 if (myJunction.getShape().size()==0) { 00059 Position2D pos = myJunction.getPosition(); 00060 myBoundary = Boundary(pos.x()-1., pos.y()-1., pos.x()+1., pos.y()+1.); 00061 } else { 00062 myBoundary = myJunction.getShape().getBoxBoundary(); 00063 } 00064 myMaxSize = MAX2(myBoundary.getWidth(), myBoundary.getHeight()); 00065 }
| GUIJunctionWrapper::~GUIJunctionWrapper | ( | ) | throw () [virtual] |
| GUIJunctionWrapper::GUIJunctionWrapper | ( | const GUIJunctionWrapper & | ) | [private] |
Invalidated copy constructor.
| virtual bool GUIGlObject::active | ( | ) | const throw () [inline, virtual, inherited] |
Returns the information whether this object is still active.
Reimplemented in GUIVehicle.
Definition at line 171 of file GUIGlObject.h.
Referenced by GLObjectValuePassConnector< std::pair< int, MSPhaseDefinition > >::updateEachTimestep().
| void GUIGlObject::buildCenterPopupEntry | ( | GUIGLObjectPopupMenu * | ret, | |
| bool | addSeparator = true | |||
| ) | throw () [protected, inherited] |
Builds an entry which allows to center to the object.
| 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(), 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.
| 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(), 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.
| 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(), 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.
| 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(), 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.
| 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(), 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.
| 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.
| 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 GUIJunctionWrapper::drawGL | ( | const GUIVisualizationSettings & | s | ) | const throw () [virtual] |
Draws the object.
| [in] | s | The settings for the current view (may influence drawing) |
Implements GUIGlObject.
Definition at line 106 of file GUIJunctionWrapper.cpp.
References GLHelper::drawFilledPoly(), GUIGlObject::getGlID(), getMicrosimID(), MSJunction::getPosition(), MSJunction::getShape(), myJunction, myMaxSize, pfdkGetStringWidth(), pfDrawString(), pfSetPosition(), pfSetScale(), SUMOReal, Position2D::x(), and Position2D::y().
00106 { 00107 // check whether it is not too small 00108 if (s.scale*myMaxSize<1.) { 00109 return; 00110 } 00111 // (optional) set id 00112 if (s.needsGlID) { 00113 glPushName(getGlID()); 00114 } 00115 glColor3d(0, 0, 0); 00116 glTranslated(0, 0, .01); 00117 GLHelper::drawFilledPoly(myJunction.getShape(), true); 00118 glTranslated(0, 0, -.01); 00119 // (optional) draw name 00120 if (s.drawJunctionName) { 00121 glPushMatrix(); 00122 glTranslated(0, 0, -.06); 00123 Position2D p = myJunction.getPosition(); 00124 glTranslated(p.x(), p.y(), 0); 00125 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); 00126 pfSetPosition(0, 0); 00127 pfSetScale(s.junctionNameSize / s.scale); 00128 glColor3d(s.junctionNameColor.red(), s.junctionNameColor.green(), s.junctionNameColor.blue()); 00129 SUMOReal w = pfdkGetStringWidth(getMicrosimID().c_str()); 00130 glRotated(180, 1, 0, 0); 00131 glTranslated(-w/2., 0.4, 0); 00132 pfDrawString(getMicrosimID().c_str()); 00133 glPopMatrix(); 00134 } 00135 // (optional) clear id 00136 if (s.needsGlID) { 00137 glPopName(); 00138 } 00139 }
| Boundary GUIJunctionWrapper::getBoundary | ( | ) | const throw () [inline] |
Returns the boundary of the junction.
Definition at line 140 of file GUIJunctionWrapper.h.
References myBoundary.
Referenced by GUINet::initGUIStructures().
00140 { 00141 return myBoundary; 00142 }
| Boundary GUIJunctionWrapper::getCenteringBoundary | ( | ) | const throw () [virtual] |
Returns the boundary to which the view shall be centered in order to show the object.
Implements GUIGlObject.
Definition at line 98 of file GUIJunctionWrapper.cpp.
References Boundary::grow(), and myBoundary.
00098 { 00099 Boundary b = myBoundary; 00100 b.grow(20); 00101 return b; 00102 }
| const std::string& GUIGlObject::getFullName | ( | ) | const throw () [inline, inherited] |
Returns the full name appearing in the tool tip.
Definition at line 95 of file GUIGlObject.h.
References GUIGlObject::myFullName.
Referenced by GUIGlObject::buildPopupHeader(), GUIGLObjectPopupMenu::onCmdCopyTypedName(), GUIParam_PopupMenuInterface::onCmdOpenTracker(), GUIGLObjectToolTip::onPaint(), GUITriggeredRerouter::openManipulator(), GUILaneSpeedTrigger::openManipulator(), GUIEmitter::openManipulator(), GUIDialog_GLChosenEditor::rebuildList(), GUISelectedStorage::save(), and GUISelectedStorage::SingleTypeSelections::save().
00095 { 00096 return myFullName; 00097 }
| GLuint GUIGlObject::getGlID | ( | ) | const throw () [inline, inherited] |
Returns the numerical id of the object.
Definition at line 103 of file GUIGlObject.h.
References GUIGlObject::myGlID.
Referenced by GUIGlObject::buildSelectionPopupEntry(), GUIViewTraffic::drawBestLanes(), GUIVehicle::drawGL(), GUITriggeredRerouter::drawGL(), GUIPolygon2D::drawGL(), GUIPointOfInterest::drawGL(), GUILaneWrapper::drawGL(), GUILaneSpeedTrigger::drawGL(), drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUIEmitter::drawGL(), GUIE3Collector::MyWrapper::drawGL(), GUIBusStop::drawGL(), GUI_E2_ZS_Collector::MyWrapper::drawGL(), GUIViewTraffic::drawRoute(), FXIMPLEMENT(), GUILaneWrapper::Colorer::getColorValue(), GUISUMOAbstractView::getObjectUnderCursor(), GUIVehicle::getPopUpMenu(), GUIGLObjectPopupMenu::onCmdAddSelected(), GUIGLObjectPopupMenu::onCmdRemoveSelected(), GUIVehicle::GUIVehiclePopupMenu::onCmdStartTrack(), and ROWdrawAction_drawLinkRules().
00103 { 00104 return myGlID; 00105 }
| const std::string & GUIJunctionWrapper::getMicrosimID | ( | ) | const throw () [virtual] |
Returns the id of the object as known to microsim.
Implements GUIGlObject.
Definition at line 92 of file GUIJunctionWrapper.cpp.
References MSJunction::getID(), and myJunction.
Referenced by drawGL().
00092 { 00093 return myJunction.getID(); 00094 }
| GUIParameterTableWindow * GUIJunctionWrapper::getParameterWindow | ( | GUIMainWindow & | app, | |
| GUISUMOAbstractView & | parent | |||
| ) | throw () [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 85 of file GUIJunctionWrapper.cpp.
| GUIGLObjectPopupMenu * GUIJunctionWrapper::getPopUpMenu | ( | GUIMainWindow & | app, | |
| GUISUMOAbstractView & | parent | |||
| ) | throw () [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 72 of file GUIJunctionWrapper.cpp.
References GUIGlObject::buildCenterPopupEntry(), GUIGlObject::buildNameCopyPopupEntry(), GUIGlObject::buildPopupHeader(), GUIGlObject::buildPositionCopyEntry(), and GUIGlObject::buildSelectionPopupEntry().
00073 { 00074 GUIGLObjectPopupMenu *ret = new GUIGLObjectPopupMenu(app, parent, *this); 00075 buildPopupHeader(ret, app); 00076 buildCenterPopupEntry(ret); 00077 buildNameCopyPopupEntry(ret); 00078 buildSelectionPopupEntry(ret); 00079 buildPositionCopyEntry(ret, false); 00080 return ret; 00081 }
| GUIGlObjectType GUIJunctionWrapper::getType | ( | ) | const throw () [inline, virtual] |
Returns the type of the object as coded in GUIGlObjectType.
Implements GUIGlObject.
Definition at line 115 of file GUIJunctionWrapper.h.
References GLO_JUNCTION.
00115 { 00116 return GLO_JUNCTION; 00117 }
| GUIJunctionWrapper& GUIJunctionWrapper::operator= | ( | const GUIJunctionWrapper & | ) | [private] |
Invalidated assignment operator.
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.
Boundary GUIJunctionWrapper::myBoundary [protected] |
The represented junction's boundary.
Definition at line 153 of file GUIJunctionWrapper.h.
Referenced by getBoundary(), and getCenteringBoundary().
MSJunction& GUIJunctionWrapper::myJunction [protected] |
A reference to the represented junction.
Definition at line 147 of file GUIJunctionWrapper.h.
Referenced by drawGL(), and getMicrosimID().
SUMOReal GUIJunctionWrapper::myMaxSize [protected] |
The maximum size (in either x-, or y-dimension) for determining whether to draw or not.
Definition at line 150 of file GUIJunctionWrapper.h.
Referenced by drawGL().
1.5.6