#include <GUIGlObject.h>

Definition at line 57 of file GUIGlObject.h.
Public Member Functions | |
| virtual bool | active () const throw () |
| Returns the information whether this object is still active. | |
| GUIGlObject (std::string fullName, GLuint glID) throw () | |
| Constructor. | |
| GUIGlObject (GUIGlObjectStorage &idStorage, std::string fullName) throw () | |
| Constructor. | |
| virtual | ~GUIGlObject () throw () |
| Destructor. | |
interfaces to be implemented by derived classes | |
| virtual void | drawGL (const GUIVisualizationSettings &s) const =0 throw () |
| Draws the object. | |
| virtual Boundary | getCenteringBoundary () const =0 throw () |
| Returns the boundary to which the view shall be centered in order to show the object. | |
| virtual const std::string & | getMicrosimID () const =0 throw () |
| Returns the id of the object as known to microsim. | |
| virtual GUIParameterTableWindow * | getParameterWindow (GUIMainWindow &app, GUISUMOAbstractView &parent)=0 throw () |
| Returns an own parameter window. | |
| virtual GUIGLObjectPopupMenu * | getPopUpMenu (GUIMainWindow &app, GUISUMOAbstractView &parent)=0 throw () |
| Returns an own popup-menu. | |
| virtual GUIGlObjectType | getType () const =0 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. | |
Private Member Functions | |
| void | setGlID (GLuint id) throw () |
| Sets the id of the object. | |
Private Attributes | |
| std::string | myFullName |
| The name of the object. | |
| GLuint | myGlID |
| The numerical id of the object. | |
Friends | |
| class | GUIGlObjectStorage |
| Needed to set the id. | |
| GUIGlObject::GUIGlObject | ( | GUIGlObjectStorage & | idStorage, | |
| std::string | fullName | |||
| ) | throw () |
Constructor.
This is the standard constructor that assures that the object is known and its id is unique. Use it always :-)
| [in] | idStorage | The global storage of gl-ids, used to give a unique id |
| [in] | fullName | The complete name, including a type-prefix |
Definition at line 51 of file GUIGlObject.cpp.
00053 : myFullName(fullName) { 00054 idStorage.registerObject(this); 00055 }
| GUIGlObject::GUIGlObject | ( | std::string | fullName, | |
| GLuint | glID | |||
| ) | throw () |
Constructor.
This constructor should be used only for compound objects, that share visualization. Use it only if you know what you are doing.
| [in] | fullName | The complete name, including a type-prefix |
| [in] | glID | The id of this object |
Definition at line 58 of file GUIGlObject.cpp.
00059 : myFullName(fullName) { 00060 }
| GUIGlObject::~GUIGlObject | ( | ) | throw () [virtual] |
| virtual bool GUIGlObject::active | ( | ) | const throw () [inline, virtual] |
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] |
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(), GUIJunctionWrapper::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] |
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(), GUIJunctionWrapper::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] |
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 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 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] |
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(), GUIJunctionWrapper::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] |
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 getGlID(), GUIIconSubSys::getIcon(), 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 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] |
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] |
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 }
| virtual void GUIGlObject::drawGL | ( | const GUIVisualizationSettings & | s | ) | const throw () [pure virtual] |
Draws the object.
| [in] | s | The settings for the current view (may influence drawing) |
Implemented in GUI_E2_ZS_Collector::MyWrapper, GUI_E2_ZS_CollectorOverLanes::MyWrapper, GUIBusStop, GUIE3Collector::MyWrapper, GUIEdge, GUIEmitter, GUIInductLoop::MyWrapper, GUIJunctionWrapper, GUILaneSpeedTrigger, GUILaneWrapper, GUINet, GUITrafficLightLogicWrapper, GUITriggeredRerouter, GUIVehicle, GUIPointOfInterest, and GUIPolygon2D.
| virtual Boundary GUIGlObject::getCenteringBoundary | ( | ) | const throw () [pure virtual] |
Returns the boundary to which the view shall be centered in order to show the object.
Implemented in GUI_E2_ZS_Collector::MyWrapper, GUI_E2_ZS_CollectorOverLanes::MyWrapper, GUIBusStop, GUIE3Collector::MyWrapper, GUIEdge, GUIEmitter, GUIInductLoop::MyWrapper, GUIJunctionWrapper, GUILaneSpeedTrigger, GUILaneWrapper, GUINet, GUITrafficLightLogicWrapper, GUITriggeredRerouter, GUIVehicle, GUIPointOfInterest, and GUIPolygon2D.
Referenced by GUINet::initGUIStructures(), GUI_E2_ZS_CollectorOverLanes::MyWrapper::MyWrapper(), and GUISUMOAbstractView::paintGL().
| const std::string& GUIGlObject::getFullName | ( | ) | const throw () [inline] |
Returns the full name appearing in the tool tip.
Definition at line 95 of file GUIGlObject.h.
References myFullName.
Referenced by 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] |
Returns the numerical id of the object.
Definition at line 103 of file GUIGlObject.h.
References myGlID.
Referenced by buildSelectionPopupEntry(), GUIViewTraffic::drawBestLanes(), GUIVehicle::drawGL(), GUITriggeredRerouter::drawGL(), GUIPolygon2D::drawGL(), GUIPointOfInterest::drawGL(), GUILaneWrapper::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIJunctionWrapper::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 }
| virtual const std::string& GUIGlObject::getMicrosimID | ( | ) | const throw () [pure virtual] |
Returns the id of the object as known to microsim.
Implemented in GUI_E2_ZS_Collector::MyWrapper, GUI_E2_ZS_CollectorOverLanes::MyWrapper, GUIBusStop, GUIE3Collector::MyWrapper, GUIEdge, GUIEmitter, GUIInductLoop::MyWrapper, GUIJunctionWrapper, GUILaneSpeedTrigger, GUILaneWrapper, GUINet, GUITrafficLightLogicWrapper, GUITriggeredRerouter, GUIVehicle, GUIPointOfInterest, and GUIPolygon2D.
Referenced by FXIMPLEMENT(), GUINet::initDetectors(), and GUIGLObjectPopupMenu::onCmdCopyName().
| virtual GUIParameterTableWindow* GUIGlObject::getParameterWindow | ( | GUIMainWindow & | app, | |
| GUISUMOAbstractView & | parent | |||
| ) | throw () [pure 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 |
Implemented in GUI_E2_ZS_Collector::MyWrapper, GUI_E2_ZS_CollectorOverLanes::MyWrapper, GUIBusStop, GUIE3Collector::MyWrapper, GUIEdge, GUIEmitter, GUIInductLoop::MyWrapper, GUIJunctionWrapper, GUILaneSpeedTrigger, GUILaneWrapper, GUINet, GUITrafficLightLogicWrapper, GUITriggeredRerouter, GUIVehicle, GUIPointOfInterest, and GUIPolygon2D.
Referenced by GUIGLObjectPopupMenu::onCmdShowPars().
| virtual GUIGLObjectPopupMenu* GUIGlObject::getPopUpMenu | ( | GUIMainWindow & | app, | |
| GUISUMOAbstractView & | parent | |||
| ) | throw () [pure 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 |
Implemented in GUIBusStop, GUIDetectorWrapper, GUIEdge, GUIEmitter, GUIJunctionWrapper, GUILaneSpeedTrigger, GUILaneWrapper, GUINet, GUITrafficLightLogicWrapper, GUITriggeredRerouter, GUIVehicle, GUIPointOfInterest, and GUIPolygon2D.
Referenced by GUISUMOAbstractView::openObjectDialog().
| virtual GUIGlObjectType GUIGlObject::getType | ( | ) | const throw () [pure virtual] |
Returns the type of the object as coded in GUIGlObjectType.
Implemented in GUIDetectorWrapper, GUIEdge, GUIJunctionWrapper, GUILaneWrapper, GUINet, GUITrafficLightLogicWrapper, GUIVehicle, and GUIGlObject_AbstractAdd.
Referenced by buildSelectionPopupEntry(), GUISelectedStorage::deselect(), GUISUMOAbstractView::getObjectUnderCursor(), GUISelectedStorage::isSelected(), GUIGLObjectPopupMenu::onCmdAddSelected(), GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdBegin2TrackPhases(), GUIVehicle::GUIVehiclePopupMenu::onCmdHideAllRoutes(), GUIVehicle::GUIVehiclePopupMenu::onCmdHideBestLanes(), GUIVehicle::GUIVehiclePopupMenu::onCmdHideCurrentRoute(), GUIGLObjectPopupMenu::onCmdRemoveSelected(), GUIVehicle::GUIVehiclePopupMenu::onCmdShowAllRoutes(), GUIVehicle::GUIVehiclePopupMenu::onCmdShowBestLanes(), GUIVehicle::GUIVehiclePopupMenu::onCmdShowCurrentRoute(), GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdShowPhases(), GUIVehicle::GUIVehiclePopupMenu::onCmdStartTrack(), GUIVehicle::GUIVehiclePopupMenu::onCmdStopTrack(), GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdSwitchTLS2Off(), GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdSwitchTLSLogic(), GUISelectedStorage::select(), and GUISelectedStorage::toggleSelection().
| void GUIGlObject::setGlID | ( | GLuint | id | ) | throw () [private] |
Sets the id of the object.
May not be done within the constructor in the case of compund objects
| [in] | id | The (new) id of the object |
Definition at line 68 of file GUIGlObject.cpp.
References myGlID.
00068 { 00069 myGlID = id; 00070 }
friend class GUIGlObjectStorage [friend] |
Needed to set the id.
Reimplemented in GUI_E2_ZS_CollectorOverLanes::MyWrapper.
Definition at line 111 of file GUIGlObject.h.
std::string GUIGlObject::myFullName [private] |
GLuint GUIGlObject::myGlID [private] |
1.5.6