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