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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
21 // The dialog to change the view (gui) settings.
22 /****************************************************************************/
23 #include <config.h>
24 
25 #include <fstream>
31 #include <utils/common/RGBColor.h>
32 #include <utils/common/ToString.h>
42 #include "GUIDialog_EditViewport.h"
43 #include "GUIDialog_ViewSettings.h"
44 
45 
46 // ===========================================================================
47 // FOX callback mapping
48 // ===========================================================================
49 FXDEFMAP(GUIDialog_ViewSettings) GUIDialog_ViewSettingsMap[] = {
53  FXMAPFUNC(SEL_COMMAND, MID_SETTINGS_OK, GUIDialog_ViewSettings::onCmdOk),
56 
65 
68 
69 };
70 
71 
72 FXIMPLEMENT(GUIDialog_ViewSettings, FXDialogBox, GUIDialog_ViewSettingsMap, ARRAYNUMBER(GUIDialog_ViewSettingsMap))
73 
74 
75 // ===========================================================================
76 // method definitions
77 // ===========================================================================
78 GUIDialog_ViewSettings::GUIDialog_ViewSettings(GUISUMOAbstractView* parent, GUIVisualizationSettings* settings, std::vector<GUISUMOAbstractView::Decal>* decals, FXMutex* decalsLock) :
79  FXDialogBox(parent, "View Settings", GUIDesignViewSettingsMainDialog),
80  myParent(parent), mySettings(settings),
81  myDecals(decals), myDecalsLock(decalsLock),
82  myDecalsTable(nullptr) {
83  myBackup = (*mySettings);
84 
85  FXVerticalFrame* contentFrame = new FXVerticalFrame(this, GUIDesignViewSettingsVerticalFrame1);
86  //
87  {
88  FXHorizontalFrame* frame0 = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame1);
89  mySchemeName = new FXComboBox(frame0, 20, this, MID_SIMPLE_VIEW_NAMECHANGE, GUIDesignViewSettingsComboBox1);
90  const std::vector<std::string>& names = gSchemeStorage.getNames();
91  for (std::vector<std::string>::const_iterator i = names.begin(); i != names.end(); ++i) {
92  int index = mySchemeName->appendItem((*i).c_str());
93  if ((*i) == mySettings->name) {
94  mySchemeName->setCurrentItem((FXint) index);
95  }
96  }
97  mySchemeName->setNumVisible(5);
98 
99  new FXButton(frame0, "\t\tSave the setting to registry", GUIIconSubSys::getIcon(GUIIcon::SAVEDB), this, MID_SIMPLE_VIEW_SAVE, GUIDesignButtonToolbar);
100  new FXButton(frame0, "\t\tRemove the setting from registry", GUIIconSubSys::getIcon(GUIIcon::REMOVEDB), this, MID_SIMPLE_VIEW_DELETE, GUIDesignButtonToolbar);
101  new FXButton(frame0, "\t\tExport setting to file", GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_SIMPLE_VIEW_EXPORT, GUIDesignButtonToolbar);
102  new FXButton(frame0, "\t\tLoad setting from file", GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG), this, MID_SIMPLE_VIEW_IMPORT, GUIDesignButtonToolbar);
103 
104  new FXVerticalSeparator(frame0);
105  new FXLabel(frame0, "Export includes:", nullptr, GUIDesignViewSettingsLabel1);
106  mySaveViewPort = new FXCheckButton(frame0, "Viewport");
107  mySaveDelay = new FXCheckButton(frame0, "Delay");
108  mySaveDecals = new FXCheckButton(frame0, "Decals");
109  mySaveBreakpoints = new FXCheckButton(frame0, "Breakpoints");
110  if (settings->netedit) {
111  mySaveBreakpoints->disable();
112  }
113  }
114  //
115  FXTabBook* tabbook = new FXTabBook(contentFrame, nullptr, 0, GUIDesignViewSettingsTabBook1);
116  {
117  // tab for the background
118  new FXTabItem(tabbook, "Background", nullptr, GUIDesignViewSettingsTabItemBook1);
119  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
120  FXVerticalFrame* frame1 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
121 
122  FXMatrix* m11 = new FXMatrix(frame1, 2, GUIDesignMatrixViewSettings);
123  new FXLabel(m11, "Color", nullptr, GUIDesignViewSettingsLabel1);
124  myBackgroundColor = new FXColorWell(m11, MFXUtils::getFXColor(settings->backgroundColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
125 
126  new FXHorizontalSeparator(frame1, GUIDesignHorizontalSeparator);
127 
128  FXVerticalFrame* frame11 = new FXVerticalFrame(frame1, GUIDesignViewSettingsVerticalFrame3);
129  new FXLabel(frame11, "Decals:");
130  myDecalsFrame = new FXVerticalFrame(frame11);
131  FXHorizontalFrame* frame111 = new FXHorizontalFrame(frame11, GUIDesignViewSettingsHorizontalFrame2);
132  new FXButton(frame111, "&Load Decals", nullptr, this, MID_SIMPLE_VIEW_LOAD_DECALS, GUIDesignViewSettingsButton1);
133  new FXButton(frame111, "&Save Decals", nullptr, this, MID_SIMPLE_VIEW_SAVE_DECALS, GUIDesignViewSettingsButton1);
134 
135  new FXHorizontalSeparator(frame1, GUIDesignHorizontalSeparator);
136 
137  FXMatrix* m12 = new FXMatrix(frame1, 2, GUIDesignViewSettingsMatrix1);
138  myShowGrid = new FXCheckButton(m12, "Show grid", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
139  myShowGrid->setCheck(mySettings->showGrid);
140  new FXLabel(m12, "");
141  FXMatrix* m121 = new FXMatrix(m12, 2, GUIDesignViewSettingsMatrix2);
142  new FXLabel(m121, "x-spacing", nullptr, GUIDesignViewSettingsLabel1);
143  myGridXSizeDialer = new FXRealSpinner(m121, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
144  myGridXSizeDialer->setRange(1, 10000);
145  myGridXSizeDialer->setValue(mySettings->gridXSize);
146  FXMatrix* m122 = new FXMatrix(m12, 2, GUIDesignViewSettingsMatrix2);
147  new FXLabel(m122, "y-spacing", nullptr, GUIDesignViewSettingsLabel1);
148  myGridYSizeDialer = new FXRealSpinner(m122, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
149  myGridYSizeDialer->setRange(1, 10000);
150  myGridYSizeDialer->setValue(mySettings->gridXSize);
151  }
152  {
153  // tab for the streets
154  new FXTabItem(tabbook, "Streets", nullptr, GUIDesignViewSettingsTabItemBook1);
155  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
156  FXVerticalFrame* frame2 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
157  // ... color settings
158  FXVerticalFrame* frame22 = new FXVerticalFrame(frame2, GUIDesignViewSettingsVerticalFrame6);
159  FXMatrix* m21 = new FXMatrix(frame22, 4, GUIDesignViewSettingsMatrix3);
160  new FXLabel(m21, "Color", nullptr, GUIDesignViewSettingsLabel1);
161  myLaneEdgeColorMode = new MFXIconComboBox(m21, 30, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
162  myLaneColorInterpolation = new FXCheckButton(m21, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
163  myLaneColorSettingFrame = new FXVerticalFrame(frame22, GUIDesignViewSettingsVerticalFrame4);
164  myParamKey = new FXComboBox(m21, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
165  myParamKey->disable();
166  myParamKey->setEditable(true);
167 
168  // rainbow settings
169  FXMatrix* m24 = new FXMatrix(frame22, 3, GUIDesignViewSettingsMatrix3);
170  myLaneColorRainbow = new FXButton(m24, "Recalibrate Rainbow", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
171  (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
172  myLaneColorRainbowCheck = new FXCheckButton(m24, "hide below threshold", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
173  myLaneColorRainbowThreshold = new FXRealSpinner(m24, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);
174  myLaneColorRainbowThreshold->setRange(-100000, 100000);
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, 1000000);
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, 1000000);
230  myLaneMinWidthDialer->setValue(mySettings->laneMinSize);
231 
232  // edge name
233  myEdgeNamePanel = new NamePanel(m22, this, "Show edge id", 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, 4, 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  myVehicleParamKey = new FXComboBox(m32, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
262  myVehicleParamKey->setEditable(true);
263  myVehicleParamKey->disable();
264 
265  myVehicleColorSettingFrame = new FXVerticalFrame(frame3, GUIDesignViewSettingsVerticalFrame4);
266 
267  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
268 
269  FXMatrix* m35 = new FXMatrix(frame3, 2, GUIDesignMatrixViewSettings);
270  myVehicleNamePanel = new NamePanel(m35, this, "Show vehicle id", mySettings->vehicleName);
271  myVehicleValuePanel = new NamePanel(m35, this, "Show vehicle color value", mySettings->vehicleValue);
272  myVehicleTextPanel = new NamePanel(m35, this, "Show vehicle text param", mySettings->vehicleText);
273  myVehicleTextParamKey = new FXComboBox(myVehicleTextPanel->myMatrix0, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
274  myVehicleTextParamKey->setEditable(true);
275 
276  //new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
277 
278  FXMatrix* m33 = new FXMatrix(frame3, 2, GUIDesignMatrixViewSettings);
279  myShowBlinker = new FXCheckButton(m33, "Show blinker / brake lights", this, MID_SIMPLE_VIEW_COLORCHANGE);
280  myShowBlinker->setCheck(mySettings->showBlinker);
281  myShowMinGap = new FXCheckButton(m33, "Show minimum gap", this, MID_SIMPLE_VIEW_COLORCHANGE);
282  myShowMinGap->setCheck(mySettings->drawMinGap);
283  myShowBrakeGap = new FXCheckButton(m33, "Show brake gap", this, MID_SIMPLE_VIEW_COLORCHANGE);
284  myShowBrakeGap->setCheck(mySettings->drawBrakeGap);
285  myShowBTRange = new FXCheckButton(m33, "Show Bluetooth range", this, MID_SIMPLE_VIEW_COLORCHANGE);
286  myShowBTRange->setCheck(mySettings->showBTRange);
287  myShowRouteIndex = new FXCheckButton(m33, "Show route index", this, MID_SIMPLE_VIEW_COLORCHANGE);
288  myShowRouteIndex->setCheck(mySettings->showRouteIndex);
289  new FXLabel(m33, " ", nullptr, GUIDesignViewSettingsLabel1);
290  //myShowLaneChangePreference = new FXCheckButton(m33, "Show lane change preference", this, MID_SIMPLE_VIEW_COLORCHANGE);
291  //myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
292  //tmpc = new FXCheckButton(m33, "Show needed headway", 0 ,0);
293  //tmpc->disable();
294 
295  //new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
296 
297  FXMatrix* m34 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix1);
298  myVehicleSizePanel = new SizePanel(m34, this, mySettings->vehicleSize);
299 
300  }
301  {
302  // persons
303  new FXTabItem(tabbook, "Persons", nullptr, GUIDesignViewSettingsTabItemBook1);
304  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
305  FXVerticalFrame* frame3 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
306 
307  FXMatrix* m101 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix3);
308  new FXLabel(m101, "Show As", nullptr, GUIDesignViewSettingsLabel1);
309  myPersonShapeDetail = new MFXIconComboBox(m101, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
310  myPersonShapeDetail->appendItem("'triangles'");
311  myPersonShapeDetail->appendItem("'circles'");
312  myPersonShapeDetail->appendItem("'simple shapes'");
313  myPersonShapeDetail->appendItem("'raster images'");
314  myPersonShapeDetail->setNumVisible(4);
315  myPersonShapeDetail->setCurrentItem(settings->personQuality);
316 
317  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
318 
319  FXMatrix* m102 = new FXMatrix(frame3, 3, GUIDesignViewSettingsMatrix3);
320  new FXLabel(m102, "Color", nullptr, GUIDesignViewSettingsLabel1);
321  myPersonColorMode = new MFXIconComboBox(m102, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
322  mySettings->personColorer.fill(*myPersonColorMode);
323  myPersonColorMode->setNumVisible(10);
324  myPersonColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
325 
326  myPersonColorSettingFrame = new FXVerticalFrame(frame3, GUIDesignViewSettingsVerticalFrame4);
327 
328  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
329 
330  FXMatrix* m103 = new FXMatrix(frame3, 2, GUIDesignMatrixViewSettings);
331  myPersonNamePanel = new NamePanel(m103, this, "Show person id", mySettings->personName);
332  myPersonValuePanel = new NamePanel(m103, this, "Show person color value", mySettings->personValue);
333 
334  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
335 
336  FXMatrix* m104 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix1);
337  myPersonSizePanel = new SizePanel(m104, this, mySettings->personSize);
338  }
339  {
340  // containers
341  new FXTabItem(tabbook, "Containers", nullptr, GUIDesignViewSettingsTabItemBook1);
342  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
343  FXVerticalFrame* frame3 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
344 
345  FXMatrix* m101 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix3);
346  new FXLabel(m101, "Show As", nullptr, GUIDesignViewSettingsLabel1);
347  myContainerShapeDetail = new MFXIconComboBox(m101, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
348  myContainerShapeDetail->appendItem("'triangles'");
349  myContainerShapeDetail->appendItem("'boxes'");
350  myContainerShapeDetail->appendItem("'simple shapes'");
351  myContainerShapeDetail->appendItem("'raster images'");
352  myContainerShapeDetail->setNumVisible(4);
353  myContainerShapeDetail->setCurrentItem(settings->containerQuality);
354 
355  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
356 
357  FXMatrix* m102 = new FXMatrix(frame3, 3, GUIDesignViewSettingsMatrix3);
358  new FXLabel(m102, "Color", nullptr, GUIDesignViewSettingsLabel1);
359  myContainerColorMode = new MFXIconComboBox(m102, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
360  mySettings->containerColorer.fill(*myContainerColorMode);
361  myContainerColorMode->setNumVisible(9);
362  myContainerColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
363 
364  myContainerColorSettingFrame = new FXVerticalFrame(frame3, GUIDesignViewSettingsVerticalFrame4);
365 
366  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
367 
368  FXMatrix* m103 = new FXMatrix(frame3, 2, GUIDesignMatrixViewSettings);
369  myContainerNamePanel = new NamePanel(m103, this, "Show container id", mySettings->containerName);
370 
371  new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
372 
373  FXMatrix* m104 = new FXMatrix(frame3, 2, GUIDesignViewSettingsMatrix1);
374  myContainerSizePanel = new SizePanel(m104, this, mySettings->containerSize);
375  }
376  {
377  // nodes
378  new FXTabItem(tabbook, "Junctions", nullptr, GUIDesignViewSettingsTabItemBook1);
379  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
380  FXVerticalFrame* frame4 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
381  FXMatrix* m41 = new FXMatrix(frame4, 3, GUIDesignViewSettingsMatrix3);
382  new FXLabel(m41, "Color", nullptr, GUIDesignViewSettingsLabel1);
383  myJunctionColorMode = new MFXIconComboBox(m41, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
384  mySettings->junctionColorer.fill(*myJunctionColorMode);
385  myJunctionColorMode->setNumVisible(4);
386  myJunctionColorInterpolation = new FXCheckButton(m41, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
387 
388  myJunctionColorSettingFrame = new FXVerticalFrame(frame4, GUIDesignViewSettingsVerticalFrame4);
389  myJunctionColorRainbow = new FXButton(frame4, "Recalibrate Rainbow", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
390  (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
391 
392  new FXHorizontalSeparator(frame4, GUIDesignHorizontalSeparator);
393  FXMatrix* m42 = new FXMatrix(frame4, 2, GUIDesignMatrixViewSettings);
394  myJunctionSizePanel = new SizePanel(m42, this, mySettings->junctionSize);
395  myDrawJunctionShape = new FXCheckButton(m42, "Draw junction shape", this, MID_SIMPLE_VIEW_COLORCHANGE);
396  myDrawJunctionShape->setCheck(mySettings->drawJunctionShape);
397  myDrawCrossingsAndWalkingAreas = new FXCheckButton(m42, "Draw crossings/walkingareas", this, MID_SIMPLE_VIEW_COLORCHANGE);
398  myDrawCrossingsAndWalkingAreas->setCheck(mySettings->drawCrossingsAndWalkingareas);
399  myShowLane2Lane = new FXCheckButton(m42, "Show lane to lane connections", this, MID_SIMPLE_VIEW_COLORCHANGE);
400  myShowLane2Lane->setCheck(mySettings->showLane2Lane);
401  new FXLabel(m42, " ", nullptr, GUIDesignViewSettingsLabel1);
402 
403  myTLIndexPanel = new NamePanel(m42, this, "Show link tls index", mySettings->drawLinkTLIndex);
404  myJunctionIndexPanel = new NamePanel(m42, this, "Show link junction index", mySettings->drawLinkJunctionIndex);
405  myJunctionIDPanel = new NamePanel(m42, this, "Show junction id", mySettings->junctionID);
406  myInternalJunctionNamePanel = new NamePanel(m42, this, "Show internal junction id", mySettings->internalJunctionName);
407  myInternalEdgeNamePanel = new NamePanel(m42, this, "Show internal edge id", mySettings->internalEdgeName);
408  myCwaEdgeNamePanel = new NamePanel(m42, this, "Show crossing and walkingarea id", mySettings->cwaEdgeName);
409  myTLSPhaseIndexPanel = new NamePanel(m42, this, "Show traffic light phase index", mySettings->tlsPhaseIndex);
410  myTLSPhaseNamePanel = new NamePanel(m42, this, "Show traffic light phase name", mySettings->tlsPhaseName);
411  myJunctionNamePanel = new NamePanel(m42, this, "Show junction name", mySettings->junctionName);
412  }
413  {
414  // detectors / triggers
415  new FXTabItem(tabbook, "Additional", nullptr, GUIDesignViewSettingsTabItemBook1);
416  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
417  FXVerticalFrame* frame5 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
418 
419  FXMatrix* m51 = new FXMatrix(frame5, 2, GUIDesignMatrixViewSettings);
420  myAddNamePanel = new NamePanel(m51, this, "Show object id", mySettings->addName);
421  myAddFullNamePanel = new NamePanel(m51, this, "Show full name", mySettings->addFullName);
422  new FXHorizontalSeparator(frame5, GUIDesignHorizontalSeparator);
423 
424  FXMatrix* m52 = new FXMatrix(frame5, 2, GUIDesignMatrixViewSettings);
425  myAddSizePanel = new SizePanel(m52, this, mySettings->addSize);
426 
427  /*
428  new FXLabel(m522, "Color", 0, GUIDesignViewSettingsLabel1);
429  myDetectorNameColor = new FXColorWell(m522, MFXUtils::getFXColor(settings->addNameColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell3);
430  */
431  }
432  {
433  // POIs
434  new FXTabItem(tabbook, "POIs", nullptr, GUIDesignViewSettingsTabItemBook1);
435  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
436  FXVerticalFrame* frame6 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
437 
438  FXMatrix* m63 = new FXMatrix(frame6, 3, GUIDesignViewSettingsMatrix3);
439  new FXLabel(m63, "Color", nullptr, GUIDesignViewSettingsLabel1);
440  myPOIColorMode = new MFXIconComboBox(m63, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
441  mySettings->poiColorer.fill(*myPOIColorMode);
442  myPOIColorMode->setNumVisible(3);
443  myPOIColorInterpolation = new FXCheckButton(m63, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
444  myPOIColorSettingFrame = new FXVerticalFrame(frame6, GUIDesignViewSettingsVerticalFrame4);
445 
446  new FXHorizontalSeparator(frame6, GUIDesignHorizontalSeparator);
447 
448  FXMatrix* m61 = new FXMatrix(frame6, 2, GUIDesignMatrixViewSettings);
449  myPOINamePanel = new NamePanel(m61, this, "Show poi id", mySettings->poiName);
450  myPOITypePanel = new NamePanel(m61, this, "Show poi type", mySettings->poiType);
451  myPOITextPanel = new NamePanel(m61, this, "Show poi text param", mySettings->poiText);
452  myPOITextParamKey = new FXComboBox(myPOITextPanel->myMatrix0, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
453  myPOITextParamKey->setEditable(true);
454  new FXHorizontalSeparator(frame6, GUIDesignHorizontalSeparator);
455 
456  FXMatrix* m62 = new FXMatrix(frame6, 2, GUIDesignMatrixViewSettings);
457  myPOISizePanel = new SizePanel(m62, this, mySettings->poiSize);
458 
459 
460  }
461  {
462  // Polygons
463  new FXTabItem(tabbook, "Polygons", nullptr, GUIDesignViewSettingsTabItemBook1);
464  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
465  FXVerticalFrame* frame9 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
466 
467  FXMatrix* m63 = new FXMatrix(frame9, 3, GUIDesignViewSettingsMatrix3);
468  new FXLabel(m63, "Color", nullptr, GUIDesignViewSettingsLabel1);
469  myPolyColorMode = new MFXIconComboBox(m63, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
470  mySettings->polyColorer.fill(*myPolyColorMode);
471  myPolyColorMode->setNumVisible(3);
472  myPolyColorInterpolation = new FXCheckButton(m63, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
473  myPolyColorSettingFrame = new FXVerticalFrame(frame9, GUIDesignViewSettingsVerticalFrame4);
474 
475  new FXHorizontalSeparator(frame9, GUIDesignHorizontalSeparator);
476 
477  FXMatrix* m91 = new FXMatrix(frame9, 2, GUIDesignMatrixViewSettings);
478  myPolyNamePanel = new NamePanel(m91, this, "Show polygon id", mySettings->polyName);
479  myPolyTypePanel = new NamePanel(m91, this, "Show polygon types", mySettings->polyType);
480  new FXHorizontalSeparator(frame9, GUIDesignHorizontalSeparator);
481 
482  myPolySizePanel = new SizePanel(m91, this, mySettings->polySize);
483  }
484  if (settings->netedit) {
485  // Selection
486  new FXTabItem(tabbook, "Selection", nullptr, GUIDesignViewSettingsTabItemBook1);
487  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
488  FXVerticalFrame* frame10 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
489 
490  FXMatrix* m102 = new FXMatrix(frame10, 2, GUIDesignMatrixViewSettings);
491  new FXLabel(m102, "Default Selection Color", nullptr, GUIDesignViewSettingsLabel1);
492  new FXLabel(m102, "", nullptr, GUIDesignViewSettingsLabel1);
493 
494  new FXLabel(m102, "Miscellaneous", nullptr, GUIDesignViewSettingsLabel1);
495  mySelectionColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
496  new FXLabel(m102, "Edge", nullptr, GUIDesignViewSettingsLabel1);
497  mySelectedEdgeColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedEdgeColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
498  new FXLabel(m102, "Lane Edge", nullptr, GUIDesignViewSettingsLabel1);
499  mySelectedLaneColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedLaneColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
500  new FXLabel(m102, "Connection", nullptr, GUIDesignViewSettingsLabel1);
501  mySelectedConnectionColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedConnectionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
502  new FXLabel(m102, "Prohibition", nullptr, GUIDesignViewSettingsLabel1);
503  mySelectedProhibitionColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedProhibitionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
504  new FXLabel(m102, "Crossing", nullptr, GUIDesignViewSettingsLabel1);
505  mySelectedCrossingColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedCrossingColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
506  new FXLabel(m102, "Additional", nullptr, GUIDesignViewSettingsLabel1);
507  mySelectedAdditionalColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedAdditionalColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
508  new FXLabel(m102, "Route", nullptr, GUIDesignViewSettingsLabel1);
509  mySelectedRouteColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedRouteColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
510  new FXLabel(m102, "Vehicle", nullptr, GUIDesignViewSettingsLabel1);
511  mySelectedVehicleColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedVehicleColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
512  new FXLabel(m102, "Person", nullptr, GUIDesignViewSettingsLabel1);
513  mySelectedPersonColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedPersonColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
514  new FXLabel(m102, "PersonPlan", nullptr, GUIDesignViewSettingsLabel1);
515  mySelectedPersonPlanColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedPersonPlanColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
516  new FXLabel(m102, "edgeData", nullptr, GUIDesignViewSettingsLabel1);
517  mySelectedEdgeDataColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedEdgeDataColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
518  }
519  {
520  // Legend
521  new FXTabItem(tabbook, "Legend", nullptr, GUIDesignViewSettingsTabItemBook1);
522  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
523  FXVerticalFrame* frame7 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
524 
525  FXMatrix* m72 = new FXMatrix(frame7, 2, GUIDesignMatrixViewSettings);
526  myShowSizeLegend = new FXCheckButton(m72, "Show Size Legend", this, MID_SIMPLE_VIEW_COLORCHANGE);
527  myShowSizeLegend->setCheck(mySettings->showSizeLegend);
528  new FXLabel(m72, "");
529  myShowColorLegend = new FXCheckButton(m72, "Show Edge Color Legend", this, MID_SIMPLE_VIEW_COLORCHANGE);
530  myShowColorLegend->setCheck(mySettings->showColorLegend);
531  new FXLabel(m72, "");
532  myShowVehicleColorLegend = new FXCheckButton(m72, "Show Vehicle Color Legend", this, MID_SIMPLE_VIEW_COLORCHANGE);
533  myShowVehicleColorLegend->setCheck(mySettings->showVehicleColorLegend);
534  new FXLabel(m72, "");
535  }
536  {
537  // openGL
538  new FXTabItem(tabbook, "openGL", nullptr, GUIDesignViewSettingsTabItemBook1);
539  FXScrollWindow* genScroll = new FXScrollWindow(tabbook);
540  FXVerticalFrame* frame8 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2);
541 
542  FXMatrix* m82 = new FXMatrix(frame8, 1, GUIDesignMatrixViewSettings);
543  myDither = new FXCheckButton(m82, "Dither", this, MID_SIMPLE_VIEW_COLORCHANGE);
544  myDither->setCheck(mySettings->dither);
545  FXMatrix* m83 = new FXMatrix(frame8, 1, GUIDesignMatrixViewSettings);
546  myFPS = new FXCheckButton(m83, "FPS", this, MID_SIMPLE_VIEW_COLORCHANGE);
547  myFPS->setCheck(mySettings->fps);
548  FXMatrix* m84 = new FXMatrix(frame8, 1, GUIDesignMatrixViewSettings);
549  myDrawBoundaries = new FXCheckButton(m84, "Draw boundaries", this, MID_SIMPLE_VIEW_COLORCHANGE);
550  myDrawBoundaries->setCheck(mySettings->drawBoundaries);
551  FXMatrix* m85 = new FXMatrix(frame8, 1, GUIDesignMatrixViewSettings);
552  myForceDrawForPositionSelection = new FXCheckButton(m85, "Force draw for position selection", this, MID_SIMPLE_VIEW_COLORCHANGE);
553  myForceDrawForPositionSelection->setCheck(mySettings->forceDrawForPositionSelection);
554  FXMatrix* m86 = new FXMatrix(frame8, 1, GUIDesignMatrixViewSettings);
555  myForceDrawForRectangleSelection = new FXCheckButton(m86, "Force draw for rectangle selection", this, MID_SIMPLE_VIEW_COLORCHANGE);
556  myForceDrawForRectangleSelection->setCheck(mySettings->forceDrawForRectangleSelection);
557  }
558  FXHorizontalFrame* f2 = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame2);
559  FXButton* initial = new FXButton(f2, "&OK", nullptr, this, MID_SETTINGS_OK, GUIDesignViewSettingsButton2);
560  new FXButton(f2, "&Cancel", nullptr, this, MID_SETTINGS_CANCEL, GUIDesignViewSettingsButton3);
561  initial->setFocus();
562 
563  rebuildColorMatrices(false);
565  loadWindowSize();
566 }
567 
568 
570  myParent->remove(this);
571  // delete name panels
574  delete myTLSPhaseIndexPanel;
575  delete myTLSPhaseNamePanel;
576  delete myCwaEdgeNamePanel;
577  delete myStreetNamePanel;
578  delete myEdgeValuePanel;
579  delete myJunctionIndexPanel;
580  delete myTLIndexPanel;
581  delete myJunctionIDPanel;
582  delete myJunctionNamePanel;
583  delete myVehicleNamePanel;
584  delete myVehicleValuePanel;
585  delete myVehicleTextPanel;
586  delete myPersonNamePanel;
587  delete myPersonValuePanel;
588  delete myAddNamePanel;
589  delete myAddFullNamePanel;
590  delete myPOINamePanel;
591  delete myPOITypePanel;
592  delete myPOITextPanel;
593  delete myPolyNamePanel;
594  delete myPolyTypePanel;
595  delete myEdgeNamePanel;
596  // delete size panels
597  delete myVehicleSizePanel;
598  delete myPersonSizePanel;
599  delete myJunctionSizePanel;
600  delete myPOISizePanel;
601  delete myPolySizePanel;
602  delete myAddSizePanel;
603 }
604 
605 
606 void
608  // update buttons that can be changed externally
609  myShowGrid->setCheck(mySettings->showGrid);
610  FXDialogBox::show();
611 }
612 
613 
614 void
616  mySettings = settings;
617  myBackup = (*settings);
618  onCmdNameChange(nullptr, 0, nullptr);
619 }
620 
621 
622 long
623 GUIDialog_ViewSettings::onCmdOk(FXObject*, FXSelector, void*) {
624  saveWindowSize();
625  hide();
626  return 1;
627 }
628 
629 
630 long
631 GUIDialog_ViewSettings::onCmdCancel(FXObject*, FXSelector, void*) {
632  saveWindowSize();
633  hide();
634  (*mySettings) = myBackup;
635  return 1;
636 }
637 
638 
639 long
640 GUIDialog_ViewSettings::onCmdNameChange(FXObject*, FXSelector, void* data) {
641  if (data != nullptr) {
642  FXString dataS = (char*) data; // !!!unicode
643  // check whether this item has been added twice
644  if (dataS == mySchemeName->getItemText(mySchemeName->getNumItems() - 1)) {
645  for (int i = 0; i < mySchemeName->getNumItems() - 1; ++i) {
646  if (dataS == mySchemeName->getItemText(i)) {
647  mySchemeName->removeItem(i);
648  }
649  }
650  }
651  myBackup = gSchemeStorage.get(dataS.text());
652  mySettings = &gSchemeStorage.get(dataS.text());
653  }
654  rebuildColorMatrices(true);
655 
657  if (mySettings->netedit) {
670  }
671 
672  myLaneEdgeColorMode->setCurrentItem((FXint) mySettings->getLaneEdgeMode());
673  myLaneEdgeScaleMode->setCurrentItem((FXint) mySettings->getLaneEdgeScaleMode());
678  myShowRails->setCheck(mySettings->showRails);
692 
693  myVehicleColorMode->setCurrentItem((FXint) mySettings->vehicleColorer.getActive());
696  myShowMinGap->setCheck(mySettings->drawMinGap);
700  /*
701  myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
702  */
707 
708  myPersonColorMode->setCurrentItem((FXint) mySettings->personColorer.getActive());
709  myPersonShapeDetail->setCurrentItem(mySettings->personQuality);
713 
714  myContainerColorMode->setCurrentItem((FXint) mySettings->containerColorer.getActive());
718 
719  myJunctionColorMode->setCurrentItem((FXint) mySettings->junctionColorer.getActive());
728 
732 
737 
741 
745  myDither->setCheck(mySettings->dither);
746  myFPS->setCheck(mySettings->fps);
753 
755  update();
756  myParent->update();
757  return 1;
758 }
759 
760 
761 bool
762 GUIDialog_ViewSettings::updateColorRanges(FXObject* sender, std::vector<FXColorWell*>::const_iterator colIt,
763  std::vector<FXColorWell*>::const_iterator colEnd,
764  std::vector<FXRealSpinner*>::const_iterator threshIt,
765  std::vector<FXRealSpinner*>::const_iterator threshEnd,
766  std::vector<FXButton*>::const_iterator buttonIt,
767  GUIColorScheme& scheme) {
768  UNUSED_PARAMETER(threshEnd);
769  int pos = 0;
770  while (colIt != colEnd) {
771  if (scheme.isFixed()) {
772  if (sender == *colIt) {
773  scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
774  }
775  } else {
776  if (sender == *threshIt) {
777  const double val = (*threshIt)->getValue();
778  scheme.setThreshold(pos, val);
779  return false;
780  }
781  if (sender == *colIt) {
782  scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
783  return false;
784  }
785  if (sender == *buttonIt) {
786  scheme.addColor(MFXUtils::getRGBColor((*colIt)->getRGBA()), (*threshIt)->getValue());
787  return true;
788  } else if (sender == *(buttonIt + 1)) {
789  scheme.removeColor(pos);
790  return true;
791  }
792  // 2 buttons per item (add / remove)
793  threshIt++;
794  buttonIt += 2;
795  }
796  ++colIt;
797  pos++;
798  }
799  return false;
800 }
801 
802 
803 bool
804 GUIDialog_ViewSettings::updateScaleRanges(FXObject* sender, std::vector<FXRealSpinner*>::const_iterator scaleIt,
805  std::vector<FXRealSpinner*>::const_iterator scaleEnd,
806  std::vector<FXRealSpinner*>::const_iterator threshIt,
807  std::vector<FXRealSpinner*>::const_iterator threshEnd,
808  std::vector<FXButton*>::const_iterator buttonIt,
809  GUIScaleScheme& scheme) {
810  int pos = 0;
811  while (scaleIt != scaleEnd) {
812  if (scheme.isFixed()) {
813  if (sender == *scaleIt) {
814  scheme.setColor(pos, (*scaleIt)->getValue());
815  }
816  } else {
817  if (sender == *threshIt) {
818  const double val = (*threshIt)->getValue();
819  double lo, hi;
820  if (pos != 0) {
821  threshIt--;
822  (*threshIt)->getRange(lo, hi);
823  (*threshIt)->setRange(lo, val);
824  threshIt++;
825  }
826  threshIt++;
827  if (threshIt != threshEnd) {
828  (*threshIt)->getRange(lo, hi);
829  (*threshIt)->setRange(val, hi);
830  }
831  scheme.setThreshold(pos, val);
832  return false;
833  }
834  if (sender == *scaleIt) {
835  scheme.setColor(pos, (*scaleIt)->getValue());
836  return false;
837  }
838  if (sender == *buttonIt) {
839  scheme.addColor((*scaleIt)->getValue(), (*threshIt)->getValue());
840  return true;
841  } else if (sender == *(buttonIt + 1)) {
842  scheme.removeColor(pos);
843  return true;
844  }
845  threshIt++;
846  buttonIt += 2;
847  }
848  ++scaleIt;
849  pos++;
850  }
851  return false;
852 }
853 
854 
855 long
856 GUIDialog_ViewSettings::onCmdColorChange(FXObject* sender, FXSelector, void* /*val*/) {
857  GUIVisualizationSettings tmpSettings = *mySettings;
858  int prevLaneMode = mySettings->getLaneEdgeMode();
859  int prevLaneScaleMode = mySettings->getLaneEdgeScaleMode();
860  int prevVehicleMode = mySettings->vehicleColorer.getActive();
861  int prevPersonMode = mySettings->personColorer.getActive();
862  int prevContainerMode = mySettings->containerColorer.getActive();
863  int prevJunctionMode = mySettings->junctionColorer.getActive();
864  int prevPOIMode = mySettings->poiColorer.getActive();
865  int prevPolyMode = mySettings->polyColorer.getActive();
866  bool doRebuildColorMatrices = false;
867 
868  tmpSettings.name = mySettings->name;
869  tmpSettings.backgroundColor = MFXUtils::getRGBColor(myBackgroundColor->getRGBA());
870  if (mySettings->netedit) {
883  }
884 
885  tmpSettings.showGrid = (myShowGrid->getCheck() != FALSE);
886  tmpSettings.gridXSize = (double) myGridXSizeDialer->getValue();
887  tmpSettings.gridYSize = (double) myGridYSizeDialer->getValue();
888 
890  tmpSettings.edgeColorer.setActive(myLaneEdgeColorMode->getCurrentItem());
891  tmpSettings.edgeScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());
892  } else {
893  tmpSettings.laneColorer.setActive(myLaneEdgeColorMode->getCurrentItem());
894  tmpSettings.laneScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());
895  }
896  tmpSettings.laneShowBorders = (myShowLaneBorders->getCheck() != FALSE);
897  tmpSettings.showBikeMarkings = (myShowBikeMarkings->getCheck() != FALSE);
898  tmpSettings.showLinkDecals = (myShowLaneDecals->getCheck() != FALSE);
899  tmpSettings.showLinkRules = (myShowLinkRules->getCheck() != FALSE);
900  tmpSettings.showRails = (myShowRails->getCheck() != FALSE);
901  tmpSettings.edgeName = myEdgeNamePanel->getSettings();
903  tmpSettings.cwaEdgeName = myCwaEdgeNamePanel->getSettings();
904  tmpSettings.streetName = myStreetNamePanel->getSettings();
905  tmpSettings.edgeValue = myEdgeValuePanel->getSettings();
906  tmpSettings.hideConnectors = (myHideMacroConnectors->getCheck() != FALSE);
907  tmpSettings.showLaneDirection = (myShowLaneDirection->getCheck() != FALSE);
908  tmpSettings.showSublanes = (myShowSublanes->getCheck() != FALSE);
909  tmpSettings.spreadSuperposed = (mySpreadSuperposed->getCheck() != FALSE);
910  if (sender == myParamKey) {
912  tmpSettings.edgeParam = myParamKey->getText().text();
914  tmpSettings.laneParam = myParamKey->getText().text();
916  tmpSettings.edgeData = myParamKey->getText().text();
917  }
918  } else if (sender == myVehicleParamKey) {
920  tmpSettings.vehicleParam = myVehicleParamKey->getText().text();
921  }
922  } else if (sender == myVehicleTextPanel->myCheck) {
924  } else if (sender == myVehicleTextParamKey) {
925  tmpSettings.vehicleTextParam = myVehicleTextParamKey->getText().text();
926  } else if (sender == myPOITextPanel->myCheck) {
927  updatePOIParams();
928  } else if (sender == myPOITextParamKey) {
929  tmpSettings.poiTextParam = myPOITextParamKey->getText().text();
930  }
931  tmpSettings.edgeValueHideCheck = (myLaneColorRainbowCheck->getCheck() != FALSE);
932  tmpSettings.edgeValueHideThreshold = myLaneColorRainbowThreshold->getValue();
933  tmpSettings.laneWidthExaggeration = myLaneWidthUpscaleDialer->getValue();
934  tmpSettings.laneMinSize = myLaneMinWidthDialer->getValue();
935 
936  tmpSettings.vehicleColorer.setActive(myVehicleColorMode->getCurrentItem());
937  tmpSettings.vehicleQuality = myVehicleShapeDetail->getCurrentItem();
938  tmpSettings.showBlinker = (myShowBlinker->getCheck() != FALSE);
939  tmpSettings.drawMinGap = (myShowMinGap->getCheck() != FALSE);
940  tmpSettings.drawBrakeGap = (myShowBrakeGap->getCheck() != FALSE);
941  tmpSettings.showBTRange = (myShowBTRange->getCheck() != FALSE);
942  tmpSettings.showRouteIndex = (myShowRouteIndex->getCheck() != FALSE);
943  /*
944  tmpSettings.drawLaneChangePreference = (myShowLaneChangePreference->getCheck() != FALSE);
945  */
946  tmpSettings.vehicleName = myVehicleNamePanel->getSettings();
948  tmpSettings.vehicleText = myVehicleTextPanel->getSettings();
949  tmpSettings.vehicleSize = myVehicleSizePanel->getSettings();
950 
951  tmpSettings.personColorer.setActive(myPersonColorMode->getCurrentItem());
952  tmpSettings.personQuality = myPersonShapeDetail->getCurrentItem();
953  tmpSettings.personName = myPersonNamePanel->getSettings();
954  tmpSettings.personValue = myPersonValuePanel->getSettings();
955  tmpSettings.personSize = myPersonSizePanel->getSettings();
956 
957  tmpSettings.containerColorer.setActive(myContainerColorMode->getCurrentItem());
958  tmpSettings.containerQuality = myContainerShapeDetail->getCurrentItem();
961 
962  tmpSettings.junctionColorer.setActive(myJunctionColorMode->getCurrentItem());
963  tmpSettings.drawLinkTLIndex = myTLIndexPanel->getSettings();
965  tmpSettings.junctionID = myJunctionIDPanel->getSettings();
971 
972  tmpSettings.addName = myAddNamePanel->getSettings();
973  tmpSettings.addFullName = myAddFullNamePanel->getSettings();
974  tmpSettings.addSize = myAddSizePanel->getSettings();
975 
976  tmpSettings.poiColorer.setActive(myPOIColorMode->getCurrentItem());
977  tmpSettings.poiName = myPOINamePanel->getSettings();
978  tmpSettings.poiType = myPOITypePanel->getSettings();
979  tmpSettings.poiText = myPOITextPanel->getSettings();
980  tmpSettings.poiSize = myPOISizePanel->getSettings();
981 
982  tmpSettings.polyColorer.setActive(myPolyColorMode->getCurrentItem());
983  tmpSettings.polyName = myPolyNamePanel->getSettings();
984  tmpSettings.polyType = myPolyTypePanel->getSettings();
985  tmpSettings.polySize = myPolySizePanel->getSettings();
986 
987  tmpSettings.showLane2Lane = (myShowLane2Lane->getCheck() != FALSE);
988  tmpSettings.drawJunctionShape = (myDrawJunctionShape->getCheck() != FALSE);
989  tmpSettings.drawCrossingsAndWalkingareas = (myDrawCrossingsAndWalkingAreas->getCheck() != FALSE);
990  tmpSettings.dither = (myDither->getCheck() != FALSE);
991  tmpSettings.fps = (myFPS->getCheck() != FALSE);
992  tmpSettings.drawBoundaries = (myDrawBoundaries->getCheck() != FALSE);
993  tmpSettings.forceDrawForPositionSelection = (myForceDrawForPositionSelection->getCheck() != FALSE);
994  tmpSettings.forceDrawForRectangleSelection = (myForceDrawForRectangleSelection->getCheck() != FALSE);
995  tmpSettings.showSizeLegend = (myShowSizeLegend->getCheck() != FALSE);
996  tmpSettings.showColorLegend = (myShowColorLegend->getCheck() != FALSE);
997  tmpSettings.showVehicleColorLegend = (myShowVehicleColorLegend->getCheck() != FALSE);
998 
999  // lanes (colors)
1000  if (sender == myLaneColorRainbow) {
1001  myParent->buildColorRainbow(tmpSettings, tmpSettings.getLaneEdgeScheme(), tmpSettings.getLaneEdgeMode(), GLO_LANE,
1002  myLaneColorRainbowCheck->getCheck() != FALSE, myLaneColorRainbowThreshold->getValue());
1003  doRebuildColorMatrices = true;
1004  }
1005  if (sender == myJunctionColorRainbow) {
1006  myParent->buildColorRainbow(tmpSettings, tmpSettings.junctionColorer.getScheme(), tmpSettings.junctionColorer.getActive(), GLO_JUNCTION);
1007  doRebuildColorMatrices = true;
1008  }
1009  if (tmpSettings.getLaneEdgeMode() == prevLaneMode) {
1010  if (updateColorRanges(sender, myLaneColors.begin(), myLaneColors.end(),
1011  myLaneThresholds.begin(), myLaneThresholds.end(), myLaneButtons.begin(),
1012  tmpSettings.getLaneEdgeScheme())) {
1013  doRebuildColorMatrices = true;
1014  }
1015  if (sender == myLaneColorInterpolation) {
1016  tmpSettings.getLaneEdgeScheme().setInterpolated(myLaneColorInterpolation->getCheck() != FALSE);
1017  doRebuildColorMatrices = true;
1018  }
1019  } else {
1020  doRebuildColorMatrices = true;
1021  }
1022  // lanes (scaling)
1023  if (tmpSettings.getLaneEdgeScaleMode() == prevLaneScaleMode) {
1024  if (updateScaleRanges(sender, myLaneScales.begin(), myLaneScales.end(),
1026  tmpSettings.getLaneEdgeScaleScheme())) {
1027  doRebuildColorMatrices = true;
1028  }
1029  if (sender == myLaneScaleInterpolation) {
1030  tmpSettings.getLaneEdgeScaleScheme().setInterpolated(myLaneScaleInterpolation->getCheck() != FALSE);
1031  doRebuildColorMatrices = true;
1032  }
1033  } else {
1034  doRebuildColorMatrices = true;
1035  }
1036  // vehicles
1037  if (tmpSettings.vehicleColorer.getActive() == prevVehicleMode) {
1038  if (updateColorRanges(sender, myVehicleColors.begin(), myVehicleColors.end(),
1040  tmpSettings.vehicleColorer.getScheme())) {
1041  doRebuildColorMatrices = true;
1042  }
1043  if (sender == myVehicleColorInterpolation) {
1044  tmpSettings.vehicleColorer.getScheme().setInterpolated(myVehicleColorInterpolation->getCheck() != FALSE);
1045  doRebuildColorMatrices = true;
1046  }
1047  } else {
1048  doRebuildColorMatrices = true;
1049  }
1050  // persons
1051  if (tmpSettings.personColorer.getActive() == prevPersonMode) {
1052  if (updateColorRanges(sender, myPersonColors.begin(), myPersonColors.end(),
1053  myPersonThresholds.begin(), myPersonThresholds.end(), myPersonButtons.begin(),
1054  tmpSettings.personColorer.getScheme())) {
1055  doRebuildColorMatrices = true;
1056  }
1057  if (sender == myPersonColorInterpolation) {
1058  tmpSettings.personColorer.getScheme().setInterpolated(myPersonColorInterpolation->getCheck() != FALSE);
1059  doRebuildColorMatrices = true;
1060  }
1061  } else {
1062  doRebuildColorMatrices = true;
1063  }
1064  // containers
1065  if (tmpSettings.containerColorer.getActive() == prevContainerMode) {
1066  if (updateColorRanges(sender, myContainerColors.begin(), myContainerColors.end(),
1068  tmpSettings.containerColorer.getScheme())) {
1069  doRebuildColorMatrices = true;
1070  }
1071  if (sender == myContainerColorInterpolation) {
1072  tmpSettings.containerColorer.getScheme().setInterpolated(myContainerColorInterpolation->getCheck() != FALSE);
1073  doRebuildColorMatrices = true;
1074  }
1075  } else {
1076  doRebuildColorMatrices = true;
1077  }
1078  // junctions
1079  if (tmpSettings.junctionColorer.getActive() == prevJunctionMode) {
1080  if (updateColorRanges(sender, myJunctionColors.begin(), myJunctionColors.end(),
1082  tmpSettings.junctionColorer.getScheme())) {
1083  doRebuildColorMatrices = true;
1084  }
1085  if (sender == myJunctionColorInterpolation) {
1086  tmpSettings.junctionColorer.getScheme().setInterpolated(myJunctionColorInterpolation->getCheck() != FALSE);
1087  doRebuildColorMatrices = true;
1088  }
1089  } else {
1090  doRebuildColorMatrices = true;
1091  }
1092  // POIs
1093  if (tmpSettings.poiColorer.getActive() == prevPOIMode) {
1094  if (updateColorRanges(sender, myPOIColors.begin(), myPOIColors.end(),
1095  myPOIThresholds.begin(), myPOIThresholds.end(), myPOIButtons.begin(),
1096  tmpSettings.poiColorer.getScheme())) {
1097  doRebuildColorMatrices = true;
1098  }
1099  if (sender == myPOIColorInterpolation) {
1100  tmpSettings.poiColorer.getScheme().setInterpolated(myPOIColorInterpolation->getCheck() != FALSE);
1101  doRebuildColorMatrices = true;
1102  }
1103  } else {
1104  doRebuildColorMatrices = true;
1105  }
1106  // polygons
1107  if (tmpSettings.polyColorer.getActive() == prevPolyMode) {
1108  if (updateColorRanges(sender, myPolyColors.begin(), myPolyColors.end(),
1109  myPolyThresholds.begin(), myPolyThresholds.end(), myPolyButtons.begin(),
1110  tmpSettings.polyColorer.getScheme())) {
1111  doRebuildColorMatrices = true;
1112  }
1113  if (sender == myPolyColorInterpolation) {
1114  tmpSettings.polyColorer.getScheme().setInterpolated(myPolyColorInterpolation->getCheck() != FALSE);
1115  doRebuildColorMatrices = true;
1116  }
1117  } else {
1118  doRebuildColorMatrices = true;
1119  }
1120 
1121  if (tmpSettings == *mySettings) {
1122  return 1;
1123  }
1124 
1125  int index = mySchemeName->getCurrentItem();
1126  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1127  // one of the initial settings is modified
1128  // every time this happens we create a new scheme
1129  int suffix = 1;
1130  while (gSchemeStorage.contains("custom_" + toString(suffix))) {
1131  suffix++;
1132  }
1133  tmpSettings.name = "custom_" + toString(suffix);
1134  // the newly created settings must be entered in several places:
1135  // - the comboBox mySchemeName of this dialog
1136  // - the comboBox of the parent view (set as active)
1137  // - the comboBox of all other views (only append) XXX @todo
1138  index = mySchemeName->appendItem(tmpSettings.name.c_str());
1139  mySchemeName->setCurrentItem(index);
1140  myParent->getColoringSchemesCombo()->appendItem(tmpSettings.name.c_str());
1141  }
1142  myParent->getColoringSchemesCombo()->setCurrentItem(
1143  myParent->getColoringSchemesCombo()->findItem(tmpSettings.name.c_str()));
1144  gSchemeStorage.add(tmpSettings); // overwrites existing
1145  mySettings = &gSchemeStorage.get(tmpSettings.name);
1146  myParent->setColorScheme(tmpSettings.name);
1147 
1148  if (doRebuildColorMatrices) {
1149  rebuildColorMatrices(true);
1150  }
1151  myParent->forceRefresh();
1152  getApp()->forceRefresh();
1153  return 1;
1154 }
1155 
1156 
1157 void
1158 GUIDialog_ViewSettings::loadSettings(const std::string& file) {
1159  GUISettingsHandler handler(file, true, mySettings->netedit);
1160  std::string settingsName = handler.addSettings(myParent);
1161  if (settingsName != "") {
1162  FXint index = mySchemeName->appendItem(settingsName.c_str());
1163  mySchemeName->setCurrentItem(index);
1164  mySettings = &gSchemeStorage.get(settingsName);
1165  }
1166  if (handler.hasDecals()) {
1167  myDecalsLock->lock();
1168  (*myDecals) = handler.getDecals();
1169  rebuildList();
1170  myParent->update();
1171  myDecalsLock->unlock();
1172  }
1173  if (handler.getDelay() >= 0) {
1174  myParent->setDelay(handler.getDelay());
1175  }
1176  if (handler.getBreakpoints().size() > 0) {
1178  }
1179  handler.applyViewport(myParent);
1180  rebuildColorMatrices(true);
1181 }
1182 
1183 
1184 void
1186  std::vector<GUISUMOAbstractView::Decal>::iterator j;
1187  for (j = myDecals->begin(); j != myDecals->end(); ++j) {
1190  dev.writeAttr("file", d.filename);
1196  dev.writeAttr("altitude", d.altitude);
1197  dev.writeAttr("rotation", d.rot);
1198  dev.writeAttr("tilt", d.tilt);
1199  dev.writeAttr("roll", d.roll);
1201  dev.writeAttr("screenRelative", d.screenRelative);
1202  dev.closeTag();
1203  }
1204 }
1205 
1206 
1207 void
1208 GUIDialog_ViewSettings::loadDecals(const std::string& file) {
1209  myDecalsLock->lock();
1210  GUISettingsHandler handler(file);
1211  if (handler.hasDecals()) {
1212  (*myDecals) = handler.getDecals();
1213  }
1214  rebuildList();
1215  myParent->update();
1216  myDecalsLock->unlock();
1217 }
1218 
1219 
1220 long
1221 GUIDialog_ViewSettings::onCmdSaveSetting(FXObject*, FXSelector, void* /*data*/) {
1222  int index = mySchemeName->getCurrentItem();
1223  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1224  return 1;
1225  }
1226  // get the name
1227  std::string name = "";
1228  while (name.length() == 0) {
1229  FXDialogBox dialog(this, "Enter a name", GUIDesignViewSettingsDialog);
1230  FXVerticalFrame* content = new FXVerticalFrame(&dialog, GUIDesignViewSettingsVerticalFrame5);
1231  new FXLabel(content, "Please enter an alphanumeric name: ", nullptr, GUIDesignViewSettingsLabel2);
1232  FXTextField* text = new FXTextField(content, 40, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsTextField1);
1233  new FXHorizontalSeparator(content, GUIDesignHorizontalSeparator);
1234  FXHorizontalFrame* buttons = new FXHorizontalFrame(content, GUIDesignViewSettingsHorizontalFrame3);
1235  new FXButton(buttons, "&OK", nullptr, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsButton4);
1236  new FXButton(buttons, "&Cancel", nullptr, &dialog, FXDialogBox::ID_CANCEL, GUIDesignViewSettingsButton5);
1237  dialog.create();
1238  text->setFocus();
1239  if (!dialog.execute()) {
1240  return 1;
1241  }
1242  name = text->getText().text();
1243  for (int i = 0; i < (int)name.length(); ++i) {
1244  if (name[i] != '_' && (name[i] < 'a' || name[i] > 'z') && (name[i] < 'A' || name[i] > 'Z') && (name[i] < '0' || name[i] > '9')) {
1245  name = "";
1246  break;
1247  }
1248  }
1249  }
1250  GUIVisualizationSettings tmpSettings = *mySettings;
1252  tmpSettings.name = name;
1253  gSchemeStorage.add(tmpSettings);
1254  mySchemeName->setItemText(index, tmpSettings.name.c_str());
1255  myParent->getColoringSchemesCombo()->setItemText(index, tmpSettings.name.c_str());
1256  myParent->setColorScheme(tmpSettings.name);
1257  mySettings = &gSchemeStorage.get(name);
1258  myBackup = *mySettings;
1259  gSchemeStorage.writeSettings(getApp());
1260  return 1;
1261 }
1262 
1263 
1264 long
1265 GUIDialog_ViewSettings::onUpdSaveSetting(FXObject* sender, FXSelector, void* ptr) {
1266  sender->handle(this,
1267  mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1268  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1269  ptr);
1270  return 1;
1271 }
1272 
1273 
1274 long
1275 GUIDialog_ViewSettings::onCmdDeleteSetting(FXObject*, FXSelector, void* /*data*/) {
1276  int index = mySchemeName->getCurrentItem();
1277  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1278  return 1;
1279  }
1280  std::string name = mySchemeName->getItem(index).text();
1281  gSchemeStorage.remove(name);
1282  mySchemeName->removeItem(index);
1283  onCmdNameChange(nullptr, 0, (void*) mySchemeName->getItem(0).text());
1284  gSchemeStorage.writeSettings(getApp());
1285  return 1;
1286 }
1287 
1288 
1289 long
1290 GUIDialog_ViewSettings::onUpdDeleteSetting(FXObject* sender, FXSelector, void* ptr) {
1291  sender->handle(this,
1292  mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1293  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1294  ptr);
1295  return 1;
1296 }
1297 
1298 
1299 long
1300 GUIDialog_ViewSettings::onCmdExportSetting(FXObject*, FXSelector, void* /*data*/) {
1301  FXString file = MFXUtils::getFilename2Write(this, "Export view settings", ".xml", GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder);
1302  if (file == "") {
1303  return 1;
1304  }
1305  try {
1306  OutputDevice& dev = OutputDevice::getDevice(file.text());
1308  mySettings->save(dev);
1309  if (mySaveViewPort->getCheck()) {
1311  }
1312  if (mySaveDelay->getCheck()) {
1313  dev.openTag(SUMO_TAG_DELAY);
1315  dev.closeTag();
1316  }
1317  if (mySaveDecals->getCheck()) {
1318  saveDecals(dev);
1319  }
1320  if (!mySettings->netedit && mySaveBreakpoints->getCheck()) {
1321  for (SUMOTime t : myParent->retrieveBreakpoints()) {
1324  dev.closeTag();
1325  }
1326  }
1327  dev.closeTag();
1328  dev.close();
1329  } catch (IOError& e) {
1330  FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what());
1331  }
1332  return 1;
1333 }
1334 
1335 
1336 long
1337 GUIDialog_ViewSettings::onUpdExportSetting(FXObject* sender, FXSelector, void* ptr) {
1338  sender->handle(this,
1339  (mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1340  && !mySaveViewPort->getCheck() && !mySaveDelay->getCheck() && !mySaveDecals->getCheck() && !mySaveBreakpoints->getCheck()) ?
1341  FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1342  ptr);
1343  return 1;
1344 }
1345 
1346 
1347 long
1348 GUIDialog_ViewSettings::onCmdImportSetting(FXObject*, FXSelector, void* /*data*/) {
1349  FXFileDialog opendialog(this, "Import view settings");
1350  opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY));
1351  opendialog.setSelectMode(SELECTFILE_ANY);
1352  opendialog.setPatternList("*.xml");
1353  if (gCurrentFolder.length() != 0) {
1354  opendialog.setDirectory(gCurrentFolder);
1355  }
1356  if (opendialog.execute()) {
1357  gCurrentFolder = opendialog.getDirectory();
1358  loadSettings(opendialog.getFilename().text());
1359  }
1360  return 1;
1361 }
1362 
1363 
1364 long
1365 GUIDialog_ViewSettings::onCmdLoadDecals(FXObject*, FXSelector, void* /*data*/) {
1366  FXFileDialog opendialog(this, "Load Decals");
1367  opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY));
1368  opendialog.setSelectMode(SELECTFILE_ANY);
1369  opendialog.setPatternList("*.xml");
1370  if (gCurrentFolder.length() != 0) {
1371  opendialog.setDirectory(gCurrentFolder);
1372  }
1373  if (opendialog.execute()) {
1374  gCurrentFolder = opendialog.getDirectory();
1375  loadDecals(opendialog.getFilename().text());
1376  }
1377  return 1;
1378 }
1379 
1380 
1381 long
1382 GUIDialog_ViewSettings::onCmdSaveDecals(FXObject*, FXSelector, void* /*data*/) {
1383  FXString file = MFXUtils::getFilename2Write(this, "Save Decals", ".xml", GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder);
1384  if (file == "") {
1385  return 1;
1386  }
1387  try {
1388  OutputDevice& dev = OutputDevice::getDevice(file.text());
1389  dev.openTag("decals");
1390  saveDecals(dev);
1391  dev.closeTag();
1392  dev.close();
1393  } catch (IOError& e) {
1394  FXMessageBox::error(myParent, MBOX_OK, "Storing failed!", "%s", e.what());
1395  }
1396  return 1;
1397 }
1398 
1399 
1400 
1401 
1402 long
1403 GUIDialog_ViewSettings::onUpdImportSetting(FXObject* sender, FXSelector, void* ptr) {
1404  sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1405  return 1;
1406 }
1407 
1408 
1409 void
1411  myDecalsTable->clearItems();
1412  const int cols = 8;
1413  // set table attributes
1414  const int numRows = MAX2((int)10, (int)myDecals->size() + 1);
1415  myDecalsTable->setTableSize(numRows, cols);
1416  myDecalsTable->setColumnText(0, "picture file");
1417  myDecalsTable->setColumnText(1, "center x");
1418  myDecalsTable->setColumnText(2, "center y");
1419  myDecalsTable->setColumnText(3, "width");
1420  myDecalsTable->setColumnText(4, "height");
1421  myDecalsTable->setColumnText(5, "rotation");
1422  myDecalsTable->setColumnText(6, "layer");
1423  myDecalsTable->setColumnText(7, "relative");
1424  FXHeader* header = myDecalsTable->getColumnHeader();
1425  header->setHeight(getApp()->getNormalFont()->getFontHeight() + getApp()->getNormalFont()->getFontAscent());
1426  int k;
1427  for (k = 0; k < cols; k++) {
1428  header->setItemJustify(k, GUIDesignViewSettingsMFXTableJustify);
1429  header->setItemSize(k, 60);
1430  }
1431  header->setItemSize(0, 150);
1432  // insert already known decals information into table
1433  FXint row = 0;
1434  std::vector<GUISUMOAbstractView::Decal>::iterator j;
1435  for (j = myDecals->begin(); j != myDecals->end(); ++j) {
1437  myDecalsTable->setItemText(row, 0, d.filename.c_str());
1438  myDecalsTable->setItemText(row, 1, toString<double>(d.centerX).c_str());
1439  myDecalsTable->setItemText(row, 2, toString<double>(d.centerY).c_str());
1440  myDecalsTable->setItemText(row, 3, toString<double>(d.width).c_str());
1441  myDecalsTable->setItemText(row, 4, toString<double>(d.height).c_str());
1442  myDecalsTable->setItemText(row, 5, toString<double>(d.rot).c_str());
1443  myDecalsTable->setItemText(row, 6, toString<double>(d.layer).c_str());
1444  myDecalsTable->setItemText(row, 7, toString<double>(d.screenRelative).c_str());
1445  row++;
1446  }
1447  // insert dummy last field
1448  for (k = 0; k < 7; k++) {
1449  myDecalsTable->setItemText(row, k, " ");
1450  }
1451 }
1452 
1453 
1454 FXMatrix*
1456  std::vector<FXColorWell*>& colors,
1457  std::vector<FXRealSpinner*>& thresholds,
1458  std::vector<FXButton*>& buttons,
1459  FXCheckButton* interpolation,
1460  GUIColorScheme& scheme) {
1461  MFXUtils::deleteChildren(frame);
1462  FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1463  colors.clear();
1464  thresholds.clear();
1465  buttons.clear();
1466  const bool fixed = scheme.isFixed();
1467  std::vector<RGBColor>::const_iterator colIt = scheme.getColors().begin();
1468  std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1469  std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1470  while (colIt != scheme.getColors().end()) {
1471  colors.push_back(new FXColorWell(m, MFXUtils::getFXColor(*colIt), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell1));
1472  if (fixed) {
1473  new FXLabel(m, nameIt->c_str());
1474  new FXLabel(m, "");
1475  new FXLabel(m, "");
1476  } else {
1477  const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1478  FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX | dialerOptions);
1479  threshDialer->setValue(*threshIt);
1480  thresholds.push_back(threshDialer);
1481  if (*threshIt == GUIVisualizationSettings::MISSING_DATA) {
1482  threshDialer->disable();
1483  threshDialer->hide();
1484  buttons.push_back(new FXButton(m, "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1485  buttons.back()->hide();
1486  buttons.push_back(new FXButton(m, "No Data", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1487  buttons.back()->disable();
1488  } else {
1489  buttons.push_back(new FXButton(m, "Add", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1490  buttons.push_back(new FXButton(m, "Remove", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1491  }
1492  }
1493  colIt++;
1494  threshIt++;
1495  nameIt++;
1496  }
1497  interpolation->setCheck(scheme.isInterpolated());
1498  if (fixed) {
1499  interpolation->disable();
1500  } else {
1501  if (colors.size() > 1) {
1502  interpolation->enable();
1503  if (interpolation->getCheck() != FALSE) {
1504  thresholds.front()->enable();
1505  } else {
1506  thresholds.front()->disable();
1507  }
1508  } else {
1509  interpolation->disable();
1510  thresholds.front()->disable();
1511  }
1512  }
1513  return m;
1514 }
1515 
1516 
1517 FXMatrix*
1519  std::vector<FXRealSpinner*>& scales,
1520  std::vector<FXRealSpinner*>& thresholds,
1521  std::vector<FXButton*>& buttons,
1522  FXCheckButton* interpolation,
1523  GUIScaleScheme& scheme) {
1524  MFXUtils::deleteChildren(frame);
1525  FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1526  scales.clear();
1527  thresholds.clear();
1528  buttons.clear();
1529  const bool fixed = scheme.isFixed();
1530  std::vector<double>::const_iterator scaleIt = scheme.getColors().begin();
1531  std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1532  std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1533  while (scaleIt != scheme.getColors().end()) {
1534  FXRealSpinner* scaleDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX);
1535  scaleDialer->setValue(*scaleIt);
1536  scales.push_back(scaleDialer);
1537  if (fixed) {
1538  new FXLabel(m, nameIt->c_str());
1539  new FXLabel(m, "");
1540  new FXLabel(m, "");
1541  } else {
1542  const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1543  FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX | dialerOptions);
1544  threshDialer->setValue(*threshIt);
1545  thresholds.push_back(threshDialer);
1546  buttons.push_back(new FXButton(m, "Add", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1547  buttons.push_back(new FXButton(m, "Remove", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1548  }
1549  scaleIt++;
1550  threshIt++;
1551  nameIt++;
1552  }
1553  interpolation->setCheck(scheme.isInterpolated());
1554  if (fixed) {
1555  interpolation->disable();
1556  } else {
1557  if (scales.size() > 1) {
1558  interpolation->enable();
1559  if (interpolation->getCheck() != FALSE) {
1560  thresholds.front()->enable();
1561  } else {
1562  thresholds.front()->disable();
1563  }
1564  } else {
1565  interpolation->disable();
1566  thresholds.front()->disable();
1567  }
1568  }
1569  return m;
1570 }
1571 
1572 
1573 void
1575  // decals
1576  delete myDecalsTable;
1578  myDecalsTable->setVisibleRows(5);
1579  myDecalsTable->setVisibleColumns(7);
1580  myDecalsTable->setTableSize(5, 7);
1581  myDecalsTable->setBackColor(FXRGB(255, 255, 255));
1582  myDecalsTable->getRowHeader()->setWidth(0);
1583  for (int i = 1; i <= 5; ++i) {
1585  myDecalsTable->setNumberCellParams(i, -10000000, 10000000, 1, 10, 100, "%.2f");
1586  }
1587  rebuildList();
1588  if (doCreate) {
1589  myDecalsTable->create();
1590  }
1592  if (doCreate) {
1593  m->create();
1594  }
1596  myLaneColorRainbow->disable();
1597  } else {
1598  myLaneColorRainbow->enable();
1599  }
1601  myJunctionColorRainbow->disable();
1602  } else {
1603  myJunctionColorRainbow->enable();
1604  }
1605  std::string activeSchemeName = myLaneEdgeColorMode->getText().text();
1606  myParamKey->clearItems();
1608  myParamKey->appendItem(mySettings->edgeParam.c_str());
1609  for (const std::string& attr : myParent->getEdgeLaneParamKeys(true)) {
1610  if (attr != mySettings->edgeParam) {
1611  myParamKey->appendItem(attr.c_str());
1612  }
1613  }
1614  myParamKey->enable();
1615  } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_LANE_PARAM_NUMERICAL) {
1616  myParamKey->appendItem(mySettings->laneParam.c_str());
1617  for (const std::string& attr : myParent->getEdgeLaneParamKeys(false)) {
1618  if (attr != mySettings->laneParam) {
1619  myParamKey->appendItem(attr.c_str());
1620  }
1621  }
1622  myParamKey->enable();
1623  } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {
1624  myParamKey->appendItem(mySettings->edgeData.c_str());
1625  for (const std::string& attr : myParent->getEdgeDataAttrs()) {
1626  if (attr != mySettings->edgeData) {
1627  myParamKey->appendItem(attr.c_str());
1628  }
1629  }
1630  myParamKey->enable();
1631  myParamKey->setEditable(false);
1632  } else {
1633  myParamKey->disable();
1634  }
1635  myParamKey->setNumVisible(myParamKey->getNumItems());
1636  myLaneColorSettingFrame->getParent()->recalc();
1637 
1639  if (doCreate) {
1640  m->create();
1641  }
1642  myLaneScaleSettingFrame->getParent()->recalc();
1643 
1645  if (doCreate) {
1646  m->create();
1647  }
1648  activeSchemeName = myVehicleColorMode->getText().text();
1649  myVehicleParamKey->setEditable(true);
1652  myVehicleParamKey->enable();
1653  } else {
1654  myVehicleParamKey->disable();
1655  }
1656  myVehicleColorSettingFrame->getParent()->recalc();
1657 
1659  if (doCreate) {
1660  m->create();
1661  }
1662  myPersonColorSettingFrame->getParent()->recalc();
1664  if (doCreate) {
1665  m->create();
1666  }
1667  myContainerColorSettingFrame->getParent()->recalc();
1669  if (doCreate) {
1670  m->create();
1671  }
1672  myJunctionColorSettingFrame->getParent()->recalc();
1673  // POIs
1675  if (doCreate) {
1676  m->create();
1677  }
1678  myPOIColorSettingFrame->getParent()->recalc();
1679  // polygons
1681  if (doCreate) {
1682  m->create();
1683  }
1684  myPolyColorSettingFrame->getParent()->recalc();
1685 
1686  layout();
1687  update();
1688 }
1689 
1690 
1691 void
1693  myVehicleParamKey->clearItems();
1694  myVehicleTextParamKey->clearItems();
1695  myVehicleParamKey->appendItem(mySettings->vehicleParam.c_str());
1696  myVehicleTextParamKey->appendItem(mySettings->vehicleTextParam.c_str());
1697  for (const std::string& attr : myParent->getVehicleParamKeys(false)) {
1698  myVehicleParamKey->appendItem(attr.c_str());
1699  myVehicleTextParamKey->appendItem(attr.c_str());
1700  }
1701  myVehicleParamKey->setNumVisible(myVehicleParamKey->getNumItems());
1702  myVehicleTextParamKey->setNumVisible(myVehicleTextParamKey->getNumItems());
1703 }
1704 
1705 void
1707  myPOITextParamKey->clearItems();
1708  myPOITextParamKey->appendItem(mySettings->poiTextParam.c_str());
1709  for (const std::string& attr : myParent->getPOIParamKeys()) {
1710  myPOITextParamKey->appendItem(attr.c_str());
1711  }
1712  myPOITextParamKey->setNumVisible(myPOITextParamKey->getNumItems());
1713 }
1714 
1715 long
1716 GUIDialog_ViewSettings::onCmdEditTable(FXObject*, FXSelector, void* data) {
1718  std::string value = i->item->getText().text();
1719  // check whether the inserted value is empty
1720  if (value.find_first_not_of(" ") == std::string::npos) {
1721  return 1;
1722  }
1724  int row = i->row;
1725  // check whether we add a new entry or edit an existing entry
1726  if (row == static_cast<int>(myDecals->size())) {
1727  d.filename = "";
1728  d.centerX = double(myParent->getGridWidth() / 2.);
1729  d.centerY = double(myParent->getGridHeight() / 2.);
1730  d.width = 0.;
1731  d.height = 0.;
1732  d.initialised = false;
1733  d.rot = 0;
1734  d.layer = 0;
1735  d.screenRelative = false;
1736  myDecalsLock->lock();
1737  myDecals->push_back(d);
1738  myDecalsLock->unlock();
1739  } else if (row > static_cast<int>(myDecals->size())) {
1740  // ignore clicks two lines below existing entries
1741  return 1;
1742  } else {
1743  d = (*myDecals)[row];
1744  }
1745 
1746  switch (i->col) {
1747  case 0:
1748  if (d.initialised && d.filename != value) {
1749  d.initialised = false;
1750  }
1751  d.filename = StringUtils::trim(value);
1752  break;
1753  case 1:
1754  try {
1755  d.centerX = StringUtils::toDouble(value);
1756  } catch (NumberFormatException&) {
1757  std::string msg = "The value must be a float, is:" + value;
1758  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1759  }
1760  break;
1761  case 2:
1762  try {
1763  d.centerY = StringUtils::toDouble(value);
1764  } catch (NumberFormatException&) {
1765  std::string msg = "The value must be a float, is:" + value;
1766  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1767  }
1768  break;
1769  case 3:
1770  try {
1771  d.width = StringUtils::toDouble(value);
1772  } catch (NumberFormatException&) {
1773  std::string msg = "The value must be a float, is:" + value;
1774  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1775  }
1776  break;
1777  case 4:
1778  try {
1779  d.height = StringUtils::toDouble(value);
1780  } catch (NumberFormatException&) {
1781  std::string msg = "The value must be a float, is:" + value;
1782  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1783  }
1784  break;
1785  case 5:
1786  try {
1787  d.rot = StringUtils::toDouble(value);
1788  } catch (NumberFormatException&) {
1789  std::string msg = "The value must be a float, is:" + value;
1790  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1791  }
1792  break;
1793  case 6:
1794  try {
1795  d.layer = StringUtils::toDouble(value);
1796  } catch (NumberFormatException&) {
1797  std::string msg = "The value must be a float, is:" + value;
1798  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1799  }
1800  break;
1801  case 7:
1802  try {
1804  } catch (NumberFormatException&) {
1805  std::string msg = "The value must be a bool, is:" + value;
1806  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1807  }
1808  break;
1809  default:
1810  throw 1;
1811  }
1812  (*myDecals)[row] = d;
1813  if (!i->updateOnly) {
1814  rebuildList();
1815  }
1816  myParent->update();
1817  return 1;
1818 }
1819 
1820 
1821 std::string
1823  return mySchemeName->getItem(mySchemeName->getCurrentItem()).text();
1824 }
1825 
1826 
1827 void
1829  if (name.c_str() == mySchemeName->getItemText(mySchemeName->getCurrentItem())) {
1830  return;
1831  }
1832  for (int i = 0; i < mySchemeName->getNumItems(); ++i) {
1833  if (name.c_str() == mySchemeName->getItemText(i)) {
1834  mySchemeName->setCurrentItem(i);
1835  onCmdNameChange(nullptr, 0, (void*)name.c_str());
1836  return;
1837  }
1838  }
1839 }
1840 
1842  FXMatrix* parent,
1843  GUIDialog_ViewSettings* target,
1844  const std::string& title,
1845  const GUIVisualizationTextSettings& settings) {
1846  myCheck = new FXCheckButton(parent, title.c_str(), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1847  myCheck->setCheck(settings.show);
1848  myMatrix0 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1849  myConstSizeCheck = new FXCheckButton(myMatrix0, "constant text size", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1850  myConstSizeCheck->setCheck(settings.constSize);
1851  FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1852  new FXLabel(m1, "Size", nullptr, GUIDesignViewSettingsLabel1);
1853  mySizeDial = new FXRealSpinner(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1854  mySizeDial->setRange(5, 1000);
1855  mySizeDial->setValue(settings.size);
1856  FXMatrix* m2 = new FXMatrix(parent, 4, GUIDesignViewSettingsMatrix5);
1857  new FXLabel(m2, "Color", nullptr, GUIDesignViewSettingsLabel1);
1859  new FXLabel(m2, "Background", nullptr, GUIDesignViewSettingsLabel1);
1861 }
1862 
1863 
1866  return GUIVisualizationTextSettings(myCheck->getCheck() != FALSE,
1867  mySizeDial->getValue(),
1868  MFXUtils::getRGBColor(myColorWell->getRGBA()),
1869  MFXUtils::getRGBColor(myBGColorWell->getRGBA()),
1870  myConstSizeCheck->getCheck() != FALSE);
1871 }
1872 
1873 
1874 void
1876  myCheck->setCheck(settings.show);
1877  mySizeDial->setValue(settings.size);
1878  myColorWell->setRGBA(MFXUtils::getFXColor(settings.color));
1879  myBGColorWell->setRGBA(MFXUtils::getFXColor(settings.bgColor));
1880  myConstSizeCheck->setCheck(settings.constSize);
1881 }
1882 
1883 
1885  FXMatrix* parent,
1886  GUIDialog_ViewSettings* target,
1887  const GUIVisualizationSizeSettings& settings) {
1888  myCheck = new FXCheckButton(parent, "Draw with constant size when zoomed out", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1889  myCheck->setCheck(settings.constantSize);
1890  myCheckSelected = new FXCheckButton(parent, "Only for selected", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1891  myCheckSelected->setCheck(settings.constantSizeSelected);
1892  FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1893  new FXLabel(m1, "Minimum Size", nullptr, GUIDesignViewSettingsLabel1);
1894  myMinSizeDial = new FXRealSpinner(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1895  myMinSizeDial->setValue(settings.minSize);
1896  FXMatrix* m2 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1897  new FXLabel(m2, "Exaggerate by", nullptr, GUIDesignViewSettingsLabel1);
1898  myExaggerateDial = new FXRealSpinner(m2, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
1899  myExaggerateDial->setRange(0, 10000);
1900  myExaggerateDial->setValue(settings.exaggeration);
1901 }
1902 
1903 
1907  myMinSizeDial->getValue(), myExaggerateDial->getValue(),
1908  myCheck->getCheck() != FALSE,
1909  myCheckSelected->getCheck() != FALSE);
1910 }
1911 
1912 
1913 void
1915  myCheck->setCheck(settings.constantSize);
1916  myCheckSelected->setCheck(settings.constantSizeSelected);
1917  myMinSizeDial->setValue(settings.minSize);
1918  myExaggerateDial->setValue(settings.exaggeration);
1919 }
1920 
1921 
1922 void
1924  getApp()->reg().writeIntEntry("VIEWSETTINGS", "x", getX());
1925  getApp()->reg().writeIntEntry("VIEWSETTINGS", "y", getY());
1926  getApp()->reg().writeIntEntry("VIEWSETTINGS", "width", getWidth());
1927  getApp()->reg().writeIntEntry("VIEWSETTINGS", "height", getHeight());
1928 }
1929 
1930 void
1932  // ensure window is visible after switching screen resolutions
1933  const FXint minSize = 400;
1934  const FXint minTitlebarHeight = 20;
1935  setX(MAX2(0, MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "x", 150),
1936  getApp()->getRootWindow()->getWidth() - minSize)));
1937  setY(MAX2(minTitlebarHeight,
1938  MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "y", 150),
1939  getApp()->getRootWindow()->getHeight() - minSize)));
1940  setWidth(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "width", 700), minSize));
1941  setHeight(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "height", 500), minSize));
1942 }
1943 
1944 
1945 /****************************************************************************/
@ MID_SIMPLE_VIEW_NAMECHANGE
Informs the dialog about switching to another scheme.
Definition: GUIAppEnum.h:561
@ MID_SIMPLE_VIEW_SAVE
For the save-to-db - button.
Definition: GUIAppEnum.h:563
@ MID_TABLE
The Table.
Definition: GUIAppEnum.h:479
@ MID_SIMPLE_VIEW_IMPORT
For the import-from-file - button.
Definition: GUIAppEnum.h:569
@ MID_SIMPLE_VIEW_EXPORT
For the export-to-file - button.
Definition: GUIAppEnum.h:567
@ MID_SIMPLE_VIEW_DELETE
For the delete - button.
Definition: GUIAppEnum.h:565
@ MID_SETTINGS_OK
Ok-button was pushed.
Definition: GUIAppEnum.h:491
@ MID_SETTINGS_CANCEL
Cancel-button was pushed.
Definition: GUIAppEnum.h:493
@ MID_SIMPLE_VIEW_LOAD_DECALS
For the load-decals - button.
Definition: GUIAppEnum.h:571
@ MID_SIMPLE_VIEW_COLORCHANGE
Informs the dialog about a value's change.
Definition: GUIAppEnum.h:559
@ MID_SIMPLE_VIEW_SAVE_DECALS
For the save-decals - button.
Definition: GUIAppEnum.h:573
GUICompleteSchemeStorage gSchemeStorage
#define GUIDesignViewSettingsColorWell2
Definition: GUIDesigns.h:481
#define GUIDesignViewSettingsMatrix3
Definition: GUIDesigns.h:438
#define GUIDesignViewSettingsMainDialog
Definition: GUIDesigns.h:409
#define GUIDesignViewSettingsMatrix5
Definition: GUIDesigns.h:442
#define GUIDesignComboBoxStatic
Combo box static (not editable)
Definition: GUIDesigns.h:240
#define GUIDesignViewSettingsMFXTable
MFX Add/Edit Typed Table.
Definition: GUIDesigns.h:484
#define GUIDesignViewSettingsComboBox1
Combo boxs.
Definition: GUIDesigns.h:445
#define GUIDesignViewSettingsHorizontalFrame3
Definition: GUIDesigns.h:431
#define GUIDesignViewSettingsVerticalFrame6
Definition: GUIDesigns.h:424
#define GUIDesignViewSettingsHorizontalFrame2
Definition: GUIDesigns.h:429
#define GUIDesignViewSettingsButton2
Definition: GUIDesigns.h:470
#define GUIDesignButtonToolbar
little button with icon placed in navigation toolbar
Definition: GUIDesigns.h:91
#define GUIDesignViewSettingsMatrix1
Matrix.
Definition: GUIDesigns.h:434
#define GUIDesignViewSettingsColorWell1
Color wells.
Definition: GUIDesigns.h:479
#define GUIDesignViewSettingsButton4
Definition: GUIDesigns.h:474
#define GUIDesignViewSettingsDialog
Definition: GUIDesigns.h:411
#define GUIDesignViewSettingsMatrix4
Definition: GUIDesigns.h:440
#define GUIDesignViewSettingsSpinDial2
Definition: GUIDesigns.h:452
#define GUIDesignViewSettingsButton5
Definition: GUIDesigns.h:476
#define GUIDesignViewSettingsHorizontalFrame1
Horizontal frames.
Definition: GUIDesigns.h:427
#define GUIDesignViewSettingsSpinDial1
Definition: GUIDesigns.h:450
#define GUIDesignViewSettingsVerticalFrame5
Definition: GUIDesigns.h:422
#define GUIDesignViewSettingsMatrix2
Definition: GUIDesigns.h:436
#define GUIDesignViewSettingsLabel1
Label.
Definition: GUIDesigns.h:460
#define GUIDesignViewSettingsTabBook1
Tab books.
Definition: GUIDesigns.h:455
#define GUIDesignViewSettingsButton3
Definition: GUIDesigns.h:472
#define GUIDesignMatrixViewSettings
FXMatrix used to pack values in Viewsettings.
Definition: GUIDesigns.h:287
#define GUIDesignViewSettingsVerticalFrame2
Definition: GUIDesigns.h:416
#define GUIDesignViewSettingsVerticalFrame3
Definition: GUIDesigns.h:418
#define GUIDesignViewSettingsColorWell
ColorWell.
Definition: GUIDesigns.h:448
#define GUIDesignViewSettingsMFXTableJustify
Definition: GUIDesigns.h:486
#define GUIDesignHorizontalSeparator
Definition: GUIDesigns.h:362
#define GUIDesignViewSettingsVerticalFrame4
Definition: GUIDesigns.h:420
#define GUIDesignViewSettingsTabItemBook1
Definition: GUIDesigns.h:457
#define GUIDesignViewSettingsVerticalFrame1
vertical frames
Definition: GUIDesigns.h:414
#define GUIDesignViewSettingsLabel2
Definition: GUIDesigns.h:462
#define GUIDesignViewSettingsTextField1
textFields
Definition: GUIDesigns.h:465
#define GUIDesignCheckButtonViewSettings
CheckButton for Frames without thick extended over the frame.
Definition: GUIDesigns.h:145
#define GUIDesignViewSettingsButton1
Buttons.
Definition: GUIDesigns.h:468
FXDEFMAP(GUIDialog_ViewSettings) GUIDialog_ViewSettingsMap[]
@ GLO_JUNCTION
a junction
@ GLO_LANE
a lane
FXString gCurrentFolder
The folder used as last.
std::string time2string(SUMOTime t)
convert SUMOTime to string
Definition: SUMOTime.cpp:68
long long int SUMOTime
Definition: SUMOTime.h:31
@ SUMO_TAG_DELAY
@ SUMO_TAG_BREAKPOINT
@ SUMO_TAG_VIEWSETTINGS_DECAL
@ SUMO_TAG_VIEWSETTINGS
@ SUMO_ATTR_VALUE
@ SUMO_ATTR_CENTER_Y
@ SUMO_ATTR_LAYER
A layer number.
@ SUMO_ATTR_HEIGHT
@ SUMO_ATTR_CENTER_Z
@ SUMO_ATTR_CENTER_X
@ SUMO_ATTR_WIDTH
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:29
T MIN2(T a, T b)
Definition: StdDefs.h:73
T MAX2(T a, T b)
Definition: StdDefs.h:79
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:44
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
void add(const GUIVisualizationSettings &scheme)
Adds a visualization scheme.
int getNumInitialSettings() const
Returns the number of initial settings.
void remove(const std::string &name)
Removes the setting with the given name.
void writeSettings(FXApp *app)
Writes the current scheme into the registry.
void writeXML(OutputDevice &dev)
write the settings to the given device
GUIVisualizationTextSettings getSettings()
void update(const GUIVisualizationTextSettings &settings)
NamePanel(FXMatrix *parent, GUIDialog_ViewSettings *target, const std::string &title, const GUIVisualizationTextSettings &settings)
SizePanel(FXMatrix *parent, GUIDialog_ViewSettings *target, const GUIVisualizationSizeSettings &settings)
void update(const GUIVisualizationSizeSettings &settings)
GUIVisualizationSizeSettings getSettings()
The dialog to change the view (gui) settings.
long onCmdExportSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be exported into a file.
FXVerticalFrame * myVehicleColorSettingFrame
FXCheckButton * myVehicleColorInterpolation
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
FXCheckButton * myHideMacroConnectors
GUISUMOAbstractView * myParent
The parent view (which settings are changed)
FXMutex * myDecalsLock
Lock used when changing the decals.
void rebuildList()
Rebuilds the decals table.
std::vector< FXColorWell * > myPolyColors
FXVerticalFrame * myJunctionColorSettingFrame
long onCmdNameChange(FXObject *, FXSelector, void *)
Called if the name of the scheme was changed.
FXVerticalFrame * myContainerColorSettingFrame
FXRealSpinner * myLaneWidthUpscaleDialer
MFXIconComboBox * myPersonShapeDetail
std::vector< FXColorWell * > myPOIColors
MFXIconComboBox * myPOIColorMode
std::vector< FXButton * > myLaneScaleButtons
long onCmdSaveDecals(FXObject *, FXSelector, void *data)
Called if the decals shall be saved to a file.
std::vector< FXColorWell * > myPersonColors
std::vector< FXRealSpinner * > myPolyThresholds
FXCheckButton * myPOIColorInterpolation
std::vector< GUISUMOAbstractView::Decal > * myDecals
The parent's decals.
std::vector< FXButton * > myContainerButtons
std::vector< FXRealSpinner * > myJunctionThresholds
MFXIconComboBox * myVehicleShapeDetail
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.
std::vector< FXRealSpinner * > myPersonThresholds
void show()
show view settings dialog
std::vector< FXButton * > myJunctionButtons
MFXIconComboBox * myContainerColorMode
FXColorWell * mySelectedProhibitionColor
FXCheckButton * myShowVehicleColorLegend
MFXIconComboBox * myLaneEdgeColorMode
... lane colorer
FXCheckButton * myLaneColorRainbowCheck
MFXIconComboBox * myContainerShapeDetail
std::vector< FXColorWell * > myJunctionColors
FXRealSpinner * myLaneMinWidthDialer
void saveWindowSize()
save window position and size to the registry
FXCheckButton * myPersonColorInterpolation
FXColorWell * mySelectionColor
selection colors
FXVerticalFrame * myLaneScaleSettingFrame
std::vector< FXColorWell * > myVehicleColors
long onCmdLoadDecals(FXObject *, FXSelector, void *data)
Called if the decals shall be loaded from a file.
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.
MFXIconComboBox * myLaneEdgeScaleMode
... lane scaler
std::vector< FXRealSpinner * > myVehicleThresholds
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
FXCheckButton * myPolyColorInterpolation
std::vector< FXButton * > myPersonButtons
void loadWindowSize()
load window position and size from the registry
FXCheckButton * myJunctionColorInterpolation
long onCmdCancel(FXObject *, FXSelector, void *)
Called if the Cancel-button was pressed.
MFXAddEditTypedTable * myDecalsTable
FXVerticalFrame * myLaneColorSettingFrame
FXCheckButton * myLaneScaleInterpolation
FXCheckButton * myForceDrawForPositionSelection
long onCmdImportSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be read from a file.
MFXIconComboBox * myJunctionColorMode
long onUpdImportSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to read settings from a file.
void setCurrent(GUIVisualizationSettings *settings)
Sets current settings (called if reopened)
void rebuildColorMatrices(bool doCreate=false)
Rebuilds color changing dialogs after choosing another coloring scheme.
void saveDecals(OutputDevice &dev) const
Writes the currently used decals into a file.
FXVerticalFrame * myPolyColorSettingFrame
std::vector< FXRealSpinner * > myLaneScales
void loadSettings(const std::string &file)
Loads a scheme from a file.
MFXIconComboBox * myPersonColorMode
FXCheckButton * myDrawCrossingsAndWalkingAreas
std::vector< FXButton * > myLaneButtons
FXCheckButton * myLaneColorInterpolation
FXVerticalFrame * myPersonColorSettingFrame
FXCheckButton * myContainerColorInterpolation
std::vector< FXColorWell * > myLaneColors
GUIVisualizationSettings * mySettings
The current settings.
long onCmdDeleteSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be deleted.
void loadDecals(const std::string &file)
Loads decals from a file.
FXVerticalFrame * myPOIColorSettingFrame
long onCmdColorChange(FXObject *, FXSelector, void *)
Called if something (color, width, etc.) has been changed.
std::vector< FXColorWell * > myContainerColors
FXCheckButton * myForceDrawForRectangleSelection
std::vector< FXRealSpinner * > myLaneScaleThresholds
FXRealSpinner * myLaneColorRainbowThreshold
GUIVisualizationSettings myBackup
A backup of the settings (used if the "Cancel" button is pressed)
std::vector< FXRealSpinner * > myContainerThresholds
void updatePOIParams()
reload known POI parameters
long onCmdEditTable(FXObject *, FXSelector, void *data)
Called if the decals-table was changed.
long onCmdOk(FXObject *, FXSelector, void *)
Called if the OK-button was pressed.
long onCmdSaveSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be saved into the registry.
long onUpdSaveSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to save the settings into the registry.
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)
std::vector< FXRealSpinner * > myLaneThresholds
long onUpdDeleteSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to delete settings.
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)
long onUpdExportSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to export settings into a file.
std::vector< FXButton * > myPOIButtons
MFXIconComboBox * myVehicleColorMode
MFXIconComboBox * myPolyColorMode
void updateVehicleParams()
reload known vehicle parameters
std::vector< FXRealSpinner * > myPOIThresholds
std::vector< FXButton * > myPolyButtons
std::vector< FXButton * > myVehicleButtons
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
const std::string & getName() const
const std::vector< double > & getThresholds() const
void setColor(const int pos, const T &color)
void setThreshold(const int pos, const double threshold)
void removeColor(const int pos)
const std::vector< T > & getColors() const
int addColor(const T &color, const double threshold, const std::string &name="")
void setInterpolated(const bool interpolate, double interpolationStart=0.f)
bool isInterpolated() const
const std::vector< std::string > & getNames() const
bool allowsNegativeValues() const
virtual std::vector< std::string > getPOIParamKeys() const
return list of available vehicle parameters
void setDelay(double delay)
Sets the delay of the parent application.
GUIDialog_EditViewport * getViewportEditor()
get the viewport and create it on first access
virtual const std::vector< SUMOTime > retrieveBreakpoints() const
retrieve breakpoints if provided by the application
double getGridWidth() const
get grid width
double getDelay() const
Returns the delay of the parent application.
virtual std::vector< std::string > getEdgeDataAttrs() const
return list of loaded edgeData attributes
virtual std::vector< std::string > getVehicleParamKeys(bool) const
return list of available vehicle parameters
virtual std::vector< std::string > getEdgeLaneParamKeys(bool) const
return list of available edge parameters
double getGridHeight() const
get grid height
void setBreakpoints(const std::vector< SUMOTime > &breakpoints)
Sets the breakpoints of the parent application.
FXComboBox * getColoringSchemesCombo()
get coloring schemes combo
virtual bool setColorScheme(const std::string &)
set color scheme
virtual void buildColorRainbow(const GUIVisualizationSettings &, GUIColorScheme &, int, GUIGlObjectType, bool hide=false, double hideThreshold=0)
recalibrate color scheme according to the current value range
void remove(GUIDialog_EditViewport *)
remove viewport
An XML-handler for visualisation schemes.
double getDelay() const
Returns the parsed delay.
bool hasDecals() const
Returns whether any decals have been parsed.
std::string addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
const std::vector< SUMOTime > & getBreakpoints() const
Returns the parsed breakpoints.
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings addName
GUIVisualizationTextSettings tlsPhaseIndex
GUIVisualizationTextSettings vehicleName
GUIVisualizationTextSettings junctionName
RGBColor backgroundColor
The background color to use.
GUIVisualizationSizeSettings vehicleSize
GUIVisualizationSizeSettings containerSize
bool showBlinker
Information whether vehicle blinkers shall be drawn.
GUIVisualizationTextSettings internalEdgeName
GUIVisualizationSizeSettings junctionSize
bool drawBoundaries
enable or disable draw boundaries
static const std::string SCHEME_NAME_EDGEDATA_NUMERICAL
bool showBikeMarkings
Information whether bicycle lane marking shall be drawn.
GUIScaler laneScaler
The lane scaler.
bool dither
Information whether dithering shall be enabled.
GUIColorer vehicleColorer
The vehicle colorer.
GUIVisualizationTextSettings personValue
bool showLinkRules
Information whether link rules (colored bars) shall be drawn.
GUIVisualizationTextSettings poiType
GUIVisualizationSizeSettings addSize
std::string name
The name of this setting.
GUIColorer edgeColorer
The mesoscopic edge colorer.
int containerQuality
The quality of container drawing.
GUIVisualizationTextSettings internalJunctionName
GUIVisualizationSizeSettings poiSize
bool drawJunctionShape
whether the shape of the junction should be drawn
std::string edgeData
key for coloring by edgeData
int personQuality
The quality of person drawing.
GUIColorer poiColorer
The POI colorer.
GUIVisualizationTextSettings poiName
GUIVisualizationTextSettings vehicleValue
GUIColorer polyColorer
The polygon colorer.
int vehicleQuality
The quality of vehicle drawing.
GUIVisualizationTextSettings drawLinkJunctionIndex
static const std::string SCHEME_NAME_LANE_PARAM_NUMERICAL
GUIVisualizationTextSettings addFullName
GUIVisualizationTextSettings edgeValue
bool fps
Information whether frames-per-second should be drawn.
std::string vehicleParam
key for coloring by vehicle parameter
bool showRails
Information whether rails shall be drawn.
GUIVisualizationSizeSettings personSize
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
GUIVisualizationTextSettings cwaEdgeName
GUIVisualizationTextSettings junctionID
std::string vehicleTextParam
key for rendering vehicle textual parameter
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
GUIVisualizationColorSettings colorSettings
color settings
bool showSublanes
Whether to show sublane boundaries.
bool showGrid
Information whether a grid shall be shown.
bool showVehicleColorLegend
Information whether the vehicle color legend shall be drawn.
bool hideConnectors
flag to show or hidde connectors
static bool UseMesoSim
this should be set at the same time as MSGlobals::gUseMesoSim
GUIColorer personColorer
The person colorer.
void save(OutputDevice &dev) const
Writes the settings into an output device.
GUIScaleScheme & getLaneEdgeScaleScheme()
Returns the current lane (edge) scaling schme.
int getLaneEdgeMode() const
Returns the number of the active lane (edge) coloring schme.
bool forceDrawForRectangleSelection
flag to force draw for rectangle selection (see drawForRectangleSelection)
bool netedit
Whether the settings are for Netedit.
bool showLaneDirection
Whether to show direction indicators for lanes.
bool edgeValueHideCheck
value below which edge data value should not be rendered
GUIColorScheme & getLaneEdgeScheme()
Returns the current lane (edge) coloring schme.
GUIScaler edgeScaler
The mesoscopic edge scaler.
bool drawMinGap
Information whether the minimum gap shall be drawn.
GUIVisualizationTextSettings streetName
GUIVisualizationTextSettings poiText
GUIVisualizationTextSettings vehicleText
int getLaneEdgeScaleMode() const
Returns the number of the active lane (edge) scaling schme.
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
GUIColorer laneColorer
The lane colorer.
GUIVisualizationTextSettings polyName
bool laneShowBorders
Information whether lane borders shall be drawn.
GUIVisualizationTextSettings tlsPhaseName
GUIVisualizationTextSettings edgeName
bool showSizeLegend
Information whether the size legend shall be drawn.
double laneMinSize
The minimum visual lane width for drawing.
GUIVisualizationTextSettings drawLinkTLIndex
GUIVisualizationTextSettings containerName
GUIVisualizationSizeSettings polySize
GUIColorer containerColorer
The container colorer.
double gridXSize
Information about the grid spacings.
bool showBTRange
Information whether the communication range shall be drawn.
bool forceDrawForPositionSelection
flag to force draw for position selection (see drawForPositionSelection)
GUIVisualizationTextSettings personName
bool showColorLegend
Information whether the edge color legend shall be drawn.
std::string poiTextParam
key for rendering poi textual parameter
bool showRouteIndex
Information whether the route index should be shown.
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
static const std::string SCHEME_NAME_EDGE_PARAM_NUMERICAL
scheme names
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
GUIColorer junctionColorer
The junction colorer.
static const std::string SCHEME_NAME_PARAM_NUMERICAL
std::string edgeParam
key for coloring by edge parameter
bool drawBrakeGap
Information whether the brake gap shall be drawn.
GUIVisualizationTextSettings polyType
void setCellType(int pos, CellType t)
void setNumberCellParams(int pos, double min, double max, double steps1, double steps2, double steps3, const std::string &format)
static void deleteChildren(FXWindow *w)
Deletes all children of the given window.
Definition: MFXUtils.cpp:30
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition: MFXUtils.cpp:82
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:112
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:106
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:60
void close()
Closes the device and removes it from the dictionary.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:239
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
static std::string trim(const std::string s, const std::string &t=" \t\n")
remove leading and trailing whitespace
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
A decal (an image) that can be shown.
double tilt
The tilt of the image to the ground plane (in degrees)
double centerX
The center of the image in x-direction (net coordinates, in m)
double height
The height of the image (net coordinates in y-direction, in m)
double width
The width of the image (net coordinates in x-direction, in m)
bool initialised
Whether this image was initialised (inserted as a texture)
double rot
The rotation of the image in the ground plane (in degrees)
double layer
The layer of the image.
double altitude
The altitude of the image (net coordinates in z-direction, in m)
double centerY
The center of the image in y-direction (net coordinates, in m)
double centerZ
The center of the image in z-direction (net coordinates, in m)
std::string filename
The path to the file the image is located at.
double roll
The roll of the image to the ground plane (in degrees)
bool screenRelative
Whether this image should be skipped in 2D-views.
RGBColor selectionColor
basic selection color
RGBColor selectedEdgeColor
edge selection color
RGBColor selectedPersonPlanColor
person plan selection color (Rides, Walks, personStops...)
RGBColor selectedCrossingColor
crossings selection color
RGBColor selectedLaneColor
lane selection color
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
RGBColor selectedEdgeDataColor
edge data selection color
RGBColor selectedProhibitionColor
prohibition selection color
RGBColor selectedConnectionColor
connection selection color
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
RGBColor selectedVehicleColor
vehicle selection color
RGBColor selectedPersonColor
person selection color
double exaggeration
The size exaggeration (upscale)
bool constantSize
whether the object shall be drawn with constant size regardless of zoom
double minSize
The minimum size to draw this object.
bool constantSizeSelected
whether only selected objects shall be drawn with constant
RGBColor bgColor
background text color
bool constSize
@brif flag to avoid size changes
FXTableItem * item