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:
205 
208 
211 
213  std::vector<GUISUMOAbstractView::Decal> *myDecals;
214 
217 
218 
221  FXComboBox* mySchemeName;
222  FXCheckButton* myShowGrid;
224 
225  FXColorWell* myBackgroundColor;
226  FXVerticalFrame* myDecalsFrame;
228 
229  FXComboBox* myLaneEdgeColorMode;
230  FXVerticalFrame* myLaneColorSettingFrame;
231  std::vector<FXColorWell*> myLaneColors;
232  std::vector<FXRealSpinDial*> myLaneThresholds;
233  std::vector<FXButton*> myLaneButtons;
234  FXCheckButton* myLaneColorInterpolation;
235 
238 
240  FXVerticalFrame* myVehicleColorSettingFrame;
241  std::vector<FXColorWell*> myVehicleColors;
242  std::vector<FXRealSpinDial*> myVehicleThresholds;
243  std::vector<FXButton*> myVehicleButtons;
246  FXCheckButton* myShowBlinker, *myShowMinGap; /* *myShowLaneChangePreference,*/
247 
249 
252 
253  FXCheckButton* myShowLane2Lane;
254  FXCheckButton* myAntialiase;
255  FXCheckButton* myDither;
256  FXCheckButton* myShowSizeLegend;
257 
262 
263 
264 protected:
267 
268 
269 private:
272 
275 
276 
277 };
278 
279 
280 #endif
281 
282 /****************************************************************************/
283