SUMO - Simulation of Urban MObility
GUIGlObject Class Referenceabstract

#include <GUIGlObject.h>

Inheritance diagram for GUIGlObject:
Inheritance graph
Collaboration diagram for GUIGlObject:
Collaboration graph

Public Member Functions

virtual void drawGLAdditional (GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
 Draws additional, user-triggered visualisations. More...
 
void drawName (const Position &pos, const SUMOReal scale, const GUIVisualizationTextSettings &settings, const SUMOReal angle=0) const
 
 GUIGlObject (GUIGlObjectType type, const std::string &microsimID)
 Constructor. More...
 
 GUIGlObject (const std::string &prefix, GUIGlObjectType type, const std::string &microsimID)
 Constructor. More...
 
virtual ~GUIGlObject ()
 Destructor. More...
 
Atomar getter methods
const std::string & getFullName () const
 Returns the full name appearing in the tool tip. More...
 
virtual const std::string & getParentName () const
 Returns the name of the parent object (if any) More...
 
GUIGlID getGlID () const
 Returns the numerical id of the object. More...
 
interfaces to be implemented by derived classes
virtual GUIGLObjectPopupMenugetPopUpMenu (GUIMainWindow &app, GUISUMOAbstractView &parent)=0
 Returns an own popup-menu. More...
 
virtual GUIParameterTableWindowgetParameterWindow (GUIMainWindow &app, GUISUMOAbstractView &parent)=0
 Returns an own parameter window. More...
 
virtual GUIParameterTableWindowgetTypeParameterWindow (GUIMainWindow &app, GUISUMOAbstractView &parent)
 Returns an own type parameter window (optional) More...
 
const std::string & getMicrosimID () const
 Returns the id of the object as known to microsim. More...
 
virtual 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...
 
virtual Boundary getCenteringBoundary () const =0
 Returns the boundary to which the view shall be centered in order to show the object. More...
 
virtual void drawGL (const GUIVisualizationSettings &s) const =0
 Draws the object. 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...
 

Static Public Attributes

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 buildShowTypeParamsPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true)
 Builds an entry which allows to open the type 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...
 

Private Member Functions

std::string createFullName () const
 
 GUIGlObject (const GUIGlObject &)
 Invalidated copy constructor. More...
 
GUIGlObjectoperator= (const GUIGlObject &)
 Invalidated assignment operator. More...
 

Private Attributes

std::string myFullName
 
GUIGlID myGlID
 The numerical id of the object. More...
 
const GUIGlObjectType myGLObjectType
 The type of the object. More...
 
std::string myMicrosimID
 
std::set< GUIParameterTableWindow * > myParamWindows
 Parameter table windows which refer to this object. More...
 
std::string myPrefix
 

Static Private Attributes

static StringBijection< GUIGlObjectType >::Entry GUIGlObjectTypeNamesInitializer []
 

Detailed Description

Definition at line 72 of file GUIGlObject.h.

Constructor & Destructor Documentation

GUIGlObject::GUIGlObject ( GUIGlObjectType  type,
const std::string &  microsimID 
)

Constructor.

This is the standard constructor that assures that the object is known and its id is unique. Use it always :-)

Parameters
[in]fullNameThe complete name, including a type-prefix
See also
GUIGlObjectStorage

Definition at line 82 of file GUIGlObject.cpp.

References createFullName(), GUIGlObjectStorage::gIDStorage, myFullName, myGlID, and GUIGlObjectStorage::registerObject().

GUIGlObject::GUIGlObject ( const std::string &  prefix,
GUIGlObjectType  type,
const std::string &  microsimID 
)

Constructor.

This constructor should be used only for compound objects, that share visualization. Use it only if you know what you are doing.

Parameters
[in]fullNameThe complete name, including a type-prefix
See also
GUIGlObjectStorage

Definition at line 91 of file GUIGlObject.cpp.

References createFullName(), GUIGlObjectStorage::gIDStorage, myFullName, myGlID, and GUIGlObjectStorage::registerObject().

GUIGlObject::~GUIGlObject ( )
virtual

Destructor.

Definition at line 101 of file GUIGlObject.cpp.

References getGlID(), GUIGlObjectStorage::gIDStorage, myParamWindows, and GUIGlObjectStorage::remove().

GUIGlObject::GUIGlObject ( const GUIGlObject )
private

Invalidated copy constructor.

Member Function Documentation

void GUIGlObject::addParameterTable ( GUIParameterTableWindow w)

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

Parameters
[in]wThe opened parameter window

Definition at line 198 of file GUIGlObject.cpp.

References myParamWindows.

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

Builds an entry which allows to open the manipulator window.

Parameters

Definition at line 189 of file GUIGlObject.cpp.

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

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

void GUIGlObject::buildShowTypeParamsPopupEntry ( GUIGLObjectPopupMenu ret,
bool  addSeparator = true 
)
protected

Builds an entry which allows to open the type parameter window.

Parameters

Definition at line 168 of file GUIGlObject.cpp.

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

Referenced by GUIBaseVehicle::getPopUpMenu().

std::string GUIGlObject::createFullName ( ) const
private

Definition at line 219 of file GUIGlObject.cpp.

References getMicrosimID(), and myPrefix.

Referenced by GUIGlObject(), setMicrosimID(), and setPrefix().

virtual void GUIGlObject::drawGLAdditional ( GUISUMOAbstractView *const  parent,
const GUIVisualizationSettings s 
) const
inlinevirtual

Draws additional, user-triggered visualisations.

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

Reimplemented in GUIBaseVehicle, GUIPerson, and GUIContainer.

Definition at line 203 of file GUIGlObject.h.

References SUMOReal, and UNUSED_PARAMETER.

GUIGlID GUIGlObject::getGlID ( ) const
inline

Returns the numerical id of the object.

Returns
This object's gl-id

Definition at line 123 of file GUIGlObject.h.

