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  }
266  {
267  // vehicles
268  new FXTabItem(tabbook, "Vehicles", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
269  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
270  FXVerticalFrame* frame3 =
271  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
272 
273  FXMatrix* m31 =
274  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
275  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
276  new FXLabel(m31, "Show As", 0, LAYOUT_CENTER_Y);
277  myVehicleShapeDetail = new FXComboBox(m31, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
278  myVehicleShapeDetail->appendItem("'triangles'");
279  myVehicleShapeDetail->appendItem("'boxes'");
280  myVehicleShapeDetail->appendItem("'simple shapes'");
281  myVehicleShapeDetail->appendItem("'raster images'");
282  myVehicleShapeDetail->setNumVisible(4);
283  myVehicleShapeDetail->setCurrentItem(settings->vehicleQuality);
284 
285  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
286 
287  FXMatrix* m32 =
288  new FXMatrix(frame3, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
289  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
290  new FXLabel(m32, "Color", 0, LAYOUT_CENTER_Y);
291  myVehicleColorMode = new FXComboBox(m32, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
292  mySettings->vehicleColorer.fill(*myVehicleColorMode);
293  myVehicleColorMode->setNumVisible((int)mySettings->vehicleColorer.size());
294  myVehicleColorInterpolation = new FXCheckButton(m32, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
295 
296  myVehicleColorSettingFrame =
297  new FXVerticalFrame(frame3, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2);
298 
299  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
300 
301  FXMatrix* m33 =
302  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
303  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
304  myShowBlinker = new FXCheckButton(m33, "Show blinker / brake lights", this, MID_SIMPLE_VIEW_COLORCHANGE);
305  myShowBlinker->setCheck(mySettings->showBlinker);
306  new FXLabel(m33, " ", 0, LAYOUT_CENTER_Y);
307  myShowMinGap = new FXCheckButton(m33, "Show minimum gap", this, MID_SIMPLE_VIEW_COLORCHANGE);
308  myShowMinGap->setCheck(mySettings->drawMinGap);
309  new FXLabel(m33, " ", 0, LAYOUT_CENTER_Y);
310  myShowBTRange = new FXCheckButton(m33, "Show Bluetooth range", this, MID_SIMPLE_VIEW_COLORCHANGE);
311  myShowBTRange->setCheck(mySettings->showBTRange);
312  new FXLabel(m33, " ", 0, LAYOUT_CENTER_Y);
313  /*
314  myShowLaneChangePreference = new FXCheckButton(m33, "Show lane change preference", this, MID_SIMPLE_VIEW_COLORCHANGE);
315  myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
316  new FXLabel(m33, " ", 0, LAYOUT_CENTER_Y);
317  */
318  myVehicleNamePanel = new NamePanel(m33, this, "Show vehicle name", mySettings->vehicleName);
319  /*
320  FXCheckButton *tmpc = new FXCheckButton(m33, "Show braking lights", 0 ,0);
321  tmpc->disable();
322  tmpc = new FXCheckButton(m33, "Show needed headway", 0 ,0);
323  tmpc->disable();
324  */
325 
326  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
327 
328  FXMatrix* m34 =
329  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
330  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
331  myVehicleSizePanel = new SizePanel(m34, this, mySettings->vehicleSize);
332  }
333 
334  {
335  // persons
336  new FXTabItem(tabbook, "Persons", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
337  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
338  FXVerticalFrame* frame3 =
339  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
340 
341  FXMatrix* m101 =
342  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
343  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
344  new FXLabel(m101, "Show As", 0, LAYOUT_CENTER_Y);
345  myPersonShapeDetail = new FXComboBox(m101, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
346  myPersonShapeDetail->appendItem("'triangles'");
347  myPersonShapeDetail->appendItem("'boxes'");
348  myPersonShapeDetail->appendItem("'simple shapes'");
349  myPersonShapeDetail->appendItem("'raster images'");
350  myPersonShapeDetail->setNumVisible(4);
351  myPersonShapeDetail->setCurrentItem(settings->personQuality);
352 
353  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
354 
355  FXMatrix* m102 =
356  new FXMatrix(frame3, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
357  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
358  new FXLabel(m102, "Color", 0, LAYOUT_CENTER_Y);
359  myPersonColorMode = new FXComboBox(m102, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
360  mySettings->personColorer.fill(*myPersonColorMode);
361  myPersonColorMode->setNumVisible(10);
362  myPersonColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
363 
364  myPersonColorSettingFrame =
365  new FXVerticalFrame(frame3, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2);
366 
367  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
368 
369  FXMatrix* m103 =
370  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
371  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
372  myPersonNamePanel = new NamePanel(m103, this, "Show person name", mySettings->personName);
373 
374  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
375 
376  FXMatrix* m104 =
377  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
378  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
379  myPersonSizePanel = new SizePanel(m104, this, mySettings->personSize);
380  }
381 
382  {
383  // containers
384  new FXTabItem(tabbook, "Containers", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
385  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
386  FXVerticalFrame* frame3 =
387  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
388 
389  FXMatrix* m101 =
390  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
391  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
392  new FXLabel(m101, "Show As", 0, LAYOUT_CENTER_Y);
393  myContainerShapeDetail = new FXComboBox(m101, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
394  myContainerShapeDetail->appendItem("'triangles'");
395  myContainerShapeDetail->appendItem("'boxes'");
396  myContainerShapeDetail->appendItem("'simple shapes'");
397  myContainerShapeDetail->appendItem("'raster images'");
398  myContainerShapeDetail->setNumVisible(4);
399  myContainerShapeDetail->setCurrentItem(settings->containerQuality);
400 
401  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
402 
403  FXMatrix* m102 =
404  new FXMatrix(frame3, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
405  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
406  new FXLabel(m102, "Color", 0, LAYOUT_CENTER_Y);
407  myContainerColorMode = new FXComboBox(m102, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
408  mySettings->containerColorer.fill(*myContainerColorMode);
409  myContainerColorMode->setNumVisible(9);
410  myContainerColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
411 
412  myContainerColorSettingFrame =
413  new FXVerticalFrame(frame3, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2);
414 
415  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
416 
417  FXMatrix* m103 =
418  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
419  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
420  myContainerNamePanel = new NamePanel(m103, this, "Show container name", mySettings->containerName);
421 
422  new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X);
423 
424  FXMatrix* m104 =
425  new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
426  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
427  myContainerSizePanel = new SizePanel(m104, this, mySettings->containerSize);
428  }
429  {
430  // nodes
431  new FXTabItem(tabbook, "Junctions", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
432  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
433  FXVerticalFrame* frame4 =
434  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
435  FXMatrix* m41 =
436  new FXMatrix(frame4, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
437  0, 0, 0, 0, 10, 10, 10, 2, 5, 5);
438  new FXLabel(m41, "Color", 0, LAYOUT_CENTER_Y);
439  myJunctionColorMode = new FXComboBox(m41, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC);
440  mySettings->junctionColorer.fill(*myJunctionColorMode);
441  myJunctionColorMode->setNumVisible(3);
442  myJunctionColorInterpolation = new FXCheckButton(m41, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
443 
444  myJunctionColorSettingFrame =
445  new FXVerticalFrame(frame4, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2);
446 
447  new FXHorizontalSeparator(frame4, SEPARATOR_GROOVE | LAYOUT_FILL_X);
448  FXMatrix* m42 =
449  new FXMatrix(frame4, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
450  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
451  myTLIndexPanel = new NamePanel(m42, this, "Show link tls index", mySettings->drawLinkTLIndex);
452  myJunctionIndexPanel = new NamePanel(m42, this, "Show link junction index", mySettings->drawLinkJunctionIndex);
453  myShowLane2Lane = new FXCheckButton(m42, "Show lane to lane connections", this, MID_SIMPLE_VIEW_COLORCHANGE);
454  myShowLane2Lane->setCheck(mySettings->showLane2Lane);
455  new FXLabel(m42, " ", 0, LAYOUT_CENTER_Y);
456  myJunctionNamePanel = new NamePanel(m42, this, "Show junction name", mySettings->junctionName);
457  myInternalJunctionNamePanel = new NamePanel(m42, this, "Show internal junction name", mySettings->internalJunctionName);
458  myInternalEdgeNamePanel = new NamePanel(m42, this, "Show internal edge name", mySettings->internalEdgeName);
459  myCwaEdgeNamePanel = new NamePanel(m42, this, "Show crossing and walkingarea name", mySettings->cwaEdgeName);
460  myDrawJunctionShape = new FXCheckButton(m42, "Draw junction shape", this, MID_SIMPLE_VIEW_COLORCHANGE);
461  myDrawJunctionShape->setCheck(mySettings->drawJunctionShape);
462  myDrawCrossingsAndWalkingAreas = new FXCheckButton(m42, "Draw crossings/walkingareas", this, MID_SIMPLE_VIEW_COLORCHANGE);
463  myDrawCrossingsAndWalkingAreas->setCheck(mySettings->drawCrossingsAndWalkingareas);
464  } {
465  // detectors / triggers
466  new FXTabItem(tabbook, "Detectors/Trigger", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
467  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
468  FXVerticalFrame* frame5 =
469  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
470 
471  FXMatrix* m51 =
472  new FXMatrix(frame5, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
473  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
474  myAddNamePanel = new NamePanel(m51, this, "Show detector name", mySettings->addName);
475  new FXHorizontalSeparator(frame5 , SEPARATOR_GROOVE | LAYOUT_FILL_X);
476 
477  FXMatrix* m52 =
478  new FXMatrix(frame5, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
479  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
480  myAddSizePanel = new SizePanel(m52, this, mySettings->addSize);
481 
482  /*
483  new FXLabel(m522, "Color", 0, LAYOUT_CENTER_Y);
484  myDetectorNameColor = new FXColorWell(m522, MFXUtils::getFXColor(settings->addNameColor),
485  this, MID_SIMPLE_VIEW_COLORCHANGE,
486  LAYOUT_FIX_WIDTH|LAYOUT_CENTER_Y|LAYOUT_SIDE_TOP|FRAME_SUNKEN|FRAME_THICK|ICON_AFTER_TEXT,
487  0, 0, 100, 0, 0, 0, 0, 0);
488  */
489  } {
490  // POIs
491  new FXTabItem(tabbook, "POIs", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
492  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
493  FXVerticalFrame* frame6 =
494  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
495 
496  FXMatrix* m61 =
497  new FXMatrix(frame6, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
498  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
499  myPOINamePanel = new NamePanel(m61, this, "Show poi names", mySettings->poiName);
500  myPOITypePanel = new NamePanel(m61, this, "Show poi types", mySettings->poiType);
501  new FXHorizontalSeparator(frame6 , SEPARATOR_GROOVE | LAYOUT_FILL_X);
502 
503  FXMatrix* m62 =
504  new FXMatrix(frame6, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
505  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
506  myPOISizePanel = new SizePanel(m62, this, mySettings->poiSize);
507 
508  } {
509  // Polygons
510  new FXTabItem(tabbook, "Polygons", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
511  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
512  FXVerticalFrame* frame9 =
513  new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2);
514 
515  FXMatrix* m91 =
516  new FXMatrix(frame9, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
517  0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
518  myPolyNamePanel = new NamePanel(m91, this, "Show polygon names", mySettings->polyName);
519  myPolyTypePanel = new NamePanel(m91, this, "Show polygon types", mySettings->polyType);
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 myJunctionIndexPanel;
576  delete myTLIndexPanel;
577  delete myJunctionNamePanel;
578  delete myVehicleNamePanel;
579  delete myAddNamePanel;
580  delete myPOINamePanel;
581  delete myPOITypePanel;
582  delete myPolyNamePanel;
583  delete myPolyTypePanel;
584  delete myEdgeNamePanel;
585  // delete size panels
586  delete myVehicleSizePanel;
587  delete myPersonSizePanel;
588  delete myPOISizePanel;
589  delete myPolySizePanel;
590  delete myAddSizePanel;
591 }
592 
593 
594 void
596  mySettings = settings;
597  myBackup = (*settings);
598  onCmdNameChange(0, 0, 0);
599 }
600 
601 
602 long
603 GUIDialog_ViewSettings::onCmdOk(FXObject*, FXSelector, void*) {
604  saveWindowSize();
605  hide();
606  return 1;
607 }
608 
609 
610 long
611 GUIDialog_ViewSettings::onCmdCancel(FXObject*, FXSelector, void*) {
612  saveWindowSize();
613  hide();
614  (*mySettings) = myBackup;
615  return 1;
616 }
617 
618 
619 long
620 GUIDialog_ViewSettings::onCmdNameChange(FXObject*, FXSelector, void* data) {
621  if (data != 0) {
622  FXString dataS = (char*) data; // !!!unicode
623  // check whether this item has been added twice
624  if (dataS == mySchemeName->getItemText(mySchemeName->getNumItems() - 1)) {
625  for (int i = 0; i < mySchemeName->getNumItems() - 1; ++i) {
626  if (dataS == mySchemeName->getItemText(i)) {
627  mySchemeName->removeItem(i);
628  }
629  }
630  }
631  myBackup = gSchemeStorage.get(dataS.text());
632  mySettings = &gSchemeStorage.get(dataS.text());
633  }
634  rebuildColorMatrices(true);
635 
637 
638  myLaneEdgeColorMode->setCurrentItem((FXint) mySettings->getLaneEdgeMode());
639  myLaneEdgeScaleMode->setCurrentItem((FXint) mySettings->getLaneEdgeScaleMode());
642  myShowRails->setCheck(mySettings->showRails);
649 
650  myVehicleColorMode->setCurrentItem((FXint) mySettings->vehicleColorer.getActive());
653  myShowMinGap->setCheck(mySettings->drawMinGap);
655  /*
656  myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
657  */
660 
661  myPersonColorMode->setCurrentItem((FXint) mySettings->personColorer.getActive());
662  myPersonShapeDetail->setCurrentItem(mySettings->personQuality);
665 
666  myContainerColorMode->setCurrentItem((FXint) mySettings->containerColorer.getActive());
670 
671  myJunctionColorMode->setCurrentItem((FXint) mySettings->junctionColorer.getActive());
676 
679 
683 
687 
691  myAntialiase->setCheck(mySettings->antialiase);
692  myDither->setCheck(mySettings->dither);
694 
696  update();
697  myParent->update();
698  return 1;
699 }
700 
701 
702 bool
703 GUIDialog_ViewSettings::updateColorRanges(FXObject* sender, std::vector<FXColorWell*>::const_iterator colIt,
704  std::vector<FXColorWell*>::const_iterator colEnd,
705  std::vector<FXRealSpinDial*>::const_iterator threshIt,
706  std::vector<FXRealSpinDial*>::const_iterator threshEnd,
707  std::vector<FXButton*>::const_iterator buttonIt,
708  GUIColorScheme& scheme) {
709  size_t pos = 0;
710  while (colIt != colEnd) {
711  if (scheme.isFixed()) {
712  if (sender == *colIt) {
713  scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
714  }
715  } else {
716  if (sender == *threshIt) {
717  const SUMOReal val = (*threshIt)->getValue();
718  double lo, hi;
719  if (pos != 0) {
720  threshIt--;
721  (*threshIt)->getRange(lo, hi);
722  (*threshIt)->setRange(lo, val);
723  threshIt++;
724  }
725  threshIt++;
726  if (threshIt != threshEnd) {
727  (*threshIt)->getRange(lo, hi);
728  (*threshIt)->setRange(val, hi);
729  }
730  scheme.setThreshold(pos, val);
731  return false;
732  }
733  if (sender == *colIt) {
734  scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
735  return false;
736  }
737  if (sender == *buttonIt) {
738  if (pos == 0) {
739  scheme.addColor(MFXUtils::getRGBColor((*colIt)->getRGBA()), (*threshIt)->getValue());
740  } else {
741  scheme.removeColor(pos);
742  }
743  return true;
744  }
745  ++threshIt;
746  ++buttonIt;
747  }
748  ++colIt;
749  pos++;
750  }
751  return false;
752 }
753 
754 
755 bool
756 GUIDialog_ViewSettings::updateScaleRanges(FXObject* sender, std::vector<FXRealSpinDial*>::const_iterator scaleIt,
757  std::vector<FXRealSpinDial*>::const_iterator scaleEnd,
758  std::vector<FXRealSpinDial*>::const_iterator threshIt,
759  std::vector<FXRealSpinDial*>::const_iterator threshEnd,
760  std::vector<FXButton*>::const_iterator buttonIt,
761  GUIScaleScheme& scheme) {
762  size_t pos = 0;
763  while (scaleIt != scaleEnd) {
764  if (scheme.isFixed()) {
765  if (sender == *scaleIt) {
766  scheme.setColor(pos, (*scaleIt)->getValue());
767  }
768  } else {
769  if (sender == *threshIt) {
770  const SUMOReal val = (*threshIt)->getValue();
771  double lo, hi;
772  if (pos != 0) {
773  threshIt--;
774  (*threshIt)->getRange(lo, hi);
775  (*threshIt)->setRange(lo, val);
776  threshIt++;
777  }
778  threshIt++;
779  if (threshIt != threshEnd) {
780  (*threshIt)->getRange(lo, hi);
781  (*threshIt)->setRange(val, hi);
782  }
783  scheme.setThreshold(pos, val);
784  return false;
785  }
786  if (sender == *scaleIt) {
787  scheme.setColor(pos, (*scaleIt)->getValue());
788  return false;
789  }
790  if (sender == *buttonIt) {
791  if (pos == 0) {
792  scheme.addColor((*scaleIt)->getValue(), (*threshIt)->getValue());
793  } else {
794  scheme.removeColor(pos);
795  }
796  return true;
797  }
798  ++threshIt;
799  ++buttonIt;
800  }
801  ++scaleIt;
802  pos++;
803  }
804  return false;
805 }
806 
807 
808 long
809 GUIDialog_ViewSettings::onCmdColorChange(FXObject* sender, FXSelector, void* /*val*/) {
810  GUIVisualizationSettings tmpSettings = *mySettings;
811  size_t prevLaneMode = mySettings->getLaneEdgeMode();
812  size_t prevLaneScaleMode = mySettings->getLaneEdgeScaleMode();
813  size_t prevVehicleMode = mySettings->vehicleColorer.getActive();
814  size_t prevPersonMode = mySettings->personColorer.getActive();
815  size_t prevContainerMode = mySettings->containerColorer.getActive();
816  size_t prevJunctionMode = mySettings->junctionColorer.getActive();
817  bool doRebuildColorMatrices = false;
818 
819  tmpSettings.name = mySettings->name;
820  tmpSettings.backgroundColor = MFXUtils::getRGBColor(myBackgroundColor->getRGBA());
821  tmpSettings.showGrid = (myShowGrid->getCheck() != FALSE);
822  tmpSettings.gridXSize = (SUMOReal) myGridXSizeDialer->getValue();
823  tmpSettings.gridYSize = (SUMOReal) myGridYSizeDialer->getValue();
824 
825 #ifdef HAVE_INTERNAL
826  if (GUIVisualizationSettings::UseMesoSim) {
827  tmpSettings.edgeColorer.setActive(myLaneEdgeColorMode->getCurrentItem());
828  tmpSettings.edgeScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());
829  } else {
830 #endif
831  tmpSettings.laneColorer.setActive(myLaneEdgeColorMode->getCurrentItem());
832  tmpSettings.laneScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());
833 #ifdef HAVE_INTERNAL
834  }
835 #endif
836  tmpSettings.laneShowBorders = (myShowLaneBorders->getCheck() != FALSE);
837  tmpSettings.showLinkDecals = (myShowLaneDecals->getCheck() != FALSE);
838  tmpSettings.showRails = (myShowRails->getCheck() != FALSE);
839  tmpSettings.edgeName = myEdgeNamePanel->getSettings();
841  tmpSettings.cwaEdgeName = myCwaEdgeNamePanel->getSettings();
842  tmpSettings.streetName = myStreetNamePanel->getSettings();
843  tmpSettings.hideConnectors = (myHideMacroConnectors->getCheck() != FALSE);
844  tmpSettings.laneWidthExaggeration = (SUMOReal) myLaneWidthUpscaleDialer->getValue();
845 
846  tmpSettings.vehicleColorer.setActive(myVehicleColorMode->getCurrentItem());
847  tmpSettings.vehicleQuality = myVehicleShapeDetail->getCurrentItem();
848  tmpSettings.showBlinker = (myShowBlinker->getCheck() != FALSE);
849  tmpSettings.drawMinGap = (myShowMinGap->getCheck() != FALSE);
850  tmpSettings.showBTRange = (myShowBTRange->getCheck() != FALSE);
851  /*
852  tmpSettings.drawLaneChangePreference = (myShowLaneChangePreference->getCheck() != FALSE);
853  */
854  tmpSettings.vehicleName = myVehicleNamePanel->getSettings();
855  tmpSettings.vehicleSize = myVehicleSizePanel->getSettings();
856 
857  tmpSettings.personColorer.setActive(myPersonColorMode->getCurrentItem());
858  tmpSettings.personQuality = myPersonShapeDetail->getCurrentItem();
859  tmpSettings.personName = myPersonNamePanel->getSettings();
860  tmpSettings.personSize = myPersonSizePanel->getSettings();
861 
862  tmpSettings.containerColorer.setActive(myContainerColorMode->getCurrentItem());
863  tmpSettings.containerQuality = myContainerShapeDetail->getCurrentItem();
866 
867  tmpSettings.junctionColorer.setActive(myJunctionColorMode->getCurrentItem());
868  tmpSettings.drawLinkTLIndex = myTLIndexPanel->getSettings();
872 
873  tmpSettings.addName = myAddNamePanel->getSettings();
874  tmpSettings.addSize = myAddSizePanel->getSettings();
875 
876  tmpSettings.poiName = myPOINamePanel->getSettings();
877  tmpSettings.poiType = myPOITypePanel->getSettings();
878  tmpSettings.poiSize = myPOISizePanel->getSettings();
879 
880  tmpSettings.polyName = myPolyNamePanel->getSettings();
881  tmpSettings.polyType = myPolyTypePanel->getSettings();
882  tmpSettings.polySize = myPolySizePanel->getSettings();
883 
884  tmpSettings.showLane2Lane = (myShowLane2Lane->getCheck() != FALSE);
885  tmpSettings.drawJunctionShape = (myDrawJunctionShape->getCheck() != FALSE);
886  tmpSettings.drawCrossingsAndWalkingareas = (myDrawCrossingsAndWalkingAreas->getCheck() != FALSE);
887  tmpSettings.antialiase = (myAntialiase->getCheck() != FALSE);
888  tmpSettings.dither = (myDither->getCheck() != FALSE);
889  tmpSettings.showSizeLegend = (myShowSizeLegend->getCheck() != FALSE);
890 
891  // lanes (colors)
892  if (tmpSettings.getLaneEdgeMode() == prevLaneMode) {
893  if (updateColorRanges(sender, myLaneColors.begin(), myLaneColors.end(),
894  myLaneThresholds.begin(), myLaneThresholds.end(), myLaneButtons.begin(),
895  tmpSettings.getLaneEdgeScheme())) {
896  doRebuildColorMatrices = true;
897  }
898  if (sender == myLaneColorInterpolation) {
899  tmpSettings.getLaneEdgeScheme().setInterpolated(myLaneColorInterpolation->getCheck() != FALSE);
900  doRebuildColorMatrices = true;
901  }
902  } else {
903  doRebuildColorMatrices = true;
904  }
905  // lanes (scaling)
906  if (tmpSettings.getLaneEdgeScaleMode() == prevLaneScaleMode) {
907  if (updateScaleRanges(sender, myLaneScales.begin(), myLaneScales.end(),
909  tmpSettings.getLaneEdgeScaleScheme())) {
910  doRebuildColorMatrices = true;
911  }
912  if (sender == myLaneScaleInterpolation) {
913  tmpSettings.getLaneEdgeScaleScheme().setInterpolated(myLaneScaleInterpolation->getCheck() != FALSE);
914  doRebuildColorMatrices = true;
915  }
916  } else {
917  doRebuildColorMatrices = true;
918  }
919  // vehicles
920  if (tmpSettings.vehicleColorer.getActive() == prevVehicleMode) {
921  if (updateColorRanges(sender, myVehicleColors.begin(), myVehicleColors.end(),
923  tmpSettings.vehicleColorer.getScheme())) {
924  doRebuildColorMatrices = true;
925  }
926  if (sender == myVehicleColorInterpolation) {
927  tmpSettings.vehicleColorer.getScheme().setInterpolated(myVehicleColorInterpolation->getCheck() != FALSE);
928  doRebuildColorMatrices = true;
929  }
930  } else {
931  doRebuildColorMatrices = true;
932  }
933  // persons
934  if (tmpSettings.personColorer.getActive() == prevPersonMode) {
935  if (updateColorRanges(sender, myPersonColors.begin(), myPersonColors.end(),
936  myPersonThresholds.begin(), myPersonThresholds.end(), myPersonButtons.begin(),
937  tmpSettings.personColorer.getScheme())) {
938  doRebuildColorMatrices = true;
939  }
940  if (sender == myPersonColorInterpolation) {
941  tmpSettings.personColorer.getScheme().setInterpolated(myPersonColorInterpolation->getCheck() != FALSE);
942  doRebuildColorMatrices = true;
943  }
944  } else {
945  doRebuildColorMatrices = true;
946  }
947  // containers
948  if (tmpSettings.containerColorer.getActive() == prevContainerMode) {
949  if (updateColorRanges(sender, myContainerColors.begin(), myContainerColors.end(),
951  tmpSettings.containerColorer.getScheme())) {
952  doRebuildColorMatrices = true;
953  }
954  if (sender == myContainerColorInterpolation) {
955  tmpSettings.containerColorer.getScheme().setInterpolated(myContainerColorInterpolation->getCheck() != FALSE);
956  doRebuildColorMatrices = true;
957  }
958  } else {
959  doRebuildColorMatrices = true;
960  }
961  // junctions
962  if (tmpSettings.junctionColorer.getActive() == prevJunctionMode) {
963  if (updateColorRanges(sender, myJunctionColors.begin(), myJunctionColors.end(),
965  tmpSettings.junctionColorer.getScheme())) {
966  doRebuildColorMatrices = true;
967  }
968  if (sender == myJunctionColorInterpolation) {
969  tmpSettings.junctionColorer.getScheme().setInterpolated(myJunctionColorInterpolation->getCheck() != FALSE);
970  doRebuildColorMatrices = true;
971  }
972  } else {
973  doRebuildColorMatrices = true;
974  }
975 
976  if (tmpSettings == *mySettings) {
977  return 1;
978  }
979 
980  int index = mySchemeName->getCurrentItem();
981  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
982  // one of the initial settings is modified
983  // every time this happens we create a new scheme
984  int suffix = 1;
985  while (gSchemeStorage.contains("custom_" + toString(suffix))) {
986  suffix++;
987  }
988  tmpSettings.name = "custom_" + toString(suffix);
989  // the newly created settings must be entered in several places:
990  // - the comboBox mySchemeName of this dialog
991  // - the comboBox of the parent view (set as active)
992  // - the comboBox of all other views (only append) XXX @todo
993  index = mySchemeName->appendItem(tmpSettings.name.c_str());
994  mySchemeName->setCurrentItem(index);
995  myParent->getColoringSchemesCombo().appendItem(tmpSettings.name.c_str());
996  }
997  myParent->getColoringSchemesCombo().setCurrentItem(
998  myParent->getColoringSchemesCombo().findItem(tmpSettings.name.c_str()));
999  gSchemeStorage.add(tmpSettings); // overwrites existing
1000  mySettings = &gSchemeStorage.get(tmpSettings.name);
1001  myParent->setColorScheme(tmpSettings.name);
1002 
1003  if (doRebuildColorMatrices) {
1004  rebuildColorMatrices(true);
1005  }
1006  myParent->forceRefresh();
1007  getApp()->forceRefresh();
1008  return 1;
1009 }
1010 
1011 
1012 void
1013 GUIDialog_ViewSettings::loadSettings(const std::string& file) {
1014  GUISettingsHandler handler(file);
1015  std::string settingsName = handler.addSettings(myParent);
1016  if (settingsName != "") {
1017  FXint index = mySchemeName->appendItem(settingsName.c_str());
1018  mySchemeName->setCurrentItem(index);
1019  mySettings = &gSchemeStorage.get(settingsName);
1020  }
1021  if (handler.hasDecals()) {
1022  myDecalsLock->lock();
1023  (*myDecals) = handler.getDecals();
1024  rebuildList();
1025  myParent->update();
1026  myDecalsLock->unlock();
1027  }
1028  if (handler.getDelay() >= 0) {
1029  myParent->setDelay(handler.getDelay());
1030  }
1031  Position lookFrom, lookAt;
1032  handler.setViewport(lookFrom, lookAt);
1033  if (lookFrom.z() > 0) {
1034  myParent->setViewport(lookFrom, lookAt);
1035  }
1036  rebuildColorMatrices(true);
1037 }
1038 
1039 
1040 void
1042  std::vector<GUISUMOAbstractView::Decal>::iterator j;
1043  for (j = myDecals->begin(); j != myDecals->end(); ++j) {
1046  dev.writeAttr("filename", d.filename);
1052  dev.writeAttr("altitude", d.altitude);
1053  dev.writeAttr("rotation", d.rot);
1054  dev.writeAttr("tilt", d.tilt);
1055  dev.writeAttr("roll", d.roll);
1057  dev.closeTag();
1058  }
1059 }
1060 
1061 
1062 void
1063 GUIDialog_ViewSettings::loadDecals(const std::string& file) {
1064  myDecalsLock->lock();
1065  GUISettingsHandler handler(file);
1066  if (handler.hasDecals()) {
1067  (*myDecals) = handler.getDecals();
1068  }
1069  rebuildList();
1070  myParent->update();
1071  myDecalsLock->unlock();
1072 }
1073 
1074 
1075 long
1076 GUIDialog_ViewSettings::onCmdSaveSetting(FXObject*, FXSelector, void* /*data*/) {
1077  int index = mySchemeName->getCurrentItem();
1078  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1079  return 1;
1080  }
1081  // get the name
1082  std::string name = "";
1083  while (name.length() == 0) {
1084  FXDialogBox dialog(this, "Enter a name", DECOR_TITLE | DECOR_BORDER);
1085  FXVerticalFrame* content = new FXVerticalFrame(&dialog, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10);
1086  new FXLabel(content, "Please enter an alphanumeric name: ", NULL, LAYOUT_FILL_X | JUSTIFY_LEFT);
1087  FXTextField* text = new FXTextField(content, 40, &dialog, FXDialogBox::ID_ACCEPT, TEXTFIELD_ENTER_ONLY | FRAME_SUNKEN | FRAME_THICK | LAYOUT_FILL_X);
1088  new FXHorizontalSeparator(content, SEPARATOR_GROOVE | LAYOUT_FILL_X);
1089  FXHorizontalFrame* buttons = new FXHorizontalFrame(content, LAYOUT_FILL_X | PACK_UNIFORM_WIDTH, 0, 0, 0, 0, 0, 0, 0, 0);
1090  new FXButton(buttons, "&OK", NULL, &dialog, FXDialogBox::ID_ACCEPT, BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_RIGHT);
1091  new FXButton(buttons, "&Cancel", NULL, &dialog, FXDialogBox::ID_CANCEL, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_RIGHT, 0, 0, 0, 0, 20, 20);
1092  dialog.create();
1093  text->setFocus();
1094  if (!dialog.execute()) {
1095  return 1;
1096  }
1097  name = text->getText().text();
1098  for (size_t i = 0; i < name.length(); ++i) {
1099  if (name[i] != '_' && (name[i] < 'a' || name[i] > 'z') && (name[i] < 'A' || name[i] > 'Z') && (name[i] < '0' || name[i] > '9')) {
1100  name = "";
1101  break;
1102  }
1103  }
1104  }
1105  GUIVisualizationSettings tmpSettings = *mySettings;
1107  tmpSettings.name = name;
1108  gSchemeStorage.add(tmpSettings);
1109  mySchemeName->setItemText(index, tmpSettings.name.c_str());
1110  myParent->getColoringSchemesCombo().setItemText(index, tmpSettings.name.c_str());
1111  myParent->setColorScheme(tmpSettings.name);
1112  mySettings = &gSchemeStorage.get(name);
1113  myBackup = *mySettings;
1114  gSchemeStorage.writeSettings(getApp());
1115  return 1;
1116 }
1117 
1118 
1119 long
1120 GUIDialog_ViewSettings::onUpdSaveSetting(FXObject* sender, FXSelector, void* ptr) {
1121  sender->handle(this,
1122  mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1123  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1124  ptr);
1125  return 1;
1126 }
1127 
1128 
1129 long
1130 GUIDialog_ViewSettings::onCmdDeleteSetting(FXObject*, FXSelector, void* /*data*/) {
1131  int index = mySchemeName->getCurrentItem();
1132  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1133  return 1;
1134  }
1135  std::string name = mySchemeName->getItem(index).text();
1136  gSchemeStorage.remove(name);
1137  mySchemeName->removeItem(index);
1138  onCmdNameChange(0, 0, (void*) mySchemeName->getItem(0).text());
1139  gSchemeStorage.writeSettings(getApp());
1140  return 1;
1141 }
1142 
1143 
1144 long
1145 GUIDialog_ViewSettings::onUpdDeleteSetting(FXObject* sender, FXSelector, void* ptr) {
1146  sender->handle(this,
1147  mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1148  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1149  ptr);
1150  return 1;
1151 }
1152 
1153 
1154 long
1155 GUIDialog_ViewSettings::onCmdExportSetting(FXObject*, FXSelector, void* /*data*/) {
1156  FXString file = MFXUtils::getFilename2Write(this, "Export view settings", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder);
1157  if (file == "") {
1158  return 1;
1159  }
1160  try {
1161  OutputDevice& dev = OutputDevice::getDevice(file.text());
1163  mySettings->save(dev);
1164  if (mySaveViewPort->getCheck()) {
1166  }
1167  if (mySaveDelay->getCheck()) {
1168  dev.openTag(SUMO_TAG_DELAY);
1170  dev.closeTag();
1171  }
1172  if (mySaveDecals->getCheck()) {
1173  saveDecals(dev);
1174  }
1175  dev.closeTag();
1176  dev.close();
1177  } catch (IOError& e) {
1178  FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what());
1179  }
1180  return 1;
1181 }
1182 
1183 
1184 long
1185 GUIDialog_ViewSettings::onUpdExportSetting(FXObject* sender, FXSelector, void* ptr) {
1186  sender->handle(this,
1187  (mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1188  && !mySaveViewPort->getCheck() && !mySaveDelay->getCheck() && !mySaveDecals->getCheck()) ?
1189  FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1190  ptr);
1191  return 1;
1192 }
1193 
1194 
1195 long
1196 GUIDialog_ViewSettings::onCmdImportSetting(FXObject*, FXSelector, void* /*data*/) {
1197  FXFileDialog opendialog(this, "Import view settings");
1198  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
1199  opendialog.setSelectMode(SELECTFILE_ANY);
1200  opendialog.setPatternList("*.xml");
1201  if (gCurrentFolder.length() != 0) {
1202  opendialog.setDirectory(gCurrentFolder);
1203  }
1204  if (opendialog.execute()) {
1205  gCurrentFolder = opendialog.getDirectory();
1206  loadSettings(opendialog.getFilename().text());
1207  }
1208  return 1;
1209 }
1210 
1211 
1212 long
1213 GUIDialog_ViewSettings::onCmdLoadDecals(FXObject*, FXSelector, void* /*data*/) {
1214  FXFileDialog opendialog(this, "Load Decals");
1215  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
1216  opendialog.setSelectMode(SELECTFILE_ANY);
1217  opendialog.setPatternList("*.xml");
1218  if (gCurrentFolder.length() != 0) {
1219  opendialog.setDirectory(gCurrentFolder);
1220  }
1221  if (opendialog.execute()) {
1222  gCurrentFolder = opendialog.getDirectory();
1223  loadDecals(opendialog.getFilename().text());
1224  }
1225  return 1;
1226 }
1227 
1228 
1229 long
1230 GUIDialog_ViewSettings::onCmdSaveDecals(FXObject*, FXSelector, void* /*data*/) {
1231  FXString file = MFXUtils::getFilename2Write(this, "Save Decals", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder);
1232  if (file == "") {
1233  return 1;
1234  }
1235  try {
1236  OutputDevice& dev = OutputDevice::getDevice(file.text());
1237  dev.openTag("decals");
1238  saveDecals(dev);
1239  dev.closeTag();
1240  dev.close();
1241  } catch (IOError& e) {
1242  FXMessageBox::error(myParent, MBOX_OK, "Storing failed!", "%s", e.what());
1243  }
1244  return 1;
1245 }
1246 
1247 
1248 
1249 
1250 long
1251 GUIDialog_ViewSettings::onUpdImportSetting(FXObject* sender, FXSelector, void* ptr) {
1252  sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1253  return 1;
1254 }
1255 
1256 
1257 void
1259  myDecalsTable->clearItems();
1260  // set table attributes
1261  myDecalsTable->setTableSize(10, 7);
1262  myDecalsTable->setColumnText(0, "picture file");
1263  myDecalsTable->setColumnText(1, "center x");
1264  myDecalsTable->setColumnText(2, "center y");
1265  myDecalsTable->setColumnText(3, "width");
1266  myDecalsTable->setColumnText(4, "height");
1267  myDecalsTable->setColumnText(5, "rotation");
1268  myDecalsTable->setColumnText(6, "layer");
1269  FXHeader* header = myDecalsTable->getColumnHeader();
1270  header->setHeight(getApp()->getNormalFont()->getFontHeight() + getApp()->getNormalFont()->getFontAscent());
1271  int k;
1272  for (k = 0; k < 7; k++) {
1273  header->setItemJustify(k, JUSTIFY_CENTER_X | JUSTIFY_TOP);
1274  header->setItemSize(k, 60);
1275  }
1276  header->setItemSize(0, 150);
1277  // insert already known decals information into table
1278  FXint row = 0;
1279  std::vector<GUISUMOAbstractView::Decal>::iterator j;
1280  for (j = myDecals->begin(); j != myDecals->end(); ++j) {
1282  myDecalsTable->setItemText(row, 0, d.filename.c_str());
1283  myDecalsTable->setItemText(row, 1, toString<SUMOReal>(d.centerX).c_str());
1284  myDecalsTable->setItemText(row, 2, toString<SUMOReal>(d.centerY).c_str());
1285  myDecalsTable->setItemText(row, 3, toString<SUMOReal>(d.width).c_str());
1286  myDecalsTable->setItemText(row, 4, toString<SUMOReal>(d.height).c_str());
1287  myDecalsTable->setItemText(row, 5, toString<SUMOReal>(d.rot).c_str());
1288  myDecalsTable->setItemText(row, 6, toString<SUMOReal>(d.layer).c_str());
1289  row++;
1290  }
1291  // insert dummy last field
1292  for (k = 0; k < 7; k++) {
1293  myDecalsTable->setItemText(row, k, " ");
1294  }
1295 }
1296 
1297 
1298 FXMatrix*
1300  std::vector<FXColorWell*>& colors,
1301  std::vector<FXRealSpinDial*>& thresholds,
1302  std::vector<FXButton*>& buttons,
1303  FXCheckButton* interpolation,
1304  GUIColorScheme& scheme) {
1305  MFXUtils::deleteChildren(frame);
1306  FXMatrix* m = new FXMatrix(frame, 3,
1307  LAYOUT_FILL_X | MATRIX_BY_COLUMNS,
1308  0, 0, 0, 0, 10, 10, 0, 0, 5, 3);
1309  colors.clear();
1310  thresholds.clear();
1311  buttons.clear();
1312  const bool fixed = scheme.isFixed();
1313  std::vector<RGBColor>::const_iterator colIt = scheme.getColors().begin();
1314  std::vector<SUMOReal>::const_iterator threshIt = scheme.getThresholds().begin();
1315  std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1316  FX::FXString buttonText = "Add";
1317  while (colIt != scheme.getColors().end()) {
1318  colors.push_back(new FXColorWell(m , MFXUtils::getFXColor(*colIt),
1320  LAYOUT_FIX_WIDTH | LAYOUT_CENTER_Y | FRAME_SUNKEN | FRAME_THICK | ICON_AFTER_TEXT,
1321  0, 0, 100, 0, 0, 0, 0, 0));
1322  if (fixed) {
1323  new FXLabel(m, nameIt->c_str());
1324  new FXLabel(m, "");
1325  } else {
1326  const int dialerOptions = scheme.allowsNegativeValues() ? SPINDIAL_NOMIN : 0;
1327  FXRealSpinDial* threshDialer = new FXRealSpinDial(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | SPINDIAL_NOMAX | dialerOptions);
1328  threshDialer->setValue(*threshIt);
1329  thresholds.push_back(threshDialer);
1330  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));
1331  buttonText = "Remove";
1332  }
1333  colIt++;
1334  threshIt++;
1335  nameIt++;
1336  }
1337  interpolation->setCheck(scheme.isInterpolated());
1338  if (fixed) {
1339  interpolation->disable();
1340  } else {
1341  if (colors.size() > 1) {
1342  interpolation->enable();
1343  if (interpolation->getCheck() != FALSE) {
1344  thresholds.front()->enable();
1345  } else {
1346  thresholds.front()->disable();
1347  }
1348  } else {
1349  interpolation->disable();
1350  thresholds.front()->disable();
1351  }
1352  }
1353  return m;
1354 }
1355 
1356 
1357 FXMatrix*
1359  std::vector<FXRealSpinDial*>& scales,
1360  std::vector<FXRealSpinDial*>& thresholds,
1361  std::vector<FXButton*>& buttons,
1362  FXCheckButton* interpolation,
1363  GUIScaleScheme& scheme) {
1364  MFXUtils::deleteChildren(frame);
1365  FXMatrix* m = new FXMatrix(frame, 3,
1366  LAYOUT_FILL_X | MATRIX_BY_COLUMNS,
1367  0, 0, 0, 0, 10, 10, 0, 0, 5, 3);
1368  scales.clear();
1369  thresholds.clear();
1370  buttons.clear();
1371  const bool fixed = scheme.isFixed();
1372  std::vector<SUMOReal>::const_iterator scaleIt = scheme.getColors().begin();
1373  std::vector<SUMOReal>::const_iterator threshIt = scheme.getThresholds().begin();
1374  std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1375  FX::FXString buttonText = "Add";
1376  while (scaleIt != scheme.getColors().end()) {
1377  FXRealSpinDial* scaleDialer = new FXRealSpinDial(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | SPINDIAL_NOMAX);
1378  scaleDialer->setValue(*scaleIt);
1379  scales.push_back(scaleDialer);
1380  if (fixed) {
1381  new FXLabel(m, nameIt->c_str());
1382  new FXLabel(m, "");
1383  } else {
1384  const int dialerOptions = scheme.allowsNegativeValues() ? SPINDIAL_NOMIN : 0;
1385  FXRealSpinDial* threshDialer = new FXRealSpinDial(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | SPINDIAL_NOMAX | dialerOptions);
1386  threshDialer->setValue(*threshIt);
1387  thresholds.push_back(threshDialer);
1388  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));
1389  buttonText = "Remove";
1390  }
1391  scaleIt++;
1392  threshIt++;
1393  nameIt++;
1394  }
1395  interpolation->setCheck(scheme.isInterpolated());
1396  if (fixed) {
1397  interpolation->disable();
1398  } else {
1399  if (scales.size() > 1) {
1400  interpolation->enable();
1401  if (interpolation->getCheck() != FALSE) {
1402  thresholds.front()->enable();
1403  } else {
1404  thresholds.front()->disable();
1405  }
1406  } else {
1407  interpolation->disable();
1408  thresholds.front()->disable();
1409  }
1410  }
1411  return m;
1412 }
1413 
1414 
1415 void
1417  // decals
1418  delete myDecalsTable;
1420  LAYOUT_FILL_Y | LAYOUT_FIX_WIDTH/*|LAYOUT_FIX_HEIGHT*/, 0, 0, 470, 0);
1421  myDecalsTable->setVisibleRows(5);
1422  myDecalsTable->setVisibleColumns(7);
1423  myDecalsTable->setTableSize(5, 7);
1424  myDecalsTable->setBackColor(FXRGB(255, 255, 255));
1425  myDecalsTable->getRowHeader()->setWidth(0);
1426  for (int i = 1; i <= 5; ++i) {
1428  myDecalsTable->setNumberCellParams(i, -10000000, 10000000, 1, 10, 100, "%.2f");
1429  }
1430  rebuildList();
1431  if (doCreate) {
1432  myDecalsTable->create();
1433  }
1435  if (doCreate) {
1436  m->create();
1437  }
1438  myLaneColorSettingFrame->getParent()->recalc();
1439 
1441  if (doCreate) {
1442  m->create();
1443  }
1444  myLaneScaleSettingFrame->getParent()->recalc();
1445 
1447  if (doCreate) {
1448  m->create();
1449  }
1450  myVehicleColorSettingFrame->getParent()->recalc();
1451 
1453  if (doCreate) {
1454  m->create();
1455  }
1456  myPersonColorSettingFrame->getParent()->recalc();
1458  if (doCreate) {
1459  m->create();
1460  }
1461  myContainerColorSettingFrame->getParent()->recalc();
1463  if (doCreate) {
1464  m->create();
1465  }
1466  myJunctionColorSettingFrame->getParent()->recalc();
1467 
1468  layout();
1469  update();
1470 }
1471 
1472 
1473 long
1474 GUIDialog_ViewSettings::onCmdEditTable(FXObject*, FXSelector, void* data) {
1476  std::string value = i->item->getText().text();
1477  // check whether the inserted value is empty
1478  if (value.find_first_not_of(" ") == std::string::npos) {
1479  return 1;
1480  }
1482  int row = i->row;
1483  // check whether we add a new entry or edit an existing entry
1484  if (row == static_cast<int>(myDecals->size())) {
1485  d.filename = "";
1486  d.centerX = SUMOReal(myParent->getGridWidth() / 2.);
1487  d.centerY = SUMOReal(myParent->getGridHeight() / 2.);
1488  d.width = 0.;
1489  d.height = 0.;
1490  d.initialised = false;
1491  d.rot = 0;
1492  d.layer = 0;
1493  myDecalsLock->lock();
1494  myDecals->push_back(d);
1495  myDecalsLock->unlock();
1496  } else if (row > static_cast<int>(myDecals->size())) {
1497  // ignore clicks two lines below existing entries
1498  return 1;
1499  } else {
1500  d = (*myDecals)[row];
1501  }
1502 
1503  switch (i->col) {
1504  case 0:
1505  if (d.initialised && d.filename != value) {
1506  d.initialised = false;
1507  }
1508  d.filename = value;
1509  break;
1510  case 1:
1511  try {
1512  d.centerX = TplConvert::_2SUMOReal(value.c_str());
1513  } catch (NumberFormatException&) {
1514  std::string msg = "The value must be a float, is:" + value;
1515  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1516  }
1517  break;
1518  case 2:
1519  try {
1520  d.centerY = TplConvert::_2SUMOReal(value.c_str());
1521  } catch (NumberFormatException&) {
1522  std::string msg = "The value must be a float, is:" + value;
1523  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1524  }
1525  break;
1526  case 3:
1527  try {
1528  d.width = TplConvert::_2SUMOReal(value.c_str());
1529  } catch (NumberFormatException&) {
1530  std::string msg = "The value must be a float, is:" + value;
1531  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1532  }
1533  break;
1534  case 4:
1535  try {
1536  d.height = TplConvert::_2SUMOReal(value.c_str());
1537  } catch (NumberFormatException&) {
1538  std::string msg = "The value must be a float, is:" + value;
1539  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1540  }
1541  break;
1542  case 5:
1543  try {
1544  d.rot = TplConvert::_2SUMOReal(value.c_str());
1545  } catch (NumberFormatException&) {
1546  std::string msg = "The value must be a float, is:" + value;
1547  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1548  }
1549  break;
1550  case 6:
1551  try {
1552  d.layer = TplConvert::_2SUMOReal(value.c_str());
1553  } catch (NumberFormatException&) {
1554  std::string msg = "The value must be a float, is:" + value;
1555  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1556  }
1557  break;
1558  default:
1559  throw 1;
1560  }
1561  (*myDecals)[row] = d;
1562  if (!i->updateOnly) {
1563  rebuildList();
1564  }
1565  myParent->update();
1566  return 1;
1567 }
1568 
1569 
1570 std::string
1572  return mySchemeName->getItem(mySchemeName->getCurrentItem()).text();
1573 }
1574 
1575 
1576 void
1578  if (name.c_str() == mySchemeName->getItemText(mySchemeName->getCurrentItem())) {
1579  return;
1580  }
1581  for (int i = 0; i < mySchemeName->getNumItems(); ++i) {
1582  if (name.c_str() == mySchemeName->getItemText(i)) {
1583  mySchemeName->setCurrentItem(i);
1584  onCmdNameChange(0, 0, (void*)name.c_str());
1585  return;
1586  }
1587  }
1588 }
1589 
1591  FXMatrix* parent,
1592  GUIDialog_ViewSettings* target,
1593  const std::string& title,
1594  const GUIVisualizationTextSettings& settings) {
1595  myCheck = new FXCheckButton(parent, title.c_str(), target, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
1596  myCheck->setCheck(settings.show);
1597  new FXLabel(parent, "");
1598  FXMatrix* m1 = new FXMatrix(parent, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
1599  0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
1600  new FXLabel(m1, "Size", 0, LAYOUT_CENTER_Y);
1601  mySizeDial = new FXRealSpinDial(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE,
1602  LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
1603  mySizeDial->setRange(10, 1000);
1604  mySizeDial->setValue(settings.size);
1605  FXMatrix* m2 = new FXMatrix(parent, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
1606  0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
1607  new FXLabel(m2, "Color", 0, LAYOUT_CENTER_Y);
1608  myColorWell = new FXColorWell(m2, MFXUtils::getFXColor(settings.color),
1609  target, MID_SIMPLE_VIEW_COLORCHANGE,
1610  LAYOUT_FIX_WIDTH | LAYOUT_CENTER_Y | LAYOUT_SIDE_TOP | FRAME_SUNKEN | FRAME_THICK | ICON_AFTER_TEXT,
1611  0, 0, 100, 0, 0, 0, 0, 0);
1612 }
1613 
1614 
1617  return GUIVisualizationTextSettings(myCheck->getCheck() != FALSE,
1618  mySizeDial->getValue(), MFXUtils::getRGBColor(myColorWell->getRGBA()));
1619 }
1620 
1621 
1622 void
1624  myCheck->setCheck(settings.show);
1625  mySizeDial->setValue(settings.size);
1626  myColorWell->setRGBA(MFXUtils::getFXColor(settings.color));
1627 }
1628 
1629 
1631  FXMatrix* parent,
1632  GUIDialog_ViewSettings* target,
1633  const GUIVisualizationSizeSettings& settings) {
1634  myCheck = new FXCheckButton(parent, "Draw with constant size when zoomed out", target, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL);
1635  myCheck->setCheck(settings.constantSize);
1636  new FXLabel(parent, "");
1637  FXMatrix* m1 = new FXMatrix(parent, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
1638  0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
1639  new FXLabel(m1, "Minimum Size", 0, LAYOUT_CENTER_Y);
1640  myMinSizeDial = new FXRealSpinDial(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE,
1641  LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
1642  myMinSizeDial->setValue(settings.minSize);
1643  FXMatrix* m2 = new FXMatrix(parent, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
1644  0, 0, 0, 0, 10, 10, 0, 0, 5, 5);
1645  new FXLabel(m2, "Exaggerate by", 0, LAYOUT_CENTER_Y);
1646  myExaggerateDial = new FXRealSpinDial(m2, 10, target, MID_SIMPLE_VIEW_COLORCHANGE,
1647  LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
1648  myExaggerateDial->setRange(0, 10000);
1649  myExaggerateDial->setValue(settings.exaggeration);
1650 }
1651 
1652 
1656  myMinSizeDial->getValue(), myExaggerateDial->getValue(), myCheck->getCheck() != FALSE);
1657 }
1658 
1659 
1660 void
1662  myCheck->setCheck(settings.constantSize);
1663  myMinSizeDial->setValue(settings.minSize);
1664  myExaggerateDial->setValue(settings.exaggeration);
1665 }
1666 
1667 
1668 void
1670  getApp()->reg().writeIntEntry("VIEWSETTINGS", "x", getX());
1671  getApp()->reg().writeIntEntry("VIEWSETTINGS", "y", getY());
1672  getApp()->reg().writeIntEntry("VIEWSETTINGS", "width", getWidth());
1673  getApp()->reg().writeIntEntry("VIEWSETTINGS", "height", getHeight());
1674 }
1675 
1676 /****************************************************************************/
1677 
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
GUIVisualizationTextSettings poiType
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
static SUMOReal _2SUMOReal(const E *const data)
Definition: TplConvert.h:242
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&#39;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:79
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:349
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.
SUMOReal getDelay() const
Returns the parsed delay.
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:275
void update(const GUIVisualizationSizeSettings &settings)
SUMOReal altitude
The altitude of the image (net coordinates in z-direction, in m)
FXCheckButton * myDrawCrossingsAndWalkingAreas
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:289
void remove(const std::string &name)
Removes the setting with the given name.
GUIVisualizationTextSettings polyType
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)
GUIVisualizationTextSettings drawLinkTLIndex
T MIN2(T a, T b)
Definition: StdDefs.h:73
Ok-button was pushed.
Definition: GUIAppEnum.h:287
GUIColorer personColorer
The person colorer.
GUIVisualizationTextSettings internalJunctionName
For the import-from-file - button.
Definition: GUIAppEnum.h:351
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&#39;s change.
Definition: GUIAppEnum.h:341
For the delete - button.
Definition: GUIAppEnum.h:347
long onCmdOk(FXObject *, FXSelector, void *)
Called if the OK-button was pressed.
For the save-decals - button.
Definition: GUIAppEnum.h:355
void unlock()
release mutex lock
Definition: MFXMutex.cpp:96
For the load-decals - button.
Definition: GUIAppEnum.h:353
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:343
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
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.
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
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.
void setDelay(SUMOReal delay)
Sets the delay of the parent application.
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:214
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
GUIVisualizationTextSettings drawLinkJunctionIndex
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:345
long onUpdImportSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to read settings from a file.
GUIVisualizationTextSettings polyName
GUIVisualizationTextSettings containerName