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 2001-2010 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/gui/globjects/GUIGlObject.h>
00036 #include <utils/gui/globjects/GUIGlObject_AbstractAdd.h>
00037 #include <utils/gui/globjects/GUIGLObjectPopupMenu.h>
00038 #include <utils/geom/Position2D.h>
00039 #include <gui/GUIManipulator.h>
00040 #include <utils/foxtools/FXRealSpinDial.h>
00041 
00042 
00043 // ===========================================================================
00044 // class declarations
00045 // ===========================================================================
00046 class MSNet;
00047 class MSEdge;
00048 class GUIManipulator;
00049 
00050 
00051 // ===========================================================================
00052 // class definitions
00053 // ===========================================================================
00058 class GUITriggeredRerouter
00059         : public MSTriggeredRerouter,
00060             public GUIGlObject_AbstractAdd {
00061 public:
00063     GUITriggeredRerouter(const std::string &id,
00064                          const std::vector<MSEdge*> &edges, SUMOReal prob,
00065                          const std::string &aXMLFilename, bool off);
00066 
00067 
00069     ~GUITriggeredRerouter() throw();
00070 
00071 
00072 
00074 
00075 
00083     GUIGLObjectPopupMenu *getPopUpMenu(GUIMainWindow &app,
00084                                        GUISUMOAbstractView &parent) throw();
00085 
00086 
00094     GUIParameterTableWindow *getParameterWindow(GUIMainWindow &app,
00095             GUISUMOAbstractView &parent) throw();
00096 
00097 
00103     const std::string &getMicrosimID() const throw();
00104 
00105 
00111     Boundary getCenteringBoundary() const throw();
00112 
00113 
00118     void drawGL(const GUIVisualizationSettings &s) const throw();
00120 
00121 
00122 
00123     GUIManipulator *openManipulator(GUIMainWindow &app,
00124                                     GUISUMOAbstractView &parent);
00125 
00126 public:
00127     class GUITriggeredRerouterPopupMenu : public GUIGLObjectPopupMenu {
00128         FXDECLARE(GUITriggeredRerouterPopupMenu)
00129     public:
00130 
00131         GUITriggeredRerouterPopupMenu(GUIMainWindow &app,
00132                                       GUISUMOAbstractView &parent, GUIGlObject &o);
00133 
00134         ~GUITriggeredRerouterPopupMenu() throw();
00135 
00137         long onCmdOpenManip(FXObject*,FXSelector,void*);
00138 
00139     protected:
00140         GUITriggeredRerouterPopupMenu() { }
00141 
00142     };
00143 
00144 
00145     class GUIManip_TriggeredRerouter : public GUIManipulator {
00146         FXDECLARE(GUIManip_TriggeredRerouter)
00147     public:
00148         enum {
00149             MID_USER_DEF = FXDialogBox::ID_LAST,
00150             MID_PRE_DEF,
00151             MID_OPTION,
00152             MID_CLOSE,
00153             ID_LAST
00154         };
00156         GUIManip_TriggeredRerouter(GUIMainWindow &app,
00157                                    const std::string &name, GUITriggeredRerouter &o,
00158                                    int xpos, int ypos);
00159 
00161         virtual ~GUIManip_TriggeredRerouter();
00162 
00163         long onCmdOverride(FXObject*,FXSelector,void*);
00164         long onCmdClose(FXObject*,FXSelector,void*);
00165         long onCmdUserDef(FXObject*,FXSelector,void*);
00166         long onUpdUserDef(FXObject*,FXSelector,void*);
00167         long onCmdChangeOption(FXObject*,FXSelector,void*);
00168 
00169     private:
00170         GUIMainWindow *myParent;
00171 
00172         FXint myChosenValue;
00173 
00174         FXDataTarget myChosenTarget;
00175 
00176         SUMOReal myUsageProbability;
00177 
00178         FXRealSpinDial *myUsageProbabilityDial;
00179 
00180         FXDataTarget myUsageProbabilityTarget;
00181 
00182         GUITriggeredRerouter *myObject;
00183 
00184     protected:
00185         GUIManip_TriggeredRerouter() { }
00186 
00187     };
00188 
00189 private:
00191     typedef std::vector<Position2D> PosCont;
00192 
00194     typedef std::vector<SUMOReal> RotCont;
00195 
00196 private:
00198     PosCont myFGPositions;
00199 
00201     RotCont myFGRotations;
00202 
00204     Boundary myBoundary;
00205 
00206 };
00207 
00208 
00209 #endif
00210 
00211 /****************************************************************************/
00212 

Generated on Wed May 5 00:06:30 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6