Referenced by GNENet::addReversedEdge(), GUIMessageWindow::appendMsg(), buildSelectionPopupEntry(), GUINet::createTLWrapper(), GNENet::deleteEdge(), GNENet::deleteJunction(), GNENet::deleteLane(), GUIMEInductLoop::MyWrapper::drawGL(), GNEInternalLane::drawGL(), GNECrossing::drawGL(), GUIContainer::drawGL(), GUIPerson::drawGL(), GUIPolygon::drawGL(), GUIInstantInductLoop::MyWrapper::drawGL(), GUILaneSpeedTrigger::drawGL(), GUICalibrator::drawGL(), GUIPointOfInterest::drawGL(), GNEJunction::drawGL(), GUIJunctionWrapper::drawGL(), GNEEdge::drawGL(), GUIE3Collector::MyWrapper::drawGL(), GNELane::drawGL(), GUI_E2_ZS_Collector::MyWrapper::drawGL(), GUIContainerStop::drawGL(), GUIBusStop::drawGL(), GUIChargingStation::drawGL(), GNEPoly::drawGL(), GUIEdge::drawGL(), GUIBaseVehicle::drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GUILane::drawGL(), GUIContainer::drawGLAdditional(), GUIPerson::drawGLAdditional(), GUIBaseVehicle::drawGLAdditional(), GUILane::drawLinkRule(), GUIMEVehicle::getColorValue(), GUIVehicle::getColorValue(), GUIJunctionWrapper::getColorValue(), GUIEdge::getColorValue(), GUIContainer::getColorValue(), GNELane::getColorValue(), GUIPerson::getColorValue(), GUILane::getColorValue(), GNEJunction::getColorValue(), GUIEdge::getIDs(), GNEEdge::getLaneGlIDs(), GUISUMOAbstractView::getObjectAtPosition(), GUISUMOAbstractView::getObjectsAtPosition(), GUIPerson::getPopUpMenu(), GNELane::getPopUpMenu(), GUIBaseVehicle::getPopUpMenu(), GUIEdge::getScaleValue(), GUILane::getScaleValue(), GUIDialog_GLObjChooser::GUIDialog_GLObjChooser(), GNESelector::handleIDs(), GNETLSEditor::handleMultiChange(), GUIGlChildWindow::isSelected(), GNEViewParent::isSelected(), GUISUMOViewParent::isSelected(), GUISelectedStorage::loadIDs(), GNEViewNet::mergeJunctions(), GUIViewTraffic::onCmdAddRerouter(), GUIGLObjectPopupMenu::onCmdAddSelected(), GUIGLObjectPopupMenu::onCmdCenter(), GUIViewTraffic::onCmdCloseEdge(), GUIViewTraffic::onCmdCloseLane(), GNEViewNet::onCmdDuplicateLane(), GUIApplicationWindow::onCmdEditChosen(), GUIGLObjectPopupMenu::onCmdRemoveSelected(), GNEConnector::onCmdSelectDeadStarts(), GNEConnector::onCmdSelectPass(), GUIPerson::GUIPersonPopupMenu::onCmdStartTrack(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdStartTrack(), GNEViewNet::onCmdStraightenEdges(), GNEViewNet::onLeftBtnPress(), GUISUMOAbstractView::removeAdditionalGLVisualisation(), GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::removeObject(), GUIVehicle::selectBlockingFoes(), GNEJunction::setColor(), GUIMessageWindow::setCursorPos(), and ~GUIGlObject().

virtual const std::string& GUIGlObject::getParentName ( ) const
inlinevirtual

Returns the name of the parent object (if any)

Returns
This object's parent id

Reimplemented in GUILane, and GNELane.

Definition at line 115 of file GUIGlObject.h.

References StringUtils::emptyString.

Referenced by GUIGLObjectPopupMenu::onCmdCopyEdgeName().

virtual GUIGLObjectPopupMenu* GUIGlObject::getPopUpMenu ( GUIMainWindow app,
GUISUMOAbstractView parent 
)
pure 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

Implemented in GUILane, GUIBaseVehicle, GUITriggeredRerouter::GUITriggeredRerouterEdge, GNEPoly, GUINet, GUIEdge, GNENet, GUIChargingStation, GUIBusStop, GUIContainerStop, GUITriggeredRerouter, GNEEdge, GUIJunctionWrapper, GNEJunction, GNELane, GUIPointOfInterest, GUICalibrator, GUILaneSpeedTrigger, GUIPerson, GUIPolygon, GUIContainer, GNECrossing, GNEInternalLane, GUITrafficLightLogicWrapper, and GUIDetectorWrapper.

Referenced by GUISUMOAbstractView::openObjectDialog().

GUIGlObjectType GUIGlObject::getType ( ) const
inline

Returns the type of the object as coded in GUIGlObjectType.

Returns
The type of the object
See also
GUIGlObjectType

Definition at line 180 of file GUIGlObject.h.

Referenced by buildSelectionPopupEntry(), GUIVehicle::drawAction_drawRailCarriages(), GUIPerson::drawAction_drawWalkingareaPath(), GUIMEInductLoop::MyWrapper::drawGL(), GUIContainer::drawGL(), GUIPerson::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIInstantInductLoop::MyWrapper::drawGL(), GUICalibrator::drawGL(), GNEJunction::drawGL(), GUIJunctionWrapper::drawGL(), GUIE3Collector::MyWrapper::drawGL(), GNELane::drawGL(), GUI_E2_ZS_Collector::MyWrapper::drawGL(), GUIContainerStop::drawGL(), GUIBusStop::drawGL(), GUIChargingStation::drawGL(), GUIBaseVehicle::drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GUILane::drawGL(), GUIPerson::drawGLAdditional(), GUIBaseVehicle::drawGLAdditional(), GUIJunctionWrapper::getColorValue(), GUIEdge::getColorValue(), GNELane::getColorValue(), GUILane::getColorValue(), GNEJunction::getColorValue(), GNEViewNet::getEdgeAtCursorPosition(), GNEViewNet::getEdgesAtCursorPosition(), GNEViewNet::getJunctionAtCursorPosition(), GNEViewNet::getLaneAtCurserPosition(), GUISUMOAbstractView::getObjectAtPosition(), GUISUMOAbstractView::getObjectsAtPosition(), GUIEdge::getScaleValue(), GUILane::getScaleValue(), GNESelector::handleIDs(), GUIGlChildWindow::isSelected(), GNEViewParent::isSelected(), GUISUMOViewParent::isSelected(), GUISelectedStorage::loadIDs(), GNEViewNet::mergeJunctions(), GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdBegin2TrackPhases(), GNEConnector::onCmdClearSelectedConnections(), GUIGLObjectPopupMenu::onCmdCopyEdgeName(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdHideAllRoutes(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdHideBestLanes(), GUIPerson::GUIPersonPopupMenu::onCmdHideCurrentRoute(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdHideCurrentRoute(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdHideLFLinkItems(), GUIPerson::GUIPersonPopupMenu::onCmdHideWalkingareaPath(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowAllRoutes(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowBestLanes(), GUIPerson::GUIPersonPopupMenu::onCmdShowCurrentRoute(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowCurrentRoute(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowFoes(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowLFLinkItems(), GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdShowPhases(), GUIPerson::GUIPersonPopupMenu::onCmdShowWalkingareaPath(), GUIPerson::GUIPersonPopupMenu::onCmdStartTrack(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdStartTrack(), GUIPerson::GUIPersonPopupMenu::onCmdStopTrack(), GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdStopTrack(), GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdSwitchTLS2Off(), GUITrafficLightLogicWrapper::GUITrafficLightLogicWrapperPopupMenu::onCmdSwitchTLSLogic(), GNEViewNet::onLeftBtnPress(), LayeredRTree::selectLayer(), GNEJunction::setColor(), and GUISelectedStorage::toggleSelection().

virtual GUIParameterTableWindow* GUIGlObject::getTypeParameterWindow ( GUIMainWindow app,
GUISUMOAbstractView parent 
)
inlinevirtual

Returns an own type parameter window (optional)

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

Reimplemented in GUIVehicle, GUIMEVehicle, and GUIBaseVehicle.

Definition at line 156 of file GUIGlObject.h.

References UNUSED_PARAMETER.

Referenced by GUIGLObjectPopupMenu::onCmdShowTypePars().

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

Invalidated assignment operator.

void GUIGlObject::removeParameterTable ( GUIParameterTableWindow w)

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

Parameters
[in]wThe closed parameter window

Definition at line 204 of file GUIGlObject.cpp.

References myParamWindows.

Referenced by GUIParameterTableWindow::~GUIParameterTableWindow().

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

Changes the microsimID of the object (happens in NETEDIT)

Reimplemented in GNEEdge.

Definition at line 110 of file GUIGlObject.cpp.

References createFullName(), myFullName, and myMicrosimID.

Referenced by GNENet::renameJunction(), GNELane::setIndex(), and GNEEdge::setMicrosimID().

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

Definition at line 213 of file GUIGlObject.cpp.

References createFullName(), myFullName, and myPrefix.

Field Documentation

StringBijection< GUIGlObjectType >::Entry GUIGlObject::GUIGlObjectTypeNamesInitializer
staticprivate
Initial value:
= {
{"network", GLO_NETWORK},
{"edge", GLO_EDGE},
{"lane", GLO_LANE},
{"junction", GLO_JUNCTION},
{"crossing", GLO_CROSSING},
{"tlLogic", GLO_TLLOGIC},
{"detector", GLO_DETECTOR},
{"trigger", GLO_TRIGGER},
{"additional", GLO_ADDITIONAL},
{"polygon", GLO_POLYGON},
{"poi", GLO_POI},
{"vehicle", GLO_VEHICLE},
{"person", GLO_PERSON},
{"container", GLO_CONTAINER},
{"undefined", GLO_MAX}
}

Definition at line 328 of file GUIGlObject.h.

std::string GUIGlObject::myFullName
private

Definition at line 315 of file GUIGlObject.h.

Referenced by GUIGlObject(), setMicrosimID(), and setPrefix().

GUIGlID GUIGlObject::myGlID
private

The numerical id of the object.

Definition at line 306 of file GUIGlObject.h.

Referenced by GUIGlObject().

const GUIGlObjectType GUIGlObject::myGLObjectType
private

The type of the object.

Definition at line 309 of file GUIGlObject.h.

std::string GUIGlObject::myMicrosimID
private

Definition at line 311 of file GUIGlObject.h.

Referenced by setMicrosimID().

std::set<GUIParameterTableWindow*> GUIGlObject::myParamWindows
private

Parameter table windows which refer to this object.

Definition at line 318 of file GUIGlObject.h.

Referenced by addParameterTable(), removeParameterTable(), and ~GUIGlObject().

std::string GUIGlObject::myPrefix
private

Definition at line 313 of file GUIGlObject.h.

Referenced by createFullName(), and setPrefix().

StringBijection< GUIGlObjectType > GUIGlObject::TypeNames
static

associates object types with strings

Definition at line 100 of file GUIGlObject.h.


The documentation for this class was generated from the following files: