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-sim.org/
12 // Copyright (C) 2001-2013 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 
158 private:
159  bool updateColorRanges(FXObject* sender, std::vector<FXColorWell*>::const_iterator colIt,
160  std::vector<FXColorWell*>::const_iterator colEnd,
161  std::vector<FXRealSpinDial*>::const_iterator threshIt,
162  std::vector<FXRealSpinDial*>::const_iterator threshEnd,
163  std::vector<FXButton*>::const_iterator buttonIt,
164  GUIColorScheme& scheme);
165 
169  FXMatrix* rebuildColorMatrix(FXVerticalFrame* frame,
170  std::vector<FXColorWell*>& colors,
171  std::vector<FXRealSpinDial*>& thresholds,
172  std::vector<FXButton*>& buttons,
173  FXCheckButton* interpolation,
174  GUIColorScheme& scheme);
175 
176 
180  void rebuildColorMatrices(bool doCreate = false);
181 
182 
184  void rebuildList();
185 
186 
190  void loadSettings(const std::string& file);
191 
192 
196  void saveDecals(const std::string& file) const;
197 
198 
202  void loadDecals(const std::string& file);
203 
204 
205 private:
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  FXVerticalFrame* myPersonColorSettingFrame;
253  std::vector<FXColorWell*> myPersonColors;
254  std::vector<FXRealSpinDial*> myPersonThresholds;
255  std::vector<FXButton*> myPersonButtons;
258 
259  FXComboBox* myJunctionColorMode;
260  FXVerticalFrame* myJunctionColorSettingFrame;
261  std::vector<FXColorWell*> myJunctionColors;
262  std::vector<FXRealSpinDial*> myJunctionThresholds;
263  std::vector<FXButton*> myJunctionButtons;
266 
270 
271  FXCheckButton* myShowLane2Lane;
272  FXCheckButton* myAntialiase;
273  FXCheckButton* myDither;
274  FXCheckButton* myShowSizeLegend;
275 
281 
282 
283 protected:
286 
287 
288 private:
291 
294 
295 
296 };
297 
298 
299 #endif
300 
301 /****************************************************************************/
302