|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // The gui-version of the MSInductLoop, together with the according 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 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 GUIInductLoop_h 00020 #define GUIInductLoop_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/foxtools/MFXMutex.h> 00033 #include <microsim/output/MSInductLoop.h> 00034 #include <utils/geom/Position.h> 00035 #include "GUIDetectorWrapper.h" 00036 00037 00038 // =========================================================================== 00039 // class declarations 00040 // =========================================================================== 00041 class GUILaneWrapper; 00042 00043 00044 // =========================================================================== 00045 // class definitions 00046 // =========================================================================== 00057 class GUIInductLoop : public MSInductLoop { 00058 public: 00066 GUIInductLoop(const std::string& id, MSLane* const lane, SUMOReal position, bool splitByType) throw(); 00067 00068 00070 ~GUIInductLoop() throw(); 00071 00072 00078 void reset() throw(); 00079 00080 00084 virtual GUIDetectorWrapper* buildDetectorGUIRepresentation(); 00085 00086 00095 std::vector<VehicleData> collectVehiclesOnDet(SUMOTime t) const throw(); 00096 00097 00098 protected: 00101 00110 void enterDetectorByMove(SUMOVehicle& veh, SUMOReal entryTimestep) throw(); 00111 00112 00121 void leaveDetectorByMove(SUMOVehicle& veh, SUMOReal leaveTimestep) throw(); 00122 00123 00130 void leaveDetectorByLaneChange(SUMOVehicle& veh) throw(); 00132 00133 00134 00135 00136 public: 00141 class MyWrapper : public GUIDetectorWrapper { 00142 public: 00144 MyWrapper(GUIInductLoop& detector, 00145 GUILaneWrapper& wrapper, 00146 SUMOReal pos) throw(); 00147 00149 ~MyWrapper() throw(); 00150 00151 00153 00154 00162 GUIParameterTableWindow* getParameterWindow( 00163 GUIMainWindow& app, GUISUMOAbstractView& parent) throw(); 00164 00165 00171 Boundary getCenteringBoundary() const throw(); 00172 00173 00178 void drawGL(const GUIVisualizationSettings& s) const throw(); 00180 00181 00183 GUIInductLoop& getLoop(); 00184 00185 00186 private: 00188 GUIInductLoop& myDetector; 00189 00191 Boundary myBoundary; 00192 00194 Position myFGPosition; 00195 00197 SUMOReal myFGRotation; 00198 00200 SUMOReal myPosition; 00201 00202 private: 00204 MyWrapper(const MyWrapper&); 00205 00207 MyWrapper& operator=(const MyWrapper&); 00208 00209 }; 00210 00211 00213 mutable MFXMutex myLock; 00214 00215 }; 00216 00217 00218 #endif 00219 00220 /****************************************************************************/ 00221