GUI_E2_ZS_Collector::MyWrapper Class Reference

#include <GUI_E2_ZS_Collector.h>

Inheritance diagram for GUI_E2_ZS_Collector::MyWrapper:

GUIDetectorWrapper GUIGlObject_AbstractAdd GUIGlObject

Detailed Description

A GUI_E2_ZS_Collector-visualiser

Definition at line 103 of file GUI_E2_ZS_Collector.h.


Public Member Functions

virtual bool active () const throw ()
 Returns the information whether this object is still active.
void drawGLName (const Position2D &p, const std::string &id, SUMOReal nameScale) const
GUI_E2_ZS_CollectorgetDetector ()
 Returns the detector itself.
 MyWrapper (GUI_E2_ZS_Collector &detector, GUIGlObjectStorage &idStorage, GLuint glID, GUI_E2_ZS_CollectorOverLanes &mustBe, GUILaneWrapper &wrapper) throw ()
 Constructor for collectors joined over lanes.
 MyWrapper (GUI_E2_ZS_Collector &detector, GUIGlObjectStorage &idStorage, GUILaneWrapper &wrapper) throw ()
 Constructor.
 ~MyWrapper () throw ()
 Destrutor.
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.
GUIParameterTableWindowgetParameterWindow (GUIMainWindow &app, GUISUMOAbstractView &parent) throw ()
 Returns an own parameter window.
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.
inherited from GUIGlObject
GUIGLObjectPopupMenugetPopUpMenu (GUIMainWindow &app, GUISUMOAbstractView &parent) throw ()
 Returns an own popup-menu.
GUIGlObjectType getType () const throw ()
 Returns the type of the object as coded in GUIGlObjectType.

Static Public Member Functions

static void clearDictionary ()
 Clears the dictionary (the objects will not be deleted).
static GUIGlObject_AbstractAddget (const std::string &name)
 Returns a named object.
static std::vector< GLuint > getIDList ()
 Returns the list of gl-ids of all additional objects.
static const std::vector
< GUIGlObject_AbstractAdd * > & 
getObjectList ()
 Returns the list of all additional objects.

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

GUIGlObjectType myGlType
 The object's type.

Static Protected Attributes

static std::vector
< GUIGlObject_AbstractAdd * > 
myObjectList
 The list of all addtional objects currently loaded.
static std::map< std::string,
GUIGlObject_AbstractAdd * > 
myObjects
 Map from names of loaded additional objects to the objects themselves.

Private Member Functions

void myConstruct (GUI_E2_ZS_Collector &detector, GUILaneWrapper &wrapper)
 MyWrapper (const MyWrapper &)
 Invalidated copy constructor.
MyWrapperoperator= (const MyWrapper &)
 Invalidated assignment operator.

Private Attributes

Boundary myBoundary
 The detector's boundary.
GUI_E2_ZS_CollectormyDetector
 The wrapped detector.
Position2DVector myFullGeometry
 A sequence of positions in full-geometry mode.
DoubleVector myShapeLengths
 A sequence of lengths in full-geometry mode.
DoubleVector myShapeRotations
 A sequence of rotations in full-geometry mode.

Friends

class GUIGlObjectStorage
 Needed to set the id.

Constructor & Destructor Documentation

GUI_E2_ZS_Collector::MyWrapper::MyWrapper ( GUI_E2_ZS_Collector detector,
GUIGlObjectStorage idStorage,
GUILaneWrapper wrapper 
) throw ()

Constructor.

Definition at line 88 of file GUI_E2_ZS_Collector.cpp.

00091         : GUIDetectorWrapper(idStorage, "E2 detector:"+detector.getID()),
00092         myDetector(detector) {
00093     myConstruct(detector, wrapper);
00094 }

GUI_E2_ZS_Collector::MyWrapper::MyWrapper ( GUI_E2_ZS_Collector detector,
GUIGlObjectStorage idStorage,
GLuint  glID,
GUI_E2_ZS_CollectorOverLanes mustBe,
GUILaneWrapper wrapper 
) throw ()

Constructor for collectors joined over lanes.

Definition at line 97 of file GUI_E2_ZS_Collector.cpp.

