GUIGlObject Class Reference

#include <GUIGlObject.h>

Inheritance diagram for GUIGlObject:

GUIEdge GUIGlObject_AbstractAdd GUIJunctionWrapper GUILaneWrapper GUINet GUITrafficLightLogicWrapper GUIVehicle GUIBusStop GUIDetectorWrapper GUIEmitter GUILaneSpeedTrigger GUIPointOfInterest GUIPolygon2D GUITriggeredRerouter GUI_E2_ZS_Collector::MyWrapper GUI_E2_ZS_CollectorOverLanes::MyWrapper GUIE3Collector::MyWrapper GUIInductLoop::MyWrapper

Detailed Description

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 GUIParameterTableWindowgetParameterWindow (GUIMainWindow &app, GUISUMOAbstractView &parent)=0 throw ()
 Returns an own parameter window.
virtual GUIGLObjectPopupMenugetPopUpMenu (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.

Constructor & Destructor Documentation

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 :-)

Parameters:
[in] idStorage The global storage of gl-ids, used to give a unique id
[in] fullName The complete name, including a type-prefix
See also:
GUIGlObjectStorage

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.

Parameters:
[in] fullName The complete name, including a type-prefix
[in] glID The id of this object
See also:
GUIGlObjectStorage

Definition at line 58 of file GUIGlObject.cpp.

00059         : myFullName(fullName) {
00060 }

GUIGlObject::~GUIGlObject (  )  throw () [virtual]

Destructor.

Definition at line 64 of file GUIGlObject.cpp.

00064 {}


Member Function Documentation

virtual bool GUIGlObject::active (  )  const throw () [inline, virtual]

Returns the information whether this object is still active.

Returns:
Whether this object is active (always true in this case)

Reimplemented in GUIVehicle.

Definition at line 171 of file GUIGlObject.h.

Referenced by GLObjectValuePassConnector< std::pair< int, MSPhaseDefinition > >::updateEachTimestep().

00171                                         {
00172         return true;
00173     }

void GUIGlObject::buildCenterPopupEntry ( GUIGLObjectPopupMenu ret,
bool  addSeparator = true 
) throw () [protected]

Builds an entry which allows to center to the object.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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]

virtual Boundary GUIGlObject::getCenteringBoundary (  )  const throw () [pure virtual]

const std::string& GUIGlObject::getFullName (  )  const throw () [inline]

GLuint GUIGlObject::getGlID (  )  const throw () [inline]

virtual const std::string& GUIGlObject::getMicrosimID (  )  const throw () [pure virtual]

virtual GUIParameterTableWindow* GUIGlObject::getParameterWindow ( GUIMainWindow app,
GUISUMOAbstractView parent 
) throw () [pure virtual]

Returns an own parameter window.

Parameters:
[in] app The application needed to build the parameter window
[in] parent The parent window needed to build the parameter window
Returns:
The built 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.

Parameters:
[in] app The application needed to build the popup-menu
[in] parent The parent window needed to build the popup-menu
Returns:
The built 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]

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

Parameters:
[in] id The (new) id of the object

Definition at line 68 of file GUIGlObject.cpp.

References myGlID.

00068                                       {
00069     myGlID = id;
00070 }


Friends And Related Function Documentation

friend class GUIGlObjectStorage [friend]

Needed to set the id.

Reimplemented in GUI_E2_ZS_CollectorOverLanes::MyWrapper.

Definition at line 111 of file GUIGlObject.h.


Field Documentation

std::string GUIGlObject::myFullName [private]

The name of the object.

Definition at line 256 of file GUIGlObject.h.

Referenced by getFullName().

GLuint GUIGlObject::myGlID [private]

The numerical id of the object.

Definition at line 253 of file GUIGlObject.h.

Referenced by getGlID(), and setGlID().


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

Generated on Wed May 5 00:06:43 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6