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