00101         : GUIDetectorWrapper("E2 detector:"+detector.getID(), glID),
00102         myDetector(detector) {
00103     myConstruct(detector, wrapper);
00104 }

GUI_E2_ZS_Collector::MyWrapper::~MyWrapper (  )  throw ()

Destrutor.

Definition at line 128 of file GUI_E2_ZS_Collector.cpp.

00128 {}

GUI_E2_ZS_Collector::MyWrapper::MyWrapper ( const MyWrapper  )  [private]

Invalidated copy constructor.


Member Function Documentation

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

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, inherited]

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, inherited]

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, inherited]

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 GUIGlObject::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, inherited]

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, inherited]

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 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(), 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, inherited]

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, inherited]

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 }

void GUIGlObject_AbstractAdd::clearDictionary (  )  [static, inherited]

Clears the dictionary (the objects will not be deleted).

!! delete (*i).second;

Definition at line 82 of file GUIGlObject_AbstractAdd.cpp.

References GUIGlObject_AbstractAdd::myObjectList, and GUIGlObject_AbstractAdd::myObjects.

Referenced by GUINet::~GUINet().

00082                                          {
00083     std::map<std::string, GUIGlObject_AbstractAdd*>::iterator i;
00084     for (i=myObjects.begin(); i!=myObjects.end(); i++) {
00086     }
00087     myObjects.clear();
00088     myObjectList.clear();
00089 }

void GUI_E2_ZS_Collector::MyWrapper::drawGL ( const GUIVisualizationSettings s  )  const throw () [virtual]

Draws the object.

Parameters:
[in] s The settings for the current view (may influence drawing)
See also:
GUIGlObject::drawGL

Implements GUIGlObject.

Definition at line 183 of file GUI_E2_ZS_Collector.cpp.

References GLHelper::drawBoxLines(), GUIGlObject_AbstractAdd::drawGLName(), GLHelper::drawLine(), DU_TL_CONTROL, getCenteringBoundary(), GUIGlObject::getGlID(), getMicrosimID(), MSE2Collector::getUsageType(), myDetector, myFullGeometry, myShapeLengths, myShapeRotations, Position2DVector::size(), and SUMOReal.

00183                                                                                     {
00184     // (optional) set id
00185     if (s.needsGlID) {
00186         glPushName(getGlID());
00187     }
00188     glTranslated(0, 0, -.03);
00189     SUMOReal dwidth = 1;
00190     if (myDetector.getUsageType()==DU_TL_CONTROL) {
00191         dwidth = (SUMOReal) 0.3;
00192         glColor3d(0, (SUMOReal) .6, (SUMOReal) .8);
00193     } else {
00194         glColor3d(0, (SUMOReal) .8, (SUMOReal) .8);
00195     }
00196     SUMOReal width=2; // !!!
00197     if (width*s.addExaggeration>1.0) {
00198         glScaled(s.addExaggeration, s.addExaggeration, 1);
00199         GLHelper::drawBoxLines(myFullGeometry, myShapeRotations, myShapeLengths, dwidth);
00200     } else {
00201         int e = (int) myFullGeometry.size() - 1;
00202         for (int i=0; i<e; ++i) {
00203             GLHelper::drawLine(myFullGeometry[i], myShapeRotations[i], myShapeLengths[i]);
00204         }
00205     }
00206     glTranslated(0, 0, .03);
00207     // (optional) draw name
00208     if (s.drawAddName) {
00209         drawGLName(getCenteringBoundary().getCenter(), getMicrosimID(), s.addNameSize / s.scale);
00210     }
00211     // (optional) clear id
00212     if (s.needsGlID) {
00213         glPopName();
00214     }
00215 }

void GUIGlObject_AbstractAdd::drawGLName ( const Position2D p,
const std::string &  id,
SUMOReal  nameScale 
) const [inherited]

Definition at line 120 of file GUIGlObject_AbstractAdd.cpp.

References pfdkGetStringWidth(), pfDrawString(), pfSetPosition(), pfSetScale(), SUMOReal, Position2D::x(), and Position2D::y().

Referenced by GUILaneSpeedTrigger::drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUIEmitter::drawGL(), GUIE3Collector::MyWrapper::drawGL(), GUIBusStop::drawGL(), and drawGL().

