SUMO - Simulation of Urban MObility

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 (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 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 
00037 
00038 // ===========================================================================
00039 // class declarations
00040 // ===========================================================================
00041 class MFXMutex;
00042 
00043 
00044 // ===========================================================================
00045 // class definitions
00046 // ===========================================================================
00053 class GUIDialog_ViewSettings : public FXDialogBox {
00054     // is a FOX-object with an own mapping
00055     FXDECLARE(GUIDialog_ViewSettings)
00056 public:
00057 
00058     class NamePanel {
00059     public:
00060         NamePanel(FXMatrix* parent, GUIDialog_ViewSettings* target,
00061                   const std::string& title,
00062                   const GUIVisualizationTextSettings& settings);
00063 
00064         GUIVisualizationTextSettings getSettings();
00065         void update(const GUIVisualizationTextSettings& settings);
00066 
00067         FXCheckButton* myCheck;
00068         FXRealSpinDial* mySizeDial;
00069         FXColorWell* myColorWell;
00070     };
00071 
00080     GUIDialog_ViewSettings(GUISUMOAbstractView* parent,
00081                            GUIVisualizationSettings* settings,
00082                            std::vector<GUISUMOAbstractView::Decal> *decals,
00083                            MFXMutex* decalsLock) throw();
00084 
00085 
00087     ~GUIDialog_ViewSettings() throw();
00088 
00089 
00093     void setCurrent(GUIVisualizationSettings* settings) throw();
00094 
00095 
00096 
00099 
00101     long onCmdOk(FXObject*,FXSelector,void*);
00102 
00104     long onCmdCancel(FXObject*,FXSelector,void*);
00105 
00107     long onCmdColorChange(FXObject*,FXSelector,void*);
00108 
00110     long onCmdEditTable(FXObject*,FXSelector,void* data);
00111 
00113     long onCmdNameChange(FXObject*,FXSelector,void*);
00114 
00116     long onCmdSaveSetting(FXObject*,FXSelector,void* data);
00118     long onUpdSaveSetting(FXObject*,FXSelector,void* data);
00119 
00121     long onCmdDeleteSetting(FXObject*,FXSelector,void* data);
00123     long onUpdDeleteSetting(FXObject*,FXSelector,void* data);
00124 
00126     long onCmdExportSetting(FXObject*,FXSelector,void* data);
00128     long onUpdExportSetting(FXObject*,FXSelector,void* data);
00129 
00131     long onCmdImportSetting(FXObject*,FXSelector,void* data);
00133     long onUpdImportSetting(FXObject*,FXSelector,void* data);
00134 
00136     long onCmdLoadDecals(FXObject*,FXSelector,void* data);
00138     long onCmdSaveDecals(FXObject*,FXSelector,void* data);
00140 
00141 
00142 
00146     std::string getCurrentScheme() const throw();
00147 
00148 
00152     void setCurrentScheme(const std::string&) throw();
00153 
00154 
00159     static RGBColor convert(const FXColor c);
00160 
00161 
00166     static FXColor convert(const RGBColor& c);
00167 
00168 protected:
00169 
00170 
00174     void rebuildColorMatrices(bool doCreate=false) throw();
00175 
00176 
00178     void rebuildList() throw();
00179 
00180 
00184     void loadSettings(const std::string& file) throw();
00185 
00186 
00190     void saveDecals(const std::string& file) const throw();
00191 
00192 
00196     void loadDecals(const std::string& file) throw();
00197 
00198 
00199 private:
00201     GUISUMOAbstractView* myParent;
00202 
00204     GUIVisualizationSettings* mySettings;
00205 
00207     GUIVisualizationSettings myBackup;
00208 
00210     std::vector<GUISUMOAbstractView::Decal> *myDecals;
00211 
00213     MFXMutex* myDecalsLock;
00214 
00215 
00218     FXComboBox* mySchemeName;
00219     FXCheckButton* myShowGrid;
00220     FXRealSpinDial* myGridXSizeDialer, *myGridYSizeDialer;
00221 
00222     FXColorWell* myBackgroundColor;
00223     FXVerticalFrame* myDecalsFrame;
00224     MFXAddEditTypedTable* myDecalsTable;
00225 
00226     FXComboBox* myLaneEdgeColorMode;
00227     FXVerticalFrame* myLaneColorSettingFrame;
00228     std::vector<FXColorWell*> myLaneColors;
00229     std::vector<FXRealSpinDial*> myLaneThresholds;
00230     std::vector<FXButton*> myLaneButtons;
00231     FXCheckButton* myLaneColorInterpolation;
00232 
00233     FXCheckButton* myShowLaneBorders, *myShowLaneDecals, *myShowRails,
00234                    *myHideMacroConnectors;
00235 
00236     FXComboBox* myVehicleColorMode, *myVehicleShapeDetail;
00237     FXVerticalFrame* myVehicleColorSettingFrame;
00238     std::vector<FXColorWell*> myVehicleColors;
00239     std::vector<FXRealSpinDial*> myVehicleThresholds;
00240     std::vector<FXButton*> myVehicleButtons;
00241     FXCheckButton* myVehicleColorInterpolation;
00242     FXRealSpinDial* myVehicleMinSizeDialer, *myVehicleUpscaleDialer;
00243     FXCheckButton* myShowBlinker; /* *myShowLaneChangePreference,*/
00244 
00245     FXCheckButton* myShowTLIndex, *myShowJunctionIndex;
00246 
00247     FXRealSpinDial* myDetectorMinSizeDialer, *myDetectorUpscaleDialer;
00248     FXRealSpinDial* myPOIMinSizeDialer, *myPOIUpscaleDialer;
00249 
00250     FXCheckButton* myShowLane2Lane;
00251     FXCheckButton* myAntialiase;
00252     FXCheckButton* myDither;
00253     FXCheckButton* myShowSizeLegend;
00254 
00255     NamePanel* myEdgeNamePanel, *myInternalEdgeNamePanel, *myStreetNamePanel,
00256                *myJunctionNamePanel, *myInternalJunctionNamePanel,
00257                *myVehicleNamePanel, *myAddNamePanel, *myPoiNamePanel;
00259 
00260 
00261 protected:
00263     GUIDialog_ViewSettings() { }
00264 
00265 
00266 private:
00268     GUIDialog_ViewSettings(const GUIDialog_ViewSettings& s);
00269 
00271     GUIDialog_ViewSettings& operator=(const GUIDialog_ViewSettings& s);
00272 
00273 
00274 };
00275 
00276 
00277 #endif
00278 
00279 /****************************************************************************/
00280 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines