Eclipse 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-2019 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>
33 #include <utils/common/RGBColor.h>
34 #include <utils/common/ToString.h>
44 #include "GUIDialog_EditViewport.h"
45 #include "GUIDialog_ViewSettings.h"
46 
47 
48 // ===========================================================================
49 // FOX callback mapping
50 // ===========================================================================
51 FXDEFMAP(GUIDialog_ViewSettings) GUIDialog_ViewSettingsMap[] = {
55  FXMAPFUNC(SEL_COMMAND, MID_SETTINGS_OK, GUIDialog_ViewSettings::onCmdOk),
58 
67 
70 
71 };
72 
73 
74 FXIMPLEMENT(GUIDialog_ViewSettings, FXDialogBox, GUIDialog_ViewSettingsMap, ARRAYNUMBER(GUIDialog_ViewSettingsMap))
75 
76 
77 // ===========================================================================
78 // method definitions
79 // ===========================================================================
80 GUIDialog_ViewSettings::GUIDialog_ViewSettings(GUISUMOAbstractView* parent, GUIVisualizationSettings* settings, std::vector<GUISUMOAbstractView::Decal>* decals, FXMutex* decalsLock) :
81  FXDialogBox(parent, "View Settings", GUIDesignViewSettingsMainDialog),
82  myParent(parent), mySettings(settings),
83  myDecals(decals), myDecalsLock(decalsLock),
84  myDecalsTable(nullptr) {
85  myBackup = (*mySettings);
86 
87  FXVerticalFrame* contentFrame = new FXVerticalFrame(this, GUIDesignViewSettingsVerticalFrame1);
88  //
89  {
90  FXHorizontalFrame* frame0 = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame1);
91  mySchemeName = new FXComboBox(frame0, 20, this, MID_SIMPLE_VIEW_NAMECHANGE, GUIDesignViewSettingsComboBox1);
92  const std::vector<std::string>& names = gSchemeStorage.getNames();
93  for (std::vector<std::string>::const_iterator i = names.begin(); i != names.end(); ++i) {
94  int index = mySchemeName->appendItem((*i).c_str());
95  if ((*i) == mySettings->name) {
96  mySchemeName->setCurrentItem((FXint) index);
97  }
98  }
99  mySchemeName->setNumVisible(5);
100 
101  new FXButton(frame0, "\t\tSave the setting to registry", GUIIconSubSys::getIcon(ICON_SAVEDB), this, MID_SIMPLE_VIEW_SAVE, GUIDesignButtonToolbar);
102  new FXButton(frame0, "\t\tRemove the setting from registry", GUIIconSubSys::getIcon(ICON_REMOVEDB), this, MID_SIMPLE_VIEW_DELETE, GUIDesignButtonToolbar);
103  new FXButton(frame0, "\t\tExport setting to file", GUIIconSubSys::getIcon(ICON_SAVE), this, MID_SIMPLE_VIEW_EXPORT, GUIDesignButtonToolbar);
104  new FXButton(frame0, "\t\tLoad setting from file", GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), this, MID_SIMPLE_VIEW_IMPORT, GUIDesignButtonToolbar);
105 
106  new FXVerticalSeparator(frame0);
107  new FXLabel(frame0, "Export includes:", nullptr, GUIDesignViewSettingsLabel1);
108  mySaveViewPort = new FXCheckButton(frame0, "Viewport");
109  mySaveDelay = new FXCheckButton(frame0, "Delay");
110  mySaveDecals = new FXCheckButton(frame0, "Decals");
111  mySaveBreakpoints = new FXCheckButton(frame0, "Breakpoints");
112  if (settings->netedit) {
113  mySaveBreakpoints->disable();
114  }
115  }
116  //
117  FXTabBook* tabbook = new FXTabBook(contentFrame, nullptr, 0, GUIDesignViewSettingsTabBook1);
118  {
119  // tab for the background
120  new FXTabItem(tabbook, "Background", nullptr, GUIDesignViewSettingsTabItemBook1);
121  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
122  FXVerticalFrame* frame1 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
123 
124  FXMatrix* m11 = new FXMatrix(frame1, 2, GUIDesignMatrixViewSettings);
125  new FXLabel(m11, "Color", nullptr, GUIDesignViewSettingsLabel1);
126  myBackgroundColor = new FXColorWell(m11, MFXUtils::getFXColor(settings->backgroundColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
127 
128  new FXHorizontalSeparator(frame1, GUIDesignHorizontalSeparator);
129 
130  FXVerticalFrame* frame11 = new FXVerticalFrame(frame1, GUIDesignViewSettingsVerticalFrame3);
131  new FXLabel(frame11, "Decals:");
132  myDecalsFrame = new FXVerticalFrame(frame11);
133  FXHorizontalFrame* frame111 = new FXHorizontalFrame(frame11, GUIDesignViewSettingsHorizontalFrame2);
134  new FXButton(frame111, "&Load Decals", nullptr, this, MID_SIMPLE_VIEW_LOAD_DECALS, GUIDesignViewSettingsButton1);
135  new FXButton(frame111, "&Save Decals", nullptr, this, MID_SIMPLE_VIEW_SAVE_DECALS, GUIDesignViewSettingsButton1);
136 
137  new FXHorizontalSeparator(frame1, GUIDesignHorizontalSeparator);
138 
139  FXMatrix* m12 = new FXMatrix(frame1, 2, GUIDesignViewSettingsMatrix1);
140  myShowGrid = new FXCheckButton(m12, "Show grid", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
141  myShowGrid->setCheck(mySettings->showGrid);
142  new FXLabel(m12, "");
143  FXMatrix* m121 = new FXMatrix(m12, 2, GUIDesignViewSettingsMatrix2);
144  new FXLabel(m121, "x-spacing", nullptr, GUIDesignViewSettingsLabel1);
145  myGridXSizeDialer = new FXRealSpinner(m121, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
146  myGridXSizeDialer->setRange(1, 10000);
147  myGridXSizeDialer->setValue(mySettings->gridXSize);
148  FXMatrix* m122 = new FXMatrix(m12, 2, GUIDesignViewSettingsMatrix2);
149  new FXLabel(m122, "y-spacing", nullptr, GUIDesignViewSettingsLabel1);
150  myGridYSizeDialer = new FXRealSpinner(m122, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
151  myGridYSizeDialer->setRange(1, 10000);
152  myGridYSizeDialer->setValue(mySettings->gridXSize);
153  }
154  {
155  // tab for the streets
156  new FXTabItem(tabbook, "Streets", nullptr, GUIDesignViewSettingsTabItemBook1);
157  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
158  FXVerticalFrame* frame2 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
159  // ... color settings
160  FXVerticalFrame* frame22 = new FXVerticalFrame(frame2, GUIDesignViewSettingsVerticalFrame6);
161  FXMatrix* m21 = new FXMatrix(frame22, 4, GUIDesignViewSettingsMatrix3);
162  new FXLabel(m21, "Color", nullptr, GUIDesignViewSettingsLabel1);
163  myLaneEdgeColorMode = new MFXIconComboBox(m21, 30, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
164  myLaneColorInterpolation = new FXCheckButton(m21, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
165  myLaneColorSettingFrame = new FXVerticalFrame(frame22, GUIDesignViewSettingsVerticalFrame4);
166  myParamKey = new FXComboBox(m21, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
167  myParamKey->disable();
168 
169  // rainbow settings
170  FXMatrix* m24 = new FXMatrix(frame22, 3, GUIDesignViewSettingsMatrix3);
171  myLaneColorRainbow = new FXButton(m24, "Recalibrate Rainbow", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
172  (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
173  myLaneColorRainbowCheck = new FXCheckButton(m24, "hide below threshold", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
174  myLaneColorRainbowThreshold = new FXRealSpinner(m24, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
175 
176  new FXHorizontalSeparator(frame2, GUIDesignHorizontalSeparator);
177  // ... scale settings
178  FXVerticalFrame* frame23 = new FXVerticalFrame(frame2, GUIDesignViewSettingsVerticalFrame6);
179  FXMatrix* m23 = new FXMatrix(frame23, 3, GUIDesignViewSettingsMatrix3);
180  new FXLabel(m23, "Scale width", nullptr, GUIDesignViewSettingsLabel1);
181  myLaneEdgeScaleMode = new MFXIconComboBox(m23, 30, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
182  myLaneScaleInterpolation = new FXCheckButton(m23, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
183  myLaneScaleSettingFrame = new FXVerticalFrame(frame23, GUIDesignViewSettingsVerticalFrame4);
184 
186  mySettings->edgeColorer.fill(*myLaneEdgeColorMode);
187  mySettings->edgeScaler.fill(*myLaneEdgeScaleMode);
188  myLaneEdgeColorMode->setNumVisible((int)mySettings->edgeColorer.size());
189  myLaneEdgeScaleMode->setNumVisible((int)mySettings->edgeScaler.size());
190  } else {
191  mySettings->laneColorer.fill(*myLaneEdgeColorMode);
192  mySettings->laneScaler.fill(*myLaneEdgeScaleMode);
193  myLaneEdgeColorMode->setNumVisible((int)mySettings->laneColorer.size());
194  myLaneEdgeScaleMode->setNumVisible((int)mySettings->laneScaler.size());
195  }
196 
197  new FXHorizontalSeparator(frame2, GUIDesignHorizontalSeparator);
198  FXMatrix* m22 = new FXMatrix(frame2, 2, GUIDesignViewSettingsMatrix1);
199  myShowLaneBorders = new FXCheckButton(m22, "Show lane borders", this, MID_SIMPLE_VIEW_COLORCHANGE);
200  myShowLaneBorders->setCheck(mySettings->laneShowBorders);
201  myShowBikeMarkings = new FXCheckButton(m22, "Show bike markings", this, MID_SIMPLE_VIEW_COLORCHANGE);
202  myShowBikeMarkings->setCheck(mySettings->showBikeMarkings);
203  myShowLaneDecals = new FXCheckButton(m22, "Show turning arrows", this, MID_SIMPLE_VIEW_COLORCHANGE);
204  myShowLaneDecals->setCheck(mySettings->showLinkDecals);
205  new FXLabel(m22, " ", nullptr, GUIDesignViewSettingsLabel1);
206  myShowLinkRules = new FXCheckButton(m22, "Show right-of-way rules", this, MID_SIMPLE_VIEW_COLORCHANGE);
207  myShowLinkRules->setCheck(mySettings->showLinkRules);
208  new FXLabel(m22, " ", nullptr, GUIDesignViewSettingsLabel1);
209  myShowRails = new FXCheckButton(m22, "Show rails", this, MID_SIMPLE_VIEW_COLORCHANGE);
210  myShowRails->setCheck(mySettings->showRails);
211  new FXLabel(m22, " ", nullptr, GUIDesignViewSettingsLabel1);
212  myHideMacroConnectors = new FXCheckButton(m22, "Hide macro connectors", this, MID_SIMPLE_VIEW_COLORCHANGE);
213  myHideMacroConnectors->setCheck(mySettings->hideConnectors);
214  new FXLabel(m22, " ", nullptr, GUIDesignViewSettingsLabel1);
215  myShowLaneDirection = new FXCheckButton(m22, "Show lane direction", this, MID_SIMPLE_VIEW_COLORCHANGE);
216  myShowLaneDirection->setCheck(mySettings->showLaneDirection);
217  new FXLabel(m22, " ", nullptr, GUIDesignViewSettingsLabel1);
218  myShowSublanes = new FXCheckButton(m22, "Show sublanes", this, MID_SIMPLE_VIEW_COLORCHANGE);
219  myShowSublanes->setCheck(mySettings->showSublanes);
220  mySpreadSuperposed = new FXCheckButton(m22, "Spread bidirectional railway\t\tMake both directional edges for a bidirectional railway visible", this, MID_SIMPLE_VIEW_COLORCHANGE);
221  mySpreadSuperposed->setCheck(mySettings->spreadSuperposed);
222  new FXLabel(m22, "Exaggerate width by", nullptr, GUIDesignViewSettingsLabel1);
223  myLaneWidthUpscaleDialer = new FXRealSpinner(m22, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
224  myLaneWidthUpscaleDialer->setRange(0, 10000);
225  myLaneWidthUpscaleDialer->setValue(mySettings->laneWidthExaggeration);
226 
227  new FXLabel(m22, "Minimum size", nullptr, GUIDesignViewSettingsLabel1);
228  myLaneMinWidthDialer = new FXRealSpinner(m22, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
229  myLaneMinWidthDialer->setRange(0, 10000);
230  myLaneMinWidthDialer->setValue(mySettings->laneMinSize);
231 
232  // edge name
233  myEdgeNamePanel = new NamePanel(m22, this, "Show edge name", mySettings->edgeName);
234  myStreetNamePanel = new NamePanel(m22, this, "Show street name", mySettings->streetName);
235  myEdgeValuePanel = new NamePanel(m22, this, "Show edge color value", mySettings->edgeValue);
236  }
237  {
238  // vehicles
239  new FXTabItem(tabbook, "Vehicles", nullptr, GUIDesignViewSettingsTabItemBook1);
240  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
241  FXVerticalFrame* frame3 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
242 
243  FXMatrix* m31 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix3);
244  new FXLabel(m31, "Show As", nullptr, GUIDesignViewSettingsLabel1);
245  myVehicleShapeDetail = new MFXIconComboBox(m31, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
246  myVehicleShapeDetail->appendItem("'triangles'");
247  myVehicleShapeDetail->appendItem("'boxes'");
248  myVehicleShapeDetail->appendItem("'simple shapes'");
249  myVehicleShapeDetail->appendItem("'raster images'");
250  myVehicleShapeDetail->setNumVisible(4);
251  myVehicleShapeDetail->setCurrentItem(settings->vehicleQuality);
252 
253  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
254 
255  FXMatrix* m32 = new FXMatrix(frame3, 3, GUIDesignViewSettingsMatrix3);
256  new FXLabel(m32, "Color", nullptr, GUIDesignViewSettingsLabel1);
257  myVehicleColorMode = new MFXIconComboBox(m32, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
258  mySettings->vehicleColorer.fill(*myVehicleColorMode);
259  myVehicleColorMode->setNumVisible((int)mySettings->vehicleColorer.size());
260  myVehicleColorInterpolation = new FXCheckButton(m32, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
261 
262  myVehicleColorSettingFrame = new FXVerticalFrame(frame3, GUIDesignViewSettingsVerticalFrame4);
263 
264  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
265 
266  FXMatrix* m33 = new FXMatrix(frame3, 2, GUIDesignMatrixViewSettings);
267  myShowBlinker = new FXCheckButton(m33, "Show blinker / brake lights", this, MID_SIMPLE_VIEW_COLORCHANGE);
268  myShowBlinker->setCheck(mySettings->showBlinker);
269  new FXLabel(m33, " ", nullptr, GUIDesignViewSettingsLabel1);
270  myShowMinGap = new FXCheckButton(m33, "Show minimum gap", this, MID_SIMPLE_VIEW_COLORCHANGE);
271  myShowMinGap->setCheck(mySettings->drawMinGap);
272  new FXLabel(m33, " ", nullptr, GUIDesignViewSettingsLabel1);
273  myShowBrakeGap = new FXCheckButton(m33, "Show brake gap", this, MID_SIMPLE_VIEW_COLORCHANGE);
274  myShowBrakeGap->setCheck(mySettings->drawBrakeGap);
275  new FXLabel(m33, " ", nullptr, GUIDesignViewSettingsLabel1);
276  myShowBTRange = new FXCheckButton(m33, "Show Bluetooth range", this, MID_SIMPLE_VIEW_COLORCHANGE);
277  myShowBTRange->setCheck(mySettings->showBTRange);
278  new FXLabel(m33, " ", nullptr, GUIDesignViewSettingsLabel1);
279  /*
280  myShowLaneChangePreference = new FXCheckButton(m33, "Show lane change preference", this, MID_SIMPLE_VIEW_COLORCHANGE);
281  myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
282  new FXLabel(m33, " ", 0, GUIDesignViewSettingsLabel1);
283  */
284  myVehicleNamePanel = new NamePanel(m33, this, "Show vehicle name", mySettings->vehicleName);
285  myVehicleValuePanel = new NamePanel(m33, this, "Show vehicle color value", mySettings->vehicleValue);
286  /*
287  FXCheckButton *tmpc = new FXCheckButton(m33, "Show braking lights", 0 ,0);
288  tmpc->disable();
289  tmpc = new FXCheckButton(m33, "Show needed headway", 0 ,0);
290  tmpc->disable();
291  */
292 
293  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
294 
295  FXMatrix* m34 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix1);
296  myVehicleSizePanel = new SizePanel(m34, this, mySettings->vehicleSize);
297  }
298  {
299  // persons
300  new FXTabItem(tabbook, "Persons", nullptr, GUIDesignViewSettingsTabItemBook1);
301  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
302  FXVerticalFrame* frame3 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
303 
304  FXMatrix* m101 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix3);
305  new FXLabel(m101, "Show As", nullptr, GUIDesignViewSettingsLabel1);
306  myPersonShapeDetail = new MFXIconComboBox(m101, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
307  myPersonShapeDetail->appendItem("'triangles'");
308  myPersonShapeDetail->appendItem("'circles'");
309  myPersonShapeDetail->appendItem("'simple shapes'");
310  myPersonShapeDetail->appendItem("'raster images'");
311  myPersonShapeDetail->setNumVisible(4);
312  myPersonShapeDetail->setCurrentItem(settings->personQuality);
313 
314  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
315 
316  FXMatrix* m102 = new FXMatrix(frame3, 3, GUIDesignViewSettingsMatrix3);
317  new FXLabel(m102, "Color", nullptr, GUIDesignViewSettingsLabel1);
318  myPersonColorMode = new MFXIconComboBox(m102, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
319  mySettings->personColorer.fill(*myPersonColorMode);
320  myPersonColorMode->setNumVisible(10);
321  myPersonColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
322 
323  myPersonColorSettingFrame = new FXVerticalFrame(frame3, GUIDesignViewSettingsVerticalFrame4);
324 
325  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
326 
327  FXMatrix* m103 = new FXMatrix(frame3, 2, GUIDesignMatrixViewSettings);
328  myPersonNamePanel = new NamePanel(m103, this, "Show person name", mySettings->personName);
329  myPersonValuePanel = new NamePanel(m103, this, "Show person color value", mySettings->personValue);
330 
331  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
332 
333  FXMatrix* m104 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix1);
334  myPersonSizePanel = new SizePanel(m104, this, mySettings->personSize);
335  }
336  {
337  // containers
338  new FXTabItem(tabbook, "Containers", nullptr, GUIDesignViewSettingsTabItemBook1);
339  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
340  FXVerticalFrame* frame3 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
341 
342  FXMatrix* m101 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix3);
343  new FXLabel(m101, "Show As", nullptr, GUIDesignViewSettingsLabel1);
344  myContainerShapeDetail = new MFXIconComboBox(m101, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
345  myContainerShapeDetail->appendItem("'triangles'");
346  myContainerShapeDetail->appendItem("'boxes'");
347  myContainerShapeDetail->appendItem("'simple shapes'");
348  myContainerShapeDetail->appendItem("'raster images'");
349  myContainerShapeDetail->setNumVisible(4);
350  myContainerShapeDetail->setCurrentItem(settings->containerQuality);
351 
352  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
353 
354  FXMatrix* m102 = new FXMatrix(frame3, 3, GUIDesignViewSettingsMatrix3);
355  new FXLabel(m102, "Color", nullptr, GUIDesignViewSettingsLabel1);
356  myContainerColorMode = new MFXIconComboBox(m102, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
357  mySettings->containerColorer.fill(*myContainerColorMode);
358  myContainerColorMode->setNumVisible(9);
359  myContainerColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
360 
361  myContainerColorSettingFrame = new FXVerticalFrame(frame3, GUIDesignViewSettingsVerticalFrame4);
362 
363  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
364 
365  FXMatrix* m103 = new FXMatrix(frame3, 2, GUIDesignMatrixViewSettings);
366  myContainerNamePanel = new NamePanel(m103, this, "Show container name", mySettings->containerName);
367 
368  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
369 
370  FXMatrix* m104 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix1);
371  myContainerSizePanel = new SizePanel(m104, this, mySettings->containerSize);
372  }
373  {
374  // nodes
375  new FXTabItem(tabbook, "Junctions", nullptr, GUIDesignViewSettingsTabItemBook1);
376  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
377  FXVerticalFrame* frame4 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
378  FXMatrix* m41 = new FXMatrix(frame4, 3, GUIDesignViewSettingsMatrix3);
379  new FXLabel(m41, "Color", nullptr, GUIDesignViewSettingsLabel1);
380  myJunctionColorMode = new MFXIconComboBox(m41, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
381  mySettings->junctionColorer.fill(*myJunctionColorMode);
382  myJunctionColorMode->setNumVisible(4);
383  myJunctionColorInterpolation = new FXCheckButton(m41, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
384 
385  myJunctionColorSettingFrame = new FXVerticalFrame(frame4, GUIDesignViewSettingsVerticalFrame4);
386  myJunctionColorRainbow = new FXButton(frame4, "Recalibrate Rainbow", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
387  (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
388 
389  new FXHorizontalSeparator(frame4, GUIDesignHorizontalSeparator);
390  FXMatrix* m42 = new FXMatrix(frame4, 2, GUIDesignMatrixViewSettings);
391  myJunctionSizePanel = new SizePanel(m42, this, mySettings->junctionSize);
392  myDrawJunctionShape = new FXCheckButton(m42, "Draw junction shape", this, MID_SIMPLE_VIEW_COLORCHANGE);
393  myDrawJunctionShape->setCheck(mySettings->drawJunctionShape);
394  myDrawCrossingsAndWalkingAreas = new FXCheckButton(m42, "Draw crossings/walkingareas", this, MID_SIMPLE_VIEW_COLORCHANGE);
395  myDrawCrossingsAndWalkingAreas->setCheck(mySettings->drawCrossingsAndWalkingareas);
396  myShowLane2Lane = new FXCheckButton(m42, "Show lane to lane connections", this, MID_SIMPLE_VIEW_COLORCHANGE);
397  myShowLane2Lane->setCheck(mySettings->showLane2Lane);
398  new FXLabel(m42, " ", nullptr, GUIDesignViewSettingsLabel1);
399 
400  myTLIndexPanel = new NamePanel(m42, this, "Show link tls index", mySettings->drawLinkTLIndex);
401  myJunctionIndexPanel = new NamePanel(m42, this, "Show link junction index", mySettings->drawLinkJunctionIndex);
402  myJunctionNamePanel = new NamePanel(m42, this, "Show junction name", mySettings->junctionName);
403  myInternalJunctionNamePanel = new NamePanel(m42, this, "Show internal junction name", mySettings->internalJunctionName);
404  myInternalEdgeNamePanel = new NamePanel(m42, this, "Show internal edge name", mySettings->internalEdgeName);
405  myCwaEdgeNamePanel = new NamePanel(m42, this, "Show crossing and walkingarea name", mySettings->cwaEdgeName);
406  myTLSPhaseIndexPanel = new NamePanel(m42, this, "Show traffic light phase", mySettings->tlsPhaseIndex);
407  }
408  {
409  // detectors / triggers
410  new FXTabItem(tabbook, "Additional", nullptr, GUIDesignViewSettingsTabItemBook1);
411  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
412  FXVerticalFrame* frame5 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
413 
414  FXMatrix* m51 = new FXMatrix(frame5, 2, GUIDesignMatrixViewSettings);
415  myAddNamePanel = new NamePanel(m51, this, "Show object name", mySettings->addName);
416  myAddFullNamePanel = new NamePanel(m51, this, "Show full name", mySettings->addFullName);
417  new FXHorizontalSeparator(frame5, GUIDesignHorizontalSeparator);
418 
419  FXMatrix* m52 = new FXMatrix(frame5, 2, GUIDesignMatrixViewSettings);
420  myAddSizePanel = new SizePanel(m52, this, mySettings->addSize);
421 
422  /*
423  new FXLabel(m522, "Color", 0, GUIDesignViewSettingsLabel1);
424  myDetectorNameColor = new FXColorWell(m522, MFXUtils::getFXColor(settings->addNameColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell3);
425  */
426  }
427  {
428  // POIs
429  new FXTabItem(tabbook, "POIs", nullptr, GUIDesignViewSettingsTabItemBook1);
430  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
431  FXVerticalFrame* frame6 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
432 
433  FXMatrix* m63 = new FXMatrix(frame6, 3, GUIDesignViewSettingsMatrix3);
434  new FXLabel(m63, "Color", nullptr, GUIDesignViewSettingsLabel1);
435  myPOIColorMode = new MFXIconComboBox(m63, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
436  mySettings->poiColorer.fill(*myPOIColorMode);
437  myPOIColorMode->setNumVisible(3);
438  myPOIColorInterpolation = new FXCheckButton(m63, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
439  myPOIColorSettingFrame = new FXVerticalFrame(frame6, GUIDesignViewSettingsVerticalFrame4);
440 
441  new FXHorizontalSeparator(frame6, GUIDesignHorizontalSeparator);
442 
443  FXMatrix* m61 = new FXMatrix(frame6, 2, GUIDesignMatrixViewSettings);
444  myPOINamePanel = new NamePanel(m61, this, "Show poi names", mySettings->poiName);
445  myPOITypePanel = new NamePanel(m61, this, "Show poi types", mySettings->poiType);
446  new FXHorizontalSeparator(frame6, GUIDesignHorizontalSeparator);
447 
448  FXMatrix* m62 = new FXMatrix(frame6, 2, GUIDesignMatrixViewSettings);
449  myPOISizePanel = new SizePanel(m62, this, mySettings->poiSize);
450 
451  }
452  {
453  // Polygons
454  new FXTabItem(tabbook, "Polygons", nullptr, GUIDesignViewSettingsTabItemBook1);
455  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
456  FXVerticalFrame* frame9 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
457 
458  FXMatrix* m63 = new FXMatrix(frame9, 3, GUIDesignViewSettingsMatrix3);
459  new FXLabel(m63, "Color", nullptr, GUIDesignViewSettingsLabel1);
460  myPolyColorMode = new MFXIconComboBox(m63, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
461  mySettings->polyColorer.fill(*myPolyColorMode);
462  myPolyColorMode->setNumVisible(3);
463  myPolyColorInterpolation = new FXCheckButton(m63, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
464  myPolyColorSettingFrame = new FXVerticalFrame(frame9, GUIDesignViewSettingsVerticalFrame4);
465 
466  new FXHorizontalSeparator(frame9, GUIDesignHorizontalSeparator);
467 
468  FXMatrix* m91 = new FXMatrix(frame9, 2, GUIDesignMatrixViewSettings);
469  myPolyNamePanel = new NamePanel(m91, this, "Show polygon names", mySettings->polyName);
470  myPolyTypePanel = new NamePanel(m91, this, "Show polygon types", mySettings->polyType);
471  new FXHorizontalSeparator(frame9, GUIDesignHorizontalSeparator);
472 
473  myPolySizePanel = new SizePanel(m91, this, mySettings->polySize);
474  }
475  if (settings->netedit) {
476  // Selection
477  new FXTabItem(tabbook, "Selection", nullptr, GUIDesignViewSettingsTabItemBook1);
478  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
479  FXVerticalFrame* frame10 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
480 
481  FXMatrix* m102 = new FXMatrix(frame10, 2, GUIDesignMatrixViewSettings);
482  new FXLabel(m102, "Default Selection Color", nullptr, GUIDesignViewSettingsLabel1);
483  new FXLabel(m102, "", nullptr, GUIDesignViewSettingsLabel1);
484 
485  new FXLabel(m102, "Miscellaneous", nullptr, GUIDesignViewSettingsLabel1);
486  mySelectionColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
487  new FXLabel(m102, "Edge", nullptr, GUIDesignViewSettingsLabel1);
488  mySelectedEdgeColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedEdgeColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
489  new FXLabel(m102, "Lane Edge", nullptr, GUIDesignViewSettingsLabel1);
490  mySelectedLaneColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedLaneColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
491  new FXLabel(m102, "Connection", nullptr, GUIDesignViewSettingsLabel1);
492  mySelectedConnectionColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedConnectionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
493  new FXLabel(m102, "Prohibition", nullptr, GUIDesignViewSettingsLabel1);
494  mySelectedProhibitionColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedProhibitionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
495  new FXLabel(m102, "Crossing", nullptr, GUIDesignViewSettingsLabel1);
496  mySelectedCrossingColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedCrossingColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
497  new FXLabel(m102, "Additional", nullptr, GUIDesignViewSettingsLabel1);
498  mySelectedAdditionalColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedAdditionalColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
499  new FXLabel(m102, "Route", nullptr, GUIDesignViewSettingsLabel1);
500  mySelectedRouteColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedRouteColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
501  new FXLabel(m102, "Vehicle", nullptr, GUIDesignViewSettingsLabel1);
502  mySelectedVehicleColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedVehicleColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
503  new FXLabel(m102, "Person", nullptr, GUIDesignViewSettingsLabel1);
504  mySelectedPersonColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedPersonColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
505  new FXLabel(m102, "PersonPlan", nullptr, GUIDesignViewSettingsLabel1);
506  mySelectedPersonPlanColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedPersonPlanColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
507  }
508  {
509  // Legend
510  new FXTabItem(tabbook, "Legend", nullptr, GUIDesignViewSettingsTabItemBook1);
511  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
512  FXVerticalFrame* frame7 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
513 
514  FXMatrix* m72 = new FXMatrix(frame7, 2, GUIDesignMatrixViewSettings);
515  myShowSizeLegend = new FXCheckButton(m72, "Show Size Legend", this, MID_SIMPLE_VIEW_COLORCHANGE);
516  myShowSizeLegend->setCheck(mySettings->showSizeLegend);
517  new FXLabel(m72, "");
518  myShowColorLegend = new FXCheckButton(m72, "Show Color Legend", this, MID_SIMPLE_VIEW_COLORCHANGE);
519  myShowColorLegend->setCheck(mySettings->showColorLegend);
520  new FXLabel(m72, "");
521  }
522  {
523  // openGL
524  new FXTabItem(tabbook, "openGL", nullptr, GUIDesignViewSettingsTabItemBook1);
525  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
526  FXVerticalFrame* frame8 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
527 
528  FXMatrix* m82 = new FXMatrix(frame8, 1, GUIDesignMatrixViewSettings);
529  myDither = new FXCheckButton(m82, "Dither", this, MID_SIMPLE_VIEW_COLORCHANGE);
530  myDither->setCheck(mySettings->dither);
531  FXMatrix* m83 = new FXMatrix(frame8, 1, GUIDesignMatrixViewSettings);
532  myFPS = new FXCheckButton(m83, "FPS", this, MID_SIMPLE_VIEW_COLORCHANGE);
533  myFPS->setCheck(mySettings->fps);
534  FXMatrix* m84 = new FXMatrix(frame8, 1, GUIDesignMatrixViewSettings);
535  myDrawBoundaries = new FXCheckButton(m84, "Draw boundaries", this, MID_SIMPLE_VIEW_COLORCHANGE);
536  myDrawBoundaries->setCheck(mySettings->drawBoundaries);
537  FXMatrix* m85 = new FXMatrix(frame8, 1, GUIDesignMatrixViewSettings);
538  myForceDrawForSelecting = new FXCheckButton(m85, "Force draw for selecting", this, MID_SIMPLE_VIEW_COLORCHANGE);
539  myForceDrawForSelecting->setCheck(mySettings->forceDrawForSelecting);
540  }
541  FXHorizontalFrame* f2 = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame2);
542  FXButton* initial = new FXButton(f2, "&OK", nullptr, this, MID_SETTINGS_OK, GUIDesignViewSettingsButton2);
543  new FXButton(f2, "&Cancel", nullptr, this, MID_SETTINGS_CANCEL, GUIDesignViewSettingsButton3);
544  initial->setFocus();
545 
546  rebuildColorMatrices(false);
548  loadWindowSize();
549 }
550 
551 
553  myParent->remove(this);
554  // delete name panels
557  delete myTLSPhaseIndexPanel;
558  delete myCwaEdgeNamePanel;
559  delete myStreetNamePanel;
560  delete myEdgeValuePanel;
561  delete myJunctionIndexPanel;
562  delete myTLIndexPanel;
563  delete myJunctionNamePanel;
564  delete myVehicleNamePanel;
565  delete myVehicleValuePanel;
566  delete myPersonNamePanel;
567  delete myPersonValuePanel;
568  delete myAddNamePanel;
569  delete myAddFullNamePanel;
570  delete myPOINamePanel;
571  delete myPOITypePanel;
572  delete myPolyNamePanel;
573  delete myPolyTypePanel;
574  delete myEdgeNamePanel;
575  // delete size panels
576  delete myVehicleSizePanel;
577  delete myPersonSizePanel;
578  delete myJunctionSizePanel;
579  delete myPOISizePanel;
580  delete myPolySizePanel;
581  delete myAddSizePanel;
582 }
583 
584 
585 void
587  // update buttons that can be changed externally
588  myShowGrid->setCheck(mySettings->showGrid);
589  FXDialogBox::show();
590 }
591 
592 
593 void
595  mySettings = settings;
596  myBackup = (*settings);
597  onCmdNameChange(nullptr, 0, nullptr);
598 }
599 
600 
601 long
602 GUIDialog_ViewSettings::onCmdOk(FXObject*, FXSelector, void*) {
603  saveWindowSize();
604  hide();
605  return 1;
606 }
607 
608 
609 long
610 GUIDialog_ViewSettings::onCmdCancel(FXObject*, FXSelector, void*) {
611  saveWindowSize();
612  hide();
613  (*mySettings) = myBackup;
614  return 1;
615 }
616 
617 
618 long
619 GUIDialog_ViewSettings::onCmdNameChange(FXObject*, FXSelector, void* data) {
620  if (data != nullptr) {
621  FXString dataS = (char*) data; // !!!unicode
622  // check whether this item has been added twice
623  if (dataS == mySchemeName->getItemText(mySchemeName->getNumItems() - 1)) {
624  for (int i = 0; i < mySchemeName->getNumItems() - 1; ++i) {
625  if (dataS == mySchemeName->getItemText(i)) {
626  mySchemeName->removeItem(i);
627  }
628  }
629  }
630  myBackup = gSchemeStorage.get(dataS.text());
631  mySettings = &gSchemeStorage.get(dataS.text());
632  }
633  rebuildColorMatrices(true);
634 
636  if (mySettings->netedit) {
648  }
649 
650  myLaneEdgeColorMode->setCurrentItem((FXint) mySettings->getLaneEdgeMode());
651  myLaneEdgeScaleMode->setCurrentItem((FXint) mySettings->getLaneEdgeScaleMode());
656  myShowRails->setCheck(mySettings->showRails);
668 
669  myVehicleColorMode->setCurrentItem((FXint) mySettings->vehicleColorer.getActive());
672  myShowMinGap->setCheck(mySettings->drawMinGap);
675  /*
676  myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
677  */
681 
682  myPersonColorMode->setCurrentItem((FXint) mySettings->personColorer.getActive());
683  myPersonShapeDetail->setCurrentItem(mySettings->personQuality);
687 
688  myContainerColorMode->setCurrentItem((FXint) mySettings->containerColorer.getActive());
692 
693  myJunctionColorMode->setCurrentItem((FXint) mySettings->junctionColorer.getActive());
700 
704 
708 
712 
716  myDither->setCheck(mySettings->dither);
717  myFPS->setCheck(mySettings->fps);
722 
724  update();
725  myParent->update();
726  return 1;
727 }
728 
729 
730 bool
731 GUIDialog_ViewSettings::updateColorRanges(FXObject* sender, std::vector<FXColorWell*>::const_iterator colIt,
732  std::vector<FXColorWell*>::const_iterator colEnd,
733  std::vector<FXRealSpinner*>::const_iterator threshIt,
734  std::vector<FXRealSpinner*>::const_iterator threshEnd,
735  std::vector<FXButton*>::const_iterator buttonIt,
736  GUIColorScheme& scheme) {
737  int pos = 0;
738  while (colIt != colEnd) {
739  if (scheme.isFixed()) {
740  if (sender == *colIt) {
741  scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
742  }
743  } else {
744  if (sender == *threshIt) {
745  const double val = (*threshIt)->getValue();
746  double lo, hi;
747  if (pos != 0) {
748  threshIt--;
749  (*threshIt)->getRange(lo, hi);
750  (*threshIt)->setRange(lo, val);
751  threshIt++;
752  }
753  threshIt++;
754  if (threshIt != threshEnd) {
755  (*threshIt)->getRange(lo, hi);
756  (*threshIt)->setRange(val, hi);
757  }
758  scheme.setThreshold(pos, val);
759  return false;
760  }
761  if (sender == *colIt) {
762  scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
763  return false;
764  }
765  if (sender == *buttonIt) {
766  scheme.addColor(MFXUtils::getRGBColor((*colIt)->getRGBA()), (*threshIt)->getValue());
767  return true;
768  } else if (sender == *(buttonIt + 1)) {
769  scheme.removeColor(pos);
770  return true;
771  }
772  // 2 buttons per item (add / remove)
773  threshIt++;
774  buttonIt += 2;
775  }
776  ++colIt;
777  pos++;
778  }
779  return false;
780 }
781 
782 
783 bool
784 GUIDialog_ViewSettings::updateScaleRanges(FXObject* sender, std::vector<FXRealSpinner*>::const_iterator scaleIt,
785  std::vector<FXRealSpinner*>::const_iterator scaleEnd,
786  std::vector<FXRealSpinner*>::const_iterator threshIt,
787  std::vector<FXRealSpinner*>::const_iterator threshEnd,
788  std::vector<FXButton*>::const_iterator buttonIt,
789  GUIScaleScheme& scheme) {
790  int pos = 0;
791  while (scaleIt != scaleEnd) {
792  if (scheme.isFixed()) {
793  if (sender == *scaleIt) {
794  scheme.setColor(pos, (*scaleIt)->getValue());
795  }
796  } else {
797  if (sender == *threshIt) {
798  const double val = (*threshIt)->getValue();
799  double lo, hi;
800  if (pos != 0) {
801  threshIt--;
802  (*threshIt)->getRange(lo, hi);
803  (*threshIt)->setRange(lo, val);
804  threshIt++;
805  }
806  threshIt++;
807  if (threshIt != threshEnd) {
808  (*threshIt)->getRange(lo, hi);
809  (*threshIt)->setRange(val, hi);
810  }
811  scheme.setThreshold(pos, val);
812  return false;
813  }
814  if (sender == *scaleIt) {
815  scheme.setColor(pos, (*scaleIt)->getValue());
816  return false;
817  }
818  if (sender == *buttonIt) {
819  scheme.addColor((*scaleIt)->getValue(), (*threshIt)->getValue());
820  return true;
821  } else if (sender == *(buttonIt + 1)) {
822  scheme.removeColor(pos);
823  return true;
824  }
825  threshIt++;
826  buttonIt += 2;
827  }
828  ++scaleIt;
829  pos++;
830  }
831  return false;
832 }
833 
834 
835 long
836 GUIDialog_ViewSettings::onCmdColorChange(FXObject* sender, FXSelector, void* /*val*/) {
837  GUIVisualizationSettings tmpSettings = *mySettings;
838  int prevLaneMode = mySettings->getLaneEdgeMode();
839  int prevLaneScaleMode = mySettings->getLaneEdgeScaleMode();
840  int prevVehicleMode = mySettings->vehicleColorer.getActive();
841  int prevPersonMode = mySettings->personColorer.getActive();
842  int prevContainerMode = mySettings->containerColorer.getActive();
843  int prevJunctionMode = mySettings->junctionColorer.getActive();
844  int prevPOIMode = mySettings->poiColorer.getActive();
845  int prevPolyMode = mySettings->polyColorer.getActive();
846  bool doRebuildColorMatrices = false;
847 
848  tmpSettings.name = mySettings->name;
849  tmpSettings.backgroundColor = MFXUtils::getRGBColor(myBackgroundColor->getRGBA());
850  if (mySettings->netedit) {
862 
863  }
864 
865  tmpSettings.showGrid = (myShowGrid->getCheck() != FALSE);
866  tmpSettings.gridXSize = (double) myGridXSizeDialer->getValue();
867  tmpSettings.gridYSize = (double) myGridYSizeDialer->getValue();
868 
870  tmpSettings.edgeColorer.setActive(myLaneEdgeColorMode->getCurrentItem());
871  tmpSettings.edgeScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());
872  } else {
873  tmpSettings.laneColorer.setActive(myLaneEdgeColorMode->getCurrentItem());
874  tmpSettings.laneScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());
875  }
876  tmpSettings.laneShowBorders = (myShowLaneBorders->getCheck() != FALSE);
877  tmpSettings.showBikeMarkings = (myShowBikeMarkings->getCheck() != FALSE);
878  tmpSettings.showLinkDecals = (myShowLaneDecals->getCheck() != FALSE);
879  tmpSettings.showLinkRules = (myShowLinkRules->getCheck() != FALSE);
880  tmpSettings.showRails = (myShowRails->getCheck() != FALSE);
881  tmpSettings.edgeName = myEdgeNamePanel->getSettings();
883  tmpSettings.cwaEdgeName = myCwaEdgeNamePanel->getSettings();
884  tmpSettings.streetName = myStreetNamePanel->getSettings();
885  tmpSettings.edgeValue = myEdgeValuePanel->getSettings();
886  tmpSettings.hideConnectors = (myHideMacroConnectors->getCheck() != FALSE);
887  tmpSettings.showLaneDirection = (myShowLaneDirection->getCheck() != FALSE);
888  tmpSettings.showSublanes = (myShowSublanes->getCheck() != FALSE);
889  tmpSettings.spreadSuperposed = (mySpreadSuperposed->getCheck() != FALSE);
890  if (sender == myParamKey) {
892  tmpSettings.edgeParam = myParamKey->getText().text();
894  tmpSettings.laneParam = myParamKey->getText().text();
896  tmpSettings.edgeData = myParamKey->getText().text();
897  }
898  }
899  tmpSettings.laneWidthExaggeration = (double) myLaneWidthUpscaleDialer->getValue();
900  tmpSettings.laneMinSize = (double) myLaneMinWidthDialer->getValue();
901 
902  tmpSettings.vehicleColorer.setActive(myVehicleColorMode->getCurrentItem());
903  tmpSettings.vehicleQuality = myVehicleShapeDetail->getCurrentItem();
904  tmpSettings.showBlinker = (myShowBlinker->getCheck() != FALSE);
905  tmpSettings.drawMinGap = (myShowMinGap->getCheck() != FALSE);
906  tmpSettings.drawBrakeGap = (myShowBrakeGap->getCheck() != FALSE);
907  tmpSettings.showBTRange = (myShowBTRange->getCheck() != FALSE);
908  /*
909  tmpSettings.drawLaneChangePreference = (myShowLaneChangePreference->getCheck() != FALSE);
910  */
911  tmpSettings.vehicleName = myVehicleNamePanel->getSettings();
913  tmpSettings.vehicleSize = myVehicleSizePanel->getSettings();
914 
915  tmpSettings.personColorer.setActive(myPersonColorMode->getCurrentItem());
916  tmpSettings.personQuality = myPersonShapeDetail->getCurrentItem();
917  tmpSettings.personName = myPersonNamePanel->getSettings();
918  tmpSettings.personValue = myPersonValuePanel->getSettings();
919  tmpSettings.personSize = myPersonSizePanel->getSettings();
920 
921  tmpSettings.containerColorer.setActive(myContainerColorMode->getCurrentItem());
922  tmpSettings.containerQuality = myContainerShapeDetail->getCurrentItem();
925 
926  tmpSettings.junctionColorer.setActive(myJunctionColorMode->getCurrentItem());
927  tmpSettings.drawLinkTLIndex = myTLIndexPanel->getSettings();
933 
934  tmpSettings.addName = myAddNamePanel->getSettings();
935  tmpSettings.addFullName = myAddFullNamePanel->getSettings();
936  tmpSettings.addSize = myAddSizePanel->getSettings();
937 
938  tmpSettings.poiColorer.setActive(myPOIColorMode->getCurrentItem());
939  tmpSettings.poiName = myPOINamePanel->getSettings();
940  tmpSettings.poiType = myPOITypePanel->getSettings();
941  tmpSettings.poiSize = myPOISizePanel->getSettings();
942 
943  tmpSettings.polyColorer.setActive(myPolyColorMode->getCurrentItem());
944  tmpSettings.polyName = myPolyNamePanel->getSettings();
945  tmpSettings.polyType = myPolyTypePanel->getSettings();
946  tmpSettings.polySize = myPolySizePanel->getSettings();
947 
948  tmpSettings.showLane2Lane = (myShowLane2Lane->getCheck() != FALSE);
949  tmpSettings.drawJunctionShape = (myDrawJunctionShape->getCheck() != FALSE);
950  tmpSettings.drawCrossingsAndWalkingareas = (myDrawCrossingsAndWalkingAreas->getCheck() != FALSE);
951  tmpSettings.dither = (myDither->getCheck() != FALSE);
952  tmpSettings.fps = (myFPS->getCheck() != FALSE);
953  tmpSettings.drawBoundaries = (myDrawBoundaries->getCheck() != FALSE);
954  tmpSettings.forceDrawForSelecting = (myForceDrawForSelecting->getCheck() != FALSE);
955  tmpSettings.showSizeLegend = (myShowSizeLegend->getCheck() != FALSE);
956  tmpSettings.showColorLegend = (myShowColorLegend->getCheck() != FALSE);
957 
958  // lanes (colors)
959  if (sender == myLaneColorRainbow) {
960  myParent->buildColorRainbow(tmpSettings, tmpSettings.getLaneEdgeScheme(), tmpSettings.getLaneEdgeMode(), GLO_LANE,
961  myLaneColorRainbowCheck->getCheck() != FALSE, myLaneColorRainbowThreshold->getValue());
962  doRebuildColorMatrices = true;
963  }
964  if (sender == myJunctionColorRainbow) {
965  myParent->buildColorRainbow(tmpSettings, tmpSettings.junctionColorer.getScheme(), tmpSettings.junctionColorer.getActive(), GLO_JUNCTION);
966  doRebuildColorMatrices = true;
967  }
968  if (tmpSettings.getLaneEdgeMode() == prevLaneMode) {
969  if (updateColorRanges(sender, myLaneColors.begin(), myLaneColors.end(),
970  myLaneThresholds.begin(), myLaneThresholds.end(), myLaneButtons.begin(),
971  tmpSettings.getLaneEdgeScheme())) {
972  doRebuildColorMatrices = true;
973  }
974  if (sender == myLaneColorInterpolation) {
975  tmpSettings.getLaneEdgeScheme().setInterpolated(myLaneColorInterpolation->getCheck() != FALSE);
976  doRebuildColorMatrices = true;
977  }
978  } else {
979  doRebuildColorMatrices = true;
980  }
981  // lanes (scaling)
982  if (tmpSettings.getLaneEdgeScaleMode() == prevLaneScaleMode) {
983  if (updateScaleRanges(sender, myLaneScales.begin(), myLaneScales.end(),
985  tmpSettings.getLaneEdgeScaleScheme())) {
986  doRebuildColorMatrices = true;
987  }
988  if (sender == myLaneScaleInterpolation) {
989  tmpSettings.getLaneEdgeScaleScheme().setInterpolated(myLaneScaleInterpolation->getCheck() != FALSE);
990  doRebuildColorMatrices = true;
991  }
992  } else {
993  doRebuildColorMatrices = true;
994  }
995  // vehicles
996  if (tmpSettings.vehicleColorer.getActive() == prevVehicleMode) {
997  if (updateColorRanges(sender, myVehicleColors.begin(), myVehicleColors.end(),
999  tmpSettings.vehicleColorer.getScheme())) {
1000  doRebuildColorMatrices = true;
1001  }
1002  if (sender == myVehicleColorInterpolation) {
1003  tmpSettings.vehicleColorer.getScheme().setInterpolated(myVehicleColorInterpolation->getCheck() != FALSE);
1004  doRebuildColorMatrices = true;
1005  }
1006  } else {
1007  doRebuildColorMatrices = true;
1008  }
1009  // persons
1010  if (tmpSettings.personColorer.getActive() == prevPersonMode) {
1011  if (updateColorRanges(sender, myPersonColors.begin(), myPersonColors.end(),
1012  myPersonThresholds.begin(), myPersonThresholds.end(), myPersonButtons.begin(),
1013  tmpSettings.personColorer.getScheme())) {
1014  doRebuildColorMatrices = true;
1015  }
1016  if (sender == myPersonColorInterpolation) {
1017  tmpSettings.personColorer.getScheme().setInterpolated(myPersonColorInterpolation->getCheck() != FALSE);
1018  doRebuildColorMatrices = true;
1019  }
1020  } else {
1021  doRebuildColorMatrices = true;
1022  }
1023  // containers
1024  if (tmpSettings.containerColorer.getActive() == prevContainerMode) {
1025  if (updateColorRanges(sender, myContainerColors.begin(), myContainerColors.end(),
1027  tmpSettings.containerColorer.getScheme())) {
1028  doRebuildColorMatrices = true;
1029  }
1030  if (sender == myContainerColorInterpolation) {
1031  tmpSettings.containerColorer.getScheme().setInterpolated(myContainerColorInterpolation->getCheck() != FALSE);
1032  doRebuildColorMatrices = true;
1033  }
1034  } else {
1035  doRebuildColorMatrices = true;
1036  }
1037  // junctions
1038  if (tmpSettings.junctionColorer.getActive() == prevJunctionMode) {
1039  if (updateColorRanges(sender, myJunctionColors.begin(), myJunctionColors.end(),
1041  tmpSettings.junctionColorer.getScheme())) {
1042  doRebuildColorMatrices = true;
1043  }
1044  if (sender == myJunctionColorInterpolation) {
1045  tmpSettings.junctionColorer.getScheme().setInterpolated(myJunctionColorInterpolation->getCheck() != FALSE);
1046  doRebuildColorMatrices = true;
1047  }
1048  } else {
1049  doRebuildColorMatrices = true;
1050  }
1051  // POIs
1052  if (tmpSettings.poiColorer.getActive() == prevPOIMode) {
1053  if (updateColorRanges(sender, myPOIColors.begin(), myPOIColors.end(),
1054  myPOIThresholds.begin(), myPOIThresholds.end(), myPOIButtons.begin(),
1055  tmpSettings.poiColorer.getScheme())) {
1056  doRebuildColorMatrices = true;
1057  }
1058  if (sender == myPOIColorInterpolation) {
1059  tmpSettings.poiColorer.getScheme().setInterpolated(myPOIColorInterpolation->getCheck() != FALSE);
1060  doRebuildColorMatrices = true;
1061  }
1062  } else {
1063  doRebuildColorMatrices = true;
1064  }
1065  // polygons
1066  if (tmpSettings.polyColorer.getActive() == prevPolyMode) {
1067  if (updateColorRanges(sender, myPolyColors.begin(), myPolyColors.end(),
1068  myPolyThresholds.begin(), myPolyThresholds.end(), myPolyButtons.begin(),
1069  tmpSettings.polyColorer.getScheme())) {
1070  doRebuildColorMatrices = true;
1071  }
1072  if (sender == myPolyColorInterpolation) {
1073  tmpSettings.polyColorer.getScheme().setInterpolated(myPolyColorInterpolation->getCheck() != FALSE);
1074  doRebuildColorMatrices = true;
1075  }
1076  } else {
1077  doRebuildColorMatrices = true;
1078  }
1079 
1080  if (tmpSettings == *mySettings) {
1081  return 1;
1082  }
1083 
1084  int index = mySchemeName->getCurrentItem();
1085  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1086  // one of the initial settings is modified
1087  // every time this happens we create a new scheme
1088  int suffix = 1;
1089  while (gSchemeStorage.contains("custom_" + toString(suffix))) {
1090  suffix++;
1091  }
1092  tmpSettings.name = "custom_" + toString(suffix);
1093  // the newly created settings must be entered in several places:
1094  // - the comboBox mySchemeName of this dialog
1095  // - the comboBox of the parent view (set as active)
1096  // - the comboBox of all other views (only append) XXX @todo
1097  index = mySchemeName->appendItem(tmpSettings.name.c_str());
1098  mySchemeName->setCurrentItem(index);
1099  myParent->getColoringSchemesCombo()->appendItem(tmpSettings.name.c_str());
1100  }
1101  myParent->getColoringSchemesCombo()->setCurrentItem(
1102  myParent->getColoringSchemesCombo()->findItem(tmpSettings.name.c_str()));
1103  gSchemeStorage.add(tmpSettings); // overwrites existing
1104  mySettings = &gSchemeStorage.get(tmpSettings.name);
1105  myParent->setColorScheme(tmpSettings.name);
1106 
1107  if (doRebuildColorMatrices) {
1108  rebuildColorMatrices(true);
1109  }
1110  myParent->forceRefresh();
1111  getApp()->forceRefresh();
1112  return 1;
1113 }
1114 
1115 
1116 void
1117 GUIDialog_ViewSettings::loadSettings(const std::string& file) {
1118  GUISettingsHandler handler(file, true, mySettings->netedit);
1119  std::string settingsName = handler.addSettings(myParent);
1120  if (settingsName != "") {
1121  FXint index = mySchemeName->appendItem(settingsName.c_str());
1122  mySchemeName->setCurrentItem(index);
1123  mySettings = &gSchemeStorage.get(settingsName);
1124  }
1125  if (handler.hasDecals()) {
1126  myDecalsLock->lock();
1127  (*myDecals) = handler.getDecals();
1128  rebuildList();
1129  myParent->update();
1130  myDecalsLock->unlock();
1131  }
1132  if (handler.getDelay() >= 0) {
1133  myParent->setDelay(handler.getDelay());
1134  }
1135  if (handler.getBreakpoints().size() > 0) {
1137  }
1138  handler.applyViewport(myParent);
1139  rebuildColorMatrices(true);
1140 }
1141 
1142 
1143 void
1145  std::vector<GUISUMOAbstractView::Decal>::iterator j;
1146  for (j = myDecals->begin(); j != myDecals->end(); ++j) {
1149  dev.writeAttr("filename", d.filename);
1155  dev.writeAttr("altitude", d.altitude);
1156  dev.writeAttr("rotation", d.rot);
1157  dev.writeAttr("tilt", d.tilt);
1158  dev.writeAttr("roll", d.roll);
1160  dev.writeAttr("screenRelative", d.screenRelative);
1161  dev.closeTag();
1162  }
1163 }
1164 
1165 
1166 void
1167 GUIDialog_ViewSettings::loadDecals(const std::string& file) {
1168  myDecalsLock->lock();
1169  GUISettingsHandler handler(file);
1170  if (handler.hasDecals()) {
1171  (*myDecals) = handler.getDecals();
1172  }
1173  rebuildList();
1174  myParent->update();
1175  myDecalsLock->unlock();
1176 }
1177 
1178 
1179 long
1180 GUIDialog_ViewSettings::onCmdSaveSetting(FXObject*, FXSelector, void* /*data*/) {
1181  int index = mySchemeName->getCurrentItem();
1182  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1183  return 1;
1184  }
1185  // get the name
1186  std::string name = "";
1187  while (name.length() == 0) {
1188  FXDialogBox dialog(this, "Enter a name", GUIDesignViewSettingsDialog);
1189  FXVerticalFrame* content = new FXVerticalFrame(&dialog, GUIDesignViewSettingsVerticalFrame5);
1190  new FXLabel(content, "Please enter an alphanumeric name: ", nullptr, GUIDesignViewSettingsLabel2);
1191  FXTextField* text = new FXTextField(content, 40, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsTextField1);
1192  new FXHorizontalSeparator(content, GUIDesignHorizontalSeparator);
1193  FXHorizontalFrame* buttons = new FXHorizontalFrame(content, GUIDesignViewSettingsHorizontalFrame3);
1194  new FXButton(buttons, "&OK", nullptr, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsButton4);
1195  new FXButton(buttons, "&Cancel", nullptr, &dialog, FXDialogBox::ID_CANCEL, GUIDesignViewSettingsButton5);
1196  dialog.create();
1197  text->setFocus();
1198  if (!dialog.execute()) {
1199  return 1;
1200  }
1201  name = text->getText().text();
1202  for (int i = 0; i < (int)name.length(); ++i) {
1203  if (name[i] != '_' && (name[i] < 'a' || name[i] > 'z') && (name[i] < 'A' || name[i] > 'Z') && (name[i] < '0' || name[i] > '9')) {
1204  name = "";
1205  break;
1206  }
1207  }
1208  }
1209  GUIVisualizationSettings tmpSettings = *mySettings;
1211  tmpSettings.name = name;
1212  gSchemeStorage.add(tmpSettings);
1213  mySchemeName->setItemText(index, tmpSettings.name.c_str());
1214  myParent->getColoringSchemesCombo()->setItemText(index, tmpSettings.name.c_str());
1215  myParent->setColorScheme(tmpSettings.name);
1216  mySettings = &gSchemeStorage.get(name);
1217  myBackup = *mySettings;
1218  gSchemeStorage.writeSettings(getApp());
1219  return 1;
1220 }
1221 
1222 
1223 long
1224 GUIDialog_ViewSettings::onUpdSaveSetting(FXObject* sender, FXSelector, void* ptr) {
1225  sender->handle(this,
1226  mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1227  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1228  ptr);
1229  return 1;
1230 }
1231 
1232 
1233 long
1234 GUIDialog_ViewSettings::onCmdDeleteSetting(FXObject*, FXSelector, void* /*data*/) {
1235  int index = mySchemeName->getCurrentItem();
1236  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1237  return 1;
1238  }
1239  std::string name = mySchemeName->getItem(index).text();
1240  gSchemeStorage.remove(name);
1241  mySchemeName->removeItem(index);
1242  onCmdNameChange(nullptr, 0, (void*) mySchemeName->getItem(0).text());
1243  gSchemeStorage.writeSettings(getApp());
1244  return 1;
1245 }
1246 
1247 
1248 long
1249 GUIDialog_ViewSettings::onUpdDeleteSetting(FXObject* sender, FXSelector, void* ptr) {
1250  sender->handle(this,
1251  mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1252  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1253  ptr);
1254  return 1;
1255 }
1256 
1257 
1258 long
1259 GUIDialog_ViewSettings::onCmdExportSetting(FXObject*, FXSelector, void* /*data*/) {
1260  FXString file = MFXUtils::getFilename2Write(this, "Export view settings", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder);
1261  if (file == "") {
1262  return 1;
1263  }
1264  try {
1265  OutputDevice& dev = OutputDevice::getDevice(file.text());
1267  mySettings->save(dev);
1268  if (mySaveViewPort->getCheck()) {
1270  }
1271  if (mySaveDelay->getCheck()) {
1272  dev.openTag(SUMO_TAG_DELAY);
1274  dev.closeTag();
1275  }
1276  if (mySaveDecals->getCheck()) {
1277  saveDecals(dev);
1278  }
1279  if (!mySettings->netedit && mySaveBreakpoints->getCheck()) {
1280  for (SUMOTime t : myParent->retrieveBreakpoints()) {
1283  dev.closeTag();
1284  }
1285  }
1286  dev.closeTag();
1287  dev.close();
1288  } catch (IOError& e) {
1289  FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what());
1290  }
1291  return 1;
1292 }
1293 
1294 
1295 long
1296 GUIDialog_ViewSettings::onUpdExportSetting(FXObject* sender, FXSelector, void* ptr) {
1297  sender->handle(this,
1298  (mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1299  && !mySaveViewPort->getCheck() && !mySaveDelay->getCheck() && !mySaveDecals->getCheck() && !mySaveBreakpoints->getCheck()) ?
1300  FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1301  ptr);
1302  return 1;
1303 }
1304 
1305 
1306 long
1307 GUIDialog_ViewSettings::onCmdImportSetting(FXObject*, FXSelector, void* /*data*/) {
1308  FXFileDialog opendialog(this, "Import view settings");
1309  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
1310  opendialog.setSelectMode(SELECTFILE_ANY);
1311  opendialog.setPatternList("*.xml");
1312  if (gCurrentFolder.length() != 0) {
1313  opendialog.setDirectory(gCurrentFolder);
1314  }
1315  if (opendialog.execute()) {
1316  gCurrentFolder = opendialog.getDirectory();
1317  loadSettings(opendialog.getFilename().text());
1318  }
1319  return 1;
1320 }
1321 
1322 
1323 long
1324 GUIDialog_ViewSettings::onCmdLoadDecals(FXObject*, FXSelector, void* /*data*/) {
1325  FXFileDialog opendialog(this, "Load Decals");
1326  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
1327  opendialog.setSelectMode(SELECTFILE_ANY);
1328  opendialog.setPatternList("*.xml");
1329  if (gCurrentFolder.length() != 0) {
1330  opendialog.setDirectory(gCurrentFolder);
1331  }
1332  if (opendialog.execute()) {
1333  gCurrentFolder = opendialog.getDirectory();
1334  loadDecals(opendialog.getFilename().text());
1335  }
1336  return 1;
1337 }
1338 
1339 
1340 long
1341 GUIDialog_ViewSettings::onCmdSaveDecals(FXObject*, FXSelector, void* /*data*/) {
1342  FXString file = MFXUtils::getFilename2Write(this, "Save Decals", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder);
1343  if (file == "") {
1344  return 1;
1345  }
1346  try {
1347  OutputDevice& dev = OutputDevice::getDevice(file.text());
1348  dev.openTag("decals");
1349  saveDecals(dev);
1350  dev.closeTag();
1351  dev.close();
1352  } catch (IOError& e) {
1353  FXMessageBox::error(myParent, MBOX_OK, "Storing failed!", "%s", e.what());
1354  }
1355  return 1;
1356 }
1357 
1358 
1359 
1360 
1361 long
1362 GUIDialog_ViewSettings::onUpdImportSetting(FXObject* sender, FXSelector, void* ptr) {
1363  sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1364  return 1;
1365 }
1366 
1367 
1368 void
1370  myDecalsTable->clearItems();
1371  const int cols = 8;
1372  // set table attributes
1373  const int numRows = MAX2((int)10, (int)myDecals->size() + 1);
1374  myDecalsTable->setTableSize(numRows, cols);
1375  myDecalsTable->setColumnText(0, "picture file");
1376  myDecalsTable->setColumnText(1, "center x");
1377  myDecalsTable->setColumnText(2, "center y");
1378  myDecalsTable->setColumnText(3, "width");
1379  myDecalsTable->setColumnText(4, "height");
1380  myDecalsTable->setColumnText(5, "rotation");
1381  myDecalsTable->setColumnText(6, "layer");
1382  myDecalsTable->setColumnText(7, "relative");
1383  FXHeader* header = myDecalsTable->getColumnHeader();
1384  header->setHeight(getApp()->getNormalFont()->getFontHeight() + getApp()->getNormalFont()->getFontAscent());
1385  int k;
1386  for (k = 0; k < cols; k++) {
1387  header->setItemJustify(k, GUIDesignViewSettingsMFXTableJustify);
1388  header->setItemSize(k, 60);
1389  }
1390  header->setItemSize(0, 150);
1391  // insert already known decals information into table
1392  FXint row = 0;
1393  std::vector<GUISUMOAbstractView::Decal>::iterator j;
1394  for (j = myDecals->begin(); j != myDecals->end(); ++j) {
1396  myDecalsTable->setItemText(row, 0, d.filename.c_str());
1397  myDecalsTable->setItemText(row, 1, toString<double>(d.centerX).c_str());
1398  myDecalsTable->setItemText(row, 2, toString<double>(d.centerY).c_str());
1399  myDecalsTable->setItemText(row, 3, toString<double>(d.width).c_str());
1400  myDecalsTable->setItemText(row, 4, toString<double>(d.height).c_str());
1401  myDecalsTable->setItemText(row, 5, toString<double>(d.rot).c_str());
1402  myDecalsTable->setItemText(row, 6, toString<double>(d.layer).c_str());
1403  myDecalsTable->setItemText(row, 7, toString<double>(d.screenRelative).c_str());
1404  row++;
1405  }
1406  // insert dummy last field
1407  for (k = 0; k < 7; k++) {
1408  myDecalsTable->setItemText(row, k, " ");
1409  }
1410 }
1411 
1412 
1413 FXMatrix*
1415  std::vector<FXColorWell*>& colors,
1416  std::vector<FXRealSpinner*>& thresholds,
1417  std::vector<FXButton*>& buttons,
1418  FXCheckButton* interpolation,
1419  GUIColorScheme& scheme) {
1420  MFXUtils::deleteChildren(frame);
1421  FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1422  colors.clear();
1423  thresholds.clear();
1424  buttons.clear();
1425  const bool fixed = scheme.isFixed();
1426  std::vector<RGBColor>::const_iterator colIt = scheme.getColors().begin();
1427  std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1428  std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1429  while (colIt != scheme.getColors().end()) {
1430  colors.push_back(new FXColorWell(m, MFXUtils::getFXColor(*colIt), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell1));
1431  if (fixed) {
1432  new FXLabel(m, nameIt->c_str());
1433  new FXLabel(m, "");
1434  new FXLabel(m, "");
1435  } else {
1436  const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1437  FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignSpinDial | SPIN_NOMAX | dialerOptions);
1438  threshDialer->setValue(*threshIt);
1439  thresholds.push_back(threshDialer);
1440  buttons.push_back(new FXButton(m, "Add", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1441  buttons.push_back(new FXButton(m, "Remove", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1442  }
1443  colIt++;
1444  threshIt++;
1445  nameIt++;
1446  }
1447  interpolation->setCheck(scheme.isInterpolated());
1448  if (fixed) {
1449  interpolation->disable();
1450  } else {
1451  if (colors.size() > 1) {
1452  interpolation->enable();
1453  if (interpolation->getCheck() != FALSE) {
1454  thresholds.front()->enable();
1455  } else {
1456  thresholds.front()->disable();
1457  }
1458  } else {
1459  interpolation->disable();
1460  thresholds.front()->disable();
1461  }
1462  }
1463  return m;
1464 }
1465 
1466 
1467 FXMatrix*
1469  std::vector<FXRealSpinner*>& scales,
1470  std::vector<FXRealSpinner*>& thresholds,
1471  std::vector<FXButton*>& buttons,
1472  FXCheckButton* interpolation,
1473  GUIScaleScheme& scheme) {
1474  MFXUtils::deleteChildren(frame);
1475  FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1476  scales.clear();
1477  thresholds.clear();
1478  buttons.clear();
1479  const bool fixed = scheme.isFixed();
1480  std::vector<double>::const_iterator scaleIt = scheme.getColors().begin();
1481  std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1482  std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1483  while (scaleIt != scheme.getColors().end()) {
1484  FXRealSpinner* scaleDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignSpinDial | SPIN_NOMAX);
1485  scaleDialer->setValue(*scaleIt);
1486  scales.push_back(scaleDialer);
1487  if (fixed) {
1488  new FXLabel(m, nameIt->c_str());
1489  new FXLabel(m, "");
1490  new FXLabel(m, "");
1491  } else {
1492  const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1493  FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignSpinDial | SPIN_NOMAX | dialerOptions);
1494  threshDialer->setValue(*threshIt);
1495  thresholds.push_back(threshDialer);
1496  buttons.push_back(new FXButton(m, "Add", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1497  buttons.push_back(new FXButton(m, "Remove", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1498  }
1499  scaleIt++;
1500  threshIt++;
1501  nameIt++;
1502  }
1503  interpolation->setCheck(scheme.isInterpolated());
1504  if (fixed) {
1505  interpolation->disable();
1506  } else {
1507  if (scales.size() > 1) {
1508  interpolation->enable();
1509  if (interpolation->getCheck() != FALSE) {
1510  thresholds.front()->enable();
1511  } else {
1512  thresholds.front()->disable();
1513  }
1514  } else {
1515  interpolation->disable();
1516  thresholds.front()->disable();
1517  }
1518  }
1519  return m;
1520 }
1521 
1522 
1523 void
1525  // decals
1526  delete myDecalsTable;
1528  myDecalsTable->setVisibleRows(5);
1529  myDecalsTable->setVisibleColumns(7);
1530  myDecalsTable->setTableSize(5, 7);
1531  myDecalsTable->setBackColor(FXRGB(255, 255, 255));
1532  myDecalsTable->getRowHeader()->setWidth(0);
1533  for (int i = 1; i <= 5; ++i) {
1535  myDecalsTable->setNumberCellParams(i, -10000000, 10000000, 1, 10, 100, "%.2f");
1536  }
1537  rebuildList();
1538  if (doCreate) {
1539  myDecalsTable->create();
1540  }
1542  if (doCreate) {
1543  m->create();
1544  }
1546  myLaneColorRainbow->disable();
1547  } else {
1548  myLaneColorRainbow->enable();
1549  }
1551  myJunctionColorRainbow->disable();
1552  } else {
1553  myJunctionColorRainbow->enable();
1554  }
1555  const std::string activeSchemeName = myLaneEdgeColorMode->getText().text();
1556  myParamKey->clearItems();
1557  myParamKey->setEditable(true);
1559  myParamKey->appendItem(mySettings->edgeParam.c_str());
1560  for (const std::string& attr : myParent->getEdgeLaneParamKeys(true)) {
1561  if (attr != mySettings->edgeParam) {
1562  myParamKey->appendItem(attr.c_str());
1563  }
1564  }
1565  myParamKey->enable();
1566  } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_LANE_PARAM_NUMERICAL) {
1567  myParamKey->appendItem(mySettings->laneParam.c_str());
1568  for (const std::string& attr : myParent->getEdgeLaneParamKeys(false)) {
1569  if (attr != mySettings->laneParam) {
1570  myParamKey->appendItem(attr.c_str());
1571  }
1572  }
1573  myParamKey->enable();
1574  } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {
1575  myParamKey->appendItem(mySettings->edgeData.c_str());
1576  for (const std::string& attr : myParent->getEdgeDataAttrs()) {
1577  if (attr != mySettings->edgeData) {
1578  myParamKey->appendItem(attr.c_str());
1579  }
1580  }
1581  myParamKey->enable();
1582  myParamKey->setEditable(false);
1583  } else {
1584  myParamKey->disable();
1585  }
1586  myParamKey->setNumVisible(myParamKey->getNumItems());
1587  myLaneColorSettingFrame->getParent()->recalc();
1588 
1590  if (doCreate) {
1591  m->create();
1592  }
1593  myLaneScaleSettingFrame->getParent()->recalc();
1594 
1596  if (doCreate) {
1597  m->create();
1598  }
1599  myVehicleColorSettingFrame->getParent()->recalc();
1600 
1602  if (doCreate) {
1603  m->create();
1604  }
1605  myPersonColorSettingFrame->getParent()->recalc();
1607  if (doCreate) {
1608  m->create();
1609  }
1610  myContainerColorSettingFrame->getParent()->recalc();
1612  if (doCreate) {
1613  m->create();
1614  }
1615  myJunctionColorSettingFrame->getParent()->recalc();
1616  // POIs
1618  if (doCreate) {
1619  m->create();
1620  }
1621  myPOIColorSettingFrame->getParent()->recalc();
1622  // polygons
1624  if (doCreate) {
1625  m->create();
1626  }
1627  myPolyColorSettingFrame->getParent()->recalc();
1628 
1629  layout();
1630  update();
1631 }
1632 
1633 
1634 long
1635 GUIDialog_ViewSettings::onCmdEditTable(FXObject*, FXSelector, void* data) {
1637  std::string value = i->item->getText().text();
1638  // check whether the inserted value is empty
1639  if (value.find_first_not_of(" ") == std::string::npos) {
1640  return 1;
1641  }
1643  int row = i->row;
1644  // check whether we add a new entry or edit an existing entry
1645  if (row == static_cast<int>(myDecals->size())) {
1646  d.filename = "";
1647  d.centerX = double(myParent->getGridWidth() / 2.);
1648  d.centerY = double(myParent->getGridHeight() / 2.);
1649  d.width = 0.;
1650  d.height = 0.;
1651  d.initialised = false;
1652  d.rot = 0;
1653  d.layer = 0;
1654  d.screenRelative = false;
1655  myDecalsLock->lock();
1656  myDecals->push_back(d);
1657  myDecalsLock->unlock();
1658  } else if (row > static_cast<int>(myDecals->size())) {
1659  // ignore clicks two lines below existing entries
1660  return 1;
1661  } else {
1662  d = (*myDecals)[row];
1663  }
1664 
1665  switch (i->col) {
1666  case 0:
1667  if (d.initialised && d.filename != value) {
1668  d.initialised = false;
1669  }
1670  d.filename = value;
1671  break;
1672  case 1:
1673  try {
1674  d.centerX = StringUtils::toDouble(value);
1675  } catch (NumberFormatException&) {
1676  std::string msg = "The value must be a float, is:" + value;
1677  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1678  }
1679  break;
1680  case 2:
1681  try {
1682  d.centerY = StringUtils::toDouble(value);
1683  } catch (NumberFormatException&) {
1684  std::string msg = "The value must be a float, is:" + value;
1685  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1686  }
1687  break;
1688  case 3:
1689  try {
1690  d.width = StringUtils::toDouble(value);
1691  } catch (NumberFormatException&) {
1692  std::string msg = "The value must be a float, is:" + value;
1693  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1694  }
1695  break;
1696  case 4:
1697  try {
1698  d.height = StringUtils::toDouble(value);
1699  } catch (NumberFormatException&) {
1700  std::string msg = "The value must be a float, is:" + value;
1701  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1702  }
1703  break;
1704  case 5:
1705  try {
1706  d.rot = StringUtils::toDouble(value);
1707  } catch (NumberFormatException&) {
1708  std::string msg = "The value must be a float, is:" + value;
1709  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1710  }
1711  break;
1712  case 6:
1713  try {
1714  d.layer = StringUtils::toDouble(value);
1715  } catch (NumberFormatException&) {
1716  std::string msg = "The value must be a float, is:" + value;
1717  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1718  }
1719  break;
1720  case 7:
1721  try {
1723  } catch (NumberFormatException&) {
1724  std::string msg = "The value must be a bool, is:" + value;
1725  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1726  }
1727  break;
1728  default:
1729  throw 1;
1730  }
1731  (*myDecals)[row] = d;
1732  if (!i->updateOnly) {
1733  rebuildList();
1734  }
1735  myParent->update();
1736  return 1;
1737 }
1738 
1739 
1740 std::string
1742  return mySchemeName->getItem(mySchemeName->getCurrentItem()).text();
1743 }
1744 
1745 
1746 void
1748  if (name.c_str() == mySchemeName->getItemText(mySchemeName->getCurrentItem())) {
1749  return;
1750  }
1751  for (int i = 0; i < mySchemeName->getNumItems(); ++i) {
1752  if (name.c_str() == mySchemeName->getItemText(i)) {
1753  mySchemeName->setCurrentItem(i);
1754  onCmdNameChange(nullptr, 0, (void*)name.c_str());
1755  return;
1756  }
1757  }
1758 }
1759 
1761  FXMatrix* parent,
1762  GUIDialog_ViewSettings* target,
1763  const std::string& title,
1764  const GUIVisualizationTextSettings& settings) {
1765  myCheck = new FXCheckButton(parent, title.c_str(), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1766  myCheck->setCheck(settings.show);
1767  myConstSizeCheck = new FXCheckButton(parent, "constant text size", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1768  myConstSizeCheck->setCheck(settings.constSize);
1769  FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1770  new FXLabel(m1, "Size", nullptr, GUIDesignViewSettingsLabel1);
1771  mySizeDial = new FXRealSpinner(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1772  mySizeDial->setRange(10, 1000);
1773  mySizeDial->setValue(settings.size);
1774  FXMatrix* m2 = new FXMatrix(parent, 4, GUIDesignViewSettingsMatrix5);
1775  new FXLabel(m2, "Color", nullptr, GUIDesignViewSettingsLabel1);
1776  myColorWell = new FXColorWell(m2, MFXUtils::getFXColor(settings.color), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell2);
1777  new FXLabel(m2, "Background", nullptr, GUIDesignViewSettingsLabel1);
1778  myBGColorWell = new FXColorWell(m2, MFXUtils::getFXColor(settings.bgColor), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell2);
1779 }
1780 
1781 
1784  return GUIVisualizationTextSettings(myCheck->getCheck() != FALSE,
1785  mySizeDial->getValue(),
1786  MFXUtils::getRGBColor(myColorWell->getRGBA()),
1787  MFXUtils::getRGBColor(myBGColorWell->getRGBA()),
1788  myConstSizeCheck->getCheck() != FALSE);
1789 }
1790 
1791 
1792 void
1794  myCheck->setCheck(settings.show);
1795  mySizeDial->setValue(settings.size);
1796  myColorWell->setRGBA(MFXUtils::getFXColor(settings.color));
1797  myBGColorWell->setRGBA(MFXUtils::getFXColor(settings.bgColor));
1798  myConstSizeCheck->setCheck(settings.constSize);
1799 }
1800 
1801 
1803  FXMatrix* parent,
1804  GUIDialog_ViewSettings* target,
1805  const GUIVisualizationSizeSettings& settings) {
1806  myCheck = new FXCheckButton(parent, "Draw with constant size when zoomed out", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1807  myCheck->setCheck(settings.constantSize);
1808  myCheckSelected = new FXCheckButton(parent, "Only for selected", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1809  myCheckSelected->setCheck(settings.constantSizeSelected);
1810  FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1811  new FXLabel(m1, "Minimum Size", nullptr, GUIDesignViewSettingsLabel1);
1812  myMinSizeDial = new FXRealSpinner(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1813  myMinSizeDial->setValue(settings.minSize);
1814  FXMatrix* m2 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1815  new FXLabel(m2, "Exaggerate by", nullptr, GUIDesignViewSettingsLabel1);
1816  myExaggerateDial = new FXRealSpinner(m2, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
1817  myExaggerateDial->setRange(0, 10000);
1818  myExaggerateDial->setValue(settings.exaggeration);
1819 }
1820 
1821 
1825  myMinSizeDial->getValue(), myExaggerateDial->getValue(),
1826  myCheck->getCheck() != FALSE,
1827  myCheckSelected->getCheck() != FALSE);
1828 }
1829 
1830 
1831 void
1833  myCheck->setCheck(settings.constantSize);
1834  myCheckSelected->setCheck(settings.constantSizeSelected);
1835  myMinSizeDial->setValue(settings.minSize);
1836  myExaggerateDial->setValue(settings.exaggeration);
1837 }
1838 
1839 
1840 void
1842  getApp()->reg().writeIntEntry("VIEWSETTINGS", "x", getX());
1843  getApp()->reg().writeIntEntry("VIEWSETTINGS", "y", getY());
1844  getApp()->reg().writeIntEntry("VIEWSETTINGS", "width", getWidth());
1845  getApp()->reg().writeIntEntry("VIEWSETTINGS", "height", getHeight());
1846 }
1847 
1848 void
1850  // ensure window is visible after switching screen resolutions
1851  const FXint minSize = 400;
1852  const FXint minTitlebarHeight = 20;
1853  setX(MAX2(0, MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "x", 150),
1854  getApp()->getRootWindow()->getWidth() - minSize)));
1855  setY(MAX2(minTitlebarHeight,
1856  MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "y", 150),
1857  getApp()->getRootWindow()->getHeight() - minSize)));
1858  setWidth(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "width", 700), minSize));
1859  setHeight(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "height", 500), minSize));
1860 }
1861 
1862 /****************************************************************************/
1863 
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.
bool drawBrakeGap
Information whether the brake gap shall be drawn.
GUIVisualizationTextSettings junctionName
virtual std::vector< std::string > getEdgeDataAttrs() const
return list of loaded edgeData attributes
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
RGBColor selectedPersonPlanColor
person plan selection color (Rides, Walks, personStops...)
For the save-decals - button.
Definition: GUIAppEnum.h:531
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
MFXIconComboBox * myVehicleColorMode
long long int SUMOTime
Definition: SUMOTime.h:35
#define GUIDesignViewSettingsMatrix5
Definition: GUIDesigns.h:397
GUIVisualizationTextSettings poiType
FXVerticalFrame * myLaneScaleSettingFrame
GUIVisualizationTextSettings streetName
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
FXCheckButton * myLaneColorRainbowCheck
#define GUIDesignViewSettingsMatrix3
Definition: GUIDesigns.h:393
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.
static const std::string SCHEME_NAME_EDGEDATA_NUMERICAL
GUIVisualizationTextSettings addName
FXCheckButton * myPolyColorInterpolation
const std::string & getName() const
GUIVisualizationTextSettings personValue
GUIVisualizationTextSettings personName
#define GUIDesignViewSettingsButton5
Definition: GUIDesigns.h:432
std::vector< FXButton * > myLaneButtons
MFXIconComboBox * myPolyColorMode
RGBColor selectedVehicleColor
vehicle selection color
FXDEFMAP(GUIDialog_ViewSettings) GUIDialog_ViewSettingsMap[]
#define GUIDesignViewSettingsColorWell2
Definition: GUIDesigns.h:437
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
GUIVisualizationTextSettings poiName
Ok-button was pushed.
Definition: GUIAppEnum.h:451
RGBColor selectedLaneColor
lane selection color
#define GUIDesignViewSettingsMFXTableJustify
Definition: GUIDesigns.h:442
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:95
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)
RGBColor bgColor
background text color
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
MFXIconComboBox * myLaneEdgeScaleMode
... lane scaler
#define GUIDesignViewSettingsVerticalFrame4
Definition: GUIDesigns.h:375
std::vector< GUISUMOAbstractView::Decal > * myDecals
The parent&#39;s decals.
std::vector< FXButton * > myPOIButtons
MFXIconComboBox * myVehicleShapeDetail
bool showRails
Information whether rails shall be drawn.
static const std::string SCHEME_NAME_EDGE_PARAM_NUMERICAL
scheme names
void loadDecals(const std::string &file)
Loads decals from a file.
std::vector< FXButton * > myPersonButtons
bool constantSizeSelected
whether only selected objects shall be drawn with constant
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:65
std::vector< FXColorWell * > myJunctionColors
MFXIconComboBox * myContainerColorMode
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:377
FXVerticalFrame * myPolyColorSettingFrame
bool allowsNegativeValues() const
T MAX2(T a, T b)
Definition: StdDefs.h:80
static void deleteChildren(FXWindow *w)
Deletes all children of the given window.
Definition: MFXUtils.cpp:32
MFXIconComboBox * myPersonColorMode
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.
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
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.
#define GUIDesignCheckButtonViewSettings
CheckButton for Frames without thick extended over the frame.
Definition: GUIDesigns.h:137
bool isInterpolated() const
std::vector< FXRealSpinner * > myLaneScaleThresholds
bool hasDecals() const
Returns whether any decals have been parsed.
#define GUIDesignViewSettingsTextField1
textFields
Definition: GUIDesigns.h:421
bool showLinkRules
Information whether link rules (colored bars) shall be drawn.
std::vector< FXRealSpinner * > myLaneThresholds
FXRealSpinner * myLaneColorRainbowThreshold
long onCmdEditTable(FXObject *, FXSelector, void *data)
Called if the decals-table was changed.
#define GUIDesignViewSettingsSpinDial1
Definition: GUIDesigns.h:406
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:527
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:264
long onCmdNameChange(FXObject *, FXSelector, void *)
Called if the name of the scheme was changed.
double getDelay() const
Returns the parsed delay.
void setBreakpoints(const std::vector< SUMOTime > &breakpoints)
Sets the breakpoints of the parent application.
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:369
#define GUIDesignViewSettingsMatrix2
Definition: GUIDesigns.h:391
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:426
GUIVisualizationTextSettings edgeName
FXTableItem * item
std::vector< FXButton * > myContainerButtons
FXCheckButton * myVehicleColorInterpolation
GUIVisualizationSizeSettings addSize
bool constantSize
whether the object shall be drawn with constant size regardless of zoom
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:371
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
MFXIconComboBox * myJunctionColorMode
RGBColor selectedConnectionColor
connection selection color
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:337
#define GUIDesignViewSettingsButton3
Definition: GUIDesigns.h:428
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:48
void rebuildList()
Rebuilds the decals table.
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
#define GUIDesignViewSettingsHorizontalFrame2
Definition: GUIDesigns.h:384
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
bool constSize
flag to avoid size changes
#define GUIDesignViewSettingsLabel2
Definition: GUIDesigns.h:418
RGBColor selectionColor
basic selection color
const std::vector< SUMOTime > & getBreakpoints() const
Returns the parsed breakpoints.
RGBColor selectedProhibitionColor
prohibition selection color
For the load-decals - button.
Definition: GUIAppEnum.h:529
bool drawMinGap
Information whether the minimum gap shall be drawn.
std::vector< FXColorWell * > myVehicleColors
#define GUIDesignViewSettingsMatrix4
Definition: GUIDesigns.h:395
FXComboBox * getColoringSchemesCombo()
get coloring schemes combo
MFXIconComboBox * myLaneEdgeColorMode
... lane colorer
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:389
GUIVisualizationTextSettings polyType
bool showSublanes
Whether to show sublane boundaries.
virtual void buildColorRainbow(const GUIVisualizationSettings &, GUIColorScheme &, int, GUIGlObjectType, bool hide=false, double hideThreshold=0)
recalibrate color scheme according to the current value range
void saveWindowSize()
save window position and size to the registry
#define GUIDesignViewSettingsColorWell1
Color wells.
Definition: GUIDesigns.h:435
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
Informs the dialog about switching to another scheme.
Definition: GUIAppEnum.h:519
FXVerticalFrame * myLaneColorSettingFrame
std::vector< FXRealSpinner * > myVehicleThresholds
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:74
#define GUIDesignViewSettingsColorWell
ColorWell.
Definition: GUIDesigns.h:404
GUIColorer personColorer
The person colorer.
void setThreshold(const int pos, const double threshold)
bool showColorLegend
Information whether the colo legend shall be drawn.
GUIVisualizationTextSettings internalJunctionName
int getNumInitialSettings() const
Returns the number of initial settings.
#define GUIDesignComboBoxStatic
Combo box static (not editable)
Definition: GUIDesigns.h:224
double centerY
The center of the image in y-direction (net coordinates, in m)
bool fps
Information whether frames-per-second should be drawn.
GUIColorer junctionColorer
The junction colorer.
virtual std::vector< std::string > getEdgeLaneParamKeys(bool) const
return list of available edge parameters
#define GUIDesignViewSettingsButton4
Definition: GUIDesigns.h:430
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:366
void setColor(const int pos, const T &color)
virtual bool setColorScheme(const std::string &)
set color scheme
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
RGBColor selectedCrossingColor
crossings selection color
#define GUIDesignViewSettingsHorizontalFrame1
Horizontal frames.
Definition: GUIDesigns.h:382
MFXAddEditTypedTable * myDecalsTable
virtual const std::vector< SUMOTime > retrieveBreakpoints() const
retrieve breakpoints if provided by the application
RGBColor selectedPersonColor
person selection color
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
#define GUIDesignViewSettingsTabBook1
Tab books.
Definition: GUIDesigns.h:411
#define GUIDesignViewSettingsComboBox1
Combo boxs.
Definition: GUIDesigns.h:401
FXCheckButton * myPOIColorInterpolation
NamePanel(FXMatrix *parent, GUIDialog_ViewSettings *target, const std::string &title, const GUIVisualizationTextSettings &settings)
GUIVisualizationSizeSettings containerSize
std::string edgeData
key for coloring by edgeData
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
GUIVisualizationTextSettings tlsPhaseIndex
const std::vector< T > & getColors() const
void writeSettings(FXApp *app)
Writes the current scheme into the registry.
#define GUIDesignViewSettingsHorizontalFrame3
Definition: GUIDesigns.h:386
std::vector< FXRealSpinner * > myContainerThresholds
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:413
FXColorWell * mySelectedProhibitionColor
GUIVisualizationSizeSettings personSize
int personQuality
The quality of person drawing.
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
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:517
long onCmdColorChange(FXObject *, FXSelector, void *)
Called if something (color, width, etc.) has been changed.
#define GUIDesignViewSettingsVerticalFrame3
Definition: GUIDesigns.h:373
FXCheckButton * myForceDrawForSelecting
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
For the delete - button.
Definition: GUIAppEnum.h:523
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:379
#define GUIDesignViewSettingsButton1
Buttons.
Definition: GUIDesigns.h:424
For the save-to-db - button.
Definition: GUIAppEnum.h:521
GUIVisualizationColorSettings colorSettings
color settings
#define GUIDesignSpinDial
Definition: GUIDesigns.h:357
GUIVisualizationSizeSettings vehicleSize
bool drawJunctionShape
whether the shape of the junction should be drawn
FXMutex * myDecalsLock
Lock used when changing the decals.
long onCmdLoadDecals(FXObject *, FXSelector, void *data)
Called if the decals shall be loaded from a file.
Cancel-button was pushed.
Definition: GUIAppEnum.h:453
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.
RGBColor selectedEdgeColor
edge selection color
FXVerticalFrame * myPOIColorSettingFrame
const std::vector< double > & getThresholds() const
static bool UseMesoSim
this should be set at the same time as MSGlobals::gUseMesoSim
FXRealSpinner * myLaneWidthUpscaleDialer
bool forceDrawForSelecting
flag to force draw to selecting (see drawForSelecting)
FXCheckButton * myContainerColorInterpolation
MFXIconComboBox * myPOIColorMode
GUIScaler laneScaler
The lane scaler.
#define GUIDesignViewSettingsSpinDial2
Definition: GUIDesigns.h:408
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
long onCmdDeleteSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be deleted.
MFXIconComboBox * myContainerShapeDetail
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
bool drawBoundaries
enable or disable draw boundaries
std::vector< FXButton * > myJunctionButtons
GUIVisualizationTextSettings drawLinkJunctionIndex
#define GUIDesignViewSettingsMFXTable
MFX Add/Edit Typed Table.
Definition: GUIDesigns.h:440
The Table.
Definition: GUIAppEnum.h:439
GUIVisualizationSettings myBackup
A backup of the settings (used if the "Cancel" button is pressed)
std::vector< FXColorWell * > myLaneColors
MFXIconComboBox * myPersonShapeDetail
bool hideConnectors
flag to show or hidde connectors
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.
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:525
#define GUIDesignViewSettingsLabel1
Label.
Definition: GUIDesigns.h:416
FXRealSpinner * myLaneMinWidthDialer
#define GUIDesignViewSettingsMainDialog
Definition: GUIDesigns.h:364