00001 /****************************************************************************/ 00007 // The gui-version of a MSE3Collector 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 GUIE3Collector_h 00020 #define GUIE3Collector_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 <string> 00033 #include <vector> 00034 #include <utils/common/PhysicalTypeDefs.h> 00035 #include <microsim/output/MSE3Collector.h> 00036 #include "GUIDetectorWrapper.h" 00037 #include <utils/geom/Position2DVector.h> 00038 #include <utils/common/ValueSource.h> 00039 00040 00041 // =========================================================================== 00042 // class definitions 00043 // =========================================================================== 00051 class GUIE3Collector : public MSE3Collector { 00052 public: 00054 GUIE3Collector(const std::string &id, 00055 const CrossSectionVector &entries, const CrossSectionVector &exits, 00056 MetersPerSecond haltingSpeedThreshold, 00057 SUMOTime haltingTimeThreshold) throw(); 00058 00060 ~GUIE3Collector() throw(); 00061 00063 const CrossSectionVector &getEntries() const; 00064 00066 const CrossSectionVector &getExits() const; 00067 00069 GUIDetectorWrapper *buildDetectorWrapper(GUIGlObjectStorage &idStorage); 00070 00071 public: 00076 class MyWrapper : public GUIDetectorWrapper { 00077 public: 00079 MyWrapper(GUIE3Collector &detector, 00080 GUIGlObjectStorage &idStorage) throw(); 00081 00083 ~MyWrapper() throw(); 00084 00085 00087 00088 00096 GUIParameterTableWindow *getParameterWindow( 00097 GUIMainWindow &app, GUISUMOAbstractView &parent) throw(); 00098 00099 00105 const std::string &getMicrosimID() const throw(); 00106 00107 00113 Boundary getCenteringBoundary() const throw(); 00114 00115 00120 void drawGL(const GUIVisualizationSettings &s) const throw(); 00122 00123 00124 00126 GUIE3Collector &getDetector(); 00127 00128 protected: 00129 struct SingleCrossingDefinition { 00131 Position2D myFGPosition; 00133 SUMOReal myFGRotation; 00134 }; 00135 00136 protected: 00138 SingleCrossingDefinition buildDefinition(const MSCrossSection §ion); 00139 00141 void drawSingleCrossing(const Position2D &pos, SUMOReal rot, 00142 SUMOReal upscale) const; 00143 00144 private: 00146 GUIE3Collector &myDetector; 00147 00149 Boundary myBoundary; 00150 00152 typedef std::vector<SingleCrossingDefinition> CrossingDefinitions; 00153 00155 CrossingDefinitions myEntryDefinitions; 00156 00158 CrossingDefinitions myExitDefinitions; 00159 00160 }; 00161 00162 }; 00163 00164 00165 #endif 00166 00167 /****************************************************************************/ 00168
1.5.6