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(nullptr) {
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:", nullptr, 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, nullptr, 0, GUIDesignViewSettingsTabBook1);
117  {
118  // tab for the background
119  new FXTabItem(tabbook, "Background", nullptr, 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", nullptr, 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", nullptr, this, MID_SIMPLE_VIEW_LOAD_DECALS, GUIDesignViewSettingsButton1);
134  new FXButton(frame111, "&Save Decals", nullptr, 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", nullptr, 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", nullptr, 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", nullptr, 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", nullptr, 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", nullptr, 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  myParamKey = new FXTextField(frame22, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignTextFielWidth100);
168  myParamKey->disable();
169 
170  new FXHorizontalSeparator(frame2, GUIDesignHorizontalSeparator);
171  // ... scale settings
172  FXVerticalFrame* frame23 = new FXVerticalFrame(frame2, GUIDesignViewSettingsVerticalFrame6);
173  FXMatrix* m23 = new FXMatrix(frame23, 3, GUIDesignViewSettingsMatrix3);
174  new FXLabel(m23, "Scale width", nullptr, GUIDesignViewSettingsLabel1);
175  myLaneEdgeScaleMode = new FXComboBox(m23, 30, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
176  myLaneScaleInterpolation = new FXCheckButton(m23, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButton);
177  myLaneScaleSettingFrame = new FXVerticalFrame(frame23, GUIDesignViewSettingsVerticalFrame4);
178 
180  mySettings->edgeColorer.fill(*myLaneEdgeColorMode);
181  mySettings->edgeScaler.fill(*myLaneEdgeScaleMode);
182  myLaneEdgeColorMode->setNumVisible((int)mySettings->edgeColorer.size());
183  myLaneEdgeScaleMode->setNumVisible((int)mySettings->edgeScaler.size());
184  } else {
185  mySettings->laneColorer.fill(*myLaneEdgeColorMode);
186  mySettings->laneScaler.fill(*myLaneEdgeScaleMode);
187  myLaneEdgeColorMode->setNumVisible((int)mySettings->laneColorer.size());
188  myLaneEdgeScaleMode->setNumVisible((int)mySettings->laneScaler.size());
189  }
190 
191  new FXHorizontalSeparator(frame2, GUIDesignHorizontalSeparator);
192  FXMatrix* m22 = new FXMatrix(frame2, 2, GUIDesignViewSettingsMatrix1);
193  myShowLaneBorders = new FXCheckButton(m22, "Show lane borders", this, MID_SIMPLE_VIEW_COLORCHANGE);
194  myShowLaneBorders->setCheck(mySettings->laneShowBorders);
195  myShowBikeMarkings = new FXCheckButton(m22, "Show bike markings", this, MID_SIMPLE_VIEW_COLORCHANGE);
196  myShowBikeMarkings->setCheck(mySettings->showBikeMarkings);
197  myShowLaneDecals = new FXCheckButton(m22, "Show turning arrows", this, MID_SIMPLE_VIEW_COLORCHANGE);
198  myShowLaneDecals->setCheck(mySettings->showLinkDecals);
199  new FXLabel(m22, " ", nullptr, GUIDesignViewSettingsLabel1);
200  myShowLinkRules = new FXCheckButton(m22, "Show right-of-way rules", this, MID_SIMPLE_VIEW_COLORCHANGE);
201  myShowLinkRules->setCheck(mySettings->showLinkRules);
202  new FXLabel(m22, " ", nullptr, GUIDesignViewSettingsLabel1);
203  myShowRails = new FXCheckButton(m22, "Show rails", this, MID_SIMPLE_VIEW_COLORCHANGE);
204  myShowRails->setCheck(mySettings->showRails);
205  new FXLabel(m22, " ", nullptr, GUIDesignViewSettingsLabel1);
206  myHideMacroConnectors = new FXCheckButton(m22, "Hide macro connectors", this, MID_SIMPLE_VIEW_COLORCHANGE);
207  myHideMacroConnectors->setCheck(mySettings->hideConnectors);
208  new FXLabel(m22, " ", nullptr, GUIDesignViewSettingsLabel1);
209  myShowLaneDirection = new FXCheckButton(m22, "Show lane direction", this, MID_SIMPLE_VIEW_COLORCHANGE);
210  myShowLaneDirection->setCheck(mySettings->showLaneDirection);
211  new FXLabel(m22, " ", nullptr, GUIDesignViewSettingsLabel1);
212  myShowSublanes = new FXCheckButton(m22, "Show sublanes", this, MID_SIMPLE_VIEW_COLORCHANGE);
213  myShowSublanes->setCheck(mySettings->showSublanes);
214  mySpreadSuperposed = new FXCheckButton(m22, "Spread superposed", this, MID_SIMPLE_VIEW_COLORCHANGE);
215  mySpreadSuperposed->setCheck(mySettings->spreadSuperposed);
216  new FXLabel(m22, "Exaggerate width by", nullptr, GUIDesignViewSettingsLabel1);
217  myLaneWidthUpscaleDialer = new FXRealSpinner(m22, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
218  myLaneWidthUpscaleDialer->setRange(0, 10000);
219  myLaneWidthUpscaleDialer->setValue(mySettings->laneWidthExaggeration);
220 
221  new FXLabel(m22, "Minimum size", nullptr, GUIDesignViewSettingsLabel1);
222  myLaneMinWidthDialer = new FXRealSpinner(m22, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
223  myLaneMinWidthDialer->setRange(0, 10000);
224  myLaneMinWidthDialer->setValue(mySettings->laneMinSize);
225 
226  // edge name
227  myEdgeNamePanel = new NamePanel(m22, this, "Show edge name", mySettings->edgeName);
228  myStreetNamePanel = new NamePanel(m22, this, "Show street name", mySettings->streetName);
229  myEdgeValuePanel = new NamePanel(m22, this, "Show edge color value", mySettings->edgeValue);
230  }
231  {
232  // vehicles
233  new FXTabItem(tabbook, "Vehicles", nullptr, GUIDesignViewSettingsTabItemBook1);
234  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
235  FXVerticalFrame* frame3 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
236 
237  FXMatrix* m31 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix3);
238  new FXLabel(m31, "Show As", nullptr, GUIDesignViewSettingsLabel1);
239  myVehicleShapeDetail = new FXComboBox(m31, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
240  myVehicleShapeDetail->appendItem("'triangles'");
241  myVehicleShapeDetail->appendItem("'boxes'");
242  myVehicleShapeDetail->appendItem("'simple shapes'");
243  myVehicleShapeDetail->appendItem("'raster images'");
244  myVehicleShapeDetail->setNumVisible(4);
245  myVehicleShapeDetail->setCurrentItem(settings->vehicleQuality);
246 
247  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
248 
249  FXMatrix* m32 = new FXMatrix(frame3, 3, GUIDesignViewSettingsMatrix3);
250  new FXLabel(m32, "Color", nullptr, GUIDesignViewSettingsLabel1);
251  myVehicleColorMode = new FXComboBox(m32, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
252  mySettings->vehicleColorer.fill(*myVehicleColorMode);
253  myVehicleColorMode->setNumVisible((int)mySettings->vehicleColorer.size());
254  myVehicleColorInterpolation = new FXCheckButton(m32, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButton);
255 
256  myVehicleColorSettingFrame = new FXVerticalFrame(frame3, GUIDesignViewSettingsVerticalFrame4);
257 
258  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
259 
260  FXMatrix* m33 = new FXMatrix(frame3, 2, GUIDesignMatrixViewSettings);
261  myShowBlinker = new FXCheckButton(m33, "Show blinker / brake lights", this, MID_SIMPLE_VIEW_COLORCHANGE);
262  myShowBlinker->setCheck(mySettings->showBlinker);
263  new FXLabel(m33, " ", nullptr, GUIDesignViewSettingsLabel1);
264  myShowMinGap = new FXCheckButton(m33, "Show minimum gap", this, MID_SIMPLE_VIEW_COLORCHANGE);
265  myShowMinGap->setCheck(mySettings->drawMinGap);
266  new FXLabel(m33, " ", nullptr, GUIDesignViewSettingsLabel1);
267  myShowBTRange = new FXCheckButton(m33, "Show Bluetooth range", this, MID_SIMPLE_VIEW_COLORCHANGE);
268  myShowBTRange->setCheck(mySettings->showBTRange);
269  new FXLabel(m33, " ", nullptr, GUIDesignViewSettingsLabel1);
270  /*
271  myShowLaneChangePreference = new FXCheckButton(m33, "Show lane change preference", this, MID_SIMPLE_VIEW_COLORCHANGE);
272  myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
273  new FXLabel(m33, " ", 0, GUIDesignViewSettingsLabel1);
274  */
275  myVehicleNamePanel = new NamePanel(m33, this, "Show vehicle name", mySettings->vehicleName);
276  myVehicleValuePanel = new NamePanel(m33, this, "Show vehicle color value", mySettings->vehicleValue);
277  /*
278  FXCheckButton *tmpc = new FXCheckButton(m33, "Show braking lights", 0 ,0);
279  tmpc->disable();
280  tmpc = new FXCheckButton(m33, "Show needed headway", 0 ,0);
281  tmpc->disable();
282  */
283 
284  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
285 
286  FXMatrix* m34 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix1);
287  myVehicleSizePanel = new SizePanel(m34, this, mySettings->vehicleSize);
288  }
289  {
290  // persons
291  new FXTabItem(tabbook, "Persons", nullptr, GUIDesignViewSettingsTabItemBook1);
292  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
293  FXVerticalFrame* frame3 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
294 
295  FXMatrix* m101 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix3);
296  new FXLabel(m101, "Show As", nullptr, GUIDesignViewSettingsLabel1);
297  myPersonShapeDetail = new FXComboBox(m101, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
298  myPersonShapeDetail->appendItem("'triangles'");
299  myPersonShapeDetail->appendItem("'boxes'");
300  myPersonShapeDetail->appendItem("'simple shapes'");
301  myPersonShapeDetail->appendItem("'raster images'");
302  myPersonShapeDetail->setNumVisible(4);
303  myPersonShapeDetail->setCurrentItem(settings->personQuality);
304 
305  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
306 
307  FXMatrix* m102 = new FXMatrix(frame3, 3, GUIDesignViewSettingsMatrix3);
308  new FXLabel(m102, "Color", nullptr, GUIDesignViewSettingsLabel1);
309  myPersonColorMode = new FXComboBox(m102, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
310  mySettings->personColorer.fill(*myPersonColorMode);
311  myPersonColorMode->setNumVisible(10);
312  myPersonColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButton);
313 
314  myPersonColorSettingFrame = new FXVerticalFrame(frame3, GUIDesignViewSettingsVerticalFrame4);
315 
316  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
317 
318  FXMatrix* m103 = new FXMatrix(frame3, 2, GUIDesignMatrixViewSettings);
319  myPersonNamePanel = new NamePanel(m103, this, "Show person name", mySettings->personName);
320  myPersonValuePanel = new NamePanel(m103, this, "Show person color value", mySettings->personValue);
321 
322  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
323 
324  FXMatrix* m104 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix1);
325  myPersonSizePanel = new SizePanel(m104, this, mySettings->personSize);
326  }
327  {
328  // containers
329  new FXTabItem(tabbook, "Containers", nullptr, GUIDesignViewSettingsTabItemBook1);
330  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
331  FXVerticalFrame* frame3 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
332 
333  FXMatrix* m101 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix3);
334  new FXLabel(m101, "Show As", nullptr, GUIDesignViewSettingsLabel1);
335  myContainerShapeDetail = new FXComboBox(m101, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
336  myContainerShapeDetail->appendItem("'triangles'");
337  myContainerShapeDetail->appendItem("'boxes'");
338  myContainerShapeDetail->appendItem("'simple shapes'");
339  myContainerShapeDetail->appendItem("'raster images'");
340  myContainerShapeDetail->setNumVisible(4);
341  myContainerShapeDetail->setCurrentItem(settings->containerQuality);
342 
343  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
344 
345  FXMatrix* m102 = new FXMatrix(frame3, 3, GUIDesignViewSettingsMatrix3);
346  new FXLabel(m102, "Color", nullptr, GUIDesignViewSettingsLabel1);
347  myContainerColorMode = new FXComboBox(m102, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
348  mySettings->containerColorer.fill(*myContainerColorMode);
349  myContainerColorMode->setNumVisible(9);
350  myContainerColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButton);
351 
352  myContainerColorSettingFrame = new FXVerticalFrame(frame3, GUIDesignViewSettingsVerticalFrame4);
353 
354  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
355 
356  FXMatrix* m103 = new FXMatrix(frame3, 2, GUIDesignMatrixViewSettings);
357  myContainerNamePanel = new NamePanel(m103, this, "Show container name", mySettings->containerName);
358 
359  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
360 
361  FXMatrix* m104 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix1);
362  myContainerSizePanel = new SizePanel(m104, this, mySettings->containerSize);
363  }
364  {
365  // nodes
366  new FXTabItem(tabbook, "Junctions", nullptr, GUIDesignViewSettingsTabItemBook1);
367  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
368  FXVerticalFrame* frame4 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
369  FXMatrix* m41 = new FXMatrix(frame4, 3, GUIDesignViewSettingsMatrix3);
370  new FXLabel(m41, "Color", nullptr, GUIDesignViewSettingsLabel1);
371  myJunctionColorMode = new FXComboBox(m41, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
372  mySettings->junctionColorer.fill(*myJunctionColorMode);
373  myJunctionColorMode->setNumVisible(4);
374  myJunctionColorInterpolation = new FXCheckButton(m41, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButton);
375 
376  myJunctionColorSettingFrame = new FXVerticalFrame(frame4, GUIDesignViewSettingsVerticalFrame4);
377  myJunctionColorRainbow = new FXButton(frame4, "Recalibrate Rainbow", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
378  (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
379 
380  new FXHorizontalSeparator(frame4, GUIDesignHorizontalSeparator);
381  FXMatrix* m42 = new FXMatrix(frame4, 2, GUIDesignMatrixViewSettings);
382  myTLIndexPanel = new NamePanel(m42, this, "Show link tls index", mySettings->drawLinkTLIndex);
383  myJunctionIndexPanel = new NamePanel(m42, this, "Show link junction index", mySettings->drawLinkJunctionIndex);
384  myShowLane2Lane = new FXCheckButton(m42, "Show lane to lane connections", this, MID_SIMPLE_VIEW_COLORCHANGE);
385  myShowLane2Lane->setCheck(mySettings->showLane2Lane);
386  new FXLabel(m42, " ", nullptr, GUIDesignViewSettingsLabel1);
387  myJunctionNamePanel = new NamePanel(m42, this, "Show junction name", mySettings->junctionName);
388  myInternalJunctionNamePanel = new NamePanel(m42, this, "Show internal junction name", mySettings->internalJunctionName);
389  myInternalEdgeNamePanel = new NamePanel(m42, this, "Show internal edge name", mySettings->internalEdgeName);
390  myCwaEdgeNamePanel = new NamePanel(m42, this, "Show crossing and walkingarea name", mySettings->cwaEdgeName);
391  myDrawJunctionShape = new FXCheckButton(m42, "Draw junction shape", this, MID_SIMPLE_VIEW_COLORCHANGE);
392  myDrawJunctionShape->setCheck(mySettings->drawJunctionShape);
393  myDrawCrossingsAndWalkingAreas = new FXCheckButton(m42, "Draw crossings/walkingareas", this, MID_SIMPLE_VIEW_COLORCHANGE);
394  myDrawCrossingsAndWalkingAreas->setCheck(mySettings->drawCrossingsAndWalkingareas);
395 
396  new FXHorizontalSeparator(frame4, GUIDesignHorizontalSeparator);
397 
398  FXMatrix* m43 = new FXMatrix(frame4, 2, GUIDesignViewSettingsMatrix1);
399  myJunctionSizePanel = new SizePanel(m43, this, mySettings->junctionSize);
400  }
401  {
402  // detectors / triggers
403  new FXTabItem(tabbook, "Additional", nullptr, GUIDesignViewSettingsTabItemBook1);
404  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
405  FXVerticalFrame* frame5 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
406 
407  FXMatrix* m51 = new FXMatrix(frame5, 2, GUIDesignMatrixViewSettings);
408  myAddNamePanel = new NamePanel(m51, this, "Show object name", mySettings->addName);
409  myAddFullNamePanel = new NamePanel(m51, this, "Show full name", mySettings->addFullName);
410  new FXHorizontalSeparator(frame5 , GUIDesignHorizontalSeparator);
411 
412  FXMatrix* m52 = new FXMatrix(frame5, 2, GUIDesignMatrixViewSettings);
413  myAddSizePanel = new SizePanel(m52, this, mySettings->addSize);
414 
415  /*
416  new FXLabel(m522, "Color", 0, GUIDesignViewSettingsLabel1);
417  myDetectorNameColor = new FXColorWell(m522, MFXUtils::getFXColor(settings->addNameColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell3);
418  */
419  }
420  {
421  // POIs
422  new FXTabItem(tabbook, "POIs", nullptr, GUIDesignViewSettingsTabItemBook1);
423  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
424  FXVerticalFrame* frame6 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
425 
426  FXMatrix* m63 = new FXMatrix(frame6, 3, GUIDesignViewSettingsMatrix3);
427  new FXLabel(m63, "Color", nullptr, GUIDesignViewSettingsLabel1);
428  myPOIColorMode = new FXComboBox(m63, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
429  mySettings->poiColorer.fill(*myPOIColorMode);
430  myPOIColorMode->setNumVisible(3);
431  myPOIColorInterpolation = new FXCheckButton(m63, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButton);
432  myPOIColorSettingFrame = new FXVerticalFrame(frame6, GUIDesignViewSettingsVerticalFrame4);
433 
434  new FXHorizontalSeparator(frame6, GUIDesignHorizontalSeparator);
435 
436  FXMatrix* m61 = new FXMatrix(frame6, 2, GUIDesignMatrixViewSettings);
437  myPOINamePanel = new NamePanel(m61, this, "Show poi names", mySettings->poiName);
438  myPOITypePanel = new NamePanel(m61, this, "Show poi types", mySettings->poiType);
439  new FXHorizontalSeparator(frame6 , GUIDesignHorizontalSeparator);
440 
441  FXMatrix* m62 = new FXMatrix(frame6, 2, GUIDesignMatrixViewSettings);
442  myPOISizePanel = new SizePanel(m62, this, mySettings->poiSize);
443 
444  }
445  {
446  // Polygons
447  new FXTabItem(tabbook, "Polygons", nullptr, GUIDesignViewSettingsTabItemBook1);
448  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
449  FXVerticalFrame* frame9 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
450 
451  FXMatrix* m63 = new FXMatrix(frame9, 3, GUIDesignViewSettingsMatrix3);
452  new FXLabel(m63, "Color", nullptr, GUIDesignViewSettingsLabel1);
453  myPolyColorMode = new FXComboBox(m63, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
454  mySettings->polyColorer.fill(*myPolyColorMode);
455  myPolyColorMode->setNumVisible(3);
456  myPolyColorInterpolation = new FXCheckButton(m63, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButton);
457  myPolyColorSettingFrame = new FXVerticalFrame(frame9, GUIDesignViewSettingsVerticalFrame4);
458 
459  new FXHorizontalSeparator(frame9, GUIDesignHorizontalSeparator);
460 
461  FXMatrix* m91 = new FXMatrix(frame9, 2, GUIDesignMatrixViewSettings);
462  myPolyNamePanel = new NamePanel(m91, this, "Show polygon names", mySettings->polyName);
463  myPolyTypePanel = new NamePanel(m91, this, "Show polygon types", mySettings->polyType);
464  new FXHorizontalSeparator(frame9 , GUIDesignHorizontalSeparator);
465 
466  myPolySizePanel = new SizePanel(m91, this, mySettings->polySize);
467  }
468  if (settings->netedit) {
469  // Selection
470  new FXTabItem(tabbook, "Selection", nullptr, GUIDesignViewSettingsTabItemBook1);
471  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
472  FXVerticalFrame* frame10 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
473 
474  FXMatrix* m102 = new FXMatrix(frame10, 2, GUIDesignMatrixViewSettings);
475  new FXLabel(m102, "Default Selection Color", nullptr, GUIDesignViewSettingsLabel1);
476  new FXLabel(m102, "", nullptr, GUIDesignViewSettingsLabel1);
477 
478  new FXLabel(m102, "Miscellaneous", nullptr, GUIDesignViewSettingsLabel1);
479  mySelectionColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->selectionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
480  new FXLabel(m102, "Edge", nullptr, GUIDesignViewSettingsLabel1);
481  mySelectedEdgeColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->selectedEdgeColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
482  new FXLabel(m102, "Lane Edge", nullptr, GUIDesignViewSettingsLabel1);
483  mySelectedLaneColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->selectedLaneColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
484  new FXLabel(m102, "Connection", nullptr, GUIDesignViewSettingsLabel1);
485  mySelectedConnectionColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->selectedConnectionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
486  new FXLabel(m102, "Additional", nullptr, GUIDesignViewSettingsLabel1);
487  mySelectedAdditionalColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->selectedAdditionalColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
488  }
489  {
490  // Legend
491  new FXTabItem(tabbook, "Legend", nullptr, GUIDesignViewSettingsTabItemBook1);
492  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
493  FXVerticalFrame* frame7 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
494 
495  FXMatrix* m72 = new FXMatrix(frame7, 2, GUIDesignMatrixViewSettings);
496  myShowSizeLegend = new FXCheckButton(m72, "Show Size Legend", this, MID_SIMPLE_VIEW_COLORCHANGE);
497  myShowSizeLegend->setCheck(mySettings->showSizeLegend);
498  new FXLabel(m72, "");
499  }
500  {
501  // openGL
502  new FXTabItem(tabbook, "openGL", nullptr, GUIDesignViewSettingsTabItemBook1);
503  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
504  FXVerticalFrame* frame8 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
505 
506  FXMatrix* m82 = new FXMatrix(frame8, 1, GUIDesignMatrixViewSettings);
507  myDither = new FXCheckButton(m82, "Dither", this, MID_SIMPLE_VIEW_COLORCHANGE);
508  myDither->setCheck(mySettings->dither);
509  }
510  FXHorizontalFrame* f2 = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame2);
511  FXButton* initial = new FXButton(f2, "&OK", nullptr, this, MID_SETTINGS_OK, GUIDesignViewSettingsButton2);
512  new FXButton(f2, "&Cancel", nullptr, this, MID_SETTINGS_CANCEL, GUIDesignViewSettingsButton3);
513  initial->setFocus();
514 
515  rebuildColorMatrices(false);
517  loadWindowSize();
518 }
519 
520 
522  myParent->remove(this);
523  // delete name panels
526  delete myCwaEdgeNamePanel;
527  delete myStreetNamePanel;
528  delete myEdgeValuePanel;
529  delete myJunctionIndexPanel;
530  delete myTLIndexPanel;
531  delete myJunctionNamePanel;
532  delete myVehicleNamePanel;
533  delete myVehicleValuePanel;
534  delete myPersonNamePanel;
535  delete myPersonValuePanel;
536  delete myAddNamePanel;
537  delete myAddFullNamePanel;
538  delete myPOINamePanel;
539  delete myPOITypePanel;
540  delete myPolyNamePanel;
541  delete myPolyTypePanel;
542  delete myEdgeNamePanel;
543  // delete size panels
544  delete myVehicleSizePanel;
545  delete myPersonSizePanel;
546  delete myJunctionSizePanel;
547  delete myPOISizePanel;
548  delete myPolySizePanel;
549  delete myAddSizePanel;
550 }
551 
552 
553 void
555  // update buttons that can be changed externally
556  myShowGrid->setCheck(mySettings->showGrid);
557  FXDialogBox::show();
558 }
559 
560 
561 void
563  mySettings = settings;
564  myBackup = (*settings);
565  onCmdNameChange(nullptr, 0, nullptr);
566 }
567 
568 
569 long
570 GUIDialog_ViewSettings::onCmdOk(FXObject*, FXSelector, void*) {
571  saveWindowSize();
572  hide();
573  return 1;
574 }
575 
576 
577 long
578 GUIDialog_ViewSettings::onCmdCancel(FXObject*, FXSelector, void*) {
579  saveWindowSize();
580  hide();
581  (*mySettings) = myBackup;
582  return 1;
583 }
584 
585 
586 long
587 GUIDialog_ViewSettings::onCmdNameChange(FXObject*, FXSelector, void* data) {
588  if (data != nullptr) {
589  FXString dataS = (char*) data; // !!!unicode
590  // check whether this item has been added twice
591  if (dataS == mySchemeName->getItemText(mySchemeName->getNumItems() - 1)) {
592  for (int i = 0; i < mySchemeName->getNumItems() - 1; ++i) {
593  if (dataS == mySchemeName->getItemText(i)) {
594  mySchemeName->removeItem(i);
595  }
596  }
597  }
598  myBackup = gSchemeStorage.get(dataS.text());
599  mySettings = &gSchemeStorage.get(dataS.text());
600  }
601  rebuildColorMatrices(true);
602 
604  if (mySettings->netedit) {
610  }
611 
612  myLaneEdgeColorMode->setCurrentItem((FXint) mySettings->getLaneEdgeMode());
613  myLaneEdgeScaleMode->setCurrentItem((FXint) mySettings->getLaneEdgeScaleMode());
618  myShowRails->setCheck(mySettings->showRails);
630 
631  myVehicleColorMode->setCurrentItem((FXint) mySettings->vehicleColorer.getActive());
634  myShowMinGap->setCheck(mySettings->drawMinGap);
636  /*
637  myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
638  */
642 
643  myPersonColorMode->setCurrentItem((FXint) mySettings->personColorer.getActive());
644  myPersonShapeDetail->setCurrentItem(mySettings->personQuality);
648 
649  myContainerColorMode->setCurrentItem((FXint) mySettings->containerColorer.getActive());
653 
654  myJunctionColorMode->setCurrentItem((FXint) mySettings->junctionColorer.getActive());
660 
664 
668 
672 
676  myDither->setCheck(mySettings->dither);
678 
680  update();
681  myParent->update();
682  return 1;
683 }
684 
685 
686 bool
687 GUIDialog_ViewSettings::updateColorRanges(FXObject* sender, std::vector<FXColorWell*>::const_iterator colIt,
688  std::vector<FXColorWell*>::const_iterator colEnd,
689  std::vector<FXRealSpinner*>::const_iterator threshIt,
690  std::vector<FXRealSpinner*>::const_iterator threshEnd,
691  std::vector<FXButton*>::const_iterator buttonIt,
692  GUIColorScheme& scheme) {
693  int pos = 0;
694  while (colIt != colEnd) {
695  if (scheme.isFixed()) {
696  if (sender == *colIt) {
697  scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
698  }
699  } else {
700  if (sender == *threshIt) {
701  const double val = (*threshIt)->getValue();
702  double lo, hi;
703  if (pos != 0) {
704  threshIt--;
705  (*threshIt)->getRange(lo, hi);
706  (*threshIt)->setRange(lo, val);
707  threshIt++;
708  }
709  threshIt++;
710  if (threshIt != threshEnd) {
711  (*threshIt)->getRange(lo, hi);
712  (*threshIt)->setRange(val, hi);
713  }
714  scheme.setThreshold(pos, val);
715  return false;
716  }
717  if (sender == *colIt) {
718  scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
719  return false;
720  }
721  if (sender == *buttonIt) {
722  scheme.addColor(MFXUtils::getRGBColor((*colIt)->getRGBA()), (*threshIt)->getValue());
723  return true;
724  } else if (sender == *(buttonIt + 1)) {
725  scheme.removeColor(pos);
726  return true;
727  }
728  // 2 buttons per item (add / remove)
729  threshIt++;
730  buttonIt += 2;
731  }
732  ++colIt;
733  pos++;
734  }
735  return false;
736 }
737 
738 
739 bool
740 GUIDialog_ViewSettings::updateScaleRanges(FXObject* sender, std::vector<FXRealSpinner*>::const_iterator scaleIt,
741  std::vector<FXRealSpinner*>::const_iterator scaleEnd,
742  std::vector<FXRealSpinner*>::const_iterator threshIt,
743  std::vector<FXRealSpinner*>::const_iterator threshEnd,
744  std::vector<FXButton*>::const_iterator buttonIt,
745  GUIScaleScheme& scheme) {
746  int pos = 0;
747  while (scaleIt != scaleEnd) {
748  if (scheme.isFixed()) {
749  if (sender == *scaleIt) {
750  scheme.setColor(pos, (*scaleIt)->getValue());
751  }
752  } else {
753  if (sender == *threshIt) {
754  const double val = (*threshIt)->getValue();
755  double lo, hi;
756  if (pos != 0) {
757  threshIt--;
758  (*threshIt)->getRange(lo, hi);
759  (*threshIt)->setRange(lo, val);
760  threshIt++;
761  }
762  threshIt++;
763  if (threshIt != threshEnd) {
764  (*threshIt)->getRange(lo, hi);
765  (*threshIt)->setRange(val, hi);
766  }
767  scheme.setThreshold(pos, val);
768  return false;
769  }
770  if (sender == *scaleIt) {
771  scheme.setColor(pos, (*scaleIt)->getValue());
772  return false;
773  }
774  if (sender == *buttonIt) {
775  scheme.addColor((*scaleIt)->getValue(), (*threshIt)->getValue());
776  return true;
777  } else if (sender == *(buttonIt + 1)) {
778  scheme.removeColor(pos);
779  return true;
780  }
781  threshIt++;
782  buttonIt += 2;
783  }
784  ++scaleIt;
785  pos++;
786  }
787  return false;
788 }
789 
790 
791 long
792 GUIDialog_ViewSettings::onCmdColorChange(FXObject* sender, FXSelector, void* /*val*/) {
793  GUIVisualizationSettings tmpSettings = *mySettings;
794  int prevLaneMode = mySettings->getLaneEdgeMode();
795  int prevLaneScaleMode = mySettings->getLaneEdgeScaleMode();
796  int prevVehicleMode = mySettings->vehicleColorer.getActive();
797  int prevPersonMode = mySettings->personColorer.getActive();
798  int prevContainerMode = mySettings->containerColorer.getActive();
799  int prevJunctionMode = mySettings->junctionColorer.getActive();
800  int prevPOIMode = mySettings->poiColorer.getActive();
801  int prevPolyMode = mySettings->polyColorer.getActive();
802  bool doRebuildColorMatrices = false;
803 
804  tmpSettings.name = mySettings->name;
805  tmpSettings.backgroundColor = MFXUtils::getRGBColor(myBackgroundColor->getRGBA());
806  if (mySettings->netedit) {
807  tmpSettings.selectionColor = MFXUtils::getRGBColor(mySelectionColor->getRGBA());
812  }
813 
814  tmpSettings.showGrid = (myShowGrid->getCheck() != FALSE);
815  tmpSettings.gridXSize = (double) myGridXSizeDialer->getValue();
816  tmpSettings.gridYSize = (double) myGridYSizeDialer->getValue();
817 
819  tmpSettings.edgeColorer.setActive(myLaneEdgeColorMode->getCurrentItem());
820  tmpSettings.edgeScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());
821  } else {
822  tmpSettings.laneColorer.setActive(myLaneEdgeColorMode->getCurrentItem());
823  tmpSettings.laneScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());
824  }
825  tmpSettings.laneShowBorders = (myShowLaneBorders->getCheck() != FALSE);
826  tmpSettings.showBikeMarkings = (myShowBikeMarkings->getCheck() != FALSE);
827  tmpSettings.showLinkDecals = (myShowLaneDecals->getCheck() != FALSE);
828  tmpSettings.showLinkRules = (myShowLinkRules->getCheck() != FALSE);
829  tmpSettings.showRails = (myShowRails->getCheck() != FALSE);
830  tmpSettings.edgeName = myEdgeNamePanel->getSettings();
832  tmpSettings.cwaEdgeName = myCwaEdgeNamePanel->getSettings();
833  tmpSettings.streetName = myStreetNamePanel->getSettings();
834  tmpSettings.edgeValue = myEdgeValuePanel->getSettings();
835  tmpSettings.hideConnectors = (myHideMacroConnectors->getCheck() != FALSE);
836  tmpSettings.showLaneDirection = (myShowLaneDirection->getCheck() != FALSE);
837  tmpSettings.showSublanes = (myShowSublanes->getCheck() != FALSE);
838  tmpSettings.spreadSuperposed = (mySpreadSuperposed->getCheck() != FALSE);
839  if (sender == myParamKey) {
841  tmpSettings.edgeParam = myParamKey->getText().text();
843  tmpSettings.laneParam = myParamKey->getText().text();
844  }
845  }
846  tmpSettings.laneWidthExaggeration = (double) myLaneWidthUpscaleDialer->getValue();
847  tmpSettings.laneMinSize = (double) myLaneMinWidthDialer->getValue();
848 
849  tmpSettings.vehicleColorer.setActive(myVehicleColorMode->getCurrentItem());
850  tmpSettings.vehicleQuality = myVehicleShapeDetail->getCurrentItem();
851  tmpSettings.showBlinker = (myShowBlinker->getCheck() != FALSE);
852  tmpSettings.drawMinGap = (myShowMinGap->getCheck() != FALSE);
853  tmpSettings.showBTRange = (myShowBTRange->getCheck() != FALSE);
854  /*
855  tmpSettings.drawLaneChangePreference = (myShowLaneChangePreference->getCheck() != FALSE);
856  */
857  tmpSettings.vehicleName = myVehicleNamePanel->getSettings();
859  tmpSettings.vehicleSize = myVehicleSizePanel->getSettings();
860 
861  tmpSettings.personColorer.setActive(myPersonColorMode->getCurrentItem());
862  tmpSettings.personQuality = myPersonShapeDetail->getCurrentItem();
863  tmpSettings.personName = myPersonNamePanel->getSettings();
864  tmpSettings.personValue = myPersonValuePanel->getSettings();
865  tmpSettings.personSize = myPersonSizePanel->getSettings();
866 
867  tmpSettings.containerColorer.setActive(myContainerColorMode->getCurrentItem());
868  tmpSettings.containerQuality = myContainerShapeDetail->getCurrentItem();
871 
872  tmpSettings.junctionColorer.setActive(myJunctionColorMode->getCurrentItem());
873  tmpSettings.drawLinkTLIndex = myTLIndexPanel->getSettings();
878 
879  tmpSettings.addName = myAddNamePanel->getSettings();
880  tmpSettings.addFullName = myAddFullNamePanel->getSettings();
881  tmpSettings.addSize = myAddSizePanel->getSettings();
882 
883  tmpSettings.poiColorer.setActive(myPOIColorMode->getCurrentItem());
884  tmpSettings.poiName = myPOINamePanel->getSettings();
885  tmpSettings.poiType = myPOITypePanel->getSettings();
886  tmpSettings.poiSize = myPOISizePanel->getSettings();
887 
888  tmpSettings.polyColorer.setActive(myPolyColorMode->getCurrentItem());
889  tmpSettings.polyName = myPolyNamePanel->getSettings();
890  tmpSettings.polyType = myPolyTypePanel->getSettings();
891  tmpSettings.polySize = myPolySizePanel->getSettings();
892 
893  tmpSettings.showLane2Lane = (myShowLane2Lane->getCheck() != FALSE);
894  tmpSettings.drawJunctionShape = (myDrawJunctionShape->getCheck() != FALSE);
895  tmpSettings.drawCrossingsAndWalkingareas = (myDrawCrossingsAndWalkingAreas->getCheck() != FALSE);
896  tmpSettings.dither = (myDither->getCheck() != FALSE);
897  tmpSettings.showSizeLegend = (myShowSizeLegend->getCheck() != FALSE);
898 
899  // lanes (colors)
900  if (sender == myLaneColorRainbow) {
901  myParent->buildColorRainbow(tmpSettings, tmpSettings.getLaneEdgeScheme(), tmpSettings.getLaneEdgeMode(), GLO_LANE);
902  doRebuildColorMatrices = true;
903  }
904  if (sender == myJunctionColorRainbow) {
905  myParent->buildColorRainbow(tmpSettings, tmpSettings.junctionColorer.getScheme(), tmpSettings.junctionColorer.getActive(), GLO_JUNCTION);
906  doRebuildColorMatrices = true;
907  }
908  if (tmpSettings.getLaneEdgeMode() == prevLaneMode) {
909  if (updateColorRanges(sender, myLaneColors.begin(), myLaneColors.end(),
910  myLaneThresholds.begin(), myLaneThresholds.end(), myLaneButtons.begin(),
911  tmpSettings.getLaneEdgeScheme())) {
912  doRebuildColorMatrices = true;
913  }
914  if (sender == myLaneColorInterpolation) {
915  tmpSettings.getLaneEdgeScheme().setInterpolated(myLaneColorInterpolation->getCheck() != FALSE);
916  doRebuildColorMatrices = true;
917  }
918  } else {
919  doRebuildColorMatrices = true;
920  }
921  // lanes (scaling)
922  if (tmpSettings.getLaneEdgeScaleMode() == prevLaneScaleMode) {
923  if (updateScaleRanges(sender, myLaneScales.begin(), myLaneScales.end(),
925  tmpSettings.getLaneEdgeScaleScheme())) {
926  doRebuildColorMatrices = true;
927  }
928  if (sender == myLaneScaleInterpolation) {
929  tmpSettings.getLaneEdgeScaleScheme().setInterpolated(myLaneScaleInterpolation->getCheck() != FALSE);
930  doRebuildColorMatrices = true;
931  }
932  } else {
933  doRebuildColorMatrices = true;
934  }
935  // vehicles
936  if (tmpSettings.vehicleColorer.getActive() == prevVehicleMode) {
937  if (updateColorRanges(sender, myVehicleColors.begin(), myVehicleColors.end(),
939  tmpSettings.vehicleColorer.getScheme())) {
940  doRebuildColorMatrices = true;
941  }
942  if (sender == myVehicleColorInterpolation) {
943  tmpSettings.vehicleColorer.getScheme().setInterpolated(myVehicleColorInterpolation->getCheck() != FALSE);
944  doRebuildColorMatrices = true;
945  }
946  } else {
947  doRebuildColorMatrices = true;
948  }
949  // persons
950  if (tmpSettings.personColorer.getActive() == prevPersonMode) {
951  if (updateColorRanges(sender, myPersonColors.begin(), myPersonColors.end(),
952  myPersonThresholds.begin(), myPersonThresholds.end(), myPersonButtons.begin(),
953  tmpSettings.personColorer.getScheme())) {
954  doRebuildColorMatrices = true;
955  }
956  if (sender == myPersonColorInterpolation) {
957  tmpSettings.personColorer.getScheme().setInterpolated(myPersonColorInterpolation->getCheck() != FALSE);
958  doRebuildColorMatrices = true;
959  }
960  } else {
961  doRebuildColorMatrices = true;
962  }
963  // containers
964  if (tmpSettings.containerColorer.getActive() == prevContainerMode) {
965  if (updateColorRanges(sender, myContainerColors.begin(), myContainerColors.end(),
967  tmpSettings.containerColorer.getScheme())) {
968  doRebuildColorMatrices = true;
969  }
970  if (sender == myContainerColorInterpolation) {
971  tmpSettings.containerColorer.getScheme().setInterpolated(myContainerColorInterpolation->getCheck() != FALSE);
972  doRebuildColorMatrices = true;
973  }
974  } else {
975  doRebuildColorMatrices = true;
976  }
977  // junctions
978  if (tmpSettings.junctionColorer.getActive() == prevJunctionMode) {
979  if (updateColorRanges(sender, myJunctionColors.begin(), myJunctionColors.end(),
981  tmpSettings.junctionColorer.getScheme())) {
982  doRebuildColorMatrices = true;
983  }
984  if (sender == myJunctionColorInterpolation) {
985  tmpSettings.junctionColorer.getScheme().setInterpolated(myJunctionColorInterpolation->getCheck() != FALSE);
986  doRebuildColorMatrices = true;
987  }
988  } else {
989  doRebuildColorMatrices = true;
990  }
991  // POIs
992  if (tmpSettings.poiColorer.getActive() == prevPOIMode) {
993  if (updateColorRanges(sender, myPOIColors.begin(), myPOIColors.end(),
994  myPOIThresholds.begin(), myPOIThresholds.end(), myPOIButtons.begin(),
995  tmpSettings.poiColorer.getScheme())) {
996  doRebuildColorMatrices = true;
997  }
998  if (sender == myPOIColorInterpolation) {
999  tmpSettings.poiColorer.getScheme().setInterpolated(myPOIColorInterpolation->getCheck() != FALSE);
1000  doRebuildColorMatrices = true;
1001  }
1002  } else {
1003  doRebuildColorMatrices = true;
1004  }
1005  // polygons
1006  if (tmpSettings.polyColorer.getActive() == prevPolyMode) {
1007  if (updateColorRanges(sender, myPolyColors.begin(), myPolyColors.end(),
1008  myPolyThresholds.begin(), myPolyThresholds.end(), myPolyButtons.begin(),
1009  tmpSettings.polyColorer.getScheme())) {
1010  doRebuildColorMatrices = true;
1011  }
1012  if (sender == myPolyColorInterpolation) {
1013  tmpSettings.polyColorer.getScheme().setInterpolated(myPolyColorInterpolation->getCheck() != FALSE);
1014  doRebuildColorMatrices = true;
1015  }
1016  } else {
1017  doRebuildColorMatrices = true;
1018  }
1019 
1020  if (tmpSettings == *mySettings) {
1021  return 1;
1022  }
1023 
1024  int index = mySchemeName->getCurrentItem();
1025  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1026  // one of the initial settings is modified
1027  // every time this happens we create a new scheme
1028  int suffix = 1;
1029  while (gSchemeStorage.contains("custom_" + toString(suffix))) {
1030  suffix++;
1031  }
1032  tmpSettings.name = "custom_" + toString(suffix);
1033  // the newly created settings must be entered in several places:
1034  // - the comboBox mySchemeName of this dialog
1035  // - the comboBox of the parent view (set as active)
1036  // - the comboBox of all other views (only append) XXX @todo
1037  index = mySchemeName->appendItem(tmpSettings.name.c_str());
1038  mySchemeName->setCurrentItem(index);
1039  myParent->getColoringSchemesCombo().appendItem(tmpSettings.name.c_str());
1040  }
1041  myParent->getColoringSchemesCombo().setCurrentItem(
1042  myParent->getColoringSchemesCombo().findItem(tmpSettings.name.c_str()));
1043  gSchemeStorage.add(tmpSettings); // overwrites existing
1044  mySettings = &gSchemeStorage.get(tmpSettings.name);
1045  myParent->setColorScheme(tmpSettings.name);
1046 
1047  if (doRebuildColorMatrices) {
1048  rebuildColorMatrices(true);
1049  }
1050  myParent->forceRefresh();
1051  getApp()->forceRefresh();
1052  return 1;
1053 }
1054 
1055 
1056 void
1057 GUIDialog_ViewSettings::loadSettings(const std::string& file) {
1058  GUISettingsHandler handler(file, true, mySettings->netedit);
1059  std::string settingsName = handler.addSettings(myParent);
1060  if (settingsName != "") {
1061  FXint index = mySchemeName->appendItem(settingsName.c_str());
1062  mySchemeName->setCurrentItem(index);
1063  mySettings = &gSchemeStorage.get(settingsName);
1064  }
1065  if (handler.hasDecals()) {
1066  myDecalsLock->lock();
1067  (*myDecals) = handler.getDecals();
1068  rebuildList();
1069  myParent->update();
1070  myDecalsLock->unlock();
1071  }
1072  if (handler.getDelay() >= 0) {
1073  myParent->setDelay(handler.getDelay());
1074  }
1075  handler.applyViewport(myParent);
1076  rebuildColorMatrices(true);
1077 }
1078 
1079 
1080 void
1082  std::vector<GUISUMOAbstractView::Decal>::iterator j;
1083  for (j = myDecals->begin(); j != myDecals->end(); ++j) {
1086  dev.writeAttr("filename", d.filename);
1092  dev.writeAttr("altitude", d.altitude);
1093  dev.writeAttr("rotation", d.rot);
1094  dev.writeAttr("tilt", d.tilt);
1095  dev.writeAttr("roll", d.roll);
1097  dev.writeAttr("screenRelative", d.screenRelative);
1098  dev.closeTag();
1099  }
1100 }
1101 
1102 
1103 void
1104 GUIDialog_ViewSettings::loadDecals(const std::string& file) {
1105  myDecalsLock->lock();
1106  GUISettingsHandler handler(file);
1107  if (handler.hasDecals()) {
1108  (*myDecals) = handler.getDecals();
1109  }
1110  rebuildList();
1111  myParent->update();
1112  myDecalsLock->unlock();
1113 }
1114 
1115 
1116 long
1117 GUIDialog_ViewSettings::onCmdSaveSetting(FXObject*, FXSelector, void* /*data*/) {
1118  int index = mySchemeName->getCurrentItem();
1119  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1120  return 1;
1121  }
1122  // get the name
1123  std::string name = "";
1124  while (name.length() == 0) {
1125  FXDialogBox dialog(this, "Enter a name", GUIDesignViewSettingsDialog);
1126  FXVerticalFrame* content = new FXVerticalFrame(&dialog, GUIDesignViewSettingsVerticalFrame5);
1127  new FXLabel(content, "Please enter an alphanumeric name: ", nullptr, GUIDesignViewSettingsLabel2);
1128  FXTextField* text = new FXTextField(content, 40, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsTextField1);
1129  new FXHorizontalSeparator(content, GUIDesignHorizontalSeparator);
1130  FXHorizontalFrame* buttons = new FXHorizontalFrame(content, GUIDesignViewSettingsHorizontalFrame3);
1131  new FXButton(buttons, "&OK", nullptr, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsButton4);
1132  new FXButton(buttons, "&Cancel", nullptr, &dialog, FXDialogBox::ID_CANCEL, GUIDesignViewSettingsButton5);
1133  dialog.create();
1134  text->setFocus();
1135  if (!dialog.execute()) {
1136  return 1;
1137  }
1138  name = text->getText().text();
1139  for (int i = 0; i < (int)name.length(); ++i) {
1140  if (name[i] != '_' && (name[i] < 'a' || name[i] > 'z') && (name[i] < 'A' || name[i] > 'Z') && (name[i] < '0' || name[i] > '9')) {
1141  name = "";
1142  break;
1143  }
1144  }
1145  }
1146  GUIVisualizationSettings tmpSettings = *mySettings;
1148  tmpSettings.name = name;
1149  gSchemeStorage.add(tmpSettings);
1150  mySchemeName->setItemText(index, tmpSettings.name.c_str());
1151  myParent->getColoringSchemesCombo().setItemText(index, tmpSettings.name.c_str());
1152  myParent->setColorScheme(tmpSettings.name);
1153  mySettings = &gSchemeStorage.get(name);
1154  myBackup = *mySettings;
1155  gSchemeStorage.writeSettings(getApp());
1156  return 1;
1157 }
1158 
1159 
1160 long
1161 GUIDialog_ViewSettings::onUpdSaveSetting(FXObject* sender, FXSelector, void* ptr) {
1162  sender->handle(this,
1163  mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1164  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1165  ptr);
1166  return 1;
1167 }
1168 
1169 
1170 long
1171 GUIDialog_ViewSettings::onCmdDeleteSetting(FXObject*, FXSelector, void* /*data*/) {
1172  int index = mySchemeName->getCurrentItem();
1173  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1174  return 1;
1175  }
1176  std::string name = mySchemeName->getItem(index).text();
1177  gSchemeStorage.remove(name);
1178  mySchemeName->removeItem(index);
1179  onCmdNameChange(nullptr, 0, (void*) mySchemeName->getItem(0).text());
1180  gSchemeStorage.writeSettings(getApp());
1181  return 1;
1182 }
1183 
1184 
1185 long
1186 GUIDialog_ViewSettings::onUpdDeleteSetting(FXObject* sender, FXSelector, void* ptr) {
1187  sender->handle(this,
1188  mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1189  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1190  ptr);
1191  return 1;
1192 }
1193 
1194 
1195 long
1196 GUIDialog_ViewSettings::onCmdExportSetting(FXObject*, FXSelector, void* /*data*/) {
1197  FXString file = MFXUtils::getFilename2Write(this, "Export view settings", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder);
1198  if (file == "") {
1199  return 1;
1200  }
1201  try {
1202  OutputDevice& dev = OutputDevice::getDevice(file.text());
1204  mySettings->save(dev);
1205  if (mySaveViewPort->getCheck()) {
1207  }
1208  if (mySaveDelay->getCheck()) {
1209  dev.openTag(SUMO_TAG_DELAY);
1211  dev.closeTag();
1212  }
1213  if (mySaveDecals->getCheck()) {
1214  saveDecals(dev);
1215  }
1216  if (!mySettings->netedit && mySaveBreakpoints->getCheck()) {
1217  for (SUMOTime t : myParent->retrieveBreakpoints()) {
1220  dev.closeTag();
1221  }
1222  }
1223  dev.closeTag();
1224  dev.close();
1225  } catch (IOError& e) {
1226  FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what());
1227  }
1228  return 1;
1229 }
1230 
1231 
1232 long
1233 GUIDialog_ViewSettings::onUpdExportSetting(FXObject* sender, FXSelector, void* ptr) {
1234  sender->handle(this,
1235  (mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1236  && !mySaveViewPort->getCheck() && !mySaveDelay->getCheck() && !mySaveDecals->getCheck() && !mySaveBreakpoints->getCheck()) ?
1237  FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1238  ptr);
1239  return 1;
1240 }
1241 
1242 
1243 long
1244 GUIDialog_ViewSettings::onCmdImportSetting(FXObject*, FXSelector, void* /*data*/) {
1245  FXFileDialog opendialog(this, "Import view settings");
1246  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
1247  opendialog.setSelectMode(SELECTFILE_ANY);
1248  opendialog.setPatternList("*.xml");
1249  if (gCurrentFolder.length() != 0) {
1250  opendialog.setDirectory(gCurrentFolder);
1251  }
1252  if (opendialog.execute()) {
1253  gCurrentFolder = opendialog.getDirectory();
1254  loadSettings(opendialog.getFilename().text());
1255  }
1256  return 1;
1257 }
1258 
1259 
1260 long
1261 GUIDialog_ViewSettings::onCmdLoadDecals(FXObject*, FXSelector, void* /*data*/) {
1262  FXFileDialog opendialog(this, "Load Decals");
1263  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
1264  opendialog.setSelectMode(SELECTFILE_ANY);
1265  opendialog.setPatternList("*.xml");
1266  if (gCurrentFolder.length() != 0) {
1267  opendialog.setDirectory(gCurrentFolder);
1268  }
1269  if (opendialog.execute()) {
1270  gCurrentFolder = opendialog.getDirectory();
1271  loadDecals(opendialog.getFilename().text());
1272  }
1273  return 1;
1274 }
1275 
1276 
1277 long
1278 GUIDialog_ViewSettings::onCmdSaveDecals(FXObject*, FXSelector, void* /*data*/) {
1279  FXString file = MFXUtils::getFilename2Write(this, "Save Decals", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder);
1280  if (file == "") {
1281  return 1;
1282  }
1283  try {
1284  OutputDevice& dev = OutputDevice::getDevice(file.text());
1285  dev.openTag("decals");
1286  saveDecals(dev);
1287  dev.closeTag();
1288  dev.close();
1289  } catch (IOError& e) {
1290  FXMessageBox::error(myParent, MBOX_OK, "Storing failed!", "%s", e.what());
1291  }
1292  return 1;
1293 }
1294 
1295 
1296 
1297 
1298 long
1299 GUIDialog_ViewSettings::onUpdImportSetting(FXObject* sender, FXSelector, void* ptr) {
1300  sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1301  return 1;
1302 }
1303 
1304 
1305 void
1307  myDecalsTable->clearItems();
1308  const int cols = 8;
1309  // set table attributes
1310  const int numRows = MAX2((int)10, (int)myDecals->size() + 1);
1311  myDecalsTable->setTableSize(numRows, cols);
1312  myDecalsTable->setColumnText(0, "picture file");
1313  myDecalsTable->setColumnText(1, "center x");
1314  myDecalsTable->setColumnText(2, "center y");
1315  myDecalsTable->setColumnText(3, "width");
1316  myDecalsTable->setColumnText(4, "height");
1317  myDecalsTable->setColumnText(5, "rotation");
1318  myDecalsTable->setColumnText(6, "layer");
1319  myDecalsTable->setColumnText(7, "relative");
1320  FXHeader* header = myDecalsTable->getColumnHeader();
1321  header->setHeight(getApp()->getNormalFont()->getFontHeight() + getApp()->getNormalFont()->getFontAscent());
1322  int k;
1323  for (k = 0; k < cols; k++) {
1324  header->setItemJustify(k, GUIDesignViewSettingsMFXTableJustify);
1325  header->setItemSize(k, 60);
1326  }
1327  header->setItemSize(0, 150);
1328  // insert already known decals information into table
1329  FXint row = 0;
1330  std::vector<GUISUMOAbstractView::Decal>::iterator j;
1331  for (j = myDecals->begin(); j != myDecals->end(); ++j) {
1333  myDecalsTable->setItemText(row, 0, d.filename.c_str());
1334  myDecalsTable->setItemText(row, 1, toString<double>(d.centerX).c_str());
1335  myDecalsTable->setItemText(row, 2, toString<double>(d.centerY).c_str());
1336  myDecalsTable->setItemText(row, 3, toString<double>(d.width).c_str());
1337  myDecalsTable->setItemText(row, 4, toString<double>(d.height).c_str());
1338  myDecalsTable->setItemText(row, 5, toString<double>(d.rot).c_str());
1339  myDecalsTable->setItemText(row, 6, toString<double>(d.layer).c_str());
1340  myDecalsTable->setItemText(row, 7, toString<double>(d.screenRelative).c_str());
1341  row++;
1342  }
1343  // insert dummy last field
1344  for (k = 0; k < 7; k++) {
1345  myDecalsTable->setItemText(row, k, " ");
1346  }
1347 }
1348 
1349 
1350 FXMatrix*
1352  std::vector<FXColorWell*>& colors,
1353  std::vector<FXRealSpinner*>& thresholds,
1354  std::vector<FXButton*>& buttons,
1355  FXCheckButton* interpolation,
1356  GUIColorScheme& scheme) {
1357  MFXUtils::deleteChildren(frame);
1358  FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1359  colors.clear();
1360  thresholds.clear();
1361  buttons.clear();
1362  const bool fixed = scheme.isFixed();
1363  std::vector<RGBColor>::const_iterator colIt = scheme.getColors().begin();
1364  std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1365  std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1366  while (colIt != scheme.getColors().end()) {
1367  colors.push_back(new FXColorWell(m , MFXUtils::getFXColor(*colIt), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell1));
1368  if (fixed) {
1369  new FXLabel(m, nameIt->c_str());
1370  new FXLabel(m, "");
1371  new FXLabel(m, "");
1372  } else {
1373  const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1374  FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignSpinDial | SPIN_NOMAX | dialerOptions);
1375  threshDialer->setValue(*threshIt);
1376  thresholds.push_back(threshDialer);
1377  buttons.push_back(new FXButton(m, "Add", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1378  buttons.push_back(new FXButton(m, "Remove", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1379  }
1380  colIt++;
1381  threshIt++;
1382  nameIt++;
1383  }
1384  interpolation->setCheck(scheme.isInterpolated());
1385  if (fixed) {
1386  interpolation->disable();
1387  } else {
1388  if (colors.size() > 1) {
1389  interpolation->enable();
1390  if (interpolation->getCheck() != FALSE) {
1391  thresholds.front()->enable();
1392  } else {
1393  thresholds.front()->disable();
1394  }
1395  } else {
1396  interpolation->disable();
1397  thresholds.front()->disable();
1398  }
1399  }
1400  return m;
1401 }
1402 
1403 
1404 FXMatrix*
1406  std::vector<FXRealSpinner*>& scales,
1407  std::vector<FXRealSpinner*>& thresholds,
1408  std::vector<FXButton*>& buttons,
1409  FXCheckButton* interpolation,
1410  GUIScaleScheme& scheme) {
1411  MFXUtils::deleteChildren(frame);
1412  FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1413  scales.clear();
1414  thresholds.clear();
1415  buttons.clear();
1416  const bool fixed = scheme.isFixed();
1417  std::vector<double>::const_iterator scaleIt = scheme.getColors().begin();
1418  std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1419  std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1420  while (scaleIt != scheme.getColors().end()) {
1421  FXRealSpinner* scaleDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignSpinDial | SPIN_NOMAX);
1422  scaleDialer->setValue(*scaleIt);
1423  scales.push_back(scaleDialer);
1424  if (fixed) {
1425  new FXLabel(m, nameIt->c_str());
1426  new FXLabel(m, "");
1427  new FXLabel(m, "");
1428  } else {
1429  const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1430  FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignSpinDial | SPIN_NOMAX | dialerOptions);
1431  threshDialer->setValue(*threshIt);
1432  thresholds.push_back(threshDialer);
1433  buttons.push_back(new FXButton(m, "Add", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1434  buttons.push_back(new FXButton(m, "Remove", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1435  }
1436  scaleIt++;
1437  threshIt++;
1438  nameIt++;
1439  }
1440  interpolation->setCheck(scheme.isInterpolated());
1441  if (fixed) {
1442  interpolation->disable();
1443  } else {
1444  if (scales.size() > 1) {
1445  interpolation->enable();
1446  if (interpolation->getCheck() != FALSE) {
1447  thresholds.front()->enable();
1448  } else {
1449  thresholds.front()->disable();
1450  }
1451  } else {
1452  interpolation->disable();
1453  thresholds.front()->disable();
1454  }
1455  }
1456  return m;
1457 }
1458 
1459 
1460 void
1462  // decals
1463  delete myDecalsTable;
1465  myDecalsTable->setVisibleRows(5);
1466  myDecalsTable->setVisibleColumns(7);
1467  myDecalsTable->setTableSize(5, 7);
1468  myDecalsTable->setBackColor(FXRGB(255, 255, 255));
1469  myDecalsTable->getRowHeader()->setWidth(0);
1470  for (int i = 1; i <= 5; ++i) {
1472  myDecalsTable->setNumberCellParams(i, -10000000, 10000000, 1, 10, 100, "%.2f");
1473  }
1474  rebuildList();
1475  if (doCreate) {
1476  myDecalsTable->create();
1477  }
1479  if (doCreate) {
1480  m->create();
1481  }
1483  myLaneColorRainbow->disable();
1484  } else {
1485  myLaneColorRainbow->enable();
1486  }
1488  myJunctionColorRainbow->disable();
1489  } else {
1490  myJunctionColorRainbow->enable();
1491  }
1492  const std::string activeSchemeName = myLaneEdgeColorMode->getText().text();
1494  myParamKey->setText(mySettings->edgeParam.c_str());
1495  myParamKey->enable();
1496  } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_LANE_PARAM_NUMERICAL) {
1497  myParamKey->setText(mySettings->laneParam.c_str());
1498  myParamKey->enable();
1499  } else {
1500  myParamKey->disable();
1501  }
1502  myLaneColorSettingFrame->getParent()->recalc();
1503 
1505  if (doCreate) {
1506  m->create();
1507  }
1508  myLaneScaleSettingFrame->getParent()->recalc();
1509 
1511  if (doCreate) {
1512  m->create();
1513  }
1514  myVehicleColorSettingFrame->getParent()->recalc();
1515 
1517  if (doCreate) {
1518  m->create();
1519  }
1520  myPersonColorSettingFrame->getParent()->recalc();
1522  if (doCreate) {
1523  m->create();
1524  }
1525  myContainerColorSettingFrame->getParent()->recalc();
1527  if (doCreate) {
1528  m->create();
1529  }
1530  myJunctionColorSettingFrame->getParent()->recalc();
1531  // POIs
1533  if (doCreate) {
1534  m->create();
1535  }
1536  myPOIColorSettingFrame->getParent()->recalc();
1537  // polygons
1539  if (doCreate) {
1540  m->create();
1541  }
1542  myPolyColorSettingFrame->getParent()->recalc();
1543 
1544  layout();
1545  update();
1546 }
1547 
1548 
1549 long
1550 GUIDialog_ViewSettings::onCmdEditTable(FXObject*, FXSelector, void* data) {
1552  std::string value = i->item->getText().text();
1553  // check whether the inserted value is empty
1554  if (value.find_first_not_of(" ") == std::string::npos) {
1555  return 1;
1556  }
1558  int row = i->row;
1559  // check whether we add a new entry or edit an existing entry
1560  if (row == static_cast<int>(myDecals->size())) {
1561  d.filename = "";
1562  d.centerX = double(myParent->getGridWidth() / 2.);
1563  d.centerY = double(myParent->getGridHeight() / 2.);
1564  d.width = 0.;
1565  d.height = 0.;
1566  d.initialised = false;
1567  d.rot = 0;
1568  d.layer = 0;
1569  d.screenRelative = false;
1570  myDecalsLock->lock();
1571  myDecals->push_back(d);
1572  myDecalsLock->unlock();
1573  } else if (row > static_cast<int>(myDecals->size())) {
1574  // ignore clicks two lines below existing entries
1575  return 1;
1576  } else {
1577  d = (*myDecals)[row];
1578  }
1579 
1580  switch (i->col) {
1581  case 0:
1582  if (d.initialised && d.filename != value) {
1583  d.initialised = false;
1584  }
1585  d.filename = value;
1586  break;
1587  case 1:
1588  try {
1589  d.centerX = StringUtils::toDouble(value);
1590  } catch (NumberFormatException&) {
1591  std::string msg = "The value must be a float, is:" + value;
1592  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1593  }
1594  break;
1595  case 2:
1596  try {
1597  d.centerY = StringUtils::toDouble(value);
1598  } catch (NumberFormatException&) {
1599  std::string msg = "The value must be a float, is:" + value;
1600  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1601  }
1602  break;
1603  case 3:
1604  try {
1605  d.width = StringUtils::toDouble(value);
1606  } catch (NumberFormatException&) {
1607  std::string msg = "The value must be a float, is:" + value;
1608  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1609  }
1610  break;
1611  case 4:
1612  try {
1613  d.height = StringUtils::toDouble(value);
1614  } catch (NumberFormatException&) {
1615  std::string msg = "The value must be a float, is:" + value;
1616  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1617  }
1618  break;
1619  case 5:
1620  try {
1621  d.rot = StringUtils::toDouble(value);
1622  } catch (NumberFormatException&) {
1623  std::string msg = "The value must be a float, is:" + value;
1624  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1625  }
1626  break;
1627  case 6:
1628  try {
1629  d.layer = StringUtils::toDouble(value);
1630  } catch (NumberFormatException&) {
1631  std::string msg = "The value must be a float, is:" + value;
1632  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1633  }
1634  break;
1635  case 7:
1636  try {
1638  } catch (NumberFormatException&) {
1639  std::string msg = "The value must be a bool, is:" + value;
1640  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1641  }
1642  break;
1643  default:
1644  throw 1;
1645  }
1646  (*myDecals)[row] = d;
1647  if (!i->updateOnly) {
1648  rebuildList();
1649  }
1650  myParent->update();
1651  return 1;
1652 }
1653 
1654 
1655 std::string
1657  return mySchemeName->getItem(mySchemeName->getCurrentItem()).text();
1658 }
1659 
1660 
1661 void
1663  if (name.c_str() == mySchemeName->getItemText(mySchemeName->getCurrentItem())) {
1664  return;
1665  }
1666  for (int i = 0; i < mySchemeName->getNumItems(); ++i) {
1667  if (name.c_str() == mySchemeName->getItemText(i)) {
1668  mySchemeName->setCurrentItem(i);
1669  onCmdNameChange(nullptr, 0, (void*)name.c_str());
1670  return;
1671  }
1672  }
1673 }
1674 
1676  FXMatrix* parent,
1677  GUIDialog_ViewSettings* target,
1678  const std::string& title,
1679  const GUIVisualizationTextSettings& settings) {
1680  myCheck = new FXCheckButton(parent, title.c_str(), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButton);
1681  myCheck->setCheck(settings.show);
1682  myConstSizeCheck = new FXCheckButton(parent, "constant text size", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButton);
1683  myConstSizeCheck->setCheck(settings.constSize);
1684  FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1685  new FXLabel(m1, "Size", nullptr, GUIDesignViewSettingsLabel1);
1686  mySizeDial = new FXRealSpinner(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1687  mySizeDial->setRange(10, 1000);
1688  mySizeDial->setValue(settings.size);
1689  FXMatrix* m2 = new FXMatrix(parent, 4, GUIDesignViewSettingsMatrix5);
1690  new FXLabel(m2, "Color", nullptr, GUIDesignViewSettingsLabel1);
1691  myColorWell = new FXColorWell(m2, MFXUtils::getFXColor(settings.color), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell2);
1692  new FXLabel(m2, "Background", nullptr, GUIDesignViewSettingsLabel1);
1693  myBGColorWell = new FXColorWell(m2, MFXUtils::getFXColor(settings.bgColor), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell2);
1694 }
1695 
1696 
1699  return GUIVisualizationTextSettings(myCheck->getCheck() != FALSE,
1700  mySizeDial->getValue(),
1701  MFXUtils::getRGBColor(myColorWell->getRGBA()),
1702  MFXUtils::getRGBColor(myBGColorWell->getRGBA()),
1703  myConstSizeCheck->getCheck() != FALSE);
1704 }
1705 
1706 
1707 void
1709  myCheck->setCheck(settings.show);
1710  mySizeDial->setValue(settings.size);
1711  myColorWell->setRGBA(MFXUtils::getFXColor(settings.color));
1712  myBGColorWell->setRGBA(MFXUtils::getFXColor(settings.bgColor));
1713  myConstSizeCheck->setCheck(settings.constSize);
1714 }
1715 
1716 
1718  FXMatrix* parent,
1719  GUIDialog_ViewSettings* target,
1720  const GUIVisualizationSizeSettings& settings) {
1721  myCheck = new FXCheckButton(parent, "Draw with constant size when zoomed out", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButton);
1722  myCheck->setCheck(settings.constantSize);
1723  myCheckSelected = new FXCheckButton(parent, "Only for selected", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButton);
1724  myCheckSelected->setCheck(settings.constantSizeSelected);
1725  FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1726  new FXLabel(m1, "Minimum Size", nullptr, GUIDesignViewSettingsLabel1);
1727  myMinSizeDial = new FXRealSpinner(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1728  myMinSizeDial->setValue(settings.minSize);
1729  FXMatrix* m2 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1730  new FXLabel(m2, "Exaggerate by", nullptr, GUIDesignViewSettingsLabel1);
1731  myExaggerateDial = new FXRealSpinner(m2, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
1732  myExaggerateDial->setRange(0, 10000);
1733  myExaggerateDial->setValue(settings.exaggeration);
1734 }
1735 
1736 
1740  myMinSizeDial->getValue(), myExaggerateDial->getValue(),
1741  myCheck->getCheck() != FALSE,
1742  myCheckSelected->getCheck() != FALSE);
1743 }
1744 
1745 
1746 void
1748  myCheck->setCheck(settings.constantSize);
1749  myCheckSelected->setCheck(settings.constantSizeSelected);
1750  myMinSizeDial->setValue(settings.minSize);
1751  myExaggerateDial->setValue(settings.exaggeration);
1752 }
1753 
1754 
1755 void
1757  getApp()->reg().writeIntEntry("VIEWSETTINGS", "x", getX());
1758  getApp()->reg().writeIntEntry("VIEWSETTINGS", "y", getY());
1759  getApp()->reg().writeIntEntry("VIEWSETTINGS", "width", getWidth());
1760  getApp()->reg().writeIntEntry("VIEWSETTINGS", "height", getHeight());
1761 }
1762 
1763 void
1765  // ensure window is visible after switching screen resolutions
1766  const FXint minSize = 400;
1767  const FXint minTitlebarHeight = 20;
1768  setX(MAX2(0, MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "x", 150),
1769  getApp()->getRootWindow()->getWidth() - minSize)));
1770  setY(MAX2(minTitlebarHeight,
1771  MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "y", 150),
1772  getApp()->getRootWindow()->getHeight() - minSize)));
1773  setWidth(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "width", 700), minSize));
1774  setHeight(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "height", 500), minSize));
1775 }
1776 
1777 /****************************************************************************/
1778 
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.
virtual void buildColorRainbow(const GUIVisualizationSettings &, GUIColorScheme &, int, GUIGlObjectType)
recalibrate color scheme according to the current value range
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:358
GUIVisualizationTextSettings poiType
FXVerticalFrame * myLaneScaleSettingFrame
GUIVisualizationTextSettings streetName
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
#define GUIDesignViewSettingsMatrix3
Definition: GUIDesigns.h:354
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
const std::string & getName() const
GUIVisualizationTextSettings personValue
GUIVisualizationTextSettings personName
#define GUIDesignViewSettingsButton5
Definition: GUIDesigns.h:393
std::vector< FXButton * > myLaneButtons
FXDEFMAP(GUIDialog_ViewSettings) GUIDialog_ViewSettingsMap[]
#define GUIDesignViewSettingsColorWell2
Definition: GUIDesigns.h:398
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
GUIVisualizationTextSettings poiName
Ok-button was pushed.
Definition: GUIAppEnum.h:304
#define GUIDesignViewSettingsMFXTableJustify
Definition: GUIDesigns.h:403
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
GUIVisualizationTextSettings edgeValue
#define GUIDesignViewSettingsVerticalFrame4
Definition: GUIDesigns.h:336
std::vector< GUISUMOAbstractView::Decal > * myDecals
The parent&#39;s decals.
std::vector< FXButton * > myPOIButtons
bool showRails
Information whether rails shall be drawn.
static const std::string SCHEME_NAME_EDGE_PARAM_NUMERICAL
void loadDecals(const std::string &file)
Loads decals from a file.
std::vector< FXButton * > myPersonButtons
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:65
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:338
FXVerticalFrame * myPolyColorSettingFrame
bool allowsNegativeValues() const
T MAX2(T a, T b)
Definition: StdDefs.h:76
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.
static const std::string SCHEME_NAME_LANE_PARAM_NUMERICAL
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:382
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:367
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
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
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter ...
#define GUIDesignViewSettingsVerticalFrame1
vertical frames
Definition: GUIDesigns.h:330
#define GUIDesignViewSettingsMatrix2
Definition: GUIDesigns.h:352
GUIVisualizationSizeSettings polySize
GUIColorer vehicleColorer
The vehicle colorer.
std::string edgeParam
key for coloring by edge parameter
double roll
The roll of the image to the ground plane (in degrees)
#define GUIDesignViewSettingsButton2
Definition: GUIDesigns.h:387
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:332
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)
GUIVisualizationTextSettings vehicleValue
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:298
#define GUIDesignViewSettingsButton3
Definition: GUIDesigns.h:389
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:345
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.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
GUIVisualizationTextSettings internalEdgeName
#define GUIDesignViewSettingsLabel2
Definition: GUIDesigns.h:379
#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:356
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:350
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:396
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
Informs the dialog about switching to another scheme.
Definition: GUIAppEnum.h:384
RGBColor selectionColor
NETEDIT special colors.
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:70
#define GUIDesignViewSettingsColorWell
ColorWell.
Definition: GUIDesigns.h:365
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:391
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:327
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:343
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:372
#define GUIDesignViewSettingsComboBox1
Combo boxs.
Definition: GUIDesigns.h:362
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:347
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)
#define GUIDesignViewSettingsTabItemBook1
Definition: GUIDesigns.h:374
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:334
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:340
#define GUIDesignViewSettingsButton1
Buttons.
Definition: GUIDesigns.h:385
For the save-to-db - button.
Definition: GUIAppEnum.h:386
#define GUIDesignSpinDial
Definition: GUIDesigns.h:318
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:369
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:401
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.
FXColorWell * mySelectionColor
selection colors
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.
#define GUIDesignTextFielWidth100
text field with thick frame and size of 100x23
Definition: GUIDesigns.h:43
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:377
FXRealSpinner * myLaneMinWidthDialer
#define GUIDesignViewSettingsMainDialog
Definition: GUIDesigns.h:325