SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // The gui-version of a MSE3Collector 00010 /****************************************************************************/ 00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00013 /****************************************************************************/ 00014 // 00015 // This file is part of SUMO. 00016 // SUMO is free software: you can redistribute it and/or modify 00017 // it under the terms of the GNU General Public License as published by 00018 // the Free Software Foundation, either version 3 of the License, or 00019 // (at your option) any later version. 00020 // 00021 /****************************************************************************/ 00022 #ifndef GUIE3Collector_h 00023 #define GUIE3Collector_h 00024 00025 00026 // =========================================================================== 00027 // included modules 00028 // =========================================================================== 00029 #ifdef _MSC_VER 00030 #include <windows_config.h> 00031 #else 00032 #include <config.h> 00033 #endif 00034 00035 #include <string> 00036 #include <vector> 00037 #include "GUIDetectorWrapper.h" 00038 #include <microsim/output/MSE3Collector.h> 00039 #include <utils/geom/PositionVector.h> 00040 #include <utils/common/ValueSource.h> 00041 00042 00043 // =========================================================================== 00044 // class definitions 00045 // =========================================================================== 00053 class GUIE3Collector : public MSE3Collector { 00054 public: 00056 GUIE3Collector(const std::string& id, 00057 const CrossSectionVector& entries, const CrossSectionVector& exits, 00058 SUMOReal haltingSpeedThreshold, 00059 SUMOTime haltingTimeThreshold) ; 00060 00062 ~GUIE3Collector() ; 00063 00064 00068 const CrossSectionVector& getEntries() const; 00069 00070 00074 const CrossSectionVector& getExits() const; 00075 00076 00081 GUIDetectorWrapper* buildDetectorGUIRepresentation(); 00082 00083 00084 public: 00089 class MyWrapper : public GUIDetectorWrapper { 00090 public: 00092 MyWrapper(GUIE3Collector& detector) ; 00093 00095 ~MyWrapper() ; 00096 00097 00099 00100 00108 GUIParameterTableWindow* getParameterWindow( 00109 GUIMainWindow& app, GUISUMOAbstractView& parent) ; 00110 00111 00117 Boundary getCenteringBoundary() const ; 00118 00119 00124 void drawGL(const GUIVisualizationSettings& s) const ; 00126 00127 00129 GUIE3Collector& getDetector(); 00130 00131 00132 protected: 00136 struct SingleCrossingDefinition { 00138 Position myFGPosition; 00140 SUMOReal myFGRotation; 00141 }; 00142 00143 protected: 00145 SingleCrossingDefinition buildDefinition(const MSCrossSection& section); 00146 00148 void drawSingleCrossing(const Position& pos, SUMOReal rot, 00149 SUMOReal upscale) const; 00150 00151 private: 00153 GUIE3Collector& myDetector; 00154 00156 Boundary myBoundary; 00157 00159 typedef std::vector<SingleCrossingDefinition> CrossingDefinitions; 00160 00162 CrossingDefinitions myEntryDefinitions; 00163 00165 CrossingDefinitions myExitDefinitions; 00166 00167 }; 00168 00169 }; 00170 00171 00172 #endif 00173 00174 /****************************************************************************/ 00175