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