00120                                                                                                       {
00121     glPolygonOffset(0, -6);
00122     glPushMatrix();
00123     glTranslated(p.x(), p.y(), 0);
00124     glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
00125     pfSetPosition(0, 0);
00126     pfSetScale(nameScale);
00127     SUMOReal w = pfdkGetStringWidth(id.c_str());
00128     glRotated(180, 1, 0, 0);
00129     glTranslated(-w/2., 0.4, 0);
00130     pfDrawString(id.c_str());
00131     glPopMatrix();
00132 }

GUIGlObject_AbstractAdd * GUIGlObject_AbstractAdd::get ( const std::string &  name  )  [static, inherited]

Returns a named object.

Definition at line 93 of file GUIGlObject_AbstractAdd.cpp.

References GUIGlObject_AbstractAdd::myObjects.

00093                                                   {
00094     std::map<std::string, GUIGlObject_AbstractAdd*>::iterator i =
00095         myObjects.find(name);
00096     if (i==myObjects.end()) {
00097         return 0;
00098     }
00099     return (*i).second;
00100 }

Boundary GUI_E2_ZS_Collector::MyWrapper::getCenteringBoundary (  )  const throw () [virtual]

Returns the boundary to which the view shall be centered in order to show the object.

Returns:
The boundary the object is within
See also:
GUIGlObject::getCenteringBoundary

Implements GUIGlObject.

Definition at line 132 of file GUI_E2_ZS_Collector.cpp.

References Boundary::grow(), and myBoundary.

Referenced by drawGL().

00132                                                                  {
00133     Boundary b(myBoundary);
00134     b.grow(20);
00135     return b;
00136 }

GUI_E2_ZS_Collector & GUI_E2_ZS_Collector::MyWrapper::getDetector (  ) 

Returns the detector itself.

Definition at line 219 of file GUI_E2_ZS_Collector.cpp.

References myDetector.

00219                                           {
00220     return myDetector;
00221 }

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

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

std::vector< GLuint > GUIGlObject_AbstractAdd::getIDList (  )  [static, inherited]

Returns the list of gl-ids of all additional objects.

Definition at line 110 of file GUIGlObject_AbstractAdd.cpp.

References GUIGlObject_AbstractAdd::myObjectList.

Referenced by FXIMPLEMENT().

00110                                    {
00111     std::vector<GLuint> ret;
00112     for (std::vector<GUIGlObject_AbstractAdd*>::iterator i=myObjectList.begin(); i!=myObjectList.end(); ++i) {
00113         ret.push_back((*i)->getGlID());
00114     }
00115     return ret;
00116 }

const std::string & GUI_E2_ZS_Collector::MyWrapper::getMicrosimID (  )  const throw () [virtual]

Returns the id of the object as known to microsim.

Returns:
The id of the detector
See also:
GUIGlObject::getMicrosimID

Implements GUIGlObject.

Definition at line 177 of file GUI_E2_ZS_Collector.cpp.

References Named::getID(), and myDetector.

Referenced by drawGL().

00177                                                           {
00178     return myDetector.getID();
00179 }

const std::vector< GUIGlObject_AbstractAdd * > & GUIGlObject_AbstractAdd::getObjectList (  )  [static, inherited]

Returns the list of all additional objects.

Definition at line 104 of file GUIGlObject_AbstractAdd.cpp.

References GUIGlObject_AbstractAdd::myObjectList.

Referenced by GUINet::initGUIStructures().

00104                                        {
00105     return myObjectList;
00106 }

