GUI_E2_ZS_CollectorOverLanes.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // The gui-version of a MS_E2_ZS_CollectorOverLanes.
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 #ifndef GUI_E2_ZS_CollectorOverLanes_h
00020 #define GUI_E2_ZS_CollectorOverLanes_h
00021 
00022 
00023 // ===========================================================================
00024 // included modules
00025 // ===========================================================================
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031 
00032 #include <utils/common/PhysicalTypeDefs.h>
00033 #include <microsim/output/MS_E2_ZS_CollectorOverLanes.h>
00034 #include <microsim/MSNet.h>
00035 #include <utils/geom/Position2D.h>
00036 #include <utils/geom/Position2DVector.h>
00037 #include <utils/common/VectorHelper.h>
00038 #include <utils/common/ValueSource.h>
00039 #include "GUI_E2_ZS_Collector.h"
00040 #include "GUIDetectorWrapper.h"
00041 
00042 
00043 // ===========================================================================
00044 // class declarations
00045 // ===========================================================================
00046 class GUIGlObjectStorage;
00047 class GUILaneWrapper;
00048 
00049 
00050 // ===========================================================================
00051 // class definitions
00052 // ===========================================================================
00062 class GUI_E2_ZS_CollectorOverLanes : public MS_E2_ZS_CollectorOverLanes {
00063 public:
00064     typedef std::vector<GUI_E2_ZS_Collector*> CollectorVector;
00065 
00067     GUI_E2_ZS_CollectorOverLanes(std::string id, DetectorUsage usage,
00068                                  MSLane* lane, SUMOReal startPos,
00069                                  SUMOTime haltingTimeThreshold,
00070                                  MetersPerSecond haltingSpeedThreshold,
00071                                  SUMOReal jamDistThreshold) throw();
00072 
00074     ~GUI_E2_ZS_CollectorOverLanes() throw();
00075 
00076     // invalid in fact, as collectors do not need a lane
00077     virtual GUIDetectorWrapper *buildDetectorWrapper(
00078         GUIGlObjectStorage &idStorage,
00079         GUILaneWrapper &lane);
00080 
00081     // valid for gui-version only
00082     virtual GUIDetectorWrapper *buildDetectorWrapper(
00083         GUIGlObjectStorage &idStorage);
00084 
00085 protected:
00086     MSE2Collector *buildCollector(size_t c, size_t r,
00087                                   MSLane *l, SUMOReal start, SUMOReal end) throw();
00088 
00089 
00090 public:
00095     class MyWrapper : public GUIDetectorWrapper {
00096     public:
00098         MyWrapper(GUI_E2_ZS_CollectorOverLanes &detector,
00099                   GUIGlObjectStorage &idStorage,
00100                   const LaneDetMap &detectors) throw();
00101 
00103         ~MyWrapper() throw();
00104 
00105 
00107 
00108 
00116         GUIParameterTableWindow *getParameterWindow(
00117             GUIMainWindow &app, GUISUMOAbstractView &parent) throw();
00118 
00119 
00125         const std::string &getMicrosimID() const throw();
00126 
00127 
00133         Boundary getCenteringBoundary() const throw();
00134 
00135 
00140         void drawGL(const GUIVisualizationSettings &s) const throw();
00142 
00143 
00144 
00146         friend class GUIGlObjectStorage;
00147 
00148 
00149 
00151         GUI_E2_ZS_CollectorOverLanes &getLoop();
00152 
00153     protected:
00155         /*
00156         void myMkExistingItem(GUIParameterTableWindow &ret,
00157                               const std::string &name, E2::DetType type);
00158                               */
00159 
00160     private:
00162         GUI_E2_ZS_CollectorOverLanes &myDetector;
00163 
00165         Boundary myBoundary;
00166 
00167         std::vector<GUIDetectorWrapper*> mySubWrappers;
00168 
00174         /*
00175         class MyValueRetriever : public ValueSource<SUMOReal>
00176         {
00177         public:
00179             MyValueRetriever(GUI_E2_ZS_CollectorOverLanes &det,
00180                              E2::DetType type, MSUnit::Seconds nSec)
00181                     : myDetector(det), myType(type), myNSec(nSec) { }
00182 
00184             ~MyValueRetriever() { }
00185 
00187             SUMOReal getValue() const {
00188                 return myDetector.getAggregate(myType, myNSec);
00189             }
00190 
00192             ValueSource<SUMOReal> *copy() const {
00193                 return new MyValueRetriever(myDetector, myType, myNSec);
00194             }
00195 
00196         private:
00198             GUI_E2_ZS_CollectorOverLanes &myDetector;
00199 
00201             E2::DetType myType;
00202 
00204             MSUnit::Seconds myNSec;
00205         };
00206         */
00207     private:
00209         MyWrapper(const MyWrapper&);
00210 
00212         MyWrapper& operator=(const MyWrapper&);
00213 
00214     };
00215 
00216 };
00217 
00218 
00219 #endif
00220 
00221 /****************************************************************************/
00222 

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