SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIDialog_ViewSettings.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // The dialog to change the view (gui) settings.
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUIDialog_ViewSettings_h
23 #define GUIDialog_ViewSettings_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <fx.h>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class MFXMutex;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
57  // is a FOX-object with an own mapping
58  FXDECLARE(GUIDialog_ViewSettings)
59 public:
60 
61  class NamePanel {
62  public:
63  NamePanel(FXMatrix* parent, GUIDialog_ViewSettings* target,
64  const std::string& title,
65  const GUIVisualizationTextSettings& settings);
66 
68  void update(const GUIVisualizationTextSettings& settings);
69 
70  FXCheckButton* myCheck;
71  FXRealSpinDial* mySizeDial;
72  FXColorWell* myColorWell;
73  };
74 
84  GUIVisualizationSettings* settings,
85  std::vector<GUISUMOAbstractView::Decal>* decals,
86  MFXMutex* decalsLock);
87 
88 
91 
92 
96  void setCurrent(GUIVisualizationSettings* settings);
97 
98 
99 
102 
104  long onCmdOk(FXObject*, FXSelector, void*);
105 
107  long onCmdCancel(FXObject*, FXSelector, void*);
108 
110  long onCmdColorChange(FXObject*, FXSelector, void*);
111 
113  long onCmdEditTable(FXObject*, FXSelector, void* data);
114 
116  long onCmdNameChange(FXObject*, FXSelector, void*);
117 
119  long onCmdSaveSetting(FXObject*, FXSelector, void* data);
121  long onUpdSaveSetting(FXObject*, FXSelector, void* data);
122 
124  long onCmdDeleteSetting(FXObject*, FXSelector, void* data);
126  long onUpdDeleteSetting(FXObject*, FXSelector, void* data);
127 
129  long onCmdExportSetting(FXObject*, FXSelector, void* data);
131  long onUpdExportSetting(FXObject*, FXSelector, void* data);
132 
134  long onCmdImportSetting(FXObject*, FXSelector, void* data);
136  long onUpdImportSetting(FXObject*, FXSelector, void* data);
137 
139  long onCmdLoadDecals(FXObject*, FXSelector, void* data);
141  long onCmdSaveDecals(FXObject*, FXSelector, void* data);
143 
144 
145 
149  std::string getCurrentScheme() const;
150 
151 
155  void setCurrentScheme(const std::string&);
156 
157 
162  static RGBColor convert(const FXColor c);
163 
164 
169  static FXColor convert(const RGBColor& c);
170 
171 protected:
172 
173 
177  void rebuildColorMatrices(bool doCreate = false);
178 
179 
181  void rebuildList();
182 
183 
187  void loadSettings(const std::string& file);
188 
189 
193  void saveDecals(const std::string& file) const;
194 
195 
199  void loadDecals(const std::string& file);
200 
201 
202 private:
204  static unsigned int myCustomSchemes;
205 
208 
211 
214 
216  std::vector<GUISUMOAbstractView::Decal>* myDecals;
217 
220 
223  FXComboBox* mySchemeName;
224  FXCheckButton* myShowGrid;
226 
227  FXColorWell* myBackgroundColor;
228  FXVerticalFrame* myDecalsFrame;
230 
231  FXComboBox* myLaneEdgeColorMode;
232  FXVerticalFrame* myLaneColorSettingFrame;
233  std::vector<FXColorWell*> myLaneColors;
234  std::vector<FXRealSpinDial*> myLaneThresholds;
235  std::vector<FXButton*> myLaneButtons;
236  FXCheckButton* myLaneColorInterpolation;
237 
240  FXRealSpinDial* myLaneWidthUpscaleDialer;
241 
243  FXVerticalFrame* myVehicleColorSettingFrame;
244  std::vector<FXColorWell*> myVehicleColors;
245  std::vector<FXRealSpinDial*> myVehicleThresholds;
246  std::vector<FXButton*> myVehicleButtons;
249  FXCheckButton* myShowBlinker, *myShowMinGap; /* *myShowLaneChangePreference,*/
250 
252 
255 
256  FXCheckButton* myShowLane2Lane;
257  FXCheckButton* myAntialiase;
258  FXCheckButton* myDither;
259  FXCheckButton* myShowSizeLegend;
260 
265 
266 
267 protected:
270 
271 
272 private:
275 
278 
279 
280 };
281 
282 
283 #endif
284 
285 /****************************************************************************/
286