SUMO - Simulation of Urban MObility
GUIInductLoop.h
Go to the documentation of this file.
00001 /****************************************************************************/
00010 // The gui-version of the MSInductLoop, together with the according
00011 /****************************************************************************/
00012 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00013 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00014 /****************************************************************************/
00015 //
00016 //   This file is part of SUMO.
00017 //   SUMO is free software: you can redistribute it and/or modify
00018 //   it under the terms of the GNU General Public License as published by
00019 //   the Free Software Foundation, either version 3 of the License, or
00020 //   (at your option) any later version.
00021 //
00022 /****************************************************************************/
00023 #ifndef GUIInductLoop_h
00024 #define GUIInductLoop_h
00025 
00026 
00027 // ===========================================================================
00028 // included modules
00029 // ===========================================================================
00030 #ifdef _MSC_VER
00031 #include <windows_config.h>
00032 #else
00033 #include <config.h>
00034 #endif
00035 
00036 #include <utils/foxtools/MFXMutex.h>
00037 #include <microsim/output/MSInductLoop.h>
00038 #include <utils/geom/Position.h>
00039 #include "GUIDetectorWrapper.h"
00040 
00041 
00042 // ===========================================================================
00043 // class declarations
00044 // ===========================================================================
00045 class GUILaneWrapper;
00046 
00047 
00048 // ===========================================================================
00049 // class definitions
00050 // ===========================================================================
00061 class GUIInductLoop : public MSInductLoop {
00062 public:
00070     GUIInductLoop(const std::string& id, MSLane* const lane, SUMOReal position, bool splitByType) ;
00071 
00072 
00074     ~GUIInductLoop() ;
00075 
00076 
00082     void reset() ;
00083 
00084 
00088     virtual GUIDetectorWrapper* buildDetectorGUIRepresentation();
00089 
00090 
00099     std::vector<VehicleData> collectVehiclesOnDet(SUMOTime t) const ;
00100 
00101 
00102 protected:
00105 
00114     void enterDetectorByMove(SUMOVehicle& veh, SUMOReal entryTimestep) ;
00115 
00116 
00125     void leaveDetectorByMove(SUMOVehicle& veh, SUMOReal leaveTimestep) ;
00126 
00127 
00134     void leaveDetectorByLaneChange(SUMOVehicle& veh) ;
00136 
00137 
00138 
00139 
00140 public:
00145     class MyWrapper : public GUIDetectorWrapper {
00146     public:
00148         MyWrapper(GUIInductLoop& detector,
00149                   GUILaneWrapper& wrapper,
00150                   SUMOReal pos) ;
00151 
00153         ~MyWrapper() ;
00154 
00155 
00157 
00158 
00166         GUIParameterTableWindow* getParameterWindow(
00167             GUIMainWindow& app, GUISUMOAbstractView& parent) ;
00168 
00169 
00175         Boundary getCenteringBoundary() const ;
00176 
00177 
00182         void drawGL(const GUIVisualizationSettings& s) const ;
00184 
00185 
00187         GUIInductLoop& getLoop();
00188 
00189 
00190     private:
00192         GUIInductLoop& myDetector;
00193 
00195         Boundary myBoundary;
00196 
00198         Position myFGPosition;
00199 
00201         SUMOReal myFGRotation;
00202 
00204         SUMOReal myPosition;
00205 
00206     private:
00208         MyWrapper(const MyWrapper&);
00209 
00211         MyWrapper& operator=(const MyWrapper&);
00212 
00213     };
00214 
00215 
00217     mutable MFXMutex myLock;
00218 
00219 };
00220 
00221 
00222 #endif
00223 
00224 /****************************************************************************/
00225 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines