SUMO - Simulation of Urban MObility
GUIDialog_ViewSettings.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // The dialog to change the view (gui) settings.
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <fstream>
38 #include <utils/common/RGBColor.h>
40 #include <utils/common/ToString.h>
49 #include "GUIDialog_EditViewport.h"
50 #include "GUIDialog_ViewSettings.h"
51 
52 #ifdef CHECK_MEMORY_LEAKS
53 #include <foreign/nvwa/debug_new.h>
54 #endif // CHECK_MEMORY_LEAKS
55 
56 
57 // ===========================================================================
58 // FOX callback mapping
59 // ===========================================================================
60 FXDEFMAP(GUIDialog_ViewSettings) GUIDialog_ViewSettingsMap[] = {
64  FXMAPFUNC(SEL_COMMAND, MID_SETTINGS_OK, GUIDialog_ViewSettings::onCmdOk),
67 
76 
79 
80 };
81 
82 
83 FXIMPLEMENT(GUIDialog_ViewSettings, FXDialogBox, GUIDialog_ViewSettingsMap, ARRAYNUMBER(GUIDialog_ViewSettingsMap))
84 
85 
86 // ===========================================================================
87 // method definitions
88 // ===========================================================================
90  GUIVisualizationSettings* settings,
91  std::vector<GUISUMOAbstractView::Decal>* decals,
92  MFXMutex* decalsLock) :
93  FXDialogBox(parent, "View Settings", DECOR_TITLE | DECOR_BORDER | DECOR_RESIZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
94  myParent(parent), mySettings(settings),
95  myDecals(decals), myDecalsLock(decalsLock),
96  myDecalsTable(0) {
97  myBackup = (*mySettings);
98 
99  FXVerticalFrame* contentFrame =
100  new FXVerticalFrame(this, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y,
101  0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
102  //
103  {
104  FXHorizontalFrame* frame0 =
105  new FXHorizontalFrame(contentFrame, FRAME_THICK, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
106  mySchemeName = new FXComboBox(frame0, 20, this, MID_SIMPLE_VIEW_NAMECHANGE, COMBOBOX_INSERT_LAST | FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_CENTER_Y | COMBOBOX_STATIC);
107  const std::vector<std::string>& names = gSchemeStorage.getNames();
108  for (std::vector<std::string>::const_iterator i = names.begin(); i != names.end(); ++i) {
109  size_t index = mySchemeName->appendItem((*i).c_str());
110  if ((*i) == mySettings->name) {
111  mySchemeName->setCurrentItem((FXint) index);
112  }
113  }
114  mySchemeName->setNumVisible(5);
115 
116  new FXButton(frame0, "\t\tSave the setting to registry",
118  ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
119  new FXButton(frame0, "\t\tRemove the setting from registry",
121  ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
122  new FXButton(frame0, "\t\tExport setting to file",
124  ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
125  new FXButton(frame0, "\t\tLoad setting from file",
127  ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
128 
129  new FXVerticalSeparator(frame0);
130  new FXLabel(frame0, "Export includes:", 0, LAYOUT_CENTER_Y);
131  mySaveViewPort = new FXCheckButton(frame0, "Viewport");
132  mySaveDelay = new FXCheckButton(frame0, "Delay");
133  mySaveDecals = new FXCheckButton(frame0, "Decals");
134 
135  }
136  //
137  FXTabBook* tabbook =
138  new FXTabBook(contentFrame, 0, 0, TABBOOK_LEFTTABS | PACK_UNIFORM_WIDTH | PACK_UNIFORM_HEIGHT | LAYOUT_FILL_X | LAYOUT_FILL_Y | LAYOUT_RIGHT,
139  0, 0, 0, 0, 0, 0, 0, 0);
140  {
141  // tab for the background
142  new FXTabItem(tabbook, "Background", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
143  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
144  FXVerticalFrame* frame1 =
145  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
146 
147  FXMatrix* m11 =
148  new FXMatrix(frame1, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
149  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
150  new FXLabel(m11, "Color", 0, LAYOUT_CENTER_Y);
151  myBackgroundColor = new FXColorWell(m11, MFXUtils::getFXColor(settings->backgroundColor),
153  LAYOUT_FIX_WIDTH | LAYOUT_CENTER_Y | LAYOUT_SIDE_TOP | FRAME_SUNKEN | FRAME_THICK | ICON_AFTER_TEXT,
154  0, 0, 100, 0, 0, 0, 0, 0);
155 
156  new FXHorizontalSeparator(frame1, SEPARATOR_GROOVE | LAYOUT_FILL_X);
157 
158  FXVerticalFrame* frame11 =
159  new FXVerticalFrame(frame1, LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
160  new FXLabel(frame11, "Decals:");
161  myDecalsFrame = new FXVerticalFrame(frame11);
162  FXHorizontalFrame* frame111 = new FXHorizontalFrame(frame11, LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_FILL_X | PACK_UNIFORM_WIDTH, 0, 0, 0, 0, 10, 10, 5, 5);
163  new FXButton(frame111, "&Load Decals", NULL, this, MID_SIMPLE_VIEW_LOAD_DECALS, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 20, 20, 4, 4);
164  new FXButton(frame111, "&Save Decals", NULL, this, MID_SIMPLE_VIEW_SAVE_DECALS, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 20, 20, 4, 4);
165 
166  new FXHorizontalSeparator(frame1, SEPARATOR_GROOVE | LAYOUT_FILL_X);
167 
168  FXMatrix* m12 =
169  new FXMatrix(frame1, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
170  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
171  myShowGrid =
172  new FXCheckButton(m12, "Show grid", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
173  myShowGrid->setCheck(mySettings->showGrid);
174  new FXLabel(m12, "");
175  FXMatrix* m121 =
176  new FXMatrix(m12, 2, LAYOUT_CENTER_Y | LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
177  0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
178  new FXLabel(m121, "x-spacing", 0, LAYOUT_CENTER_Y);
179  myGridXSizeDialer =
180  new FXRealSpinDial(m121, 10, this, MID_SIMPLE_VIEW_COLORCHANGE,
181  LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
182  myGridXSizeDialer->setRange(1, 10000);
183  myGridXSizeDialer->setValue(mySettings->gridXSize);
184  FXMatrix* m122 =
185  new FXMatrix(m12, 2, LAYOUT_CENTER_Y | LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
186  0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
187  new FXLabel(m122, "y-spacing", 0, LAYOUT_CENTER_Y);
188  myGridYSizeDialer =
189  new FXRealSpinDial(m122, 10, this, MID_SIMPLE_VIEW_COLORCHANGE,
190  LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
191  myGridYSizeDialer->setRange(1, 10000);
192  myGridYSizeDialer->setValue(mySettings->gridXSize);
193  }
194  {
195  // tab for the streets
196  new FXTabItem(tabbook, "Streets", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
197  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
198  FXVerticalFrame* frame2 =
199  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
200  // ... color settings
201  FXVerticalFrame* frame22 =
202  new FXVerticalFrame(frame2, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
203  FXMatrix* m21 =
204  new FXMatrix(frame22, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
205  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
206  new FXLabel(m21, "Color", 0, LAYOUT_CENTER_Y);
207  myLaneEdgeColorMode = new FXComboBox(m21, 30, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
208  myLaneColorInterpolation = new FXCheckButton(m21, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
209  myLaneColorSettingFrame = new FXVerticalFrame(frame22, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2);
210 
211  new FXHorizontalSeparator(frame2, SEPARATOR_GROOVE | LAYOUT_FILL_X);
212  // ... scale settings
213  FXVerticalFrame* frame23 =
214  new FXVerticalFrame(frame2, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
215  FXMatrix* m23 =
216  new FXMatrix(frame23, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
217  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
218  new FXLabel(m23, "Scale width", 0, LAYOUT_CENTER_Y);
219  myLaneEdgeScaleMode = new FXComboBox(m23, 30, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
220  myLaneScaleInterpolation = new FXCheckButton(m23, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
221  myLaneScaleSettingFrame = new FXVerticalFrame(frame23, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2);
222 
223 #ifdef HAVE_INTERNAL
224  if (GUIVisualizationSettings::UseMesoSim) {
225  mySettings->edgeColorer.fill(*myLaneEdgeColorMode);
226  mySettings->edgeScaler.fill(*myLaneEdgeScaleMode);
227  myLaneEdgeColorMode->setNumVisible((int)mySettings->edgeColorer.size());
228  myLaneEdgeScaleMode->setNumVisible((int)mySettings->edgeScaler.size());
229  } else {
230 #endif
231  mySettings->laneColorer.fill(*myLaneEdgeColorMode);
232  mySettings->laneScaler.fill(*myLaneEdgeScaleMode);
233  myLaneEdgeColorMode->setNumVisible((int)mySettings->laneColorer.size());
234  myLaneEdgeScaleMode->setNumVisible((int)mySettings->laneScaler.size());
235 #ifdef HAVE_INTERNAL
236  }
237 #endif
238 
239  new FXHorizontalSeparator(frame2, SEPARATOR_GROOVE | LAYOUT_FILL_X);
240  FXMatrix* m22 =
241  new FXMatrix(frame2, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
242  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
243  myShowLaneBorders = new FXCheckButton(m22, "Show lane borders", this, MID_SIMPLE_VIEW_COLORCHANGE);
244  myShowLaneBorders->setCheck(mySettings->laneShowBorders);
245  new FXLabel(m22, " ", 0, LAYOUT_CENTER_Y);
246  myShowLaneDecals = new FXCheckButton(m22, "Show link decals", this, MID_SIMPLE_VIEW_COLORCHANGE);
247  myShowLaneDecals->setCheck(mySettings->showLinkDecals);
248  new FXLabel(m22, " ", 0, LAYOUT_CENTER_Y);
249  myShowRails = new FXCheckButton(m22, "Show rails", this, MID_SIMPLE_VIEW_COLORCHANGE);
250  myShowRails->setCheck(mySettings->showRails);
251  new FXLabel(m22, " ", 0, LAYOUT_CENTER_Y);
252  myHideMacroConnectors = new FXCheckButton(m22, "Hide macro connectors", this, MID_SIMPLE_VIEW_COLORCHANGE);
253  myHideMacroConnectors->setCheck(mySettings->hideConnectors);
254  new FXLabel(m22, " ", 0, LAYOUT_CENTER_Y);
255  new FXLabel(m22, "Exaggerate width by", 0, LAYOUT_CENTER_Y);
256  myLaneWidthUpscaleDialer =
257  new FXRealSpinDial(m22, 10, this, MID_SIMPLE_VIEW_COLORCHANGE,
258  LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
259  myLaneWidthUpscaleDialer->setRange(0, 10000);
260  myLaneWidthUpscaleDialer->setValue(mySettings->laneWidthExaggeration);
261 
262  // edge name
263  myEdgeNamePanel = new NamePanel(m22, this, "Show edge name", mySettings->edgeName);
264  myStreetNamePanel = new NamePanel(m22, this, "Show street name", mySettings->streetName);
265  myInternalEdgeNamePanel = new NamePanel(m22, this, "Show internal edge name", mySettings->internalEdgeName);
266  myCwaEdgeNamePanel = new NamePanel(m22, this, "Show crossing and walkingarea name", mySettings->cwaEdgeName);
267  }
268  {
269  // vehicles
270  new FXTabItem(tabbook, "Vehicles", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
271  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
272  FXVerticalFrame* frame3 =
273  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
274 
275  FXMatrix* m31 =
276  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
277  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
278  new FXLabel(m31, "Show As", 0, LAYOUT_CENTER_Y);
279  myVehicleShapeDetail = new FXComboBox(m31, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
280  myVehicleShapeDetail->appendItem("'triangles'");
281  myVehicleShapeDetail->appendItem("'boxes'");
282  myVehicleShapeDetail->appendItem("'simple shapes'");
283  myVehicleShapeDetail->appendItem("'raster images'");
284  myVehicleShapeDetail->setNumVisible(4);
285  myVehicleShapeDetail->setCurrentItem(settings->vehicleQuality);
286 
287  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
288 
289  FXMatrix* m32 =
290  new FXMatrix(frame3, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
291  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
292  new FXLabel(m32, "Color", 0, LAYOUT_CENTER_Y);
293  myVehicleColorMode = new FXComboBox(m32, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
294  mySettings->vehicleColorer.fill(*myVehicleColorMode);
295  myVehicleColorMode->setNumVisible((int)mySettings->vehicleColorer.size());
296  myVehicleColorInterpolation = new FXCheckButton(m32, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
297 
298  myVehicleColorSettingFrame =
299  new FXVerticalFrame(frame3, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2);
300 
301  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
302 
303  FXMatrix* m33 =
304  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
305  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
306  myShowBlinker = new FXCheckButton(m33, "Show blinker / brake lights", this, MID_SIMPLE_VIEW_COLORCHANGE);
307  myShowBlinker->setCheck(mySettings->showBlinker);
308  new FXLabel(m33, " ", 0, LAYOUT_CENTER_Y);
309  myShowMinGap = new FXCheckButton(m33, "Show minimum gap", this, MID_SIMPLE_VIEW_COLORCHANGE);
310  myShowMinGap->setCheck(mySettings->drawMinGap);
311  new FXLabel(m33, " ", 0, LAYOUT_CENTER_Y);
312  myShowBTRange = new FXCheckButton(m33, "Show Bluetooth range", this, MID_SIMPLE_VIEW_COLORCHANGE);
313  myShowBTRange->setCheck(mySettings->showBTRange);
314  new FXLabel(m33, " ", 0, LAYOUT_CENTER_Y);
315  /*
316  myShowLaneChangePreference = new FXCheckButton(m33, "Show lane change preference", this, MID_SIMPLE_VIEW_COLORCHANGE);
317  myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
318  new FXLabel(m33, " ", 0, LAYOUT_CENTER_Y);
319  */
320  myVehicleNamePanel = new NamePanel(m33, this, "Show vehicle name", mySettings->vehicleName);
321  /*
322  FXCheckButton *tmpc = new FXCheckButton(m33, "Show braking lights", 0 ,0);
323  tmpc->disable();
324  tmpc = new FXCheckButton(m33, "Show needed headway", 0 ,0);
325  tmpc->disable();
326  */
327 
328  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
329 
330  FXMatrix* m34 =
331  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
332  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
333  myVehicleSizePanel = new SizePanel(m34, this, mySettings->vehicleSize);
334  }
335 
336  {
337  // persons
338  new FXTabItem(tabbook, "Persons", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
339  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
340  FXVerticalFrame* frame3 =
341  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
342 
343  FXMatrix* m101 =
344  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
345  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
346  new FXLabel(m101, "Show As", 0, LAYOUT_CENTER_Y);
347  myPersonShapeDetail = new FXComboBox(m101, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
348  myPersonShapeDetail->appendItem("'triangles'");
349  myPersonShapeDetail->appendItem("'boxes'");
350  myPersonShapeDetail->appendItem("'simple shapes'");
351  myPersonShapeDetail->appendItem("'raster images'");
352  myPersonShapeDetail->setNumVisible(4);
353  myPersonShapeDetail->setCurrentItem(settings->personQuality);
354 
355  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
356 
357  FXMatrix* m102 =
358  new FXMatrix(frame3, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
359  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
360  new FXLabel(m102, "Color", 0, LAYOUT_CENTER_Y);
361  myPersonColorMode = new FXComboBox(m102, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
362  mySettings->personColorer.fill(*myPersonColorMode);
363  myPersonColorMode->setNumVisible(10);
364  myPersonColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
365 
366  myPersonColorSettingFrame =
367  new FXVerticalFrame(frame3, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2);
368 
369  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
370 
371  FXMatrix* m103 =
372  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
373  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
374  myPersonNamePanel = new NamePanel(m103, this, "Show person name", mySettings->personName);
375 
376  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
377 
378  FXMatrix* m104 =
379  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
380  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
381  myPersonSizePanel = new SizePanel(m104, this, mySettings->personSize);
382  }
383 
384  {
385  // containers
386  new FXTabItem(tabbook, "Containers", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
387  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
388  FXVerticalFrame* frame3 =
389  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
390 
391  FXMatrix* m101 =
392  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
393  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
394  new FXLabel(m101, "Show As", 0, LAYOUT_CENTER_Y);
395  myContainerShapeDetail = new FXComboBox(m101, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
396  myContainerShapeDetail->appendItem("'triangles'");
397  myContainerShapeDetail->appendItem("'boxes'");
398  myContainerShapeDetail->appendItem("'simple shapes'");
399  myContainerShapeDetail->appendItem("'raster images'");
400  myContainerShapeDetail->setNumVisible(4);
401  myContainerShapeDetail->setCurrentItem(settings->containerQuality);
402 
403  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
404 
405  FXMatrix* m102 =
406  new FXMatrix(frame3, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
407  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
408  new FXLabel(m102, "Color", 0, LAYOUT_CENTER_Y);
409  myContainerColorMode = new FXComboBox(m102, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
410  mySettings->containerColorer.fill(*myContainerColorMode);
411  myContainerColorMode->setNumVisible(9);
412  myContainerColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
413 
414  myContainerColorSettingFrame =
415  new FXVerticalFrame(frame3, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2);
416 
417  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
418 
419  FXMatrix* m103 =
420  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
421  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
422  myContainerNamePanel = new NamePanel(m103, this, "Show container name", mySettings->containerName);
423 
424  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
425 
426  FXMatrix* m104 =
427  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
428  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
429  myContainerSizePanel = new SizePanel(m104, this, mySettings->containerSize);
430  }
431  {
432  // nodes
433  new FXTabItem(tabbook, "Junctions", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
434  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
435  FXVerticalFrame* frame4 =
436  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
437  FXMatrix* m41 =
438  new FXMatrix(frame4, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
439  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
440  new FXLabel(m41, "Color", 0, LAYOUT_CENTER_Y);
441  myJunctionColorMode = new FXComboBox(m41, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
442  mySettings->junctionColorer.fill(*myJunctionColorMode);
443  myJunctionColorMode->setNumVisible(3);
444  myJunctionColorInterpolation = new FXCheckButton(m41, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
445 
446  myJunctionColorSettingFrame =
447  new FXVerticalFrame(frame4, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2);
448 
449  new FXHorizontalSeparator(frame4, SEPARATOR_GROOVE | LAYOUT_FILL_X);
450  FXMatrix* m42 =
451  new FXMatrix(frame4, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
452  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
453  myShowTLIndex = new FXCheckButton(m42, "Show link tls index", this, MID_SIMPLE_VIEW_COLORCHANGE);
454  myShowTLIndex->setCheck(mySettings->drawLinkTLIndex);
455  new FXLabel(m42, " ", 0, LAYOUT_CENTER_Y);
456  myShowJunctionIndex = new FXCheckButton(m42, "Show link junction index", this, MID_SIMPLE_VIEW_COLORCHANGE);
457  myShowJunctionIndex->setCheck(mySettings->drawLinkJunctionIndex);
458  new FXLabel(m42, " ", 0, LAYOUT_CENTER_Y);
459  myShowLane2Lane = new FXCheckButton(m42, "Show lane to lane connections", this, MID_SIMPLE_VIEW_COLORCHANGE);
460  myShowLane2Lane->setCheck(mySettings->showLane2Lane);
461  new FXLabel(m42, " ", 0, LAYOUT_CENTER_Y);
462  myJunctionNamePanel = new NamePanel(m42, this, "Show junction name", mySettings->junctionName);
463  myInternalJunctionNamePanel = new NamePanel(m42, this, "Show internal junction name", mySettings->internalJunctionName);
464  myDrawJunctionShape = new FXCheckButton(m42, "Draw junction shape", this, MID_SIMPLE_VIEW_COLORCHANGE);
465  myDrawJunctionShape->setCheck(mySettings->drawJunctionShape);
466  } {
467  // detectors / triggers
468  new FXTabItem(tabbook, "Detectors/Trigger", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
469  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
470  FXVerticalFrame* frame5 =
471  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
472 
473  FXMatrix* m51 =
474  new FXMatrix(frame5, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
475  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
476  myAddNamePanel = new NamePanel(m51, this, "Show detector name", mySettings->addName);
477  new FXHorizontalSeparator(frame5 , SEPARATOR_GROOVE | LAYOUT_FILL_X);
478 
479  FXMatrix* m52 =
480  new FXMatrix(frame5, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
481  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
482  myAddSizePanel = new SizePanel(m52, this, mySettings->addSize);
483 
484  /*
485  new FXLabel(m522, "Color", 0, LAYOUT_CENTER_Y);
486  myDetectorNameColor = new FXColorWell(m522, MFXUtils::getFXColor(settings->addNameColor),
487  this, MID_SIMPLE_VIEW_COLORCHANGE,
488  LAYOUT_FIX_WIDTH|LAYOUT_CENTER_Y|LAYOUT_SIDE_TOP|FRAME_SUNKEN|FRAME_THICK|ICON_AFTER_TEXT,
489  0, 0, 100, 0, 0, 0, 0, 0);
490  */
491  } {
492  // POIs
493  new FXTabItem(tabbook, "POIs", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
494  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
495  FXVerticalFrame* frame6 =
496  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
497 
498  FXMatrix* m61 =
499  new FXMatrix(frame6, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
500  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
501  myPOINamePanel = new NamePanel(m61, this, "Show poi names", mySettings->poiName);
502  new FXHorizontalSeparator(frame6 , SEPARATOR_GROOVE | LAYOUT_FILL_X);
503 
504  FXMatrix* m62 =
505  new FXMatrix(frame6, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
506  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
507  myPOISizePanel = new SizePanel(m62, this, mySettings->poiSize);
508 
509  } {
510  // Polygons
511  new FXTabItem(tabbook, "Polygons", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
512  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
513  FXVerticalFrame* frame9 =
514  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
515 
516  FXMatrix* m91 =
517  new FXMatrix(frame9, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
518  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
519  myPolyNamePanel = new NamePanel(m91, this, "Show polygon names", mySettings->polyName);
520  new FXHorizontalSeparator(frame9 , SEPARATOR_GROOVE | LAYOUT_FILL_X);
521 
522  myPolySizePanel = new SizePanel(m91, this, mySettings->polySize);
523 
524  }{
525  // Legend
526  new FXTabItem(tabbook, "Legend", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
527  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
528  FXVerticalFrame* frame7 =
529  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
530 
531  FXMatrix* m72 =
532  new FXMatrix(frame7, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
533  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
534  myShowSizeLegend = new FXCheckButton(m72, "Show Size Legend", this, MID_SIMPLE_VIEW_COLORCHANGE);
535  myShowSizeLegend->setCheck(mySettings->showSizeLegend);
536  new FXLabel(m72, "");
537  } {
538  // openGL
539  new FXTabItem(tabbook, "openGL", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
540  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
541  FXVerticalFrame* frame8 =
542  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
543 
544  FXMatrix* m82 =
545  new FXMatrix(frame8, 1, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
546  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
547  myAntialiase = new FXCheckButton(m82, "Antialiase", this, MID_SIMPLE_VIEW_COLORCHANGE);
548  myAntialiase->setCheck(mySettings->antialiase);
549  myDither = new FXCheckButton(m82, "Dither", this, MID_SIMPLE_VIEW_COLORCHANGE);
550  myDither->setCheck(mySettings->dither);
551  }
552  FXHorizontalFrame* f2 = new FXHorizontalFrame(contentFrame, LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_FILL_X | PACK_UNIFORM_WIDTH, 0, 0, 0, 0, 10, 10, 5, 5);
553  FXButton* initial = new FXButton(f2, "&Use", NULL, this, MID_SETTINGS_OK, BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
554  new FXButton(f2, "&Discard", NULL, this, MID_SETTINGS_CANCEL, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4);
555  initial->setFocus();
556 
557  rebuildColorMatrices(false);
559 
560  const FXint minSize = 400;
561  setX(MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "x", 150), getApp()->getRootWindow()->getWidth() - minSize));
562  setY(MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "y", 150), getApp()->getRootWindow()->getHeight() - minSize));
563  setWidth(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "width", 700), minSize));
564  setHeight(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "height", 500), minSize));
565 }
566 
567 
569  myParent->remove(this);
570  // delete name panels
573  delete myCwaEdgeNamePanel;
574  delete myStreetNamePanel;
575  delete myJunctionNamePanel;
576  delete myVehicleNamePanel;
577  delete myAddNamePanel;
578  delete myPOINamePanel;
579  delete myPolyNamePanel;
580  delete myEdgeNamePanel;
581  // delete size panels
582  delete myVehicleSizePanel;
583  delete myPersonSizePanel;
584  delete myPOISizePanel;
585  delete myPolySizePanel;
586  delete myAddSizePanel;
587 }
588 
589 
590 void
592  mySettings = settings;
593  myBackup = (*settings);
594  onCmdNameChange(0, 0, 0);
595 }
596 
597 
598 long
600  saveWindowSize();
601  hide();
602  return 1;
603 }
604 
605 
606 long
608  saveWindowSize();
609  hide();
610  (*mySettings) = myBackup;
611  return 1;
612 }
613 
614 
615 long
617  if (data != 0) {
618  FXString dataS = (char*) data; // !!!unicode
619  // check whether this item has been added twice
620  if (dataS == mySchemeName->getItemText(mySchemeName->getNumItems() - 1)) {
621  for (int i = 0; i < mySchemeName->getNumItems() - 1; ++i) {
622  if (dataS == mySchemeName->getItemText(i)) {
623  mySchemeName->removeItem(i);
624  }
625  }
626  }
627  myBackup = gSchemeStorage.get(dataS.text());
628  mySettings = &gSchemeStorage.get(dataS.text());
629  }
630  rebuildColorMatrices(true);
631 
633 
634  myLaneEdgeColorMode->setCurrentItem((FXint) mySettings->getLaneEdgeMode());
635  myLaneEdgeScaleMode->setCurrentItem((FXint) mySettings->getLaneEdgeScaleMode());
638  myShowRails->setCheck(mySettings->showRails);
645 
646  myVehicleColorMode->setCurrentItem((FXint) mySettings->vehicleColorer.getActive());
649  myShowMinGap->setCheck(mySettings->drawMinGap);
651  /*
652  myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
653  */
656 
657  myPersonColorMode->setCurrentItem((FXint) mySettings->personColorer.getActive());
658  myPersonShapeDetail->setCurrentItem(mySettings->personQuality);
661 
662  myContainerColorMode->setCurrentItem((FXint) mySettings->containerColorer.getActive());
666 
667  myJunctionColorMode->setCurrentItem((FXint) mySettings->junctionColorer.getActive());
672 
675 
678 
681 
684  myAntialiase->setCheck(mySettings->antialiase);
685  myDither->setCheck(mySettings->dither);
687 
689  update();
690  myParent->update();
691  return 1;
692 }
693 
694 
695 bool
696 GUIDialog_ViewSettings::updateColorRanges(FXObject* sender, std::vector<FXColorWell*>::const_iterator colIt,
697  std::vector<FXColorWell*>::const_iterator colEnd,
698  std::vector<FXRealSpinDial*>::const_iterator threshIt,
699  std::vector<FXRealSpinDial*>::const_iterator threshEnd,
700  std::vector<FXButton*>::const_iterator buttonIt,
701  GUIColorScheme& scheme) {
702  size_t pos = 0;
703  while (colIt != colEnd) {
704  if (scheme.isFixed()) {
705  if (sender == *colIt) {
706  scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
707  }
708  } else {
709  if (sender == *threshIt) {
710  const SUMOReal val = (*threshIt)->getValue();
711  double lo, hi;
712  if (pos != 0) {
713  threshIt--;
714  (*threshIt)->getRange(lo, hi);
715  (*threshIt)->setRange(lo, val);
716  threshIt++;
717  }
718  threshIt++;
719  if (threshIt != threshEnd) {
720  (*threshIt)->getRange(lo, hi);
721  (*threshIt)->setRange(val, hi);
722  }
723  scheme.setThreshold(pos, val);
724  return false;
725  }
726  if (sender == *colIt) {
727  scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
728  return false;
729  }
730  if (sender == *buttonIt) {
731  if (pos == 0) {
732  scheme.addColor(MFXUtils::getRGBColor((*colIt)->getRGBA()), (*threshIt)->getValue());
733  } else {
734  scheme.removeColor(pos);
735  }
736  return true;
737  }
738  ++threshIt;
739  ++buttonIt;
740  }
741  ++colIt;
742  pos++;
743  }
744  return false;
745 }
746 
747 
748 bool
749 GUIDialog_ViewSettings::updateScaleRanges(FXObject* sender, std::vector<FXRealSpinDial*>::const_iterator scaleIt,
750  std::vector<FXRealSpinDial*>::const_iterator scaleEnd,
751  std::vector<FXRealSpinDial*>::const_iterator threshIt,
752  std::vector<FXRealSpinDial*>::const_iterator threshEnd,
753  std::vector<FXButton*>::const_iterator buttonIt,
754  GUIScaleScheme& scheme) {
755  size_t pos = 0;
756  while (scaleIt != scaleEnd) {
757  if (scheme.isFixed()) {
758  if (sender == *scaleIt) {
759  scheme.setColor(pos, (*scaleIt)->getValue());
760  }
761  } else {
762  if (sender == *threshIt) {
763  const SUMOReal val = (*threshIt)->getValue();
764  double lo, hi;
765  if (pos != 0) {
766  threshIt--;
767  (*threshIt)->getRange(lo, hi);
768  (*threshIt)->setRange(lo, val);
769  threshIt++;
770  }
771  threshIt++;
772  if (threshIt != threshEnd) {
773  (*threshIt)->getRange(lo, hi);
774  (*threshIt)->setRange(val, hi);
775  }
776  scheme.setThreshold(pos, val);
777  return false;
778  }
779  if (sender == *scaleIt) {
780  scheme.setColor(pos, (*scaleIt)->getValue());
781  return false;
782  }
783  if (sender == *buttonIt) {
784  if (pos == 0) {
785  scheme.addColor((*scaleIt)->getValue(), (*threshIt)->getValue());
786  } else {
787  scheme.removeColor(pos);
788  }
789  return true;
790  }
791  ++threshIt;
792  ++buttonIt;
793  }
794  ++scaleIt;
795  pos++;
796  }
797  return false;
798 }
799 
800 
801 long
802 GUIDialog_ViewSettings::onCmdColorChange(FXObject* sender, FXSelector, void* /*val*/) {
803  GUIVisualizationSettings tmpSettings = *mySettings;
804  size_t prevLaneMode = mySettings->getLaneEdgeMode();
805  size_t prevLaneScaleMode = mySettings->getLaneEdgeScaleMode();
806  size_t prevVehicleMode = mySettings->vehicleColorer.getActive();
807  size_t prevPersonMode = mySettings->personColorer.getActive();
808  size_t prevContainerMode = mySettings->containerColorer.getActive();
809  size_t prevJunctionMode = mySettings->junctionColorer.getActive();
810  bool doRebuildColorMatrices = false;
811 
812  tmpSettings.name = mySettings->name;
813  tmpSettings.backgroundColor = MFXUtils::getRGBColor(myBackgroundColor->getRGBA());
814  tmpSettings.showGrid = (myShowGrid->getCheck() != FALSE);
815  tmpSettings.gridXSize = (SUMOReal) myGridXSizeDialer->getValue();
816  tmpSettings.gridYSize = (SUMOReal) myGridYSizeDialer->getValue();
817 
818 #ifdef HAVE_INTERNAL
819  if (GUIVisualizationSettings::UseMesoSim) {
820  tmpSettings.edgeColorer.setActive(myLaneEdgeColorMode->getCurrentItem());
821  tmpSettings.edgeScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());
822  } else {
823 #endif
824  tmpSettings.laneColorer.setActive(myLaneEdgeColorMode->getCurrentItem());
825  tmpSettings.laneScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());
826 #ifdef HAVE_INTERNAL
827  }
828 #endif
829  tmpSettings.laneShowBorders = (myShowLaneBorders->getCheck() != FALSE);
830  tmpSettings.showLinkDecals = (myShowLaneDecals->getCheck() != FALSE);
831  tmpSettings.showRails = (myShowRails->getCheck() != FALSE);
832  tmpSettings.edgeName = myEdgeNamePanel->getSettings();
834  tmpSettings.cwaEdgeName = myCwaEdgeNamePanel->getSettings();
835  tmpSettings.streetName = myStreetNamePanel->getSettings();
836  tmpSettings.hideConnectors = (myHideMacroConnectors->getCheck() != FALSE);
837  tmpSettings.laneWidthExaggeration = (SUMOReal) myLaneWidthUpscaleDialer->getValue();
838 
839  tmpSettings.vehicleColorer.setActive(myVehicleColorMode->getCurrentItem());
840  tmpSettings.vehicleQuality = myVehicleShapeDetail->getCurrentItem();
841  tmpSettings.showBlinker = (myShowBlinker->getCheck() != FALSE);
842  tmpSettings.drawMinGap = (myShowMinGap->getCheck() != FALSE);
843  tmpSettings.showBTRange = (myShowBTRange->getCheck() != FALSE);
844  /*
845  tmpSettings.drawLaneChangePreference = (myShowLaneChangePreference->getCheck() != FALSE);
846  */
847  tmpSettings.vehicleName = myVehicleNamePanel->getSettings();
848  tmpSettings.vehicleSize = myVehicleSizePanel->getSettings();
849 
850  tmpSettings.personColorer.setActive(myPersonColorMode->getCurrentItem());
851  tmpSettings.personQuality = myPersonShapeDetail->getCurrentItem();
852  tmpSettings.personName = myPersonNamePanel->getSettings();
853  tmpSettings.personSize = myPersonSizePanel->getSettings();
854 
855  tmpSettings.containerColorer.setActive(myContainerColorMode->getCurrentItem());
856  tmpSettings.containerQuality = myContainerShapeDetail->getCurrentItem();
859 
860  tmpSettings.junctionColorer.setActive(myJunctionColorMode->getCurrentItem());
861  tmpSettings.drawLinkTLIndex = (myShowTLIndex->getCheck() != FALSE);
862  tmpSettings.drawLinkJunctionIndex = (myShowJunctionIndex->getCheck() != FALSE);
865 
866  tmpSettings.addName = myAddNamePanel->getSettings();
867  tmpSettings.addSize = myAddSizePanel->getSettings();
868 
869  tmpSettings.poiName = myPOINamePanel->getSettings();
870  tmpSettings.poiSize = myPOISizePanel->getSettings();
871 
872  tmpSettings.polyName = myPolyNamePanel->getSettings();
873  tmpSettings.polySize = myPolySizePanel->getSettings();
874 
875  tmpSettings.showLane2Lane = (myShowLane2Lane->getCheck() != FALSE);
876  tmpSettings.drawJunctionShape = (myDrawJunctionShape->getCheck() != FALSE);
877  tmpSettings.antialiase = (myAntialiase->getCheck() != FALSE);
878  tmpSettings.dither = (myDither->getCheck() != FALSE);
879  tmpSettings.showSizeLegend = (myShowSizeLegend->getCheck() != FALSE);
880 
881  // lanes (colors)
882  if (tmpSettings.getLaneEdgeMode() == prevLaneMode) {
883  if (updateColorRanges(sender, myLaneColors.begin(), myLaneColors.end(),
884  myLaneThresholds.begin(), myLaneThresholds.end(), myLaneButtons.begin(),
885  tmpSettings.getLaneEdgeScheme())) {
886  doRebuildColorMatrices = true;
887  }
888  if (sender == myLaneColorInterpolation) {
889  tmpSettings.getLaneEdgeScheme().setInterpolated(myLaneColorInterpolation->getCheck() != FALSE);
890  doRebuildColorMatrices = true;
891  }
892  } else {
893  doRebuildColorMatrices = true;
894  }
895  // lanes (scaling)
896  if (tmpSettings.getLaneEdgeScaleMode() == prevLaneScaleMode) {
897  if (updateScaleRanges(sender, myLaneScales.begin(), myLaneScales.end(),
899  tmpSettings.getLaneEdgeScaleScheme())) {
900  doRebuildColorMatrices = true;
901  }
902  if (sender == myLaneScaleInterpolation) {
903  tmpSettings.getLaneEdgeScaleScheme().setInterpolated(myLaneScaleInterpolation->getCheck() != FALSE);
904  doRebuildColorMatrices = true;
905  }
906  } else {
907  doRebuildColorMatrices = true;
908  }
909  // vehicles
910  if (tmpSettings.vehicleColorer.getActive() == prevVehicleMode) {
911  if (updateColorRanges(sender, myVehicleColors.begin(), myVehicleColors.end(),
913  tmpSettings.vehicleColorer.getScheme())) {
914  doRebuildColorMatrices = true;
915  }
916  if (sender == myVehicleColorInterpolation) {
917  tmpSettings.vehicleColorer.getScheme().setInterpolated(myVehicleColorInterpolation->getCheck() != FALSE);
918  doRebuildColorMatrices = true;
919  }
920  } else {
921  doRebuildColorMatrices = true;
922  }
923  // persons
924  if (tmpSettings.personColorer.getActive() == prevPersonMode) {
925  if (updateColorRanges(sender, myPersonColors.begin(), myPersonColors.end(),
926  myPersonThresholds.begin(), myPersonThresholds.end(), myPersonButtons.begin(),
927  tmpSettings.personColorer.getScheme())) {
928  doRebuildColorMatrices = true;
929  }
930  if (sender == myPersonColorInterpolation) {
931  tmpSettings.personColorer.getScheme().setInterpolated(myPersonColorInterpolation->getCheck() != FALSE);
932  doRebuildColorMatrices = true;
933  }
934  } else {
935  doRebuildColorMatrices = true;
936  }
937  // containers
938  if (tmpSettings.containerColorer.getActive() == prevContainerMode) {
939  if (updateColorRanges(sender, myContainerColors.begin(), myContainerColors.end(),
941  tmpSettings.containerColorer.getScheme())) {
942  doRebuildColorMatrices = true;
943  }
944  if (sender == myContainerColorInterpolation) {
945  tmpSettings.containerColorer.getScheme().setInterpolated(myContainerColorInterpolation->getCheck() != FALSE);
946  doRebuildColorMatrices = true;
947  }
948  } else {
949  doRebuildColorMatrices = true;
950  }
951  // junctions
952  if (tmpSettings.junctionColorer.getActive() == prevJunctionMode) {
953  if (updateColorRanges(sender, myJunctionColors.begin(), myJunctionColors.end(),
955  tmpSettings.junctionColorer.getScheme())) {
956  doRebuildColorMatrices = true;
957  }
958  if (sender == myJunctionColorInterpolation) {
959  tmpSettings.junctionColorer.getScheme().setInterpolated(myJunctionColorInterpolation->getCheck() != FALSE);
960  doRebuildColorMatrices = true;
961  }
962  } else {
963  doRebuildColorMatrices = true;
964  }
965 
966  if (tmpSettings == *mySettings) {
967  return 1;
968  }
969 
970  int index = mySchemeName->getCurrentItem();
971  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
972  // one of the initial settings is modified
973  // every time this happens we create a new scheme
974  int suffix = 1;
975  while (gSchemeStorage.contains("custom_" + toString(suffix))) {
976  suffix++;
977  }
978  tmpSettings.name = "custom_" + toString(suffix);
979  // the newly created settings must be entered in several places:
980  // - the comboBox mySchemeName of this dialog
981  // - the comboBox of the parent view (set as active)
982  // - the comboBox of all other views (only append) XXX @todo
983  index = mySchemeName->appendItem(tmpSettings.name.c_str());
984  mySchemeName->setCurrentItem(index);
985  myParent->getColoringSchemesCombo().appendItem(tmpSettings.name.c_str());
986  }
987  myParent->getColoringSchemesCombo().setCurrentItem(
988  myParent->getColoringSchemesCombo().findItem(tmpSettings.name.c_str()));
989  gSchemeStorage.add(tmpSettings); // overwrites existing
990  mySettings = &gSchemeStorage.get(tmpSettings.name);
991  myParent->setColorScheme(tmpSettings.name);
992 
993  if (doRebuildColorMatrices) {
994  rebuildColorMatrices(true);
995  }
996  myParent->forceRefresh();
997  getApp()->forceRefresh();
998  return 1;
999 }
1000 
1001 
1002 void
1003 GUIDialog_ViewSettings::loadSettings(const std::string& file) {
1004  GUISettingsHandler handler(file);
1005  std::string settingsName = handler.addSettings(myParent);
1006  if (settingsName != "") {
1007  FXint index = mySchemeName->appendItem(settingsName.c_str());
1008  mySchemeName->setCurrentItem(index);
1009  mySettings = &gSchemeStorage.get(settingsName);
1010  }
1011  if (handler.hasDecals()) {
1012  myDecalsLock->lock();
1013  (*myDecals) = handler.getDecals();
1014  rebuildList();
1015  myParent->update();
1016  myDecalsLock->unlock();
1017  }
1018  Position lookFrom, lookAt;
1019  handler.setViewport(lookFrom, lookAt);
1020  if (lookFrom.z() > 0) {
1021  myParent->setViewport(lookFrom, lookAt);
1022  }
1023  rebuildColorMatrices(true);
1024 }
1025 
1026 
1027 void
1029  std::vector<GUISUMOAbstractView::Decal>::iterator j;
1030  for (j = myDecals->begin(); j != myDecals->end(); ++j) {
1033  dev.writeAttr("filename", d.filename);
1039  dev.writeAttr("altitude", d.altitude);
1040  dev.writeAttr("rotation", d.rot);
1041  dev.writeAttr("tilt", d.tilt);
1042  dev.writeAttr("roll", d.roll);
1044  dev.closeTag();
1045  }
1046 }
1047 
1048 
1049 void
1050 GUIDialog_ViewSettings::loadDecals(const std::string& file) {
1051  myDecalsLock->lock();
1052  GUISettingsHandler handler(file);
1053  if (handler.hasDecals()) {
1054  (*myDecals) = handler.getDecals();
1055  }
1056  rebuildList();
1057  myParent->update();
1058  myDecalsLock->unlock();
1059 }
1060 
1061 
1062 long
1064  int index = mySchemeName->getCurrentItem();
1065  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1066  return 1;
1067  }
1068  // get the name
1069  std::string name = "";
1070  while (name.length() == 0) {
1071  FXDialogBox dialog(this, "Enter a name", DECOR_TITLE | DECOR_BORDER);
1072  FXVerticalFrame* content = new FXVerticalFrame(&dialog, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10);
1073  new FXLabel(content, "Please enter an alphanumeric name: ", NULL, LAYOUT_FILL_X | JUSTIFY_LEFT);
1074  FXTextField* text = new FXTextField(content, 40, &dialog, FXDialogBox::ID_ACCEPT, TEXTFIELD_ENTER_ONLY | FRAME_SUNKEN | FRAME_THICK | LAYOUT_FILL_X);
1075  new FXHorizontalSeparator(content, SEPARATOR_GROOVE | LAYOUT_FILL_X);
1076  FXHorizontalFrame* buttons = new FXHorizontalFrame(content, LAYOUT_FILL_X | PACK_UNIFORM_WIDTH, 0, 0, 0, 0, 0, 0, 0, 0);
1077  new FXButton(buttons, "&OK", NULL, &dialog, FXDialogBox::ID_ACCEPT, BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_RIGHT);
1078  new FXButton(buttons, "&Cancel", NULL, &dialog, FXDialogBox::ID_CANCEL, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_RIGHT, 0, 0, 0, 0, 20, 20);
1079  dialog.create();
1080  text->setFocus();
1081  if (!dialog.execute()) {
1082  return 1;
1083  }
1084  name = text->getText().text();
1085  for (size_t i = 0; i < name.length(); ++i) {
1086  if (name[i] != '_' && (name[i] < 'a' || name[i] > 'z') && (name[i] < 'A' || name[i] > 'Z') && (name[i] < '0' || name[i] > '9')) {
1087  name = "";
1088  break;
1089  }
1090  }
1091  }
1092  GUIVisualizationSettings tmpSettings = *mySettings;
1094  tmpSettings.name = name;
1095  gSchemeStorage.add(tmpSettings);
1096  mySchemeName->setItemText(index, tmpSettings.name.c_str());
1097  myParent->getColoringSchemesCombo().setItemText(index, tmpSettings.name.c_str());
1098  myParent->setColorScheme(tmpSettings.name);
1099  mySettings = &gSchemeStorage.get(name);
1100  myBackup = *mySettings;
1101  gSchemeStorage.writeSettings(getApp());
1102  return 1;
1103 }
1104 
1105 
1106 long
1107 GUIDialog_ViewSettings::onUpdSaveSetting(FXObject* sender, FXSelector, void* ptr) {
1108  sender->handle(this,
1109  mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1110  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1111  ptr);
1112  return 1;
1113 }
1114 
1115 
1116 long
1118  int index = mySchemeName->getCurrentItem();
1119  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1120  return 1;
1121  }
1122  std::string name = mySchemeName->getItem(index).text();
1123  gSchemeStorage.remove(name);
1124  mySchemeName->removeItem(index);
1125  onCmdNameChange(0, 0, (void*) mySchemeName->getItem(0).text());
1126  gSchemeStorage.writeSettings(getApp());
1127  return 1;
1128 }
1129 
1130 
1131 long
1132 GUIDialog_ViewSettings::onUpdDeleteSetting(FXObject* sender, FXSelector, void* ptr) {
1133  sender->handle(this,
1134  mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1135  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1136  ptr);
1137  return 1;
1138 }
1139 
1140 
1141 long
1143  FXString file = MFXUtils::getFilename2Write(this, "Export view settings", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder);
1144  if (file == "") {
1145  return 1;
1146  }
1147  try {
1148  OutputDevice& dev = OutputDevice::getDevice(file.text());
1150  mySettings->save(dev);
1151  if (mySaveViewPort->getCheck()) {
1153  }
1154  if (mySaveDelay->getCheck()) {
1155  dev.openTag(SUMO_TAG_DELAY);
1157  dev.closeTag();
1158  }
1159  if (mySaveDecals->getCheck()) {
1160  saveDecals(dev);
1161  }
1162  dev.closeTag();
1163  dev.close();
1164  } catch (IOError& e) {
1165  FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what());
1166  }
1167  return 1;
1168 }
1169 
1170 
1171 long
1172 GUIDialog_ViewSettings::onUpdExportSetting(FXObject* sender, FXSelector, void* ptr) {
1173  sender->handle(this,
1174  (mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1175  && !mySaveViewPort->getCheck() && !mySaveDelay->getCheck() && !mySaveDecals->getCheck()) ?
1176  FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1177  ptr);
1178  return 1;
1179 }
1180 
1181 
1182 long
1184  FXFileDialog opendialog(this, "Import view settings");
1185  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
1186  opendialog.setSelectMode(SELECTFILE_ANY);
1187  opendialog.setPatternList("*.xml");
1188  if (gCurrentFolder.length() != 0) {
1189  opendialog.setDirectory(gCurrentFolder);
1190  }
1191  if (opendialog.execute()) {
1192  gCurrentFolder = opendialog.getDirectory();
1193  loadSettings(opendialog.getFilename().text());
1194  }
1195  return 1;
1196 }
1197 
1198 
1199 long
1200 GUIDialog_ViewSettings::onCmdLoadDecals(FXObject*, FXSelector, void* /*data*/) {
1201  FXFileDialog opendialog(this, "Load Decals");
1202  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
1203  opendialog.setSelectMode(SELECTFILE_ANY);
1204  opendialog.setPatternList("*.xml");
1205  if (gCurrentFolder.length() != 0) {
1206  opendialog.setDirectory(gCurrentFolder);
1207  }
1208  if (opendialog.execute()) {
1209  gCurrentFolder = opendialog.getDirectory();
1210  loadDecals(opendialog.getFilename().text());
1211  }
1212  return 1;
1213 }
1214 
1215 
1216 long
1217 GUIDialog_ViewSettings::onCmdSaveDecals(FXObject*, FXSelector, void* /*data*/) {
1218  FXString file = MFXUtils::getFilename2Write(this, "Save Decals", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder);
1219  if (file == "") {
1220  return 1;
1221  }
1222  try {
1223  OutputDevice& dev = OutputDevice::getDevice(file.text());
1224  dev.openTag("decals");
1225  saveDecals(dev);
1226  dev.closeTag();
1227  dev.close();
1228  } catch (IOError& e) {
1229  FXMessageBox::error(myParent, MBOX_OK, "Storing failed!", "%s", e.what());
1230  }
1231  return 1;
1232 }
1233 
1234 
1235 
1236 
1237 long
1238 GUIDialog_ViewSettings::onUpdImportSetting(FXObject* sender, FXSelector, void* ptr) {
1239  sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1240  return 1;
1241 }
1242 
1243 
1244 void
1246  myDecalsTable->clearItems();
1247  // set table attributes
1248  myDecalsTable->setTableSize(10, 7);
1249  myDecalsTable->setColumnText(0, "picture file");
1250  myDecalsTable->setColumnText(1, "center x");
1251  myDecalsTable->setColumnText(2, "center y");
1252  myDecalsTable->setColumnText(3, "width");
1253  myDecalsTable->setColumnText(4, "height");
1254  myDecalsTable->setColumnText(5, "rotation");
1255  myDecalsTable->setColumnText(6, "layer");
1256  FXHeader* header = myDecalsTable->getColumnHeader();
1257  header->setHeight(getApp()->getNormalFont()->getFontHeight() + getApp()->getNormalFont()->getFontAscent());
1258  int k;
1259  for (k = 0; k < 7; k++) {
1260  header->setItemJustify(k, JUSTIFY_CENTER_X | JUSTIFY_TOP);
1261  header->setItemSize(k, 60);
1262  }
1263  header->setItemSize(0, 150);
1264  // insert already known decals information into table
1265  FXint row = 0;
1266  std::vector<GUISUMOAbstractView::Decal>::iterator j;
1267  for (j = myDecals->begin(); j != myDecals->end(); ++j) {
1269  myDecalsTable->setItemText(row, 0, d.filename.c_str());
1270  myDecalsTable->setItemText(row, 1, toString<SUMOReal>(d.centerX).c_str());
1271  myDecalsTable->setItemText(row, 2, toString<SUMOReal>(d.centerY).c_str());
1272  myDecalsTable->setItemText(row, 3, toString<SUMOReal>(d.width).c_str());
1273  myDecalsTable->setItemText(row, 4, toString<SUMOReal>(d.height).c_str());
1274  myDecalsTable->setItemText(row, 5, toString<SUMOReal>(d.rot).c_str());
1275  myDecalsTable->setItemText(row, 6, toString<SUMOReal>(d.layer).c_str());
1276  row++;
1277  }
1278  // insert dummy last field
1279  for (k = 0; k < 7; k++) {
1280  myDecalsTable->setItemText(row, k, " ");
1281  }
1282 }
1283 
1284 
1285 FXMatrix*
1287  std::vector<FXColorWell*>& colors,
1288  std::vector<FXRealSpinDial*>& thresholds,
1289  std::vector<FXButton*>& buttons,
1290  FXCheckButton* interpolation,
1291  GUIColorScheme& scheme) {
1292  MFXUtils::deleteChildren(frame);
1293  FXMatrix* m = new FXMatrix(frame, 3,
1294  LAYOUT_FILL_X | MATRIX_BY_COLUMNS,
1295  0, 0, 0, 0, 10, 10, 0, 0, 5, 3);
1296  colors.clear();
1297  thresholds.clear();
1298  buttons.clear();
1299  const bool fixed = scheme.isFixed();
1300  std::vector<RGBColor>::const_iterator colIt = scheme.getColors().begin();
1301  std::vector<SUMOReal>::const_iterator threshIt = scheme.getThresholds().begin();
1302  std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1303  FX::FXString buttonText = "Add";
1304  while (colIt != scheme.getColors().end()) {
1305  colors.push_back(new FXColorWell(m , MFXUtils::getFXColor(*colIt),
1307  LAYOUT_FIX_WIDTH | LAYOUT_CENTER_Y | FRAME_SUNKEN | FRAME_THICK | ICON_AFTER_TEXT,
1308  0, 0, 100, 0, 0, 0, 0, 0));
1309  if (fixed) {
1310  new FXLabel(m, nameIt->c_str());
1311  new FXLabel(m, "");
1312  } else {
1313  const int dialerOptions = scheme.allowsNegativeValues() ? SPINDIAL_NOMIN : 0;
1314  FXRealSpinDial* threshDialer = new FXRealSpinDial(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | SPINDIAL_NOMAX | dialerOptions);
1315  threshDialer->setValue(*threshIt);
1316  thresholds.push_back(threshDialer);
1317  buttons.push_back(new FXButton(m, buttonText, NULL, this, MID_SIMPLE_VIEW_COLORCHANGE, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 20, 20, 4, 4));
1318  buttonText = "Remove";
1319  }
1320  colIt++;
1321  threshIt++;
1322  nameIt++;
1323  }
1324  interpolation->setCheck(scheme.isInterpolated());
1325  if (fixed) {
1326  interpolation->disable();
1327  } else {
1328  if (colors.size() > 1) {
1329  interpolation->enable();
1330  if (interpolation->getCheck() != FALSE) {
1331  thresholds.front()->enable();
1332  } else {
1333  thresholds.front()->disable();
1334  }
1335  } else {
1336  interpolation->disable();
1337  thresholds.front()->disable();
1338  }
1339  }
1340  return m;
1341 }
1342 
1343 
1344 FXMatrix*
1346  std::vector<FXRealSpinDial*>& scales,
1347  std::vector<FXRealSpinDial*>& thresholds,
1348  std::vector<FXButton*>& buttons,
1349  FXCheckButton* interpolation,
1350  GUIScaleScheme& scheme) {
1351  MFXUtils::deleteChildren(frame);
1352  FXMatrix* m = new FXMatrix(frame, 3,
1353  LAYOUT_FILL_X | MATRIX_BY_COLUMNS,
1354  0, 0, 0, 0, 10, 10, 0, 0, 5, 3);
1355  scales.clear();
1356  thresholds.clear();
1357  buttons.clear();
1358  const bool fixed = scheme.isFixed();
1359  std::vector<SUMOReal>::const_iterator scaleIt = scheme.getColors().begin();
1360  std::vector<SUMOReal>::const_iterator threshIt = scheme.getThresholds().begin();
1361  std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1362  FX::FXString buttonText = "Add";
1363  while (scaleIt != scheme.getColors().end()) {
1364  FXRealSpinDial* scaleDialer = new FXRealSpinDial(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | SPINDIAL_NOMAX);
1365  scaleDialer->setValue(*scaleIt);
1366  scales.push_back(scaleDialer);
1367  if (fixed) {
1368  new FXLabel(m, nameIt->c_str());
1369  new FXLabel(m, "");
1370  } else {
1371  const int dialerOptions = scheme.allowsNegativeValues() ? SPINDIAL_NOMIN : 0;
1372  FXRealSpinDial* threshDialer = new FXRealSpinDial(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | SPINDIAL_NOMAX | dialerOptions);
1373  threshDialer->setValue(*threshIt);
1374  thresholds.push_back(threshDialer);
1375  buttons.push_back(new FXButton(m, buttonText, NULL, this, MID_SIMPLE_VIEW_COLORCHANGE, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 20, 20, 4, 4));
1376  buttonText = "Remove";
1377  }
1378  scaleIt++;
1379  threshIt++;
1380  nameIt++;
1381  }
1382  interpolation->setCheck(scheme.isInterpolated());
1383  if (fixed) {
1384  interpolation->disable();
1385  } else {
1386  if (scales.size() > 1) {
1387  interpolation->enable();
1388  if (interpolation->getCheck() != FALSE) {
1389  thresholds.front()->enable();
1390  } else {
1391  thresholds.front()->disable();
1392  }
1393  } else {
1394  interpolation->disable();
1395  thresholds.front()->disable();
1396  }
1397  }
1398  return m;
1399 }
1400 
1401 
1402 void
1404  // decals
1405  delete myDecalsTable;
1407  LAYOUT_FILL_Y | LAYOUT_FIX_WIDTH/*|LAYOUT_FIX_HEIGHT*/, 0, 0, 470, 0);
1408  myDecalsTable->setVisibleRows(5);
1409  myDecalsTable->setVisibleColumns(7);
1410  myDecalsTable->setTableSize(5, 7);
1411  myDecalsTable->setBackColor(FXRGB(255, 255, 255));
1412  myDecalsTable->getRowHeader()->setWidth(0);
1413  for (int i = 1; i <= 5; ++i) {
1415  myDecalsTable->setNumberCellParams(i, -10000000, 10000000, 1, 10, 100, "%.2f");
1416  }
1417  rebuildList();
1418  if (doCreate) {
1419  myDecalsTable->create();
1420  }
1422  if (doCreate) {
1423  m->create();
1424  }
1425  myLaneColorSettingFrame->getParent()->recalc();
1426 
1428  if (doCreate) {
1429  m->create();
1430  }
1431  myLaneScaleSettingFrame->getParent()->recalc();
1432 
1434  if (doCreate) {
1435  m->create();
1436  }
1437  myVehicleColorSettingFrame->getParent()->recalc();
1438 
1440  if (doCreate) {
1441  m->create();
1442  }
1443  myPersonColorSettingFrame->getParent()->recalc();
1445  if (doCreate) {
1446  m->create();
1447  }
1448  myContainerColorSettingFrame->getParent()->recalc();
1450  if (doCreate) {
1451  m->create();
1452  }
1453  myJunctionColorSettingFrame->getParent()->recalc();
1454 
1455  layout();
1456  update();
1457 }
1458 
1459 
1460 long
1463  std::string value = i->item->getText().text();
1464  // check whether the inserted value is empty
1465  if (value.find_first_not_of(" ") == std::string::npos) {
1466  return 1;
1467  }
1469  int row = i->row;
1470  // check whether we add a new entry or edit an existing entry
1471  if (row == static_cast<int>(myDecals->size())) {
1472  d.filename = "";
1473  d.centerX = SUMOReal(myParent->getGridWidth() / 2.);
1474  d.centerY = SUMOReal(myParent->getGridHeight() / 2.);
1475  d.width = 0.;
1476  d.height = 0.;
1477  d.initialised = false;
1478  d.rot = 0;
1479  d.layer = 0;
1480  myDecalsLock->lock();
1481  myDecals->push_back(d);
1482  myDecalsLock->unlock();
1483  } else if (row > static_cast<int>(myDecals->size())) {
1484  // ignore clicks two lines below existing entries
1485  return 1;
1486  } else {
1487  d = (*myDecals)[row];
1488  }
1489 
1490  switch (i->col) {
1491  case 0:
1492  if (d.initialised && d.filename != value) {
1493  d.initialised = false;
1494  }
1495  d.filename = value;
1496  break;
1497  case 1:
1498  try {
1499  d.centerX = TplConvert::_2SUMOReal(value.c_str());
1500  } catch (NumberFormatException&) {
1501  std::string msg = "The value must be a float, is:" + value;
1502  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1503  }
1504  break;
1505  case 2:
1506  try {
1507  d.centerY = TplConvert::_2SUMOReal(value.c_str());
1508  } catch (NumberFormatException&) {
1509  std::string msg = "The value must be a float, is:" + value;
1510  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1511  }
1512  break;
1513  case 3:
1514  try {
1515  d.width = TplConvert::_2SUMOReal(value.c_str());
1516  } catch (NumberFormatException&) {
1517  std::string msg = "The value must be a float, is:" + value;
1518  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1519  }
1520  break;
1521  case 4:
1522  try {
1523  d.height = TplConvert::_2SUMOReal(value.c_str());
1524  } catch (NumberFormatException&) {
1525  std::string msg = "The value must be a float, is:" + value;
1526  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1527  }
1528  break;
1529  case 5:
1530  try {
1531  d.rot = TplConvert::_2SUMOReal(value.c_str());
1532  } catch (NumberFormatException&) {
1533  std::string msg = "The value must be a float, is:" + value;
1534  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1535  }
1536  break;
1537  case 6:
1538  try {
1539  d.layer = TplConvert::_2SUMOReal(value.c_str());
1540  } catch (NumberFormatException&) {
1541  std::string msg = "The value must be a float, is:" + value;
1542  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1543  }
1544  break;
1545  default:
1546  throw 1;
1547  }
1548  (*myDecals)[row] = d;
1549  if (!i->updateOnly) {
1550  rebuildList();
1551  }
1552  myParent->update();
1553  return 1;
1554 }
1555 
1556 
1557 std::string
1559  return mySchemeName->getItem(mySchemeName->getCurrentItem()).text();
1560 }
1561 
1562 
1563 void
1565  if (name.c_str() == mySchemeName->getItemText(mySchemeName->getCurrentItem())) {
1566  return;
1567  }
1568  for (int i = 0; i < mySchemeName->getNumItems(); ++i) {
1569  if (name.c_str() == mySchemeName->getItemText(i)) {
1570  mySchemeName->setCurrentItem(i);
1571  onCmdNameChange(0, 0, (void*)name.c_str());
1572  return;
1573  }
1574  }
1575 }
1576 
1578  FXMatrix* parent,
1579  GUIDialog_ViewSettings* target,
1580  const std::string& title,
1581  const GUIVisualizationTextSettings& settings) {
1582  myCheck = new FXCheckButton(parent, title.c_str(), target, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
1583  myCheck->setCheck(settings.show);
1584  new FXLabel(parent, "");
1585  FXMatrix* m1 = new FXMatrix(parent, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
1586  0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
1587  new FXLabel(m1, "Size", 0, LAYOUT_CENTER_Y);
1588  mySizeDial = new FXRealSpinDial(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE,
1589  LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
1590  mySizeDial->setRange(10, 1000);
1591  mySizeDial->setValue(settings.size);
1592  FXMatrix* m2 = new FXMatrix(parent, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
1593  0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
1594  new FXLabel(m2, "Color", 0, LAYOUT_CENTER_Y);
1595  myColorWell = new FXColorWell(m2, MFXUtils::getFXColor(settings.color),
1596  target, MID_SIMPLE_VIEW_COLORCHANGE,
1597  LAYOUT_FIX_WIDTH | LAYOUT_CENTER_Y | LAYOUT_SIDE_TOP | FRAME_SUNKEN | FRAME_THICK | ICON_AFTER_TEXT,
1598  0, 0, 100, 0, 0, 0, 0, 0);
1599 }
1600 
1601 
1604  return GUIVisualizationTextSettings(myCheck->getCheck() != FALSE,
1605  mySizeDial->getValue(), MFXUtils::getRGBColor(myColorWell->getRGBA()));
1606 }
1607 
1608 
1609 void
1611  myCheck->setCheck(settings.show);
1612  mySizeDial->setValue(settings.size);
1613  myColorWell->setRGBA(MFXUtils::getFXColor(settings.color));
1614 }
1615 
1616 
1618  FXMatrix* parent,
1619  GUIDialog_ViewSettings* target,
1620  const GUIVisualizationSizeSettings& settings) {
1621  myCheck = new FXCheckButton(parent, "Draw with constant size when zoomed out", target, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
1622  myCheck->setCheck(settings.constantSize);
1623  new FXLabel(parent, "");
1624  FXMatrix* m1 = new FXMatrix(parent, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
1625  0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
1626  new FXLabel(m1, "Minimum Size", 0, LAYOUT_CENTER_Y);
1627  myMinSizeDial = new FXRealSpinDial(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE,
1628  LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
1629  myMinSizeDial->setValue(settings.minSize);
1630  FXMatrix* m2 = new FXMatrix(parent, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
1631  0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
1632  new FXLabel(m2, "Exaggerate by", 0, LAYOUT_CENTER_Y);
1633  myExaggerateDial = new FXRealSpinDial(m2, 10, target, MID_SIMPLE_VIEW_COLORCHANGE,
1634  LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
1635  myExaggerateDial->setRange(0, 10000);
1636  myExaggerateDial->setValue(settings.exaggeration);
1637 }
1638 
1639 
1643  myMinSizeDial->getValue(), myExaggerateDial->getValue(), myCheck->getCheck() != FALSE);
1644 }
1645 
1646 
1647 void
1649  myCheck->setCheck(settings.constantSize);
1650  myMinSizeDial->setValue(settings.minSize);
1651  myExaggerateDial->setValue(settings.exaggeration);
1652 }
1653 
1654 
1655 void
1657  getApp()->reg().writeIntEntry("VIEWSETTINGS", "x", getX());
1658  getApp()->reg().writeIntEntry("VIEWSETTINGS", "y", getY());
1659  getApp()->reg().writeIntEntry("VIEWSETTINGS", "width", getWidth());
1660  getApp()->reg().writeIntEntry("VIEWSETTINGS", "height", getHeight());
1661 }
1662 
1663 /****************************************************************************/
1664 
void rebuildColorMatrices(bool doCreate=false)
Rebuilds color changing dialogs after choosing another coloring scheme.
GUIDialog_EditViewport * getViewportEditor()
get the viewport and create it on first access
GUIVisualizationTextSettings junctionName
A decal (an image) that can be shown.
FXVerticalFrame * myVehicleColorSettingFrame
long onUpdSaveSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to save the settings into the registry.
FXCheckButton * myLaneColorInterpolation
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:257
void close()
Closes the device and removes it from the dictionary.
const std::vector< T > & getColors() const
GUICompleteSchemeStorage gSchemeStorage
bool showSizeLegend
Information whether the size legend shall be drawn.
FXCheckButton * myJunctionColorInterpolation
bool isInterpolated() const
FXVerticalFrame * myLaneScaleSettingFrame
GUIVisualizationTextSettings streetName
float laneWidthExaggeration
The lane exaggeration (upscale thickness)
size_t getLaneEdgeMode() const
Returns the number of the active lane (edge) coloring schme.
SUMOReal roll
The roll of the image to the ground plane (in degrees)
std::string addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
virtual void setViewport(const Position &lookFrom, const Position &lookAt)
applies the given viewport settings
bool showBlinker
Information whether vehicle blinkers shall be drawn.
GUIVisualizationTextSettings addName
void removeColor(const size_t pos)
GUIVisualizationTextSettings personName
std::vector< FXButton * > myLaneButtons
bool drawLinkTLIndex
Information whether a link's tls index shall be drawn.
static SUMOReal _2SUMOReal(const E *const data)
Definition: TplConvert.h:223
FXDEFMAP(GUIDialog_ViewSettings) GUIDialog_ViewSettingsMap[]
GUIVisualizationTextSettings poiName
GUIColorScheme & getLaneEdgeScheme()
Returns the current lane (edge) coloring schme.
bool showBTRange
Information whether the communication range shall be drawn.
GUIColorer laneColorer
The lane colorer.
GUIColorer containerColorer
The container colorer.
A layer number.
Stores the information about how to visualize structures.
The dialog to change the view (gui) settings.
SizePanel(FXMatrix *parent, GUIDialog_ViewSettings *target, const GUIVisualizationSizeSettings &settings)
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:119
void remove(GUIDialog_EditViewport *)
std::vector< FXRealSpinDial * > myLaneScaleThresholds
std::vector< GUISUMOAbstractView::Decal > * myDecals
The parent's decals.
void setColor(const size_t pos, const T &color)
bool showRails
Information whether rails shall be drawn.
void loadDecals(const std::string &file)
Loads decals from a file.
std::vector< FXButton * > myPersonButtons
FXMatrix * rebuildScaleMatrix(FXVerticalFrame *frame, std::vector< FXRealSpinDial * > &scales, std::vector< FXRealSpinDial * > &thresholds, std::vector< FXButton * > &buttons, FXCheckButton *interpolation, GUIScaleScheme &scheme)
Rebuilds manipulators for the current scaling scheme.
std::vector< FXColorWell * > myJunctionColors
GUIVisualizationTextSettings vehicleName
void loadSettings(const std::string &file)
Loads a scheme from a file.
bool hasDecals() const
Returns whether any decals have been parsed.
T MAX2(T a, T b)
Definition: StdDefs.h:74
static void deleteChildren(FXWindow *w)
Deletes all children of the given window.
Definition: MFXUtils.cpp:43
long onCmdSaveDecals(FXObject *, FXSelector, void *data)
Called if the decals shall be saved to a file.
For the export-to-file - button.
Definition: GUIAppEnum.h:343
void writeXML(OutputDevice &dev)
write the settings to the given device
GUIVisualizationTextSettings cwaEdgeName
FXString gCurrentFolder
The folder used as last.
long onCmdSaveSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be saved into the registry.
bool laneShowBorders
Information whether lane borders shall be drawn.
SUMOReal getGridHeight() const
SUMOReal centerZ
The center of the image in z-direction (net coordinates, in m)
long onCmdExportSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be exported into a file.
SUMOReal width
The width of the image (net coordinates in x-direction, in m)
long onCmdEditTable(FXObject *, FXSelector, void *data)
Called if the decals-table was changed.
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition: MFXUtils.cpp:95
bool dither
Information whether dithering shall be enabled.
FXVerticalFrame * myContainerColorSettingFrame
std::vector< FXRealSpinDial * > myPersonThresholds
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
long onCmdNameChange(FXObject *, FXSelector, void *)
Called if the name of the scheme was changed.
void setViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
void setThreshold(const size_t pos, const SUMOReal threshold)
GUIVisualizationSizeSettings polySize
GUIColorer vehicleColorer
The vehicle colorer.
bool isFixed() const
GUIVisualizationTextSettings edgeName
FXTableItem * item
void setInterpolated(const bool interpolate, SUMOReal interpolationStart=0.f)
std::vector< FXButton * > myContainerButtons
FXCheckButton * myVehicleColorInterpolation
GUIVisualizationSizeSettings addSize
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
std::string name
The name of this setting.
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
void rebuildList()
Rebuilds the decals table.
The Table.
Definition: GUIAppEnum.h:271
void update(const GUIVisualizationSizeSettings &settings)
SUMOReal altitude
The altitude of the image (net coordinates in z-direction, in m)
GUIVisualizationSettings * mySettings
The current settings.
GUIVisualizationTextSettings internalEdgeName
FXMatrix * rebuildColorMatrix(FXVerticalFrame *frame, std::vector< FXColorWell * > &colors, std::vector< FXRealSpinDial * > &thresholds, std::vector< FXButton * > &buttons, FXCheckButton *interpolation, GUIColorScheme &scheme)
Rebuilds manipulators for the current coloring scheme.
std::vector< FXRealSpinDial * > myLaneScales
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
SUMOReal centerY
The center of the image in y-direction (net coordinates, in m)
bool drawMinGap
Information whether the minimum gap shall be drawn.
std::vector< FXColorWell * > myVehicleColors
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
FXRealSpinDial * myLaneWidthUpscaleDialer
Cancel-button was pushed.
Definition: GUIAppEnum.h:285
void remove(const std::string &name)
Removes the setting with the given name.
unsigned int getNumInitialSettings() const
Returns the number of initial settings.
void saveWindowSize()
save window position and size to the registry
SUMOReal z() const
Returns the z-position.
Definition: Position.h:73
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
bool allowsNegativeValues() const
FXVerticalFrame * myLaneColorSettingFrame
FXComboBox & getColoringSchemesCombo()
bool initialised
Whether this image was initialised (inserted as a texture)
T MIN2(T a, T b)
Definition: StdDefs.h:68
Ok-button was pushed.
Definition: GUIAppEnum.h:283
GUIColorer personColorer
The person colorer.
GUIVisualizationTextSettings internalJunctionName
For the import-from-file - button.
Definition: GUIAppEnum.h:345
const std::vector< std::string > & getNames() const
float minSize
The minimum size to draw this object.
GUIColorer junctionColorer
The junction colorer.
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
std::string filename
The path to the file the image is located at.
SUMOReal gridXSize
Information about the grid spacings.
long onUpdDeleteSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to delete settings.
FXVerticalFrame * myJunctionColorSettingFrame
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:53
FXCheckButton * myLaneScaleInterpolation
SUMOReal getDelay() const
Returns the delay of the parent application.
unsigned int addColor(const T &color, const SUMOReal threshold, const std::string &name="")
GUIScaleScheme & getLaneEdgeScaleScheme()
Returns the current lane (edge) scaling schme.
std::vector< FXColorWell * > myPersonColors
FXRealSpinDial * myGridYSizeDialer
int containerQuality
The quality of container drawing.
long onCmdCancel(FXObject *, FXSelector, void *)
Called if the Cancel-button was pressed.
RGBColor backgroundColor
The background color to use.
bool antialiase
Information whether antialiase shall be enabled.
std::vector< FXButton * > myLaneScaleButtons
void saveDecals(OutputDevice &dev) const
Writes the currently used decals into a file.
Informs the dialog about a value's change.
Definition: GUIAppEnum.h:335
For the delete - button.
Definition: GUIAppEnum.h:341
long onCmdOk(FXObject *, FXSelector, void *)
Called if the OK-button was pressed.
For the save-decals - button.
Definition: GUIAppEnum.h:349
void unlock()
release mutex lock
Definition: MFXMutex.cpp:96
For the load-decals - button.
Definition: GUIAppEnum.h:347
SUMOReal height
The height of the image (net coordinates in y-direction, in m)
GUIVisualizationSizeSettings poiSize
bool updateScaleRanges(FXObject *sender, std::vector< FXRealSpinDial * >::const_iterator colIt, std::vector< FXRealSpinDial * >::const_iterator colEnd, std::vector< FXRealSpinDial * >::const_iterator threshIt, std::vector< FXRealSpinDial * >::const_iterator threshEnd, std::vector< FXButton * >::const_iterator buttonIt, GUIScaleScheme &scheme)
SUMOReal centerX
The center of the image in x-direction (net coordinates, in m)
MFXAddEditTypedTable * myDecalsTable
float exaggeration
The size exaggeration (upscale)
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
NamePanel(FXMatrix *parent, GUIDialog_ViewSettings *target, const std::string &title, const GUIVisualizationTextSettings &settings)
GUIVisualizationSizeSettings containerSize
FXComboBox * myLaneEdgeScaleMode
... lane scaler
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
GUIVisualizationTextSettings getSettings()
Informs the dialog about switching to another scheme.
Definition: GUIAppEnum.h:337
void writeSettings(FXApp *app)
Writes the current scheme into the registry.
FXComboBox * myLaneEdgeColorMode
... lane colorer
void setCurrent(GUIVisualizationSettings *settings)
Sets current settings (called if reopened)
FXCheckButton * myHideMacroConnectors
bool drawLinkJunctionIndex
Information whether a link's junction index shall be drawn.
SUMOReal getGridWidth() const
GUIVisualizationSizeSettings personSize
virtual bool setColorScheme(const std::string &)
int personQuality
The quality of person drawing.
void lock()
lock mutex
Definition: MFXMutex.cpp:86
bool showGrid
Information whether a grid shall be shown.
long onUpdExportSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to export settings into a file.
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:125
SUMOReal layer
The layer of the image.
long onCmdColorChange(FXObject *, FXSelector, void *)
Called if something (color, width, etc.) has been changed.
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
void setCellType(size_t pos, CellType t)
bool closeTag()
Closes the most recently opened tag.
#define SUMOReal
Definition: config.h:218
FXRealSpinDial * myGridXSizeDialer
An XML-handler for visualisation schemes.
void save(OutputDevice &dev) const
Writes the settings into an output device.
FXCheckButton * myPersonColorInterpolation
GUIVisualizationSizeSettings vehicleSize
bool drawJunctionShape
whether the shape of the junction should be drawn
std::vector< FXRealSpinDial * > myContainerThresholds
long onCmdLoadDecals(FXObject *, FXSelector, void *data)
Called if the decals shall be loaded from a file.
void update(const GUIVisualizationTextSettings &settings)
std::vector< FXRealSpinDial * > myVehicleThresholds
SUMOReal tilt
The tilt of the image to the ground plane (in degrees)
GUIVisualizationSizeSettings getSettings()
int vehicleQuality
The quality of vehicle drawing.
bool updateColorRanges(FXObject *sender, std::vector< FXColorWell * >::const_iterator colIt, std::vector< FXColorWell * >::const_iterator colEnd, std::vector< FXRealSpinDial * >::const_iterator threshIt, std::vector< FXRealSpinDial * >::const_iterator threshEnd, std::vector< FXButton * >::const_iterator buttonIt, GUIColorScheme &scheme)
MFXMutex * myDecalsLock
Lock used when changing the decals.
void setNumberCellParams(size_t pos, double min, double max, double steps1, double steps2, double steps3, const std::string &format)
std::vector< FXRealSpinDial * > myJunctionThresholds
FXCheckButton * myContainerColorInterpolation
GUIScaler laneScaler
The lane scaler.
const std::vector< SUMOReal > & getThresholds() const
long onCmdDeleteSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be deleted.
GUISUMOAbstractView * myParent
The parent view (which settings are changed)
FXVerticalFrame * myPersonColorSettingFrame
std::vector< FXColorWell * > myContainerColors
static FXIcon * getIcon(GUIIcon which)
std::vector< FXButton * > myJunctionButtons
GUIVisualizationSettings myBackup
A backup of the settings (used if the "Cancel" button is pressed)
size_t getLaneEdgeScaleMode() const
Returns the number of the active lane (edge) scaling schme.
std::vector< FXColorWell * > myLaneColors
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::vector< FXRealSpinDial * > myLaneThresholds
std::vector< FXButton * > myVehicleButtons
SUMOReal rot
The rotation of the image in the ground plane (in degrees)
long onCmdImportSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be read from a file.
void add(const GUIVisualizationSettings &scheme)
Adds a visualization scheme.
For the save-to-db - button.
Definition: GUIAppEnum.h:339
long onUpdImportSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to read settings from a file.
GUIVisualizationTextSettings polyName
GUIVisualizationTextSettings containerName