GUIDialog_ViewSettings.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // The dialog to change the view (gui) settings.
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 GUIDialog_ViewSettings_h
00020 #define GUIDialog_ViewSettings_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 <fx.h>
00033 #include <utils/gui/windows/GUISUMOAbstractView.h>
00034 #include <utils/foxtools/FXRealSpinDial.h>
00035 #include <utils/foxtools/MFXAddEditTypedTable.h>
00036 #include <utils/foxtools/MFXMutex.h>
00037 
00038 
00039 // ===========================================================================
00040 // class definitions
00041 // ===========================================================================
00048 class GUIDialog_ViewSettings : public FXDialogBox {
00049     // is a FOX-object with an own mapping
00050     FXDECLARE(GUIDialog_ViewSettings)
00051 public:
00060     GUIDialog_ViewSettings(GUISUMOAbstractView *parent,
00061                            GUIVisualizationSettings *settings,
00062                            std::vector<GUISUMOAbstractView::Decal> *decals,
00063                            MFXMutex *decalsLock) throw();
00064 
00065 
00067     ~GUIDialog_ViewSettings() throw();
00068 
00069 
00073     void setCurrent(GUIVisualizationSettings *settings) throw();
00074 
00075 
00076 
00079 
00081     long onCmdOk(FXObject*,FXSelector,void*);
00082 
00084     long onCmdCancel(FXObject*,FXSelector,void*);
00085 
00087     long onCmdColorChange(FXObject*,FXSelector,void*);
00088 
00090     long onCmdEditTable(FXObject*,FXSelector,void*data);
00091 
00093     long onCmdNameChange(FXObject*,FXSelector,void*);
00094 
00096     long onCmdSaveSetting(FXObject*,FXSelector,void*data);
00098     long onUpdSaveSetting(FXObject*,FXSelector,void*data);
00099 
00101     long onCmdDeleteSetting(FXObject*,FXSelector,void*data);
00103     long onUpdDeleteSetting(FXObject*,FXSelector,void*data);
00104 
00106     long onCmdExportSetting(FXObject*,FXSelector,void*data);
00108     long onUpdExportSetting(FXObject*,FXSelector,void*data);
00109 
00111     long onCmdImportSetting(FXObject*,FXSelector,void*data);
00113     long onUpdImportSetting(FXObject*,FXSelector,void*data);
00114 
00116     long onCmdLoadDecals(FXObject*,FXSelector,void*data);
00118     long onCmdSaveDecals(FXObject*,FXSelector,void*data);
00120 
00121 
00122 
00126     std::string getCurrentScheme() const throw();
00127 
00128 
00132     void setCurrentScheme(const std::string &) throw();
00133 
00134 
00135 protected:
00140     RGBColor convert(const FXColor c) const throw();
00141 
00142 
00147     FXColor convert(const RGBColor &c) const throw();
00148 
00149 
00153     void rebuildColorMatrices(bool doCreate=false) throw();
00154 
00155 
00157     void rebuildList() throw();
00158 
00159 
00163     void loadSettings(const std::string &file) throw();
00164 
00165 
00169     void saveDecals(const std::string &file) const throw();
00170 
00171 
00175     void loadDecals(const std::string &file) throw();
00176 
00177 
00178 private:
00180     GUISUMOAbstractView *myParent;
00181 
00183     GUIVisualizationSettings *mySettings;
00184 
00186     GUIVisualizationSettings myBackup;
00187 
00189     std::vector<GUISUMOAbstractView::Decal> *myDecals;
00190 
00192     MFXMutex *myDecalsLock;
00193 
00194 
00197     FXComboBox *mySchemeName;
00198     FXCheckButton *myShowGrid;
00199     FXRealSpinDial *myGridXSizeDialer, *myGridYSizeDialer;
00200 
00201     FXColorWell *myBackgroundColor;
00202     FXVerticalFrame *myDecalsFrame;
00203     MFXAddEditTypedTable *myDecalsTable;
00204 
00205     FXComboBox *myLaneEdgeColorMode;
00206     FXVerticalFrame *myLaneColorSettingFrame;
00207     std::vector<FXColorWell *> myLaneColors;
00208     std::vector<FXRealSpinDial *> myLaneThresholds;
00209     std::vector<FXButton *> myLaneButtons;
00210     FXCheckButton *myLaneColorInterpolation;
00211 
00212     FXCheckButton *myShowLaneBorders, *myShowLaneDecals, *myShowRails, *myShowEdgeName, *myShowInternalEdgeName, *myHideMacroConnectors;
00213     FXRealSpinDial *myEdgeNameSizeDialer;
00214     FXColorWell *myEdgeNameColor;
00215     FXRealSpinDial *myInternalEdgeNameSizeDialer;
00216     FXColorWell *myInternalEdgeNameColor;
00217 
00218     FXComboBox *myVehicleColorMode, *myVehicleShapeDetail;
00219     FXVerticalFrame *myVehicleColorSettingFrame;
00220     std::vector<FXColorWell *> myVehicleColors;
00221     std::vector<FXRealSpinDial *> myVehicleThresholds;
00222     std::vector<FXButton *> myVehicleButtons;
00223     FXCheckButton *myVehicleColorInterpolation;
00224     FXRealSpinDial *myVehicleMinSizeDialer, *myVehicleUpscaleDialer;
00225     FXCheckButton *myShowBlinker, /* *myShowLaneChangePreference,*/ *myShowVehicleName;
00226     FXRealSpinDial *myVehicleNameSizeDialer;
00227     FXColorWell *myVehicleNameColor;
00228 
00229     FXCheckButton *myShowTLIndex, *myShowJunctionIndex;
00230     FXCheckButton *myShowJunctionName;
00231     FXRealSpinDial *myJunctionNameSizeDialer;
00232     FXColorWell *myJunctionNameColor;
00233 
00234     FXRealSpinDial *myDetectorMinSizeDialer, *myDetectorUpscaleDialer, *myAddNameSizeDialer;
00235     FXCheckButton *myShowAddName;
00236 
00237     FXRealSpinDial *myPOIMinSizeDialer, *myPOIUpscaleDialer, *myPOINameSizeDialer;
00238     FXCheckButton *myShowPOIName;
00239     FXColorWell *myPOINameColor;
00240 
00241     FXCheckButton *myShowLane2Lane;
00242     FXCheckButton *myAntialiase;
00243     FXCheckButton *myDither;
00244     FXCheckButton *myShowSizeLegend;
00246 
00247 
00248 protected:
00250     GUIDialog_ViewSettings() { }
00251 
00252 
00253 private:
00255     GUIDialog_ViewSettings(const GUIDialog_ViewSettings &s);
00256 
00258     GUIDialog_ViewSettings &operator=(const GUIDialog_ViewSettings &s);
00259 
00260 
00261 };
00262 
00263 
00264 #endif
00265 
00266 /****************************************************************************/
00267 

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