Eclipse SUMO - Simulation of Urban MObility
GUIDialog_ViewSettings.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2022 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 /****************************************************************************/
20 // The dialog to change the view (gui) settings.
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
28 
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 class MFXIconComboBox;
34 
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
45 class GUIDialog_ViewSettings : public FXDialogBox {
47  FXDECLARE(GUIDialog_ViewSettings)
48 
49 public:
51  class NamePanel {
52 
53  public:
55  NamePanel(FXMatrix* parent, GUIDialog_ViewSettings* target,
56  const std::string& title,
57  const GUIVisualizationTextSettings& settings);
58 
61 
63  void update(const GUIVisualizationTextSettings& settings);
64 
66  FXCheckButton* myCheck;
67 
69  FXRealSpinner* mySizeDial;
70 
72  FXColorWell* myColorWell;
73 
75  FXColorWell* myBGColorWell;
76 
78  FXCheckButton* mySelectedCheck;
79 
81  FXCheckButton* myConstSizeCheck;
82 
84  FXMatrix* myMatrix0;
85  };
86 
88  class SizePanel {
89 
90  public:
92  SizePanel(FXMatrix* parent, GUIDialog_ViewSettings* target,
93  const GUIVisualizationSizeSettings& settings);
94 
97 
99  void update(const GUIVisualizationSizeSettings& settings);
100 
102  FXRealSpinner* myMinSizeDial;
103 
105  FXRealSpinner* myExaggerateDial;
106 
108  FXCheckButton* myCheck;
109 
111  FXCheckButton* myCheckSelected;
112  };
113 
123  GUIVisualizationSettings* settings,
124  std::vector<GUISUMOAbstractView::Decal>* decals,
125  FXMutex* decalsLock);
126 
129 
131  void show();
132 
136  void setCurrent(GUIVisualizationSettings* settings);
137 
140 
142  long onCmdOk(FXObject*, FXSelector, void*);
143 
145  long onCmdCancel(FXObject*, FXSelector, void*);
146 
148  long onCmdColorChange(FXObject*, FXSelector, void*);
149 
151  long onCmdEditTable(FXObject*, FXSelector, void* data);
152 
154  long onCmdNameChange(FXObject*, FXSelector, void*);
155 
157  long onCmdSaveSetting(FXObject*, FXSelector, void* data);
158 
160  long onUpdSaveSetting(FXObject*, FXSelector, void* data);
161 
163  long onCmdDeleteSetting(FXObject*, FXSelector, void* data);
164 
166  long onUpdDeleteSetting(FXObject*, FXSelector, void* data);
167 
169  long onCmdExportSetting(FXObject*, FXSelector, void* data);
170 
172  long onUpdExportSetting(FXObject*, FXSelector, void* data);
173 
175  long onCmdImportSetting(FXObject*, FXSelector, void* data);
176 
178  long onUpdImportSetting(FXObject*, FXSelector, void* data);
179 
181  long onCmdLoadDecals(FXObject*, FXSelector, void* data);
182 
184  long onCmdSaveDecals(FXObject*, FXSelector, void* data);
185 
187  long onCmdClearDecals(FXObject*, FXSelector, void* data);
189 
193  std::string getCurrentScheme() const;
194 
198  void setCurrentScheme(const std::string&);
199 
200 protected:
202  FOX_CONSTRUCTOR(GUIDialog_ViewSettings)
203 
204 
206 
209 
212 
214  std::vector<GUISUMOAbstractView::Decal>* myDecals;
215 
217  FXMutex* myDecalsLock;
218 
221  FXComboBox* mySchemeName;
222  FXCheckButton* myShowGrid;
224 
225  FXColorWell* myBackgroundColor;
226  FXVerticalFrame* myDecalsFrame;
228 
230  FXColorWell* mySelectionColor;
231  FXColorWell* mySelectedEdgeColor;
232  FXColorWell* mySelectedLaneColor;
237  FXColorWell* mySelectedRouteColor;
239  FXColorWell* mySelectedPersonColor;
242 
244  FXColorWell* myBusStopColor;
245  FXColorWell* myBusStopColorSign;
246  FXColorWell* myTrainStopColor;
247  FXColorWell* myTrainStopColorSign;
248  FXColorWell* myContainerStopColor;
252  FXColorWell* myStopsColor;
253  FXColorWell* myVehicleTripsColor;
254  FXColorWell* myStopPersonsColor;
255  FXColorWell* myPersonTripColor;
256  FXColorWell* myWalkColor;
257  FXColorWell* myRideColor;
258  FXColorWell* myStopContainersColor;
259  FXColorWell* myTransportColor;
260  FXColorWell* myTranshipColor;
261 
263 
264  FXRealSpinner* myTripWidth;
265  FXRealSpinner* myPersonTripWidth;
266  FXRealSpinner* myWalkWidth;
267  FXRealSpinner* myRideWidth;
268  FXRealSpinner* myTransportWidth;
269  FXRealSpinner* myTranshipWidth;
270 
273  FXVerticalFrame* myLaneColorSettingFrame;
274  std::vector<FXColorWell*> myLaneColors;
275  std::vector<FXRealSpinner*> myLaneThresholds;
276  std::vector<FXButton*> myLaneButtons;
277  FXCheckButton* myLaneColorInterpolation;
279  FXCheckButton* myLaneColorRainbowCheck;
282  FXComboBox* myParamKey;
283 
286  FXVerticalFrame* myLaneScaleSettingFrame;
287  std::vector<FXRealSpinner*> myLaneScales;
288  std::vector<FXRealSpinner*> myLaneScaleThresholds;
289  std::vector<FXButton*> myLaneScaleButtons;
290  FXCheckButton* myLaneScaleInterpolation;
291 
295  FXRealSpinner* myLaneWidthUpscaleDialer;
296  FXRealSpinner* myLaneMinWidthDialer;
297 
300  FXVerticalFrame* myVehicleColorSettingFrame;
301  std::vector<FXColorWell*> myVehicleColors;
302  std::vector<FXRealSpinner*> myVehicleThresholds;
303  std::vector<FXButton*> myVehicleButtons;
305 
308  FXVerticalFrame* myVehicleScaleSettingFrame;
309  std::vector<FXRealSpinner*> myVehicleScales;
310  std::vector<FXRealSpinner*> myVehicleScaleThresholds;
311  std::vector<FXButton*> myVehicleScaleButtons;
313 
314  FXCheckButton* myShowBlinker, *myShowMinGap, *myShowBrakeGap, *myShowBTRange, *myShowRouteIndex, *myScaleLength, *myShowParkingInfo; /* *myShowLaneChangePreference,*/
315  FXComboBox* myVehicleParamKey;
317 
320  FXVerticalFrame* myPersonColorSettingFrame;
321  std::vector<FXColorWell*> myPersonColors;
322  std::vector<FXRealSpinner*> myPersonThresholds;
323  std::vector<FXButton*> myPersonButtons;
325 
329  std::vector<FXColorWell*> myContainerColors;
330  std::vector<FXRealSpinner*> myContainerThresholds;
331  std::vector<FXButton*> myContainerButtons;
334 
337  FXVerticalFrame* myJunctionColorSettingFrame;
338  std::vector<FXColorWell*> myJunctionColors;
339  std::vector<FXRealSpinner*> myJunctionThresholds;
340  std::vector<FXButton*> myJunctionButtons;
342 
345  FXVerticalFrame* myPOIColorSettingFrame;
346  std::vector<FXColorWell*> myPOIColors;
347  std::vector<FXRealSpinner*> myPOIThresholds;
348  std::vector<FXButton*> myPOIButtons;
349  FXCheckButton* myPOIColorInterpolation;
350  FXComboBox* myPOITextParamKey;
351  FXSpinner* myPoiDetail;
352 
355  FXVerticalFrame* myPolyColorSettingFrame;
356  std::vector<FXColorWell*> myPolyColors;
357  std::vector<FXRealSpinner*> myPolyThresholds;
358  std::vector<FXButton*> myPolyButtons;
359  FXCheckButton* myPolyColorInterpolation;
360 
363  FXVerticalFrame* myDataColorSettingFrame;
364  std::vector<FXColorWell*> myDataColors;
365  std::vector<FXRealSpinner*> myDataThresholds;
366  std::vector<FXButton*> myDataButtons;
367  FXCheckButton* myDataColorInterpolation;
368  FXComboBox* myDataParamKey;
372  FXCheckButton* myDataColorRainbowCheck;
374 
376  FXCheckButton* myShowLane2Lane;
377  FXCheckButton* myDrawJunctionShape;
379  FXCheckButton* myShowSizeLegend;
380  FXCheckButton* myShowColorLegend;
381  FXCheckButton* myShowVehicleColorLegend;
382 
384  FXCheckButton* myDither;
385  FXCheckButton* myFPS;
386  FXCheckButton* myDrawBoundaries;
390 
403 
406 
409 
411 
413  bool updateColorRanges(FXObject* sender, std::vector<FXColorWell*>::const_iterator colIt,
414  std::vector<FXColorWell*>::const_iterator colEnd,
415  std::vector<FXRealSpinner*>::const_iterator threshIt,
416  std::vector<FXRealSpinner*>::const_iterator threshEnd,
417  std::vector<FXButton*>::const_iterator buttonIt,
418  GUIColorScheme& scheme);
419 
421  bool updateScaleRanges(FXObject* sender, std::vector<FXRealSpinner*>::const_iterator colIt,
422  std::vector<FXRealSpinner*>::const_iterator colEnd,
423  std::vector<FXRealSpinner*>::const_iterator threshIt,
424  std::vector<FXRealSpinner*>::const_iterator threshEnd,
425  std::vector<FXButton*>::const_iterator buttonIt,
426  GUIScaleScheme& scheme);
427 
429  FXMatrix* rebuildColorMatrix(FXVerticalFrame* frame,
430  std::vector<FXColorWell*>& colors,
431  std::vector<FXRealSpinner*>& thresholds,
432  std::vector<FXButton*>& buttons,
433  FXCheckButton* interpolation,
434  GUIColorScheme& scheme);
435 
437  FXMatrix* rebuildScaleMatrix(FXVerticalFrame* frame,
438  std::vector<FXRealSpinner*>& scales,
439  std::vector<FXRealSpinner*>& thresholds,
440  std::vector<FXButton*>& buttons,
441  FXCheckButton* interpolation,
442  GUIScaleScheme& scheme);
443 
447  void rebuildColorMatrices(bool doCreate = false);
448 
450  void rebuildDecalsTable();
451 
455  void loadSettings(const std::string& file);
456 
460  void saveDecals(OutputDevice& dev) const;
461 
465  void loadDecals(const std::string& file);
466 
468  void saveWindowSize();
469 
471  void loadWindowSize();
472 
474  void updateVehicleParams();
475 
477  void updatePOIParams();
478 
480  void buildHeader(FXVerticalFrame* contentFrame);
481 
484 
485  void buildBackgroundFrame(FXTabBook* tabbook);
486  void buildStreetsFrame(FXTabBook* tabbook);
487  void buildVehiclesFrame(FXTabBook* tabbook);
488  void buildPersonsFrame(FXTabBook* tabbook);
489  void buildContainersFrame(FXTabBook* tabbook);
490  void buildJunctionsFrame(FXTabBook* tabbook);
491  void buildAdditionalsFrame(FXTabBook* tabbook);
492  void buildDemandFrame(FXTabBook* tabbook);
493  void buildPOIsFrame(FXTabBook* tabbook);
494  void buildPolygonsFrame(FXTabBook* tabbook);
495  void buildSelectionFrame(FXTabBook* tabbook);
496  void buildDataFrame(FXTabBook* tabbook);
497  void buildLegendFrame(FXTabBook* tabbook);
498  void buildOpenGLFrame(FXTabBook* tabbook);
499 
501 
503  void buildButtons(FXVerticalFrame* contentFrame);
504 
505 private:
508 
510  GUIDialog_ViewSettings& operator=(const GUIDialog_ViewSettings& s) = delete;
511 };
GUIVisualizationTextSettings getSettings()
get settings
FXColorWell * myBGColorWell
BGColor well.
void update(const GUIVisualizationTextSettings &settings)
update
FXCheckButton * myCheck
check button
FXCheckButton * myConstSizeCheck
const size check
NamePanel(FXMatrix *parent, GUIDialog_ViewSettings *target, const std::string &title, const GUIVisualizationTextSettings &settings)
constructor
FXCheckButton * mySelectedCheck
draw only for selected?
FXCheckButton * myCheckSelected
check selected button
FXCheckButton * myCheck
check button
FXRealSpinner * myMinSizeDial
min size dial
SizePanel(FXMatrix *parent, GUIDialog_ViewSettings *target, const GUIVisualizationSizeSettings &settings)
constructor
void update(const GUIVisualizationSizeSettings &settings)
update
GUIVisualizationSizeSettings getSettings()
get settings
FXRealSpinner * myExaggerateDial
exaggerate dial
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
void buildBackgroundFrame(FXTabBook *tabbook)
build frames
FXCheckButton * myDataColorRainbowCheck
FXCheckButton * myVehicleColorInterpolation
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
FXVerticalFrame * myDataColorSettingFrame
FXCheckButton * myHideMacroConnectors
GUISUMOAbstractView * myParent
FOX need this.
FXMutex * myDecalsLock
Lock used when changing the decals.
std::vector< FXColorWell * > myPolyColors
FXVerticalFrame * myJunctionColorSettingFrame
void buildSelectionFrame(FXTabBook *tabbook)
void buildOpenGLFrame(FXTabBook *tabbook)
long onCmdNameChange(FXObject *, FXSelector, void *)
Called if the name of the scheme was changed.
FXVerticalFrame * myContainerColorSettingFrame
FXRealSpinner * myLaneWidthUpscaleDialer
MFXIconComboBox * myPersonShapeDetail
std::vector< FXColorWell * > myPOIColors
FXColorWell * myBusStopColor
additional colors
MFXIconComboBox * myPOIColorMode
POIs.
std::vector< FXButton * > myLaneScaleButtons
MFXIconComboBox * myDataColorMode
Data.
long onCmdSaveDecals(FXObject *, FXSelector, void *data)
Called if the decals shall be saved to a file.
std::vector< FXColorWell * > myPersonColors
std::vector< FXButton * > myDataButtons
std::vector< FXRealSpinner * > myVehicleScales
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
FXCheckButton * myVehicleScaleInterpolation
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.
void buildJunctionsFrame(FXTabBook *tabbook)
FXRealSpinner * myContainerMinSizeDialer
std::vector< FXRealSpinner * > myPersonThresholds
void show()
show view settings dialog
std::vector< FXButton * > myJunctionButtons
MFXIconComboBox * myContainerColorMode
Containers.
MFXIconComboBox * myPolyShapeDetail
FXColorWell * mySelectedProhibitionColor
FXCheckButton * myShowVehicleColorLegend
void buildStreetsFrame(FXTabBook *tabbook)
FXRealSpinner * myTripWidth
demand widths
FXCheckButton * mySaveViewPort
load/save-menu
void buildVehiclesFrame(FXTabBook *tabbook)
MFXIconComboBox * myLaneEdgeColorMode
... lane colorer
FXCheckButton * myLaneColorRainbowCheck
MFXIconComboBox * myContainerShapeDetail
void rebuildDecalsTable()
Rebuilds the decals table.
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
FXRealSpinner * myTazRelationUpscaleDialer
void buildHeader(FXVerticalFrame *contentFrame)
build header
long onCmdCancel(FXObject *, FXSelector, void *)
Called if the Cancel-button was pressed.
MFXAddEditTypedTable * myDecalsTable
FXVerticalFrame * myLaneColorSettingFrame
FXCheckButton * myLaneScaleInterpolation
void buildDemandFrame(FXTabBook *tabbook)
FXCheckButton * myForceDrawForPositionSelection
long onCmdImportSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be read from a file.
MFXIconComboBox * myJunctionColorMode
junctions
FXVerticalFrame * myVehicleScaleSettingFrame
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.
long onCmdClearDecals(FXObject *, FXSelector, void *data)
Called if the decals shall be cleared.
std::vector< FXRealSpinner * > myDataThresholds
FXCheckButton * myDataColorInterpolation
MFXIconComboBox * myPersonColorMode
Persons.
FXCheckButton * myDrawCrossingsAndWalkingAreas
std::vector< FXButton * > myLaneButtons
GUIDialog_ViewSettings(GUISUMOAbstractView *parent, GUIVisualizationSettings *settings, std::vector< GUISUMOAbstractView::Decal > *decals, FXMutex *decalsLock)
Constructor.
FXCheckButton * myRealisticLinkRules
FXCheckButton * myLaneColorInterpolation
FXVerticalFrame * myPersonColorSettingFrame
void buildContainersFrame(FXTabBook *tabbook)
void buildLegendFrame(FXTabBook *tabbook)
std::vector< FXRealSpinner * > myVehicleScaleThresholds
FXCheckButton * myContainerColorInterpolation
std::vector< FXColorWell * > myLaneColors
SizePanel * myVehicleSizePanel
size panels
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
FXCheckButton * myDither
openGL
GUIVisualizationSettings myBackup
A backup of the settings (used if the "Cancel" button is pressed)
std::vector< FXRealSpinner * > myContainerThresholds
void buildPersonsFrame(FXTabBook *tabbook)
void updatePOIParams()
reload known POI parameters
FXCheckButton * myShowLane2Lane
buttons
std::vector< FXColorWell * > myDataColors
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.
MFXIconComboBox * myPOIShapeDetail
void buildAdditionalsFrame(FXTabBook *tabbook)
void buildPOIsFrame(FXTabBook *tabbook)
FXRealSpinner * myContainerUpscaleDialer
void buildPolygonsFrame(FXTabBook *tabbook)
void buildDataFrame(FXTabBook *tabbook)
long onUpdSaveSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to save the settings into the registry.
void buildButtons(FXVerticalFrame *contentFrame)
build buttons
MFXIconComboBox * myVehicleScaleMode
vehicle scaler
std::vector< FXButton * > myVehicleScaleButtons
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)
update color ranges
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)
update scale ranges
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
Vehicles.
FXRealSpinner * myDataColorRainbowThreshold
MFXIconComboBox * myPolyColorMode
Polygons.
FXColorWell * myChargingStationColorSign
NamePanel * myEdgeNamePanel
name panels
FXRealSpinner * myEdgeRelationUpscaleDialer
void updateVehicleParams()
reload known vehicle parameters
std::vector< FXRealSpinner * > myPOIThresholds
std::vector< FXButton * > myPolyButtons
std::vector< FXButton * > myVehicleButtons
Stores the information about how to visualize structures.
ComboBox with icon.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61