GUIParameterTableWindow * GUI_E2_ZS_Collector::MyWrapper::getParameterWindow ( GUIMainWindow app,
GUISUMOAbstractView parent 
) throw () [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
See also:
GUIGlObject::getParameterWindow

Implements GUIGlObject.

Definition at line 140 of file GUI_E2_ZS_Collector.cpp.

References GUIParameterTableWindow::closeBuilding(), MSE2Collector::getCurrentJamLengthInMeters(), MSE2Collector::getCurrentJamLengthInVehicles(), MSE2Collector::getCurrentJamNumber(), MSE2Collector::getCurrentMaxJamLengthInMeters(), MSE2Collector::getCurrentMaxJamLengthInVehicles(), MSE2Collector::getCurrentMeanLength(), MSE2Collector::getCurrentMeanSpeed(), MSE2Collector::getCurrentOccupancy(), MSE2Collector::getCurrentStartedHalts(), MSE2Collector::getCurrentVehicleNumber(), MSE2Collector::getEndPos(), MSLane::getID(), MSMoveReminder::getLane(), MSE2Collector::getStartPos(), GUIParameterTableWindow::mkItem(), and myDetector.

00141                                        {
00142     GUIParameterTableWindow *ret =
00143         new GUIParameterTableWindow(app, *this, 13);
00144     // add items
00145     // parameter
00146     ret->mkItem("length [m]", false, myDetector.getEndPos()-myDetector.getStartPos());
00147     ret->mkItem("position [m]", false, myDetector.getStartPos());
00148     ret->mkItem("lane", false, myDetector.getLane()->getID());
00149     // values
00150     ret->mkItem("vehicles [#]", true,
00151                 new FunctionBinding<MSE2Collector, unsigned>(&myDetector, &MSE2Collector::getCurrentVehicleNumber));
00152     ret->mkItem("occupancy [%]", true,
00153                 new FunctionBinding<MSE2Collector, SUMOReal>(&myDetector, &MSE2Collector::getCurrentOccupancy));
00154     ret->mkItem("mean speed [m/s]", true,
00155                 new FunctionBinding<MSE2Collector, SUMOReal>(&myDetector, &MSE2Collector::getCurrentMeanSpeed));
00156     ret->mkItem("mean vehicle length [m]", true,
00157                 new FunctionBinding<MSE2Collector, SUMOReal>(&myDetector, &MSE2Collector::getCurrentMeanLength));
00158     ret->mkItem("jam number [#]", true,
00159                 new FunctionBinding<MSE2Collector, unsigned>(&myDetector, &MSE2Collector::getCurrentJamNumber));
00160     ret->mkItem("max jam length [veh]", true,
00161                 new FunctionBinding<MSE2Collector, unsigned>(&myDetector, &MSE2Collector::getCurrentMaxJamLengthInVehicles));
00162     ret->mkItem("max jam length [m]", true,
00163                 new FunctionBinding<MSE2Collector, SUMOReal>(&myDetector, &MSE2Collector::getCurrentMaxJamLengthInMeters));
00164     ret->mkItem("jam length sum [veh]", true,
00165                 new FunctionBinding<MSE2Collector, unsigned>(&myDetector, &MSE2Collector::getCurrentJamLengthInVehicles));
00166     ret->mkItem("jam length sum [m]", true,
00167                 new FunctionBinding<MSE2Collector, SUMOReal>(&myDetector, &MSE2Collector::getCurrentJamLengthInMeters));
00168     ret->mkItem("started halts [#]", true,
00169                 new FunctionBinding<MSE2Collector, unsigned>(&myDetector, &MSE2Collector::getCurrentStartedHalts));
00170     // close building
00171     ret->closeBuilding();
00172     return ret;
00173 }

GUIGLObjectPopupMenu * GUIDetectorWrapper::getPopUpMenu ( GUIMainWindow app,
GUISUMOAbstractView parent 
) throw () [virtual, inherited]

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
See also:
GUIGlObject::getPopUpMenu

Implements GUIGlObject.

Definition at line 61 of file GUIDetectorWrapper.cpp.

References GUIGlObject::buildCenterPopupEntry(), GUIGlObject::buildNameCopyPopupEntry(), GUIGlObject::buildPopupHeader(), GUIGlObject::buildPositionCopyEntry(), GUIGlObject::buildSelectionPopupEntry(), and GUIGlObject::buildShowParamsPopupEntry().

00062                                                                       {
00063     GUIGLObjectPopupMenu *ret = new GUIGLObjectPopupMenu(app, parent, *this);
00064     buildPopupHeader(ret, app);
00065     buildCenterPopupEntry(ret);
00066     buildNameCopyPopupEntry(ret);
00067     buildSelectionPopupEntry(ret);
00068     buildShowParamsPopupEntry(ret);
00069     buildPositionCopyEntry(ret, false);
00070     return ret;
00071 }

GUIGlObjectType GUIDetectorWrapper::getType (  )  const throw () [inline, virtual, inherited]

Returns the type of the object as coded in GUIGlObjectType.

Returns:
GLO_DETECTOR, subclasses are detectors
See also:
GUIGlObject::getType

GUIGlObjectType

Reimplemented from GUIGlObject_AbstractAdd.

Definition at line 82 of file GUIDetectorWrapper.h.

References GLO_DETECTOR.

00082                                             {
00083         return GLO_DETECTOR;
00084     }

void GUI_E2_ZS_Collector::MyWrapper::myConstruct ( GUI_E2_ZS_Collector detector,
GUILaneWrapper wrapper 
) [private]

Definition at line 107 of file GUI_E2_ZS_Collector.cpp.

References Position2D::distanceTo(), Position2DVector::getBegin(), Position2DVector::getEnd(), MSE2Collector::getEndPos(), GUILaneWrapper::getShape(), MSE2Collector::getStartPos(), Position2DVector::getSubpart(), myBoundary, myFullGeometry, myShapeLengths, myShapeRotations, PI, SUMOReal, Position2D::x(), and Position2D::y().

00108                                  {
00109     const Position2DVector &v = wrapper.getShape();
00110     Line2D l(v.getBegin(), v.getEnd());
00111     // build geometry
00112     myFullGeometry = v.getSubpart(detector.getStartPos(), detector.getEndPos());
00113     //
00114     myShapeRotations.reserve(myFullGeometry.size()-1);
00115     myShapeLengths.reserve(myFullGeometry.size()-1);
00116     int e = (int) myFullGeometry.size() - 1;
00117     for (int i=0; i<e; ++i) {
00118         const Position2D &f = myFullGeometry[i];
00119         const Position2D &s = myFullGeometry[i+1];
00120         myShapeLengths.push_back(f.distanceTo(s));
00121         myShapeRotations.push_back((SUMOReal) atan2((s.x()-f.x()), (f.y()-s.y()))*(SUMOReal) 180.0/(SUMOReal) PI);
00122     }
00123     //
00124     myBoundary = myFullGeometry.getBoxBoundary();
00125 }

MyWrapper& GUI_E2_ZS_Collector::MyWrapper::operator= ( const MyWrapper  )  [private]

Invalidated assignment operator.


Friends And Related Function Documentation

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.


Field Documentation

The detector's boundary.

Definition at line 170 of file GUI_E2_ZS_Collector.h.

Referenced by getCenteringBoundary(), and myConstruct().

The wrapped detector.

Definition at line 167 of file GUI_E2_ZS_Collector.h.

Referenced by drawGL(), getDetector(), getMicrosimID(), and getParameterWindow().

A sequence of positions in full-geometry mode.

Definition at line 173 of file GUI_E2_ZS_Collector.h.

Referenced by drawGL(), and myConstruct().

The object's type.

Definition at line 85 of file GUIGlObject_AbstractAdd.h.

Referenced by GUIGlObject_AbstractAdd::getType().

std::vector< GUIGlObject_AbstractAdd * > GUIGlObject_AbstractAdd::myObjectList [static, protected, inherited]

The list of all addtional objects currently loaded.

Definition at line 92 of file GUIGlObject_AbstractAdd.h.

Referenced by GUIGlObject_AbstractAdd::clearDictionary(), GUIGlObject_AbstractAdd::getIDList(), and GUIGlObject_AbstractAdd::getObjectList().

std::map< std::string, GUIGlObject_AbstractAdd * > GUIGlObject_AbstractAdd::myObjects [static, protected, inherited]

Map from names of loaded additional objects to the objects themselves.

Definition at line 89 of file GUIGlObject_AbstractAdd.h.

Referenced by GUIGlObject_AbstractAdd::clearDictionary(), and GUIGlObject_AbstractAdd::get().

A sequence of lengths in full-geometry mode.

Definition at line 176 of file GUI_E2_ZS_Collector.h.

Referenced by drawGL(), and myConstruct().

A sequence of rotations in full-geometry mode.

Definition at line 179 of file GUI_E2_ZS_Collector.h.

Referenced by drawGL(), and myConstruct().


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

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