GUILaneSpeedTrigger.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // Changes the speed allowed on a set of lanes (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 GUILaneSpeedTrigger_h
00020 #define GUILaneSpeedTrigger_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/MSLaneSpeedTrigger.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 MSLane;
00048 class GUIManipulator;
00049 
00050 
00051 // ===========================================================================
00052 // class definitions
00053 // ===========================================================================
00060 class GUILaneSpeedTrigger
00061         : public MSLaneSpeedTrigger,
00062             public GUIGlObject_AbstractAdd {
00063 public:
00070     GUILaneSpeedTrigger(const std::string &id,
00071                         const std::vector<MSLane*> &destLanes,
00072                         const std::string &file) throw(ProcessError);
00073 
00074 
00076     ~GUILaneSpeedTrigger() throw();
00077 
00078 
00079 
00081 
00082 
00090     GUIGLObjectPopupMenu *getPopUpMenu(GUIMainWindow &app,
00091                                        GUISUMOAbstractView &parent) throw();
00092 
00093 
00101     GUIParameterTableWindow *getParameterWindow(GUIMainWindow &app,
00102             GUISUMOAbstractView &parent) throw();
00103 
00104 
00110     const std::string &getMicrosimID() const throw();
00111 
00112 
00118     Boundary getCenteringBoundary() const throw();
00119 
00120 
00125     void drawGL(const GUIVisualizationSettings &s) const throw();
00127 
00128 
00129 
00130     GUIManipulator *openManipulator(GUIMainWindow &app,
00131                                     GUISUMOAbstractView &parent);
00132 
00133 public:
00134     class GUILaneSpeedTriggerPopupMenu : public GUIGLObjectPopupMenu {
00135         FXDECLARE(GUILaneSpeedTriggerPopupMenu)
00136     public:
00137 
00138         GUILaneSpeedTriggerPopupMenu(GUIMainWindow &app,
00139                                      GUISUMOAbstractView &parent, GUIGlObject &o);
00140 
00141         ~GUILaneSpeedTriggerPopupMenu() throw();
00142 
00144         long onCmdOpenManip(FXObject*,FXSelector,void*);
00145 
00146     protected:
00147         GUILaneSpeedTriggerPopupMenu() { }
00148 
00149     };
00150 
00151     class GUIManip_LaneSpeedTrigger : public GUIManipulator {
00152         FXDECLARE(GUIManip_LaneSpeedTrigger)
00153     public:
00154         enum {
00155             MID_USER_DEF = FXDialogBox::ID_LAST,
00156             MID_PRE_DEF,
00157             MID_OPTION,
00158             MID_CLOSE,
00159             ID_LAST
00160         };
00162         GUIManip_LaneSpeedTrigger(GUIMainWindow &app,
00163                                   const std::string &name, GUILaneSpeedTrigger &o,
00164                                   int xpos, int ypos);
00165 
00167         virtual ~GUIManip_LaneSpeedTrigger();
00168 
00169         long onCmdOverride(FXObject*,FXSelector,void*);
00170         long onCmdClose(FXObject*,FXSelector,void*);
00171         long onCmdUserDef(FXObject*,FXSelector,void*);
00172         long onUpdUserDef(FXObject*,FXSelector,void*);
00173         long onCmdPreDef(FXObject*,FXSelector,void*);
00174         long onUpdPreDef(FXObject*,FXSelector,void*);
00175         long onCmdChangeOption(FXObject*,FXSelector,void*);
00176 
00177     private:
00178         GUIMainWindow *myParent;
00179 
00180         FXint myChosenValue;
00181 
00182         FXDataTarget myChosenTarget;
00183 
00184         SUMOReal mySpeed;
00185 
00186         FXDataTarget mySpeedTarget;
00187 
00188         FXRealSpinDial *myUserDefinedSpeed;
00189 
00190         FXComboBox *myPredefinedValues;
00191 
00192         GUILaneSpeedTrigger *myObject;
00193 
00194     protected:
00195         GUIManip_LaneSpeedTrigger() { }
00196 
00197     };
00198 
00199 private:
00201     typedef std::vector<Position2D> PosCont;
00202 
00204     typedef std::vector<SUMOReal> RotCont;
00205 
00206 private:
00208     PosCont myFGPositions;
00209 
00211     RotCont myFGRotations;
00212 
00214     Boundary myBoundary;
00215 
00217     bool myShowAsKMH;
00218 
00220     mutable SUMOReal myLastValue;
00221 
00223     mutable std::string myLastValueString;
00224 
00225 };
00226 
00227 
00228 #endif
00229 
00230 /****************************************************************************/
00231 

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