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