SUMO - Simulation of Urban MObility

GUIE3Collector.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // The gui-version of a MSE3Collector
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 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 <microsim/output/MSE3Collector.h>
00035 #include "GUIDetectorWrapper.h"
00036 #include <utils/geom/PositionVector.h>
00037 #include <utils/common/ValueSource.h>
00038 
00039 
00040 // ===========================================================================
00041 // class definitions
00042 // ===========================================================================
00050 class GUIE3Collector : public MSE3Collector {
00051 public:
00053     GUIE3Collector(const std::string& id,
00054                    const CrossSectionVector& entries, const CrossSectionVector& exits,
00055                    SUMOReal haltingSpeedThreshold,
00056                    SUMOTime haltingTimeThreshold) throw();
00057 
00059     ~GUIE3Collector() throw();
00060 
00061 
00065     const CrossSectionVector& getEntries() const;
00066 
00067 
00071     const CrossSectionVector& getExits() const;
00072 
00073 
00078     GUIDetectorWrapper* buildDetectorGUIRepresentation();
00079 
00080 
00081 public:
00086     class MyWrapper : public GUIDetectorWrapper {
00087     public:
00089         MyWrapper(GUIE3Collector& detector) throw();
00090 
00092         ~MyWrapper() throw();
00093 
00094 
00096 
00097 
00105         GUIParameterTableWindow* getParameterWindow(
00106             GUIMainWindow& app, GUISUMOAbstractView& parent) throw();
00107 
00108 
00114         Boundary getCenteringBoundary() const throw();
00115 
00116 
00121         void drawGL(const GUIVisualizationSettings& s) const throw();
00123 
00124 
00126         GUIE3Collector& getDetector();
00127 
00128 
00129     protected:
00133         struct SingleCrossingDefinition {
00135             Position myFGPosition;
00137             SUMOReal myFGRotation;
00138         };
00139 
00140     protected:
00142         SingleCrossingDefinition buildDefinition(const MSCrossSection& section);
00143 
00145         void drawSingleCrossing(const Position& pos, SUMOReal rot,
00146                                 SUMOReal upscale) const;
00147 
00148     private:
00150         GUIE3Collector& myDetector;
00151 
00153         Boundary myBoundary;
00154 
00156         typedef std::vector<SingleCrossingDefinition> CrossingDefinitions;
00157 
00159         CrossingDefinitions myEntryDefinitions;
00160 
00162         CrossingDefinitions myExitDefinitions;
00163 
00164     };
00165 
00166 };
00167 
00168 
00169 #endif
00170 
00171 /****************************************************************************/
00172 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines