SUMO - Simulation of Urban MObility

GUITriggeredRerouter.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Reroutes vehicles passing an edge (gui-version)
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 GUITriggeredRerouter_h
00020 #define GUITriggeredRerouter_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 <vector>
00033 #include <string>
00034 #include <microsim/trigger/MSTriggeredRerouter.h>
00035 #include <utils/foxtools/FXRealSpinDial.h>
00036 #include <utils/gui/globjects/GUIGlObject_AbstractAdd.h>
00037 #include <utils/gui/globjects/GUIGLObjectPopupMenu.h>
00038 #include <gui/GUIManipulator.h>
00039 
00040 
00041 // ===========================================================================
00042 // class definitions
00043 // ===========================================================================
00048 class GUITriggeredRerouter
00049     : public MSTriggeredRerouter,
00050       public GUIGlObject_AbstractAdd {
00051 public:
00059     GUITriggeredRerouter(const std::string& id,
00060                          const std::vector<MSEdge*> &edges, SUMOReal prob,
00061                          const std::string& aXMLFilename, bool off);
00062 
00063 
00065     ~GUITriggeredRerouter() throw();
00066 
00067 
00068 
00070 
00071 
00079     GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app,
00080                                        GUISUMOAbstractView& parent) throw();
00081 
00082 
00090     GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app,
00091             GUISUMOAbstractView& parent) throw();
00092 
00093 
00099     Boundary getCenteringBoundary() const throw();
00100 
00101 
00106     void drawGL(const GUIVisualizationSettings& s) const throw();
00108 
00109 
00110 
00111     GUIManipulator* openManipulator(GUIMainWindow& app,
00112                                     GUISUMOAbstractView& parent);
00113 
00114 public:
00115     class GUITriggeredRerouterPopupMenu : public GUIGLObjectPopupMenu {
00116         FXDECLARE(GUITriggeredRerouterPopupMenu)
00117     public:
00118 
00119         GUITriggeredRerouterPopupMenu(GUIMainWindow& app,
00120                                       GUISUMOAbstractView& parent, GUIGlObject& o);
00121 
00122         ~GUITriggeredRerouterPopupMenu() throw();
00123 
00125         long onCmdOpenManip(FXObject*,FXSelector,void*);
00126 
00127     protected:
00128         GUITriggeredRerouterPopupMenu() { }
00129 
00130     };
00131 
00132 
00133     class GUIManip_TriggeredRerouter : public GUIManipulator {
00134         FXDECLARE(GUIManip_TriggeredRerouter)
00135     public:
00136         enum {
00137             MID_USER_DEF = FXDialogBox::ID_LAST,
00138             MID_PRE_DEF,
00139             MID_OPTION,
00140             MID_CLOSE,
00141             ID_LAST
00142         };
00144         GUIManip_TriggeredRerouter(GUIMainWindow& app,
00145                                    const std::string& name, GUITriggeredRerouter& o,
00146                                    int xpos, int ypos);
00147 
00149         virtual ~GUIManip_TriggeredRerouter();
00150 
00151         long onCmdOverride(FXObject*,FXSelector,void*);
00152         long onCmdClose(FXObject*,FXSelector,void*);
00153         long onCmdUserDef(FXObject*,FXSelector,void*);
00154         long onUpdUserDef(FXObject*,FXSelector,void*);
00155         long onCmdChangeOption(FXObject*,FXSelector,void*);
00156 
00157     private:
00158         GUIMainWindow* myParent;
00159 
00160         FXint myChosenValue;
00161 
00162         FXDataTarget myChosenTarget;
00163 
00164         SUMOReal myUsageProbability;
00165 
00166         FXRealSpinDial* myUsageProbabilityDial;
00167 
00168         FXDataTarget myUsageProbabilityTarget;
00169 
00170         GUITriggeredRerouter* myObject;
00171 
00172     protected:
00173         GUIManip_TriggeredRerouter() { }
00174 
00175     };
00176 
00177 private:
00179     typedef std::vector<Position> PosCont;
00180 
00182     typedef std::vector<SUMOReal> RotCont;
00183 
00184 private:
00186     PosCont myFGPositions;
00187 
00189     RotCont myFGRotations;
00190 
00192     Boundary myBoundary;
00193 
00194 };
00195 
00196 
00197 #endif
00198 
00199 /****************************************************************************/
00200 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines