SUMO - Simulation of Urban MObility
GUIDialog_ViewSettings.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // The dialog to change the view (gui) settings.
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 GUIDialog_ViewSettings_h
00023 #define GUIDialog_ViewSettings_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 <fx.h>
00036 #include <utils/gui/windows/GUISUMOAbstractView.h>
00037 #include <utils/foxtools/FXRealSpinDial.h>
00038 #include <utils/foxtools/MFXAddEditTypedTable.h>
00039 
00040 
00041 // ===========================================================================
00042 // class declarations
00043 // ===========================================================================
00044 class MFXMutex;
00045 
00046 
00047 // ===========================================================================
00048 // class definitions
00049 // ===========================================================================
00056 class GUIDialog_ViewSettings : public FXDialogBox {
00057     // is a FOX-object with an own mapping
00058     FXDECLARE(GUIDialog_ViewSettings)
00059 public:
00060 
00061     class NamePanel {
00062     public:
00063         NamePanel(FXMatrix* parent, GUIDialog_ViewSettings* target,
00064                   const std::string& title,
00065                   const GUIVisualizationTextSettings& settings);
00066 
00067         GUIVisualizationTextSettings getSettings();
00068         void update(const GUIVisualizationTextSettings& settings);
00069 
00070         FXCheckButton* myCheck;
00071         FXRealSpinDial* mySizeDial;
00072         FXColorWell* myColorWell;
00073     };
00074 
00083     GUIDialog_ViewSettings(GUISUMOAbstractView* parent,
00084                            GUIVisualizationSettings* settings,
00085                            std::vector<GUISUMOAbstractView::Decal> *decals,
00086                            MFXMutex* decalsLock) ;
00087 
00088 
00090     ~GUIDialog_ViewSettings() ;
00091 
00092 
00096     void setCurrent(GUIVisualizationSettings* settings) ;
00097 
00098 
00099 
00102 
00104     long onCmdOk(FXObject*, FXSelector, void*);
00105 
00107     long onCmdCancel(FXObject*, FXSelector, void*);
00108 
00110     long onCmdColorChange(FXObject*, FXSelector, void*);
00111 
00113     long onCmdEditTable(FXObject*, FXSelector, void* data);
00114 
00116     long onCmdNameChange(FXObject*, FXSelector, void*);
00117 
00119     long onCmdSaveSetting(FXObject*, FXSelector, void* data);
00121     long onUpdSaveSetting(FXObject*, FXSelector, void* data);
00122 
00124     long onCmdDeleteSetting(FXObject*, FXSelector, void* data);
00126     long onUpdDeleteSetting(FXObject*, FXSelector, void* data);
00127 
00129     long onCmdExportSetting(FXObject*, FXSelector, void* data);
00131     long onUpdExportSetting(FXObject*, FXSelector, void* data);
00132 
00134     long onCmdImportSetting(FXObject*, FXSelector, void* data);
00136     long onUpdImportSetting(FXObject*, FXSelector, void* data);
00137 
00139     long onCmdLoadDecals(FXObject*, FXSelector, void* data);
00141     long onCmdSaveDecals(FXObject*, FXSelector, void* data);
00143 
00144 
00145 
00149     std::string getCurrentScheme() const ;
00150 
00151 
00155     void setCurrentScheme(const std::string&) ;
00156 
00157 
00162     static RGBColor convert(const FXColor c);
00163 
00164 
00169     static FXColor convert(const RGBColor& c);
00170 
00171 protected:
00172 
00173 
00177     void rebuildColorMatrices(bool doCreate = false) ;
00178 
00179 
00181     void rebuildList() ;
00182 
00183 
00187     void loadSettings(const std::string& file) ;
00188 
00189 
00193     void saveDecals(const std::string& file) const ;
00194 
00195 
00199     void loadDecals(const std::string& file) ;
00200 
00201 
00202 private:
00204     GUISUMOAbstractView* myParent;
00205 
00207     GUIVisualizationSettings* mySettings;
00208 
00210     GUIVisualizationSettings myBackup;
00211 
00213     std::vector<GUISUMOAbstractView::Decal> *myDecals;
00214 
00216     MFXMutex* myDecalsLock;
00217 
00218 
00221     FXComboBox* mySchemeName;
00222     FXCheckButton* myShowGrid;
00223     FXRealSpinDial* myGridXSizeDialer, *myGridYSizeDialer;
00224 
00225     FXColorWell* myBackgroundColor;
00226     FXVerticalFrame* myDecalsFrame;
00227     MFXAddEditTypedTable* myDecalsTable;
00228 
00229     FXComboBox* myLaneEdgeColorMode;
00230     FXVerticalFrame* myLaneColorSettingFrame;
00231     std::vector<FXColorWell*> myLaneColors;
00232     std::vector<FXRealSpinDial*> myLaneThresholds;
00233     std::vector<FXButton*> myLaneButtons;
00234     FXCheckButton* myLaneColorInterpolation;
00235 
00236     FXCheckButton* myShowLaneBorders, *myShowLaneDecals, *myShowRails,
00237                    *myHideMacroConnectors;
00238 
00239     FXComboBox* myVehicleColorMode, *myVehicleShapeDetail;
00240     FXVerticalFrame* myVehicleColorSettingFrame;
00241     std::vector<FXColorWell*> myVehicleColors;
00242     std::vector<FXRealSpinDial*> myVehicleThresholds;
00243     std::vector<FXButton*> myVehicleButtons;
00244     FXCheckButton* myVehicleColorInterpolation;
00245     FXRealSpinDial* myVehicleMinSizeDialer, *myVehicleUpscaleDialer;
00246     FXCheckButton* myShowBlinker, *myShowMinGap; /* *myShowLaneChangePreference,*/
00247 
00248     FXCheckButton* myShowTLIndex, *myShowJunctionIndex;
00249 
00250     FXRealSpinDial* myDetectorMinSizeDialer, *myDetectorUpscaleDialer;
00251     FXRealSpinDial* myPOIMinSizeDialer, *myPOIUpscaleDialer;
00252 
00253     FXCheckButton* myShowLane2Lane;
00254     FXCheckButton* myAntialiase;
00255     FXCheckButton* myDither;
00256     FXCheckButton* myShowSizeLegend;
00257 
00258     NamePanel* myEdgeNamePanel, *myInternalEdgeNamePanel, *myStreetNamePanel,
00259                *myJunctionNamePanel, *myInternalJunctionNamePanel,
00260                *myVehicleNamePanel, *myAddNamePanel, *myPoiNamePanel;
00262 
00263 
00264 protected:
00266     GUIDialog_ViewSettings() { }
00267 
00268 
00269 private:
00271     GUIDialog_ViewSettings(const GUIDialog_ViewSettings& s);
00272 
00274     GUIDialog_ViewSettings& operator=(const GUIDialog_ViewSettings& s);
00275 
00276 
00277 };
00278 
00279 
00280 #endif
00281 
00282 /****************************************************************************/
00283 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines