SUMO - Simulation of Urban MObility
GUITriggeredRerouter.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // Reroutes vehicles passing an edge (gui-version)
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 GUITriggeredRerouter_h
00023 #define GUITriggeredRerouter_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 <vector>
00036 #include <string>
00037 #include <microsim/trigger/MSTriggeredRerouter.h>
00038 #include <utils/foxtools/FXRealSpinDial.h>
00039 #include <utils/gui/globjects/GUIGlObject_AbstractAdd.h>
00040 #include <utils/gui/globjects/GUIGLObjectPopupMenu.h>
00041 #include <gui/GUIManipulator.h>
00042 
00043 
00044 // ===========================================================================
00045 // class definitions
00046 // ===========================================================================
00051 class GUITriggeredRerouter
00052     : public MSTriggeredRerouter,
00053       public GUIGlObject_AbstractAdd {
00054 public:
00062     GUITriggeredRerouter(const std::string& id,
00063                          const std::vector<MSEdge*> &edges, SUMOReal prob,
00064                          const std::string& aXMLFilename, bool off);
00065 
00066 
00068     ~GUITriggeredRerouter() ;
00069 
00070 
00071 
00073 
00074 
00082     GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app,
00083                                        GUISUMOAbstractView& parent) ;
00084 
00085 
00093     GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app,
00094             GUISUMOAbstractView& parent) ;
00095 
00096 
00102     Boundary getCenteringBoundary() const ;
00103 
00104 
00109     void drawGL(const GUIVisualizationSettings& s) const ;
00111 
00112 
00113 
00114     GUIManipulator* openManipulator(GUIMainWindow& app,
00115                                     GUISUMOAbstractView& parent);
00116 
00117 public:
00118     class GUITriggeredRerouterPopupMenu : public GUIGLObjectPopupMenu {
00119         FXDECLARE(GUITriggeredRerouterPopupMenu)
00120     public:
00121 
00122         GUITriggeredRerouterPopupMenu(GUIMainWindow& app,
00123                                       GUISUMOAbstractView& parent, GUIGlObject& o);
00124 
00125         ~GUITriggeredRerouterPopupMenu() ;
00126 
00128         long onCmdOpenManip(FXObject*, FXSelector, void*);
00129 
00130     protected:
00131         GUITriggeredRerouterPopupMenu() { }
00132 
00133     };
00134 
00135 
00136     class GUIManip_TriggeredRerouter : public GUIManipulator {
00137         FXDECLARE(GUIManip_TriggeredRerouter)
00138     public:
00139         enum {
00140             MID_USER_DEF = FXDialogBox::ID_LAST,
00141             MID_PRE_DEF,
00142             MID_OPTION,
00143             MID_CLOSE,
00144             ID_LAST
00145         };
00147         GUIManip_TriggeredRerouter(GUIMainWindow& app,
00148                                    const std::string& name, GUITriggeredRerouter& o,
00149                                    int xpos, int ypos);
00150 
00152         virtual ~GUIManip_TriggeredRerouter();
00153 
00154         long onCmdOverride(FXObject*, FXSelector, void*);
00155         long onCmdClose(FXObject*, FXSelector, void*);
00156         long onCmdUserDef(FXObject*, FXSelector, void*);
00157         long onUpdUserDef(FXObject*, FXSelector, void*);
00158         long onCmdChangeOption(FXObject*, FXSelector, void*);
00159 
00160     private:
00161         GUIMainWindow* myParent;
00162 
00163         FXint myChosenValue;
00164 
00165         FXDataTarget myChosenTarget;
00166 
00167         SUMOReal myUsageProbability;
00168 
00169         FXRealSpinDial* myUsageProbabilityDial;
00170 
00171         FXDataTarget myUsageProbabilityTarget;
00172 
00173         GUITriggeredRerouter* myObject;
00174 
00175     protected:
00176         GUIManip_TriggeredRerouter() { }
00177 
00178     };
00179 
00180 private:
00182     typedef std::vector<Position> PosCont;
00183 
00185     typedef std::vector<SUMOReal> RotCont;
00186 
00187 private:
00189     PosCont myFGPositions;
00190 
00192     RotCont myFGRotations;
00193 
00195     Boundary myBoundary;
00196 
00197 };
00198 
00199 
00200 #endif
00201 
00202 /****************************************************************************/
00203 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines