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-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 /****************************************************************************/
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 
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), myBackup(*settings),
81  myDecals(decals), myDecalsLock(decalsLock), myDecalsTable(nullptr),
82  myDataValuePanel(nullptr) {
83  // create content frame
84  FXVerticalFrame* contentFrame = new FXVerticalFrame(this, GUIDesignViewSettingsVerticalFrame1);
85  // build header
86  buildHeader(contentFrame);
87  // create tabbook for every section
88  FXTabBook* tabbook = new FXTabBook(contentFrame, nullptr, 0, GUIDesignViewSettingsTabBook1);
89  // build background frame
90  buildBackgroundFrame(tabbook);
91  // build streets frame
92  buildStreetsFrame(tabbook);
93  // build vehicles frame
94  buildVehiclesFrame(tabbook);
95  // build persons frame
96  buildPersonsFrame(tabbook);
97  // build containers frame
98  buildContainersFrame(tabbook);
99  // build junctions frame
100  buildJunctionsFrame(tabbook);
101  // build additionals frame
102  buildAdditionalsFrame(tabbook);
103  // build demand frame
104  if (mySettings->netedit) {
105  buildDemandFrame(tabbook);
106  }
107  // build POIs frame
108  buildPOIsFrame(tabbook);
109  // build polygons frame
110  buildPolygonsFrame(tabbook);
111  // build selection frame (only in NETEDIT)
112  if (mySettings->netedit) {
113  buildSelectionFrame(tabbook);
114  }
115  // build data frame (only in NETEDIT)
116  if (mySettings->netedit) {
117  buildDataFrame(tabbook);
118  }
119  // build legend frame
120  buildLegendFrame(tabbook);
121  // build openGL frame
122  buildOpenGLFrame(tabbook);
123  // build buttons
124  buildButtons(contentFrame);
125  // rebuild color matrix
126  rebuildColorMatrices(false);
128  loadWindowSize();
129 }
130 
131 
133  myParent->remove(this);
134  // delete name panels
137  delete myTLSPhaseIndexPanel;
138  delete myTLSPhaseNamePanel;
139  delete myCwaEdgeNamePanel;
140  delete myStreetNamePanel;
141  delete myEdgeValuePanel;
142  delete myJunctionIndexPanel;
143  delete myTLIndexPanel;
144  delete myJunctionIDPanel;
145  delete myJunctionNamePanel;
146  delete myVehicleNamePanel;
147  delete myVehicleValuePanel;
149  delete myVehicleTextPanel;
150  delete myPersonNamePanel;
151  delete myPersonValuePanel;
152  delete myAddNamePanel;
153  delete myAddFullNamePanel;
154  delete myPOINamePanel;
155  delete myPOITypePanel;
156  delete myPOITextPanel;
157  delete myPolyNamePanel;
158  delete myPolyTypePanel;
159  delete myEdgeNamePanel;
160  delete myDataValuePanel;
161  // delete size panels
162  delete myVehicleSizePanel;
163  delete myPersonSizePanel;
164  delete myJunctionSizePanel;
165  delete myPOISizePanel;
166  delete myPolySizePanel;
167  delete myAddSizePanel;
168 }
169 
170 
171 void
173  // update buttons that can be changed externally
174  myShowGrid->setCheck(mySettings->showGrid);
175  FXDialogBox::show();
176 }
177 
178 
179 void
181  mySettings = settings;
182  myBackup = (*settings);
183  onCmdNameChange(nullptr, 0, nullptr);
184 }
185 
186 
187 long
188 GUIDialog_ViewSettings::onCmdOk(FXObject*, FXSelector, void*) {
189  saveWindowSize();
190  hide();
191  return 1;
192 }
193 
194 
195 long
196 GUIDialog_ViewSettings::onCmdCancel(FXObject*, FXSelector, void*) {
197  saveWindowSize();
198  hide();
199  (*mySettings) = myBackup;
200  return 1;
201 }
202 
203 
204 long
205 GUIDialog_ViewSettings::onCmdNameChange(FXObject*, FXSelector, void* ptr) {
206  if (ptr != nullptr) {
207  FXString dataS = (char*) ptr; // !!!unicode
208  // check whether this item has been added twice
209  if (dataS == mySchemeName->getItemText(mySchemeName->getNumItems() - 1)) {
210  for (int i = 0; i < mySchemeName->getNumItems() - 1; ++i) {
211  if (dataS == mySchemeName->getItemText(i)) {
212  mySchemeName->removeItem(i);
213  }
214  }
215  }
216  myBackup = gSchemeStorage.get(dataS.text());
217  mySettings = &gSchemeStorage.get(dataS.text());
218  }
219  rebuildColorMatrices(true);
220 
222 
231  if (mySettings->netedit) {
241 
248 
261 
268  }
269 
277  myShowRails->setCheck(mySettings->showRails);
291 
296  myShowMinGap->setCheck(mySettings->drawMinGap);
302  /*
303  myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
304  */
310 
316 
321 
331 
335 
336  myPoiDetail->setValue(mySettings->poiDetail);
341 
345 
349  myDither->setCheck(mySettings->dither);
350  myFPS->setCheck(mySettings->fps);
357 
359  update();
360  myParent->update();
361  return 1;
362 }
363 
364 
365 bool
366 GUIDialog_ViewSettings::updateColorRanges(FXObject* sender, std::vector<FXColorWell*>::const_iterator colIt,
367  std::vector<FXColorWell*>::const_iterator colEnd,
368  std::vector<FXRealSpinner*>::const_iterator threshIt,
369  std::vector<FXRealSpinner*>::const_iterator threshEnd,
370  std::vector<FXButton*>::const_iterator buttonIt,
371  GUIColorScheme& scheme) {
372  UNUSED_PARAMETER(threshEnd);
373  int pos = 0;
374  while (colIt != colEnd) {
375  if (scheme.isFixed()) {
376  if (sender == *colIt) {
377  scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
378  }
379  } else {
380  if (sender == *threshIt) {
381  const double val = (*threshIt)->getValue();
382  scheme.setThreshold(pos, val);
383  return false;
384  }
385  if (sender == *colIt) {
386  scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
387  return false;
388  }
389  if (sender == *buttonIt) {
390  scheme.addColor(MFXUtils::getRGBColor((*colIt)->getRGBA()), (*threshIt)->getValue());
391  return true;
392  } else if (sender == *(buttonIt + 1)) {
393  scheme.removeColor(pos);
394  return true;
395  }
396  // 2 buttons per item (add / remove)
397  threshIt++;
398  buttonIt += 2;
399  }
400  ++colIt;
401  pos++;
402  }
403  return false;
404 }
405 
406 
407 bool
408 GUIDialog_ViewSettings::updateScaleRanges(FXObject* sender, std::vector<FXRealSpinner*>::const_iterator scaleIt,
409  std::vector<FXRealSpinner*>::const_iterator scaleEnd,
410  std::vector<FXRealSpinner*>::const_iterator threshIt,
411  std::vector<FXRealSpinner*>::const_iterator threshEnd,
412  std::vector<FXButton*>::const_iterator buttonIt,
413  GUIScaleScheme& scheme) {
414  int pos = 0;
415  while (scaleIt != scaleEnd) {
416  if (scheme.isFixed()) {
417  if (sender == *scaleIt) {
418  scheme.setColor(pos, (*scaleIt)->getValue());
419  }
420  } else {
421  if (sender == *threshIt) {
422  const double val = (*threshIt)->getValue();
423  double lo, hi;
424  if (pos != 0) {
425  threshIt--;
426  (*threshIt)->getRange(lo, hi);
427  (*threshIt)->setRange(lo, val);
428  threshIt++;
429  }
430  threshIt++;
431  if (threshIt != threshEnd) {
432  (*threshIt)->getRange(lo, hi);
433  (*threshIt)->setRange(val, hi);
434  }
435  scheme.setThreshold(pos, val);
436  return false;
437  }
438  if (sender == *scaleIt) {
439  scheme.setColor(pos, (*scaleIt)->getValue());
440  return false;
441  }
442  if (sender == *buttonIt) {
443  scheme.addColor((*scaleIt)->getValue(), (*threshIt)->getValue());
444  return true;
445  } else if (sender == *(buttonIt + 1)) {
446  scheme.removeColor(pos);
447  return true;
448  }
449  threshIt++;
450  buttonIt += 2;
451  }
452  ++scaleIt;
453  pos++;
454  }
455  return false;
456 }
457 
458 
459 long
460 GUIDialog_ViewSettings::onCmdColorChange(FXObject* sender, FXSelector, void* /*val*/) {
461  GUIVisualizationSettings tmpSettings = *mySettings;
462  int prevLaneMode = mySettings->getLaneEdgeMode();
463  int prevLaneScaleMode = mySettings->getLaneEdgeScaleMode();
464  int prevVehicleMode = mySettings->vehicleColorer.getActive();
465  int prevVehicleScaleMode = mySettings->vehicleScaler.getActive();
466  int prevPersonMode = mySettings->personColorer.getActive();
467  int prevContainerMode = mySettings->containerColorer.getActive();
468  int prevJunctionMode = mySettings->junctionColorer.getActive();
469  int prevPOIMode = mySettings->poiColorer.getActive();
470  int prevPolyMode = mySettings->polyColorer.getActive();
471  int prevDataMode = mySettings->dataColorer.getActive();
472  bool doRebuildColorMatrices = false;
473 
474  tmpSettings.name = mySettings->name;
475  tmpSettings.backgroundColor = MFXUtils::getRGBColor(myBackgroundColor->getRGBA());
476 
477  // additionals
486  if (mySettings->netedit) {
487  tmpSettings.colorSettings.stopColor = MFXUtils::getRGBColor(myStopsColor->getRGBA());
491  tmpSettings.colorSettings.walkColor = MFXUtils::getRGBColor(myWalkColor->getRGBA());
492  tmpSettings.colorSettings.rideColor = MFXUtils::getRGBColor(myRideColor->getRGBA());
496 
497  tmpSettings.widthSettings.tripWidth = myTripWidth->getValue();
498  tmpSettings.widthSettings.personTripWidth = myPersonTripWidth->getValue();
499  tmpSettings.widthSettings.walkWidth = myWalkWidth->getValue();
500  tmpSettings.widthSettings.rideWidth = myRideWidth->getValue();
501  tmpSettings.widthSettings.transportWidth = myTransportWidth->getValue();
502  tmpSettings.widthSettings.transhipWidth = myTranshipWidth->getValue();
503 
516  }
517 
518  tmpSettings.showGrid = (myShowGrid->getCheck() != FALSE);
519  tmpSettings.gridXSize = (double) myGridXSizeDialer->getValue();
520  tmpSettings.gridYSize = (double) myGridYSizeDialer->getValue();
521 
525  } else {
528  }
529  tmpSettings.laneShowBorders = (myShowLaneBorders->getCheck() != FALSE);
530  tmpSettings.showBikeMarkings = (myShowBikeMarkings->getCheck() != FALSE);
531  tmpSettings.showLinkDecals = (myShowLaneDecals->getCheck() != FALSE);
532  tmpSettings.realisticLinkRules = (myRealisticLinkRules->getCheck() != FALSE);
533  tmpSettings.showLinkRules = (myShowLinkRules->getCheck() != FALSE);
534  tmpSettings.showRails = (myShowRails->getCheck() != FALSE);
535  tmpSettings.edgeName = myEdgeNamePanel->getSettings();
537  tmpSettings.cwaEdgeName = myCwaEdgeNamePanel->getSettings();
538  tmpSettings.streetName = myStreetNamePanel->getSettings();
539  tmpSettings.edgeValue = myEdgeValuePanel->getSettings();
540  tmpSettings.hideConnectors = (myHideMacroConnectors->getCheck() != FALSE);
541  tmpSettings.showLaneDirection = (myShowLaneDirection->getCheck() != FALSE);
542  tmpSettings.showSublanes = (myShowSublanes->getCheck() != FALSE);
543  tmpSettings.spreadSuperposed = (mySpreadSuperposed->getCheck() != FALSE);
544  if (sender == myParamKey) {
546  tmpSettings.edgeParam = myParamKey->getText().text();
548  tmpSettings.laneParam = myParamKey->getText().text();
550  tmpSettings.edgeData = myParamKey->getText().text();
551  }
552  } else if (sender == myVehicleParamKey) {
554  tmpSettings.vehicleParam = myVehicleParamKey->getText().text();
555  }
556  } else if (sender == myDataParamKey) {
558  tmpSettings.relDataAttr = myDataParamKey->getText().text();
559  }
560  } else if (sender == myVehicleTextPanel->myCheck) {
562  } else if (sender == myVehicleTextParamKey) {
563  tmpSettings.vehicleTextParam = myVehicleTextParamKey->getText().text();
564  } else if (sender == myPOITextPanel->myCheck) {
565  updatePOIParams();
566  } else if (sender == myPOITextParamKey) {
567  tmpSettings.poiTextParam = myPOITextParamKey->getText().text();
568  }
569  tmpSettings.edgeValueHideCheck = (myLaneColorRainbowCheck->getCheck() != FALSE);
570  tmpSettings.edgeValueHideThreshold = myLaneColorRainbowThreshold->getValue();
571  tmpSettings.laneWidthExaggeration = myLaneWidthUpscaleDialer->getValue();
572  tmpSettings.laneMinSize = myLaneMinWidthDialer->getValue();
573 
577  tmpSettings.showBlinker = (myShowBlinker->getCheck() != FALSE);
578  tmpSettings.drawMinGap = (myShowMinGap->getCheck() != FALSE);
579  tmpSettings.drawBrakeGap = (myShowBrakeGap->getCheck() != FALSE);
580  tmpSettings.showBTRange = (myShowBTRange->getCheck() != FALSE);
581  tmpSettings.showRouteIndex = (myShowRouteIndex->getCheck() != FALSE);
582  tmpSettings.scaleLength = (myScaleLength->getCheck() != FALSE);
583  tmpSettings.showParkingInfo = (myShowParkingInfo->getCheck() != FALSE);
584  /*
585  tmpSettings.drawLaneChangePreference = (myShowLaneChangePreference->getCheck() != FALSE);
586  */
587  tmpSettings.vehicleName = myVehicleNamePanel->getSettings();
590  tmpSettings.vehicleText = myVehicleTextPanel->getSettings();
591  tmpSettings.vehicleSize = myVehicleSizePanel->getSettings();
592 
595  tmpSettings.personName = myPersonNamePanel->getSettings();
596  tmpSettings.personValue = myPersonValuePanel->getSettings();
597  tmpSettings.personSize = myPersonSizePanel->getSettings();
598 
603 
605  tmpSettings.drawLinkTLIndex = myTLIndexPanel->getSettings();
607  tmpSettings.junctionID = myJunctionIDPanel->getSettings();
613 
614  tmpSettings.addName = myAddNamePanel->getSettings();
615  tmpSettings.addFullName = myAddFullNamePanel->getSettings();
616  tmpSettings.addSize = myAddSizePanel->getSettings();
617 
619  tmpSettings.poiDetail = myPoiDetail->getValue();
620  tmpSettings.poiName = myPOINamePanel->getSettings();
621  tmpSettings.poiType = myPOITypePanel->getSettings();
622  tmpSettings.poiText = myPOITextPanel->getSettings();
623  tmpSettings.poiSize = myPOISizePanel->getSettings();
624 
626  tmpSettings.polyName = myPolyNamePanel->getSettings();
627  tmpSettings.polyType = myPolyTypePanel->getSettings();
628  tmpSettings.polySize = myPolySizePanel->getSettings();
629 
630  if (mySettings->netedit) {
631  tmpSettings.dataValue = myDataValuePanel->getSettings();
633  tmpSettings.dataValue = myDataValuePanel->getSettings();
634  tmpSettings.tazRelWidthExaggeration = myTazRelationUpscaleDialer->getValue();
635  tmpSettings.edgeRelWidthExaggeration = myEdgeRelationUpscaleDialer->getValue();
636  tmpSettings.dataValueHideCheck = (myDataColorRainbowCheck->getCheck() != FALSE);
637  tmpSettings.dataValueHideThreshold = myDataColorRainbowThreshold->getValue();
638  }
639 
640  tmpSettings.showLane2Lane = (myShowLane2Lane->getCheck() != FALSE);
641  tmpSettings.drawJunctionShape = (myDrawJunctionShape->getCheck() != FALSE);
642  tmpSettings.drawCrossingsAndWalkingareas = (myDrawCrossingsAndWalkingAreas->getCheck() != FALSE);
643  tmpSettings.dither = (myDither->getCheck() != FALSE);
644  tmpSettings.fps = (myFPS->getCheck() != FALSE);
645  tmpSettings.drawBoundaries = (myDrawBoundaries->getCheck() != FALSE);
646  tmpSettings.forceDrawForPositionSelection = (myForceDrawForPositionSelection->getCheck() != FALSE);
647  tmpSettings.forceDrawForRectangleSelection = (myForceDrawForRectangleSelection->getCheck() != FALSE);
648  tmpSettings.showSizeLegend = (myShowSizeLegend->getCheck() != FALSE);
649  tmpSettings.showColorLegend = (myShowColorLegend->getCheck() != FALSE);
650  tmpSettings.showVehicleColorLegend = (myShowVehicleColorLegend->getCheck() != FALSE);
651 
652  // lanes (colors)
653  if (sender == myLaneColorRainbow) {
654  myParent->buildColorRainbow(tmpSettings, tmpSettings.getLaneEdgeScheme(), tmpSettings.getLaneEdgeMode(), GLO_LANE,
655  myLaneColorRainbowCheck->getCheck() != FALSE, myLaneColorRainbowThreshold->getValue());
656  doRebuildColorMatrices = true;
657  } else if (sender == myJunctionColorRainbow) {
658  myParent->buildColorRainbow(tmpSettings, tmpSettings.junctionColorer.getScheme(), tmpSettings.junctionColorer.getActive(), GLO_JUNCTION);
659  doRebuildColorMatrices = true;
660  } else if (sender == myDataColorRainbow) {
661  myParent->buildColorRainbow(tmpSettings, tmpSettings.dataColorer.getScheme(), tmpSettings.dataColorer.getActive(), GLO_TAZRELDATA,
662  myDataColorRainbowCheck->getCheck() != FALSE, myDataColorRainbowThreshold->getValue());
663  doRebuildColorMatrices = true;
664  }
665  if (tmpSettings.getLaneEdgeMode() == prevLaneMode) {
666  if (updateColorRanges(sender, myLaneColors.begin(), myLaneColors.end(),
667  myLaneThresholds.begin(), myLaneThresholds.end(), myLaneButtons.begin(),
668  tmpSettings.getLaneEdgeScheme())) {
669  doRebuildColorMatrices = true;
670  }
671  if (sender == myLaneColorInterpolation) {
672  tmpSettings.getLaneEdgeScheme().setInterpolated(myLaneColorInterpolation->getCheck() != FALSE);
673  doRebuildColorMatrices = true;
674  }
675  } else {
676  doRebuildColorMatrices = true;
677  }
678  // lanes (scaling)
679  if (tmpSettings.getLaneEdgeScaleMode() == prevLaneScaleMode) {
680  if (updateScaleRanges(sender, myLaneScales.begin(), myLaneScales.end(),
682  tmpSettings.getLaneEdgeScaleScheme())) {
683  doRebuildColorMatrices = true;
684  }
685  if (sender == myLaneScaleInterpolation) {
686  tmpSettings.getLaneEdgeScaleScheme().setInterpolated(myLaneScaleInterpolation->getCheck() != FALSE);
687  doRebuildColorMatrices = true;
688  }
689  } else {
690  doRebuildColorMatrices = true;
691  }
692  // vehicles
693  if (tmpSettings.vehicleColorer.getActive() == prevVehicleMode) {
694  if (updateColorRanges(sender, myVehicleColors.begin(), myVehicleColors.end(),
696  tmpSettings.vehicleColorer.getScheme())) {
697  doRebuildColorMatrices = true;
698  }
699  if (sender == myVehicleColorInterpolation) {
700  tmpSettings.vehicleColorer.getScheme().setInterpolated(myVehicleColorInterpolation->getCheck() != FALSE);
701  doRebuildColorMatrices = true;
702  }
703  } else {
704  doRebuildColorMatrices = true;
705  }
706  // vehicles (scaling)
707  if (tmpSettings.vehicleScaler.getActive() == prevVehicleScaleMode) {
708  if (updateScaleRanges(sender, myVehicleScales.begin(), myVehicleScales.end(),
710  tmpSettings.vehicleScaler.getScheme())) {
711  doRebuildColorMatrices = true;
712  }
713  if (sender == myVehicleScaleInterpolation) {
714  tmpSettings.vehicleScaler.getScheme().setInterpolated(myVehicleScaleInterpolation->getCheck() != FALSE);
715  doRebuildColorMatrices = true;
716  }
717  } else {
718  doRebuildColorMatrices = true;
719  }
720  // persons
721  if (tmpSettings.personColorer.getActive() == prevPersonMode) {
722  if (updateColorRanges(sender, myPersonColors.begin(), myPersonColors.end(),
723  myPersonThresholds.begin(), myPersonThresholds.end(), myPersonButtons.begin(),
724  tmpSettings.personColorer.getScheme())) {
725  doRebuildColorMatrices = true;
726  }
727  if (sender == myPersonColorInterpolation) {
728  tmpSettings.personColorer.getScheme().setInterpolated(myPersonColorInterpolation->getCheck() != FALSE);
729  doRebuildColorMatrices = true;
730  }
731  } else {
732  doRebuildColorMatrices = true;
733  }
734  // containers
735  if (tmpSettings.containerColorer.getActive() == prevContainerMode) {
736  if (updateColorRanges(sender, myContainerColors.begin(), myContainerColors.end(),
738  tmpSettings.containerColorer.getScheme())) {
739  doRebuildColorMatrices = true;
740  }
741  if (sender == myContainerColorInterpolation) {
742  tmpSettings.containerColorer.getScheme().setInterpolated(myContainerColorInterpolation->getCheck() != FALSE);
743  doRebuildColorMatrices = true;
744  }
745  } else {
746  doRebuildColorMatrices = true;
747  }
748  // junctions
749  if (tmpSettings.junctionColorer.getActive() == prevJunctionMode) {
750  if (updateColorRanges(sender, myJunctionColors.begin(), myJunctionColors.end(),
752  tmpSettings.junctionColorer.getScheme())) {
753  doRebuildColorMatrices = true;
754  }
755  if (sender == myJunctionColorInterpolation) {
756  tmpSettings.junctionColorer.getScheme().setInterpolated(myJunctionColorInterpolation->getCheck() != FALSE);
757  doRebuildColorMatrices = true;
758  }
759  } else {
760  doRebuildColorMatrices = true;
761  }
762  // POIs
763  if (tmpSettings.poiColorer.getActive() == prevPOIMode) {
764  if (updateColorRanges(sender, myPOIColors.begin(), myPOIColors.end(),
765  myPOIThresholds.begin(), myPOIThresholds.end(), myPOIButtons.begin(),
766  tmpSettings.poiColorer.getScheme())) {
767  doRebuildColorMatrices = true;
768  }
769  if (sender == myPOIColorInterpolation) {
770  tmpSettings.poiColorer.getScheme().setInterpolated(myPOIColorInterpolation->getCheck() != FALSE);
771  doRebuildColorMatrices = true;
772  }
773  } else {
774  doRebuildColorMatrices = true;
775  }
776  // polygons
777  if (tmpSettings.polyColorer.getActive() == prevPolyMode) {
778  if (updateColorRanges(sender, myPolyColors.begin(), myPolyColors.end(),
779  myPolyThresholds.begin(), myPolyThresholds.end(), myPolyButtons.begin(),
780  tmpSettings.polyColorer.getScheme())) {
781  doRebuildColorMatrices = true;
782  }
783  if (sender == myPolyColorInterpolation) {
784  tmpSettings.polyColorer.getScheme().setInterpolated(myPolyColorInterpolation->getCheck() != FALSE);
785  doRebuildColorMatrices = true;
786  }
787  } else {
788  doRebuildColorMatrices = true;
789  }
790  // data
791  if (tmpSettings.netedit) {
792  if (tmpSettings.dataColorer.getActive() == prevDataMode) {
793  if (updateColorRanges(sender, myDataColors.begin(), myDataColors.end(),
794  myDataThresholds.begin(), myDataThresholds.end(), myDataButtons.begin(),
795  tmpSettings.dataColorer.getScheme())) {
796  doRebuildColorMatrices = true;
797  }
798  if (sender == myDataColorInterpolation) {
799  tmpSettings.dataColorer.getScheme().setInterpolated(myDataColorInterpolation->getCheck() != FALSE);
800  doRebuildColorMatrices = true;
801  }
802  } else {
803  doRebuildColorMatrices = true;
804  }
805  }
806  // openGL
807  if (sender == myRecalculateBoundaries) {
809  }
810 
811  if (tmpSettings == *mySettings) {
812  return 1;
813  }
814 
815  int index = mySchemeName->getCurrentItem();
816  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
817  // one of the initial settings is modified
818  // every time this happens we create a new scheme
819  int suffix = 1;
820  while (gSchemeStorage.contains("custom_" + toString(suffix))) {
821  suffix++;
822  }
823  tmpSettings.name = "custom_" + toString(suffix);
824  // the newly created settings must be entered in several places:
825  // - the comboBox mySchemeName of this dialog
826  // - the comboBox of the parent view (set as active)
827  // - the comboBox of all other views (only append) XXX @todo
828  index = mySchemeName->appendItem(tmpSettings.name.c_str());
829  mySchemeName->setCurrentItem(index);
830  myParent->getColoringSchemesCombo()->appendItem(tmpSettings.name.c_str());
831  }
832  myParent->getColoringSchemesCombo()->setCurrentItem(
833  myParent->getColoringSchemesCombo()->findItem(tmpSettings.name.c_str()));
834  gSchemeStorage.add(tmpSettings); // overwrites existing
835  mySettings = &gSchemeStorage.get(tmpSettings.name);
836  myParent->setColorScheme(tmpSettings.name);
837 
838  if (doRebuildColorMatrices) {
839  rebuildColorMatrices(true);
840  }
841  myParent->forceRefresh();
842  getApp()->forceRefresh();
843  return 1;
844 }
845 
846 
847 void
848 GUIDialog_ViewSettings::loadSettings(const std::string& file) {
849  GUISettingsHandler handler(file, true, mySettings->netedit);
850  for (std::string settingsName : handler.addSettings(myParent)) {
851  FXint index = mySchemeName->appendItem(settingsName.c_str());
852  mySchemeName->setCurrentItem(index);
853  mySettings = &gSchemeStorage.get(settingsName);
854  }
855  if (handler.hasDecals()) {
856  myDecalsLock->lock();
857  (*myDecals) = handler.getDecals();
859  myParent->update();
860  myDecalsLock->unlock();
861  }
862  if (handler.getDelay() >= 0) {
863  myParent->setDelay(handler.getDelay());
864  }
865  if (handler.getBreakpoints().size() > 0) {
867  }
868  handler.applyViewport(myParent);
869  rebuildColorMatrices(true);
870 }
871 
872 
873 void
875  std::vector<GUISUMOAbstractView::Decal>::iterator j;
876  for (j = myDecals->begin(); j != myDecals->end(); ++j) {
879  dev.writeAttr("file", d.filename);
885  dev.writeAttr("altitude", d.altitude);
886  dev.writeAttr("rotation", d.rot);
887  dev.writeAttr("tilt", d.tilt);
888  dev.writeAttr("roll", d.roll);
890  dev.writeAttr("screenRelative", d.screenRelative);
891  dev.closeTag();
892  }
893 }
894 
895 
896 void
897 GUIDialog_ViewSettings::loadDecals(const std::string& file) {
898  myDecalsLock->lock();
899  GUISettingsHandler handler(file);
900  if (handler.hasDecals()) {
901  (*myDecals) = handler.getDecals();
902  }
904  myParent->update();
905  myDecalsLock->unlock();
906 }
907 
908 
909 long
910 GUIDialog_ViewSettings::onCmdSaveSetting(FXObject*, FXSelector, void* /*data*/) {
911  int index = mySchemeName->getCurrentItem();
912  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
913  return 1;
914  }
915  // get the name
916  std::string name = "";
917  while (name.length() == 0) {
918  FXDialogBox dialog(this, "Enter a name", GUIDesignViewSettingsDialog);
919  FXVerticalFrame* content = new FXVerticalFrame(&dialog, GUIDesignViewSettingsVerticalFrame5);
920  new FXLabel(content, "Please enter an alphanumeric name: ", nullptr, GUIDesignViewSettingsLabel2);
921  FXTextField* text = new FXTextField(content, 40, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsTextField1);
922  new FXHorizontalSeparator(content, GUIDesignHorizontalSeparator);
923  FXHorizontalFrame* buttons = new FXHorizontalFrame(content, GUIDesignViewSettingsHorizontalFrame3);
924  new FXButton(buttons, "&OK", nullptr, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsButton4);
925  new FXButton(buttons, "&Cancel", nullptr, &dialog, FXDialogBox::ID_CANCEL, GUIDesignViewSettingsButton5);
926  dialog.create();
927  text->setFocus();
928  if (!dialog.execute()) {
929  return 1;
930  }
931  name = text->getText().text();
932  for (int i = 0; i < (int)name.length(); ++i) {
933  if (name[i] != '_' && (name[i] < 'a' || name[i] > 'z') && (name[i] < 'A' || name[i] > 'Z') && (name[i] < '0' || name[i] > '9')) {
934  name = "";
935  break;
936  }
937  }
938  }
939  GUIVisualizationSettings tmpSettings = *mySettings;
940  tmpSettings.name = name;
941  if (name == mySettings->name || StringUtils::startsWith(mySettings->name, "custom_")) {
943  myParent->getColoringSchemesCombo()->setItemText(index, name.c_str());
944  } else {
946  index = mySchemeName->appendItem(name.c_str());
947  myParent->getColoringSchemesCombo()->appendItem(name.c_str());
948  myParent->getColoringSchemesCombo()->setCurrentItem(
949  myParent->getColoringSchemesCombo()->findItem(name.c_str()));
950  }
951  gSchemeStorage.add(tmpSettings);
952  mySchemeName->setItemText(index, name.c_str());
953  myParent->setColorScheme(name);
954  mySettings = &gSchemeStorage.get(name);
955  myBackup = *mySettings;
956  gSchemeStorage.writeSettings(getApp());
957  return 1;
958 }
959 
960 
961 long
962 GUIDialog_ViewSettings::onUpdSaveSetting(FXObject* sender, FXSelector, void* ptr) {
963  sender->handle(this,
964  mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
965  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
966  ptr);
967  return 1;
968 }
969 
970 
971 long
972 GUIDialog_ViewSettings::onCmdDeleteSetting(FXObject*, FXSelector, void* /*data*/) {
973  int index = mySchemeName->getCurrentItem();
974  if (index < (int) gSchemeStorage.getNumInitialSettings()) {
975  return 1;
976  }
977  std::string name = mySchemeName->getItem(index).text();
978  gSchemeStorage.remove(name);
979  mySchemeName->removeItem(index);
980  onCmdNameChange(nullptr, 0, (void*) mySchemeName->getItem(0).text());
981  gSchemeStorage.writeSettings(getApp());
982  return 1;
983 }
984 
985 
986 long
987 GUIDialog_ViewSettings::onUpdDeleteSetting(FXObject* sender, FXSelector, void* ptr) {
988  sender->handle(this,
989  mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
990  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
991  ptr);
992  return 1;
993 }
994 
995 
996 long
997 GUIDialog_ViewSettings::onCmdExportSetting(FXObject*, FXSelector, void* /*data*/) {
998  FXString file = MFXUtils::getFilename2Write(this, "Export view settings", ".xml", GUIIconSubSys::getIcon(GUIIcon::SAVE), gCurrentFolder);
999  if (file == "") {
1000  return 1;
1001  }
1002  try {
1003  OutputDevice& dev = OutputDevice::getDevice(file.text());
1005  mySettings->save(dev);
1006  if (mySaveViewPort->getCheck()) {
1008  }
1009  if (mySaveDelay->getCheck()) {
1010  dev.openTag(SUMO_TAG_DELAY);
1012  dev.closeTag();
1013  }
1014  if (mySaveDecals->getCheck()) {
1015  saveDecals(dev);
1016  }
1017  if (!mySettings->netedit && mySaveBreakpoints->getCheck()) {
1018  for (SUMOTime t : myParent->retrieveBreakpoints()) {
1021  dev.closeTag();
1022  }
1023  }
1024  dev.closeTag();
1025  dev.close();
1026  } catch (IOError& e) {
1027  FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what());
1028  }
1029  return 1;
1030 }
1031 
1032 
1033 long
1034 GUIDialog_ViewSettings::onUpdExportSetting(FXObject* sender, FXSelector, void* ptr) {
1035  sender->handle(this,
1036  (mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1037  && !mySaveViewPort->getCheck() && !mySaveDelay->getCheck() && !mySaveDecals->getCheck() && !mySaveBreakpoints->getCheck()) ?
1038  FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1039  ptr);
1040  return 1;
1041 }
1042 
1043 
1044 long
1045 GUIDialog_ViewSettings::onCmdImportSetting(FXObject*, FXSelector, void* /*data*/) {
1046  FXFileDialog opendialog(this, "Import view settings");
1047  opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG));
1048  opendialog.setSelectMode(SELECTFILE_ANY);
1049  opendialog.setPatternList("*.xml");
1050  if (gCurrentFolder.length() != 0) {
1051  opendialog.setDirectory(gCurrentFolder);
1052  }
1053  if (opendialog.execute()) {
1054  gCurrentFolder = opendialog.getDirectory();
1055  loadSettings(opendialog.getFilename().text());
1056  }
1057  return 1;
1058 }
1059 
1060 
1061 long
1062 GUIDialog_ViewSettings::onCmdLoadDecals(FXObject*, FXSelector, void* /*data*/) {
1063  FXFileDialog opendialog(this, "Load Decals");
1064  opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY));
1065  opendialog.setSelectMode(SELECTFILE_ANY);
1066  opendialog.setPatternList("*.xml");
1067  if (gCurrentFolder.length() != 0) {
1068  opendialog.setDirectory(gCurrentFolder);
1069  }
1070  if (opendialog.execute()) {
1071  gCurrentFolder = opendialog.getDirectory();
1072  loadDecals(opendialog.getFilename().text());
1073  }
1074  return 1;
1075 }
1076 
1077 
1078 long
1079 GUIDialog_ViewSettings::onCmdSaveDecals(FXObject*, FXSelector, void* /*data*/) {
1080  FXString file = MFXUtils::getFilename2Write(this, "Save Decals", ".xml", GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder);
1081  if (file == "") {
1082  return 1;
1083  }
1084  try {
1085  OutputDevice& dev = OutputDevice::getDevice(file.text());
1086  dev.openTag("decals");
1087  saveDecals(dev);
1088  dev.closeTag();
1089  dev.close();
1090  } catch (IOError& e) {
1091  FXMessageBox::error(myParent, MBOX_OK, "Storing failed!", "%s", e.what());
1092  }
1093  return 1;
1094 }
1095 
1096 
1097 long
1098 GUIDialog_ViewSettings::onCmdClearDecals(FXObject*, FXSelector, void* /*data*/) {
1099  // lock decals mutex
1100  myDecalsLock->lock();
1101  // clear decals
1102  myDecals->clear();
1103  // rebuild list
1105  // update view
1106  myParent->update();
1107  // unlock decals mutex
1108  myDecalsLock->unlock();
1109  return 1;
1110 }
1111 
1112 
1113 long
1114 GUIDialog_ViewSettings::onUpdImportSetting(FXObject* sender, FXSelector, void* ptr) {
1115  sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1116  return 1;
1117 }
1118 
1119 
1120 void
1122  myDecalsTable->clearItems();
1123  const int cols = 8;
1124  // set table attributes
1125  const int numRows = MAX2((int)10, (int)myDecals->size() + 1);
1126  myDecalsTable->setTableSize(numRows, cols);
1127  myDecalsTable->setColumnText(0, "file");
1128  myDecalsTable->setColumnText(1, "centerX");
1129  myDecalsTable->setColumnText(2, "centerY");
1130  myDecalsTable->setColumnText(3, "width");
1131  myDecalsTable->setColumnText(4, "height");
1132  myDecalsTable->setColumnText(5, "rotation");
1133  myDecalsTable->setColumnText(6, "layer");
1134  myDecalsTable->setColumnText(7, "relative");
1135  FXHeader* header = myDecalsTable->getColumnHeader();
1136  header->setHeight(getApp()->getNormalFont()->getFontHeight() + getApp()->getNormalFont()->getFontAscent());
1137  int k;
1138  for (k = 0; k < cols; k++) {
1139  header->setItemJustify(k, GUIDesignViewSettingsMFXTableJustify);
1140  header->setItemSize(k, 60);
1141  }
1142  header->setItemSize(0, 150);
1143  // insert already known decals information into table
1144  FXint row = 0;
1145  std::vector<GUISUMOAbstractView::Decal>::iterator j;
1146  for (j = myDecals->begin(); j != myDecals->end(); ++j) {
1148  myDecalsTable->setItemText(row, 0, d.filename.c_str());
1149  myDecalsTable->setItemText(row, 1, toString<double>(d.centerX).c_str());
1150  myDecalsTable->setItemText(row, 2, toString<double>(d.centerY).c_str());
1151  myDecalsTable->setItemText(row, 3, toString<double>(d.width).c_str());
1152  myDecalsTable->setItemText(row, 4, toString<double>(d.height).c_str());
1153  myDecalsTable->setItemText(row, 5, toString<double>(d.rot).c_str());
1154  myDecalsTable->setItemText(row, 6, toString<double>(d.layer).c_str());
1155  myDecalsTable->setItemText(row, 7, toString<double>(d.screenRelative).c_str());
1156  row++;
1157  }
1158  // insert dummy last field
1159  for (k = 0; k < 7; k++) {
1160  myDecalsTable->setItemText(row, k, " ");
1161  }
1162 }
1163 
1164 
1165 FXMatrix*
1167  std::vector<FXColorWell*>& colors,
1168  std::vector<FXRealSpinner*>& thresholds,
1169  std::vector<FXButton*>& buttons,
1170  FXCheckButton* interpolation,
1171  GUIColorScheme& scheme) {
1172  MFXUtils::deleteChildren(frame);
1173  FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1174  colors.clear();
1175  thresholds.clear();
1176  buttons.clear();
1177  const bool fixed = scheme.isFixed();
1178  std::vector<RGBColor>::const_iterator colIt = scheme.getColors().begin();
1179  std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1180  std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1181  while (colIt != scheme.getColors().end()) {
1182  colors.push_back(new FXColorWell(m, MFXUtils::getFXColor(*colIt), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell1));
1183  if (fixed) {
1184  new FXLabel(m, nameIt->c_str());
1185  new FXLabel(m, "");
1186  new FXLabel(m, "");
1187  } else {
1188  const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1189  FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX | dialerOptions);
1190  threshDialer->setValue(*threshIt);
1191  thresholds.push_back(threshDialer);
1192  if (*threshIt == GUIVisualizationSettings::MISSING_DATA) {
1193  threshDialer->disable();
1194  threshDialer->hide();
1195  buttons.push_back(new FXButton(m, "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1196  buttons.back()->hide();
1197  buttons.push_back(new FXButton(m, "No Data", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1198  buttons.back()->disable();
1199  } else {
1200  buttons.push_back(new FXButton(m, "Add", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1201  buttons.push_back(new FXButton(m, "Remove", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1202  }
1203  }
1204  colIt++;
1205  threshIt++;
1206  nameIt++;
1207  }
1208  interpolation->setCheck(scheme.isInterpolated());
1209  if (fixed) {
1210  interpolation->disable();
1211  } else {
1212  if (colors.size() > 1) {
1213  interpolation->enable();
1214  if (interpolation->getCheck() != FALSE) {
1215  thresholds.front()->enable();
1216  } else {
1217  thresholds.front()->disable();
1218  }
1219  } else {
1220  interpolation->disable();
1221  thresholds.front()->disable();
1222  }
1223  }
1224  return m;
1225 }
1226 
1227 
1228 FXMatrix*
1230  std::vector<FXRealSpinner*>& scales,
1231  std::vector<FXRealSpinner*>& thresholds,
1232  std::vector<FXButton*>& buttons,
1233  FXCheckButton* interpolation,
1234  GUIScaleScheme& scheme) {
1235  MFXUtils::deleteChildren(frame);
1236  FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1237  scales.clear();
1238  thresholds.clear();
1239  buttons.clear();
1240  const bool fixed = scheme.isFixed();
1241  std::vector<double>::const_iterator scaleIt = scheme.getColors().begin();
1242  std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1243  std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1244  while (scaleIt != scheme.getColors().end()) {
1245  FXRealSpinner* scaleDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX);
1246  scaleDialer->setValue(*scaleIt);
1247  scales.push_back(scaleDialer);
1248  if (fixed) {
1249  new FXLabel(m, nameIt->c_str());
1250  new FXLabel(m, "");
1251  new FXLabel(m, "");
1252  } else {
1253  const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1254  FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX | dialerOptions);
1255  threshDialer->setValue(*threshIt);
1256  thresholds.push_back(threshDialer);
1257  buttons.push_back(new FXButton(m, "Add", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1258  buttons.push_back(new FXButton(m, "Remove", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1259  }
1260  scaleIt++;
1261  threshIt++;
1262  nameIt++;
1263  }
1264  interpolation->setCheck(scheme.isInterpolated());
1265  if (fixed) {
1266  interpolation->disable();
1267  } else {
1268  if (scales.size() > 1) {
1269  interpolation->enable();
1270  if (interpolation->getCheck() != FALSE) {
1271  thresholds.front()->enable();
1272  } else {
1273  thresholds.front()->disable();
1274  }
1275  } else {
1276  interpolation->disable();
1277  thresholds.front()->disable();
1278  }
1279  }
1280  return m;
1281 }
1282 
1283 
1284 void
1286  // decals
1287  delete myDecalsTable;
1289  myDecalsTable->setVisibleRows(5);
1290  myDecalsTable->setVisibleColumns(7);
1291  myDecalsTable->setTableSize(5, 7);
1292  myDecalsTable->setBackColor(FXRGB(255, 255, 255));
1293  myDecalsTable->getRowHeader()->setWidth(0);
1294  for (int i = 1; i <= 5; ++i) {
1296  myDecalsTable->setNumberCellParams(i, -10000000, 10000000, 1, 10, 100, "%.2f");
1297  }
1299  if (doCreate) {
1300  myDecalsTable->create();
1301  }
1303  if (doCreate) {
1304  m->create();
1305  }
1307  myLaneColorRainbow->disable();
1308  } else {
1309  myLaneColorRainbow->enable();
1310  }
1312  myJunctionColorRainbow->disable();
1313  } else {
1314  myJunctionColorRainbow->enable();
1315  }
1316  std::string activeSchemeName = myLaneEdgeColorMode->getText().text();
1317  myParamKey->clearItems();
1319  myParamKey->appendItem(mySettings->edgeParam.c_str());
1320  for (const std::string& attr : myParent->getEdgeLaneParamKeys(true)) {
1321  if (attr != mySettings->edgeParam) {
1322  myParamKey->appendItem(attr.c_str());
1323  }
1324  }
1325  myParamKey->enable();
1326  } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_LANE_PARAM_NUMERICAL) {
1327  myParamKey->appendItem(mySettings->laneParam.c_str());
1328  for (const std::string& attr : myParent->getEdgeLaneParamKeys(false)) {
1329  if (attr != mySettings->laneParam) {
1330  myParamKey->appendItem(attr.c_str());
1331  }
1332  }
1333  myParamKey->enable();
1334  } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {
1335  myParamKey->appendItem(mySettings->edgeData.c_str());
1336  for (const std::string& attr : myParent->getEdgeDataAttrs()) {
1337  if (attr != mySettings->edgeData) {
1338  myParamKey->appendItem(attr.c_str());
1339  }
1340  }
1341  myParamKey->enable();
1342  myParamKey->setEditable(false);
1343  } else {
1344  myParamKey->disable();
1345  }
1346  myParamKey->setNumVisible(myParamKey->getNumItems());
1347  myLaneColorSettingFrame->getParent()->recalc();
1348 
1350  if (doCreate) {
1351  m->create();
1352  }
1353  myLaneScaleSettingFrame->getParent()->recalc();
1354 
1356  if (doCreate) {
1357  m->create();
1358  }
1359  activeSchemeName = myVehicleColorMode->getText().text();
1360  myVehicleParamKey->setEditable(true);
1363  myVehicleParamKey->enable();
1364  } else {
1365  myVehicleParamKey->disable();
1366  }
1367  myVehicleColorSettingFrame->getParent()->recalc();
1368 
1370  if (doCreate) {
1371  m->create();
1372  }
1373  myVehicleScaleSettingFrame->getParent()->recalc();
1374 
1376  if (doCreate) {
1377  m->create();
1378  }
1379  myPersonColorSettingFrame->getParent()->recalc();
1381  if (doCreate) {
1382  m->create();
1383  }
1384  myContainerColorSettingFrame->getParent()->recalc();
1386  if (doCreate) {
1387  m->create();
1388  }
1389  myJunctionColorSettingFrame->getParent()->recalc();
1390  // POIs
1392  if (doCreate) {
1393  m->create();
1394  }
1395  myPOIColorSettingFrame->getParent()->recalc();
1396  // polygons
1398  if (doCreate) {
1399  m->create();
1400  }
1401  myPolyColorSettingFrame->getParent()->recalc();
1402 
1403  // data
1404  if (mySettings->netedit) {
1406  if (doCreate) {
1407  m->create();
1408  }
1409  activeSchemeName = myDataColorMode->getText().text();
1410  myDataParamKey->setEditable(true);
1412  myDataParamKey->clearItems();
1413  myDataParamKey->appendItem(mySettings->relDataAttr.c_str());
1414  for (const std::string& attr : myParent->getRelDataAttrs()) {
1415  if (attr != mySettings->relDataAttr) {
1416  myDataParamKey->appendItem(attr.c_str());
1417  }
1418  }
1419  myDataParamKey->enable();
1420  } else {
1421  myDataParamKey->disable();
1422  }
1423  myDataColorSettingFrame->getParent()->recalc();
1424  }
1425 
1426  layout();
1427  update();
1428 }
1429 
1430 
1431 void
1433  myVehicleParamKey->clearItems();
1434  myVehicleTextParamKey->clearItems();
1435  myVehicleParamKey->appendItem(mySettings->vehicleParam.c_str());
1436  myVehicleTextParamKey->appendItem(mySettings->vehicleTextParam.c_str());
1437  for (const std::string& attr : myParent->getVehicleParamKeys(false)) {
1438  myVehicleParamKey->appendItem(attr.c_str());
1439  myVehicleTextParamKey->appendItem(attr.c_str());
1440  }
1441  myVehicleParamKey->setNumVisible(myVehicleParamKey->getNumItems());
1442  myVehicleTextParamKey->setNumVisible(myVehicleTextParamKey->getNumItems());
1443 }
1444 
1445 void
1447  myPOITextParamKey->clearItems();
1448  myPOITextParamKey->appendItem(mySettings->poiTextParam.c_str());
1449  for (const std::string& attr : myParent->getPOIParamKeys()) {
1450  myPOITextParamKey->appendItem(attr.c_str());
1451  }
1452  myPOITextParamKey->setNumVisible(myPOITextParamKey->getNumItems());
1453 }
1454 
1455 long
1456 GUIDialog_ViewSettings::onCmdEditTable(FXObject*, FXSelector, void* ptr) {
1458  std::string value = i->item->getText().text();
1459  // check whether the inserted value is empty
1460  if (value.find_first_not_of(" ") == std::string::npos) {
1461  return 1;
1462  }
1464  int row = i->row;
1465  // check whether we add a new entry or edit an existing entry
1466  if (row == static_cast<int>(myDecals->size())) {
1467  d.filename = "";
1468  d.centerX = double(myParent->getGridWidth() / 2.);
1469  d.centerY = double(myParent->getGridHeight() / 2.);
1470  d.width = 0.;
1471  d.height = 0.;
1472  d.initialised = false;
1473  d.rot = 0;
1474  d.layer = 0;
1475  d.screenRelative = false;
1476  myDecalsLock->lock();
1477  myDecals->push_back(d);
1478  myDecalsLock->unlock();
1479  } else if (row > static_cast<int>(myDecals->size())) {
1480  // ignore clicks two lines below existing entries
1481  return 1;
1482  } else {
1483  d = (*myDecals)[row];
1484  }
1485 
1486  switch (i->col) {
1487  case 0:
1488  if (d.initialised && d.filename != value) {
1489  d.initialised = false;
1490  }
1491  d.filename = StringUtils::trim(value);
1492  break;
1493  case 1:
1494  try {
1495  d.centerX = StringUtils::toDouble(value);
1496  } catch (NumberFormatException&) {
1497  std::string msg = "The value must be a float, is:" + value;
1498  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1499  }
1500  break;
1501  case 2:
1502  try {
1503  d.centerY = StringUtils::toDouble(value);
1504  } catch (NumberFormatException&) {
1505  std::string msg = "The value must be a float, is:" + value;
1506  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1507  }
1508  break;
1509  case 3:
1510  try {
1511  d.width = StringUtils::toDouble(value);
1512  } catch (NumberFormatException&) {
1513  std::string msg = "The value must be a float, is:" + value;
1514  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1515  }
1516  break;
1517  case 4:
1518  try {
1519  d.height = StringUtils::toDouble(value);
1520  } catch (NumberFormatException&) {
1521  std::string msg = "The value must be a float, is:" + value;
1522  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1523  }
1524  break;
1525  case 5:
1526  try {
1527  d.rot = StringUtils::toDouble(value);
1528  } catch (NumberFormatException&) {
1529  std::string msg = "The value must be a float, is:" + value;
1530  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1531  }
1532  break;
1533  case 6:
1534  try {
1535  d.layer = StringUtils::toDouble(value);
1536  } catch (NumberFormatException&) {
1537  std::string msg = "The value must be a float, is:" + value;
1538  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1539  }
1540  break;
1541  case 7:
1542  try {
1544  } catch (NumberFormatException&) {
1545  std::string msg = "The value must be a bool, is:" + value;
1546  FXMessageBox::error(this, MBOX_OK, "Number format error", "%s", msg.c_str());
1547  }
1548  break;
1549  default:
1550  throw 1;
1551  }
1552  (*myDecals)[row] = d;
1553  if (!i->updateOnly) {
1555  }
1556  myParent->update();
1557  return 1;
1558 }
1559 
1560 
1561 std::string
1563  return mySchemeName->getItem(mySchemeName->getCurrentItem()).text();
1564 }
1565 
1566 
1567 void
1569  if (name.c_str() == mySchemeName->getItemText(mySchemeName->getCurrentItem())) {
1570  return;
1571  }
1572  for (int i = 0; i < mySchemeName->getNumItems(); ++i) {
1573  if (name.c_str() == mySchemeName->getItemText(i)) {
1574  mySchemeName->setCurrentItem(i);
1575  onCmdNameChange(nullptr, 0, (void*)name.c_str());
1576  return;
1577  }
1578  }
1579 }
1580 
1582  FXMatrix* parent,
1583  GUIDialog_ViewSettings* target,
1584  const std::string& title,
1585  const GUIVisualizationTextSettings& settings) {
1586  myCheck = new FXCheckButton(parent, title.c_str(), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1587  myCheck->setCheck(settings.showText);
1588  myMatrix0 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1589  mySelectedCheck = new FXCheckButton(myMatrix0, "Only for selected", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1590  mySelectedCheck->setCheck(settings.onlySelected);
1591  myConstSizeCheck = new FXCheckButton(myMatrix0, "constant text size", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1592  myConstSizeCheck->setCheck(settings.constSize);
1593  FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1594  new FXLabel(m1, "Size", nullptr, GUIDesignViewSettingsLabel1);
1595  mySizeDial = new FXRealSpinner(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1596  mySizeDial->setRange(5, 1000);
1597  mySizeDial->setValue(settings.size);
1598  FXMatrix* m2 = new FXMatrix(parent, 4, GUIDesignViewSettingsMatrix5);
1599  new FXLabel(m2, "Color", nullptr, GUIDesignViewSettingsLabel1);
1601  new FXLabel(m2, "Background", nullptr, GUIDesignViewSettingsLabel1);
1603 }
1604 
1605 
1608  return GUIVisualizationTextSettings(myCheck->getCheck() != FALSE,
1609  mySizeDial->getValue(),
1610  MFXUtils::getRGBColor(myColorWell->getRGBA()),
1611  MFXUtils::getRGBColor(myBGColorWell->getRGBA()),
1612  myConstSizeCheck->getCheck() != FALSE,
1613  mySelectedCheck->getCheck() != FALSE);
1614 }
1615 
1616 
1617 void
1619  myCheck->setCheck(settings.showText);
1620  mySizeDial->setValue(settings.size);
1621  myColorWell->setRGBA(MFXUtils::getFXColor(settings.color));
1622  myBGColorWell->setRGBA(MFXUtils::getFXColor(settings.bgColor));
1623  myConstSizeCheck->setCheck(settings.constSize);
1624  mySelectedCheck->setCheck(settings.onlySelected);
1625 }
1626 
1627 
1629  FXMatrix* parent,
1630  GUIDialog_ViewSettings* target,
1631  const GUIVisualizationSizeSettings& settings) {
1632  myCheck = new FXCheckButton(parent, "Draw with constant size when zoomed out", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1633  myCheck->setCheck(settings.constantSize);
1634  myCheckSelected = new FXCheckButton(parent, "Only for selected", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1635  myCheckSelected->setCheck(settings.constantSizeSelected);
1636  FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1637  new FXLabel(m1, "Minimum Size", nullptr, GUIDesignViewSettingsLabel1);
1638  myMinSizeDial = new FXRealSpinner(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1639  myMinSizeDial->setValue(settings.minSize);
1640  FXMatrix* m2 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1641  new FXLabel(m2, "Exaggerate by", nullptr, GUIDesignViewSettingsLabel1);
1642  myExaggerateDial = new FXRealSpinner(m2, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
1643  myExaggerateDial->setRange(0, 10000);
1644  myExaggerateDial->setValue(settings.exaggeration);
1645 }
1646 
1647 
1651  myMinSizeDial->getValue(), myExaggerateDial->getValue(),
1652  myCheck->getCheck() != FALSE,
1653  myCheckSelected->getCheck() != FALSE);
1654 }
1655 
1656 
1657 void
1659  myCheck->setCheck(settings.constantSize);
1660  myCheckSelected->setCheck(settings.constantSizeSelected);
1661  myMinSizeDial->setValue(settings.minSize);
1662  myExaggerateDial->setValue(settings.exaggeration);
1663 }
1664 
1665 
1666 void
1668  getApp()->reg().writeIntEntry("VIEWSETTINGS", "x", getX());
1669  getApp()->reg().writeIntEntry("VIEWSETTINGS", "y", getY());
1670  getApp()->reg().writeIntEntry("VIEWSETTINGS", "width", getWidth());
1671  getApp()->reg().writeIntEntry("VIEWSETTINGS", "height", getHeight());
1672 }
1673 
1674 void
1676  // ensure window is visible after switching screen resolutions
1677  const FXint minSize = 400;
1678  const FXint minTitlebarHeight = 20;
1679  setX(MAX2(0, MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "x", 150),
1680  getApp()->getRootWindow()->getWidth() - minSize)));
1681  setY(MAX2(minTitlebarHeight,
1682  MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "y", 150),
1683  getApp()->getRootWindow()->getHeight() - minSize)));
1684  setWidth(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "width", 700), minSize));
1685  setHeight(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "height", 500), minSize));
1686 }
1687 
1688 
1689 void
1690 GUIDialog_ViewSettings::buildHeader(FXVerticalFrame* contentFrame) {
1691  FXHorizontalFrame* horizontalFrame = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame1);
1692  mySchemeName = new FXComboBox(horizontalFrame, 20, this, MID_SIMPLE_VIEW_NAMECHANGE, GUIDesignViewSettingsComboBox1);
1693  for (const auto& name : gSchemeStorage.getNames()) {
1694  const int index = mySchemeName->appendItem(name.c_str());
1695  if (name == mySettings->name) {
1696  mySchemeName->setCurrentItem((FXint)index);
1697  }
1698  }
1699  mySchemeName->setNumVisible(5);
1700 
1701  new FXButton(horizontalFrame, "\t\tSave the setting to registry", GUIIconSubSys::getIcon(GUIIcon::SAVEDB), this, MID_SIMPLE_VIEW_SAVE, GUIDesignButtonToolbar);
1702  new FXButton(horizontalFrame, "\t\tRemove the setting from registry", GUIIconSubSys::getIcon(GUIIcon::REMOVEDB), this, MID_SIMPLE_VIEW_DELETE, GUIDesignButtonToolbar);
1703  new FXButton(horizontalFrame, "\t\tExport setting to file", GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_SIMPLE_VIEW_EXPORT, GUIDesignButtonToolbar);
1704  new FXButton(horizontalFrame, "\t\tLoad setting from file", GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG), this, MID_SIMPLE_VIEW_IMPORT, GUIDesignButtonToolbar);
1705 
1706  new FXVerticalSeparator(horizontalFrame);
1707  new FXLabel(horizontalFrame, "Export includes:", nullptr, GUIDesignViewSettingsLabel1);
1708  mySaveViewPort = new FXCheckButton(horizontalFrame, "Viewport");
1709  mySaveDelay = new FXCheckButton(horizontalFrame, "Delay");
1710  mySaveDecals = new FXCheckButton(horizontalFrame, "Decals");
1711  mySaveBreakpoints = new FXCheckButton(horizontalFrame, "Breakpoints");
1712  if (mySettings->netedit) {
1713  mySaveBreakpoints->disable();
1714  }
1715 }
1716 
1717 
1718 void
1720  // tab for the background
1721  new FXTabItem(tabbook, "Background", nullptr, GUIDesignViewSettingsTabItemBook1);
1722  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
1723  FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
1724 
1725  FXMatrix* matrixColor = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
1726  new FXLabel(matrixColor, "Color", nullptr, GUIDesignViewSettingsLabel1);
1728 
1729  FXVerticalFrame* verticalFrameDecals = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame3);
1730  new FXLabel(verticalFrameDecals, "Decals:");
1731  myDecalsFrame = new FXVerticalFrame(verticalFrameDecals);
1732  FXHorizontalFrame* horizontalFrameButtonsDecals = new FXHorizontalFrame(verticalFrameDecals, GUIDesignViewSettingsHorizontalFrame2);
1733  new FXButton(horizontalFrameButtonsDecals, "&Load Decals", nullptr, this, MID_SIMPLE_VIEW_LOAD_DECALS, GUIDesignViewSettingsButton1);
1734  new FXButton(horizontalFrameButtonsDecals, "&Save Decals", nullptr, this, MID_SIMPLE_VIEW_SAVE_DECALS, GUIDesignViewSettingsButton1);
1735  new FXButton(horizontalFrameButtonsDecals, "&Clear Decals", nullptr, this, MID_SIMPLE_VIEW_CLEAR_DECALS, GUIDesignViewSettingsButton1);
1736 
1737  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1738 
1739  FXMatrix* matrixGrid = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
1740  myShowGrid = new FXCheckButton(matrixGrid, "Toggle grid", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1741  myShowGrid->setCheck(mySettings->showGrid);
1742  new FXLabel(matrixGrid, "");
1743  FXMatrix* matrixGridX = new FXMatrix(matrixGrid, 2, GUIDesignViewSettingsMatrix2);
1744  new FXLabel(matrixGridX, "x-spacing", nullptr, GUIDesignViewSettingsLabel1);
1745  myGridXSizeDialer = new FXRealSpinner(matrixGridX, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1746  myGridXSizeDialer->setRange(1, 10000);
1748  FXMatrix* matrixGridY = new FXMatrix(matrixGrid, 2, GUIDesignViewSettingsMatrix2);
1749  new FXLabel(matrixGridY, "y-spacing", nullptr, GUIDesignViewSettingsLabel1);
1750  myGridYSizeDialer = new FXRealSpinner(matrixGridY, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1751  myGridYSizeDialer->setRange(1, 10000);
1753 }
1754 
1755 
1756 void
1758  new FXTabItem(tabbook, "Streets", nullptr, GUIDesignViewSettingsTabItemBook1);
1759  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
1760  FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
1761  // ... color settings
1762  FXVerticalFrame* verticalFrameColor = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);
1763  FXMatrix* matrixColor = new FXMatrix(verticalFrameColor, 4, GUIDesignViewSettingsMatrix3);
1764  new FXLabel(matrixColor, "Color", nullptr, GUIDesignViewSettingsLabel1);
1766  myLaneColorInterpolation = new FXCheckButton(matrixColor, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1767  myLaneColorSettingFrame = new FXVerticalFrame(verticalFrameColor, GUIDesignViewSettingsVerticalFrame4);
1768  myParamKey = new FXComboBox(matrixColor, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1769  myParamKey->disable();
1770  myParamKey->setEditable(true);
1771 
1772  // rainbow settings
1773  FXMatrix* matrixRainbow = new FXMatrix(verticalFrameColor, 3, GUIDesignViewSettingsMatrix3);
1774  myLaneColorRainbow = new FXButton(matrixRainbow, "Recalibrate Rainbow", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
1775  (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
1776  myLaneColorRainbowCheck = new FXCheckButton(matrixRainbow, "hide below threshold", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1777  myLaneColorRainbowThreshold = new FXRealSpinner(matrixRainbow, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);
1778  myLaneColorRainbowThreshold->setRange(-100000, 100000);
1779 
1780  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1781  // ... scale settings
1782  FXVerticalFrame* verticalFrameScale = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);
1783  FXMatrix* matrixScale = new FXMatrix(verticalFrameScale, 3, GUIDesignViewSettingsMatrix3);
1784  new FXLabel(matrixScale, "Scale width", nullptr, GUIDesignViewSettingsLabel1);
1786  myLaneScaleInterpolation = new FXCheckButton(matrixScale, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1787  myLaneScaleSettingFrame = new FXVerticalFrame(verticalFrameScale, GUIDesignViewSettingsVerticalFrame4);
1788 
1794  } else {
1799  }
1800 
1801  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1802  FXMatrix* matrixLanes = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
1803 
1804  myShowLaneBorders = new FXCheckButton(matrixLanes, "Show lane borders", this, MID_SIMPLE_VIEW_COLORCHANGE);
1806  myShowBikeMarkings = new FXCheckButton(matrixLanes, "Show bike markings", this, MID_SIMPLE_VIEW_COLORCHANGE);
1808 
1809  myShowLaneDecals = new FXCheckButton(matrixLanes, "Show turning arrows", this, MID_SIMPLE_VIEW_COLORCHANGE);
1811  new FXLabel(matrixLanes, " ", nullptr, GUIDesignViewSettingsLabel1);
1812 
1813  myShowLinkRules = new FXCheckButton(matrixLanes, "Show right-of-way rules", this, MID_SIMPLE_VIEW_COLORCHANGE);
1815  myRealisticLinkRules = new FXCheckButton(matrixLanes, "Realistic stop line colors", this, MID_SIMPLE_VIEW_COLORCHANGE);
1817 
1818  myShowRails = new FXCheckButton(matrixLanes, "Show rails", this, MID_SIMPLE_VIEW_COLORCHANGE);
1819  myShowRails->setCheck(mySettings->showRails);
1820  new FXLabel(matrixLanes, " ", nullptr, GUIDesignViewSettingsLabel1);
1821  myHideMacroConnectors = new FXCheckButton(matrixLanes, "Hide macro connectors", this, MID_SIMPLE_VIEW_COLORCHANGE);
1823  new FXLabel(matrixLanes, " ", nullptr, GUIDesignViewSettingsLabel1);
1824  myShowLaneDirection = new FXCheckButton(matrixLanes, "Show lane direction", this, MID_SIMPLE_VIEW_COLORCHANGE);
1826  new FXLabel(matrixLanes, " ", nullptr, GUIDesignViewSettingsLabel1);
1827  myShowSublanes = new FXCheckButton(matrixLanes, "Show sublanes", this, MID_SIMPLE_VIEW_COLORCHANGE);
1829  mySpreadSuperposed = new FXCheckButton(matrixLanes, "Spread bidirectional railway\t\tMake both directional edges for a bidirectional railway visible", this, MID_SIMPLE_VIEW_COLORCHANGE);
1831  new FXLabel(matrixLanes, "Exaggerate width by", nullptr, GUIDesignViewSettingsLabel1);
1832  myLaneWidthUpscaleDialer = new FXRealSpinner(matrixLanes, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
1833  myLaneWidthUpscaleDialer->setRange(0, 1000000);
1835 
1836  new FXLabel(matrixLanes, "Minimum size", nullptr, GUIDesignViewSettingsLabel1);
1837  myLaneMinWidthDialer = new FXRealSpinner(matrixLanes, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
1838  myLaneMinWidthDialer->setRange(0, 1000000);
1840 
1841  // edge name
1842  myEdgeNamePanel = new NamePanel(matrixLanes, this, "Show edge id", mySettings->edgeName);
1843  myStreetNamePanel = new NamePanel(matrixLanes, this, "Show street name", mySettings->streetName);
1844  myEdgeValuePanel = new NamePanel(matrixLanes, this, "Show edge color value", mySettings->edgeValue);
1845 }
1846 
1847 
1848 void
1850  new FXTabItem(tabbook, "Vehicles", nullptr, GUIDesignViewSettingsTabItemBook1);
1851  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
1852  FXVerticalFrame* verticalframe = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
1853 
1854  FXMatrix* matrixShowAs = new FXMatrix(verticalframe, 2, GUIDesignViewSettingsMatrix3);
1855  new FXLabel(matrixShowAs, "Show As", nullptr, GUIDesignViewSettingsLabel1);
1857  myVehicleShapeDetail->appendIconItem("'triangles'");
1859  myVehicleShapeDetail->appendIconItem("'simple shapes'");
1860  myVehicleShapeDetail->appendIconItem("'raster images'");
1861  myVehicleShapeDetail->appendIconItem("'circles'");
1864 
1865  new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
1866 
1867  FXMatrix* matrixColor = new FXMatrix(verticalframe, 4, GUIDesignViewSettingsMatrix3);
1868  new FXLabel(matrixColor, "Color", nullptr, GUIDesignViewSettingsLabel1);
1872  myVehicleColorInterpolation = new FXCheckButton(matrixColor, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1873  myVehicleParamKey = new FXComboBox(matrixColor, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1874  myVehicleParamKey->setEditable(true);
1875  myVehicleParamKey->disable();
1876 
1877  myVehicleColorSettingFrame = new FXVerticalFrame(verticalframe, GUIDesignViewSettingsVerticalFrame4);
1878  new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
1879 
1880  // vehicle scale settings
1881  FXVerticalFrame* verticalFrameScale = new FXVerticalFrame(verticalframe, GUIDesignViewSettingsVerticalFrame6);
1882  FXMatrix* matrixScale = new FXMatrix(verticalFrameScale, 3, GUIDesignViewSettingsMatrix3);
1883  new FXLabel(matrixScale, "Scale size", nullptr, GUIDesignViewSettingsLabel1);
1885  myVehicleScaleInterpolation = new FXCheckButton(matrixScale, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1886  myVehicleScaleSettingFrame = new FXVerticalFrame(verticalFrameScale, GUIDesignViewSettingsVerticalFrame4);
1889  new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
1890 
1891  FXMatrix* matrixVehicle = new FXMatrix(verticalframe, 2, GUIDesignMatrixViewSettings);
1892  myVehicleNamePanel = new NamePanel(matrixVehicle, this, "Show vehicle id", mySettings->vehicleName);
1893  myVehicleValuePanel = new NamePanel(matrixVehicle, this, "Show vehicle color value", mySettings->vehicleValue);
1894  myVehicleScaleValuePanel = new NamePanel(matrixVehicle, this, "Show vehicle scale value", mySettings->vehicleScaleValue);
1895  myVehicleTextPanel = new NamePanel(matrixVehicle, this, "Show vehicle text param", mySettings->vehicleText);
1897  myVehicleTextParamKey->setEditable(true);
1898 
1899  //new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
1900 
1901  FXMatrix* matrixShow = new FXMatrix(verticalframe, 2, GUIDesignMatrixViewSettings);
1902  myShowBlinker = new FXCheckButton(matrixShow, "Show blinker / brake lights", this, MID_SIMPLE_VIEW_COLORCHANGE);
1903  myShowBlinker->setCheck(mySettings->showBlinker);
1904  myShowMinGap = new FXCheckButton(matrixShow, "Show minimum gap", this, MID_SIMPLE_VIEW_COLORCHANGE);
1905  myShowMinGap->setCheck(mySettings->drawMinGap);
1906  myShowBrakeGap = new FXCheckButton(matrixShow, "Show brake gap", this, MID_SIMPLE_VIEW_COLORCHANGE);
1908  myShowBTRange = new FXCheckButton(matrixShow, "Show Bluetooth range", this, MID_SIMPLE_VIEW_COLORCHANGE);
1909  myShowBTRange->setCheck(mySettings->showBTRange);
1910  myShowRouteIndex = new FXCheckButton(matrixShow, "Show route index", this, MID_SIMPLE_VIEW_COLORCHANGE);
1912  myScaleLength = new FXCheckButton(matrixShow, "Scale length with geometry", this, MID_SIMPLE_VIEW_COLORCHANGE);
1913  myScaleLength->setCheck(mySettings->scaleLength);
1914  myShowParkingInfo = new FXCheckButton(matrixShow, "Show parking info", this, MID_SIMPLE_VIEW_COLORCHANGE);
1916  //new FXLabel(matrixShow, " ", nullptr, GUIDesignViewSettingsLabel1);
1917  //myShowLaneChangePreference = new FXCheckButton(matrixShow, "Show lane change preference", this, MID_SIMPLE_VIEW_COLORCHANGE);
1918  //myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
1919  //tmpc = new FXCheckButton(matrixShow, "Show needed headway", 0 ,0);
1920  //tmpc->disable();
1921 
1922  //new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
1923 
1924  FXMatrix* matrixSize = new FXMatrix(verticalframe, 2, GUIDesignViewSettingsMatrix1);
1925  myVehicleSizePanel = new SizePanel(matrixSize, this, mySettings->vehicleSize);
1926 }
1927 
1928 
1929 void
1931  new FXTabItem(tabbook, "Persons", nullptr, GUIDesignViewSettingsTabItemBook1);
1932  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
1933  FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
1934 
1935  FXMatrix* m101 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix3);
1936  new FXLabel(m101, "Show As", nullptr, GUIDesignViewSettingsLabel1);
1938  myPersonShapeDetail->appendIconItem("'triangles'");
1939  myPersonShapeDetail->appendIconItem("'circles'");
1940  myPersonShapeDetail->appendIconItem("'simple shapes'");
1941  myPersonShapeDetail->appendIconItem("'raster images'");
1944 
1945  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1946 
1947  FXMatrix* m102 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
1948  new FXLabel(m102, "Color", nullptr, GUIDesignViewSettingsLabel1);
1952  myPersonColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1953 
1954  myPersonColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
1955 
1956  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1957 
1958  FXMatrix* m103 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
1959  myPersonNamePanel = new NamePanel(m103, this, "Show person id", mySettings->personName);
1960  myPersonValuePanel = new NamePanel(m103, this, "Show person color value", mySettings->personValue);
1961 
1962  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1963 
1964  FXMatrix* m104 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
1965  myPersonSizePanel = new SizePanel(m104, this, mySettings->personSize);
1966 }
1967 
1968 
1969 void
1971  new FXTabItem(tabbook, "Containers", nullptr, GUIDesignViewSettingsTabItemBook1);
1972  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
1973  FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
1974 
1975  FXMatrix* m101 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix3);
1976  new FXLabel(m101, "Show As", nullptr, GUIDesignViewSettingsLabel1);
1978  myContainerShapeDetail->appendIconItem("'triangles'");
1980  myContainerShapeDetail->appendIconItem("'simple shapes'");
1981  myContainerShapeDetail->appendIconItem("'raster images'");
1984 
1985  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1986 
1987  FXMatrix* m102 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
1988  new FXLabel(m102, "Color", nullptr, GUIDesignViewSettingsLabel1);
1992  myContainerColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1993 
1994  myContainerColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
1995 
1996  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1997 
1998  FXMatrix* m103 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
1999  myContainerNamePanel = new NamePanel(m103, this, "Show container id", mySettings->containerName);
2000 
2001  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2002 
2003  FXMatrix* m104 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
2005 }
2006 
2007 
2008 void
2010  new FXTabItem(tabbook, "Junctions", nullptr, GUIDesignViewSettingsTabItemBook1);
2011  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2012  FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2013  FXMatrix* m41 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2014  new FXLabel(m41, "Color", nullptr, GUIDesignViewSettingsLabel1);
2018  myJunctionColorInterpolation = new FXCheckButton(m41, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2019 
2020  myJunctionColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2021  myJunctionColorRainbow = new FXButton(verticalFrame, "Recalibrate Rainbow", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
2022  (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
2023 
2024  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2025  FXMatrix* m42 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2027  myDrawJunctionShape = new FXCheckButton(m42, "Draw junction shape", this, MID_SIMPLE_VIEW_COLORCHANGE);
2029  myDrawCrossingsAndWalkingAreas = new FXCheckButton(m42, "Draw crossings/walkingareas", this, MID_SIMPLE_VIEW_COLORCHANGE);
2031  myShowLane2Lane = new FXCheckButton(m42, "Show lane to lane connections", this, MID_SIMPLE_VIEW_COLORCHANGE);
2033  new FXLabel(m42, " ", nullptr, GUIDesignViewSettingsLabel1);
2034 
2035  myTLIndexPanel = new NamePanel(m42, this, "Show link tls index", mySettings->drawLinkTLIndex);
2036  myJunctionIndexPanel = new NamePanel(m42, this, "Show link junction index", mySettings->drawLinkJunctionIndex);
2037  myJunctionIDPanel = new NamePanel(m42, this, "Show junction id", mySettings->junctionID);
2038  myInternalJunctionNamePanel = new NamePanel(m42, this, "Show internal junction id", mySettings->internalJunctionName);
2039  myInternalEdgeNamePanel = new NamePanel(m42, this, "Show internal edge id", mySettings->internalEdgeName);
2040  myCwaEdgeNamePanel = new NamePanel(m42, this, "Show crossing and walkingarea id", mySettings->cwaEdgeName);
2041  myTLSPhaseIndexPanel = new NamePanel(m42, this, "Show traffic light phase index", mySettings->tlsPhaseIndex);
2042  myTLSPhaseNamePanel = new NamePanel(m42, this, "Show traffic light phase name", mySettings->tlsPhaseName);
2043  myJunctionNamePanel = new NamePanel(m42, this, "Show junction name", mySettings->junctionName);
2044 }
2045 
2046 
2047 void
2049  new FXTabItem(tabbook, "Additional", nullptr, GUIDesignViewSettingsTabItemBook1);
2050  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2051  FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2052  // IDs
2053  FXMatrix* matrixIDs = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2054  myAddNamePanel = new NamePanel(matrixIDs, this, "Show object id", mySettings->addName);
2055  myAddFullNamePanel = new NamePanel(matrixIDs, this, "Show full name", mySettings->addFullName);
2056  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2057  //Sizes
2058  FXMatrix* matrixSizes = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2059  myAddSizePanel = new SizePanel(matrixSizes, this, mySettings->addSize);
2060  // color
2061  FXMatrix* matrixColor = new FXMatrix(verticalFrame, 3, GUIDesignMatrixViewSettings);
2062  new FXLabel(matrixColor, "StoppingPlace", nullptr, GUIDesignViewSettingsLabel1);
2063  new FXLabel(matrixColor, "body", nullptr, GUIDesignViewSettingsLabel1);
2064  new FXLabel(matrixColor, "sign", nullptr, GUIDesignViewSettingsLabel1);
2065  new FXLabel(matrixColor, "busStops", nullptr, GUIDesignViewSettingsLabel1);
2068  new FXLabel(matrixColor, "trainStops", nullptr, GUIDesignViewSettingsLabel1);
2071  new FXLabel(matrixColor, "containerStops", nullptr, GUIDesignViewSettingsLabel1);
2074  new FXLabel(matrixColor, "chargingStations", nullptr, GUIDesignViewSettingsLabel1);
2077 }
2078 
2079 
2080 void
2082  new FXTabItem(tabbook, "Demand", nullptr, GUIDesignViewSettingsTabItemBook1);
2083  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2084  FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2085  // elements
2086  FXMatrix* demandMatrix = new FXMatrix(verticalFrame, 3, GUIDesignMatrixViewSettings);
2087  new FXLabel(demandMatrix, "element", nullptr, GUIDesignViewSettingsLabel1);
2088  new FXLabel(demandMatrix, "color", nullptr, GUIDesignViewSettingsLabel1);
2089  new FXLabel(demandMatrix, "width", nullptr, GUIDesignViewSettingsLabel1);
2090  new FXLabel(demandMatrix, "trips", nullptr, GUIDesignViewSettingsLabel1);
2092  myTripWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2094  new FXLabel(demandMatrix, "personTrips", nullptr, GUIDesignViewSettingsLabel1);
2096  myPersonTripWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2098  new FXLabel(demandMatrix, "walks", nullptr, GUIDesignViewSettingsLabel1);
2100  myWalkWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2102  new FXLabel(demandMatrix, "rides", nullptr, GUIDesignViewSettingsLabel1);
2104  myRideWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2106  new FXLabel(demandMatrix, "transport", nullptr, GUIDesignViewSettingsLabel1);
2108  myTransportWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2110  new FXLabel(demandMatrix, "tranship", nullptr, GUIDesignViewSettingsLabel1);
2112  myTranshipWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2114  // stops
2115  FXMatrix* stopMatrix = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2116  new FXLabel(stopMatrix, "stop", nullptr, GUIDesignViewSettingsLabel1);
2117  new FXLabel(stopMatrix, "color", nullptr, GUIDesignViewSettingsLabel1);
2118  new FXLabel(stopMatrix, "vehicles", nullptr, GUIDesignViewSettingsLabel1);
2120  new FXLabel(stopMatrix, "persons", nullptr, GUIDesignViewSettingsLabel1);
2122  new FXLabel(stopMatrix, "containers", nullptr, GUIDesignViewSettingsLabel1);
2124 }
2125 
2126 
2127 void
2129  new FXTabItem(tabbook, "POIs", nullptr, GUIDesignViewSettingsTabItemBook1);
2130  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2131  FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2132 
2133  FXMatrix* m63 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2134  new FXLabel(m63, "Color", nullptr, GUIDesignViewSettingsLabel1);
2138  myPOIColorInterpolation = new FXCheckButton(m63, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2139  myPOIColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2140 
2141  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2142 
2143  FXMatrix* m61 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2144 
2145  new FXLabel(m61, "POI detail", nullptr, GUIDesignViewSettingsLabel1);
2147  myPoiDetail->setRange(3, 100);
2148  myPoiDetail->setValue(mySettings->poiDetail);
2149 
2150  myPOINamePanel = new NamePanel(m61, this, "Show poi id", mySettings->poiName);
2151  myPOITypePanel = new NamePanel(m61, this, "Show poi type", mySettings->poiType);
2152  myPOITextPanel = new NamePanel(m61, this, "Show poi text param", mySettings->poiText);
2154  myPOITextParamKey->setEditable(true);
2155  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2156 
2157  FXMatrix* m62 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2158  myPOISizePanel = new SizePanel(m62, this, mySettings->poiSize);
2159 }
2160 
2161 
2162 void
2164  new FXTabItem(tabbook, "Polygons", nullptr, GUIDesignViewSettingsTabItemBook1);
2165  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2166  FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2167 
2168  FXMatrix* m63 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2169  new FXLabel(m63, "Color", nullptr, GUIDesignViewSettingsLabel1);
2173  myPolyColorInterpolation = new FXCheckButton(m63, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2174  myPolyColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2175 
2176  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2177 
2178  FXMatrix* m91 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2179  myPolyNamePanel = new NamePanel(m91, this, "Show polygon id", mySettings->polyName);
2180  myPolyTypePanel = new NamePanel(m91, this, "Show polygon types", mySettings->polyType);
2181  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2182 
2183  myPolySizePanel = new SizePanel(m91, this, mySettings->polySize);
2184 }
2185 
2186 
2187 void
2189  new FXTabItem(tabbook, "Selection", nullptr, GUIDesignViewSettingsTabItemBook1);
2190  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2191  FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2192 
2193  FXMatrix* m102 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2194  new FXLabel(m102, "Default Selection Color", nullptr, GUIDesignViewSettingsLabel1);
2195  new FXLabel(m102, "", nullptr, GUIDesignViewSettingsLabel1);
2196 
2197  new FXLabel(m102, "Miscellaneous", nullptr, GUIDesignViewSettingsLabel1);
2199  new FXLabel(m102, "Edge", nullptr, GUIDesignViewSettingsLabel1);
2201  new FXLabel(m102, "Lane Edge", nullptr, GUIDesignViewSettingsLabel1);
2203  new FXLabel(m102, "Connection", nullptr, GUIDesignViewSettingsLabel1);
2205  new FXLabel(m102, "Prohibition", nullptr, GUIDesignViewSettingsLabel1);
2207  new FXLabel(m102, "Crossing", nullptr, GUIDesignViewSettingsLabel1);
2209  new FXLabel(m102, "Additional", nullptr, GUIDesignViewSettingsLabel1);
2211  new FXLabel(m102, "Route", nullptr, GUIDesignViewSettingsLabel1);
2213  new FXLabel(m102, "Vehicle", nullptr, GUIDesignViewSettingsLabel1);
2215  new FXLabel(m102, "Person", nullptr, GUIDesignViewSettingsLabel1);
2217  new FXLabel(m102, "PersonPlan", nullptr, GUIDesignViewSettingsLabel1);
2219  new FXLabel(m102, "edgeData", nullptr, GUIDesignViewSettingsLabel1);
2221 }
2222 
2223 
2224 void
2226  new FXTabItem(tabbook, "Data", nullptr, GUIDesignViewSettingsTabItemBook1);
2227  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2228  FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2229  // ... color settings
2230  FXVerticalFrame* verticalFrame2 = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);
2231  FXMatrix* m111 = new FXMatrix(verticalFrame2, 4, GUIDesignViewSettingsMatrix3);
2232  new FXLabel(m111, "Color", nullptr, GUIDesignViewSettingsLabel1);
2234  myDataColorInterpolation = new FXCheckButton(m111, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2235  myDataColorSettingFrame = new FXVerticalFrame(verticalFrame2, GUIDesignViewSettingsVerticalFrame4);
2236  myDataParamKey = new FXComboBox(m111, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2237  myDataParamKey->disable();
2238  myDataParamKey->setEditable(true);
2241 
2242  // rainbow settings
2243  FXMatrix* m113 = new FXMatrix(verticalFrame2, 3, GUIDesignViewSettingsMatrix3);
2244  myDataColorRainbow = new FXButton(m113, "Recalibrate Rainbow", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
2245  (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
2246  myDataColorRainbowCheck = new FXCheckButton(m113, "hide below threshold", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2247  myDataColorRainbowThreshold = new FXRealSpinner(m113, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);
2248  myDataColorRainbowThreshold->setRange(-100000000, 100000000);
2249 
2250  new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2251  FXMatrix* m112 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
2252 
2253  new FXLabel(m112, "Exaggerate edgeRelation width by", nullptr, GUIDesignViewSettingsLabel1);
2255  myEdgeRelationUpscaleDialer->setRange(0, 1000000);
2257 
2258  new FXLabel(m112, "Exaggerate tazRelation width by", nullptr, GUIDesignViewSettingsLabel1);
2260  myTazRelationUpscaleDialer->setRange(0, 1000000);
2262 
2263  // text decoration
2264  myDataValuePanel = new NamePanel(m112, this, "Show data color value", mySettings->dataValue);
2265 }
2266 
2267 
2268 void
2270  new FXTabItem(tabbook, "Legend", nullptr, GUIDesignViewSettingsTabItemBook1);
2271  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2272  FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2273 
2274  FXMatrix* m72 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2275  myShowSizeLegend = new FXCheckButton(m72, "Show Size Legend", this, MID_SIMPLE_VIEW_COLORCHANGE);
2277  new FXLabel(m72, "");
2278  myShowColorLegend = new FXCheckButton(m72, "Show Edge Color Legend", this, MID_SIMPLE_VIEW_COLORCHANGE);
2280  new FXLabel(m72, "");
2281  myShowVehicleColorLegend = new FXCheckButton(m72, "Show Vehicle Color Legend", this, MID_SIMPLE_VIEW_COLORCHANGE);
2283  new FXLabel(m72, "");
2284 }
2285 
2286 
2287 void
2289  new FXTabItem(tabbook, "openGL", nullptr, GUIDesignViewSettingsTabItemBook1);
2290  FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2291  FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2292 
2293  FXMatrix* m82 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2294  myDither = new FXCheckButton(m82, "Dither", this, MID_SIMPLE_VIEW_COLORCHANGE);
2295  myDither->setCheck(mySettings->dither);
2296  FXMatrix* m83 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2297  myFPS = new FXCheckButton(m83, "FPS", this, MID_SIMPLE_VIEW_COLORCHANGE);
2298  myFPS->setCheck(mySettings->fps);
2299  FXMatrix* m84 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2300  myDrawBoundaries = new FXCheckButton(m84, "Draw boundaries", this, MID_SIMPLE_VIEW_COLORCHANGE);
2302  FXMatrix* m85 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2303  myForceDrawForPositionSelection = new FXCheckButton(m85, "Force draw for position selection", this, MID_SIMPLE_VIEW_COLORCHANGE);
2305  FXMatrix* m86 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2306  myForceDrawForRectangleSelection = new FXCheckButton(m86, "Force draw for rectangle selection", this, MID_SIMPLE_VIEW_COLORCHANGE);
2308  FXMatrix* m87 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2309  myRecalculateBoundaries = new FXButton(m87, "Recalcule boundaries", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
2310  (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
2311 }
2312 
2313 
2314 void
2315 GUIDialog_ViewSettings::buildButtons(FXVerticalFrame* contentFrame) {
2316  FXHorizontalFrame* horizontalFrameButtons = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame2);
2317  FXButton* OK = new FXButton(horizontalFrameButtons, "&OK", nullptr, this, MID_SETTINGS_OK, GUIDesignViewSettingsButton2);
2318  new FXButton(horizontalFrameButtons, "&Cancel", nullptr, this, MID_SETTINGS_CANCEL, GUIDesignViewSettingsButton3);
2319  OK->setFocus();
2320 }
2321 
2322 /****************************************************************************/
@ MID_SIMPLE_VIEW_NAMECHANGE
Informs the dialog about switching to another scheme.
Definition: GUIAppEnum.h:581
@ MID_SIMPLE_VIEW_CLEAR_DECALS
For the clear-decals - button.
Definition: GUIAppEnum.h:595
@ MID_SIMPLE_VIEW_SAVE
For the save-to-db - button.
Definition: GUIAppEnum.h:583
@ MID_TABLE
The Table.
Definition: GUIAppEnum.h:493
@ MID_SIMPLE_VIEW_IMPORT
For the import-from-file - button.
Definition: GUIAppEnum.h:589
@ MID_SIMPLE_VIEW_EXPORT
For the export-to-file - button.
Definition: GUIAppEnum.h:587
@ MID_SIMPLE_VIEW_DELETE
For the delete - button.
Definition: GUIAppEnum.h:585
@ MID_SETTINGS_OK
Ok-button was pushed.
Definition: GUIAppEnum.h:505
@ MID_SETTINGS_CANCEL
Cancel-button was pushed.
Definition: GUIAppEnum.h:507
@ MID_SIMPLE_VIEW_LOAD_DECALS
For the load-decals - button.
Definition: GUIAppEnum.h:591
@ MID_SIMPLE_VIEW_COLORCHANGE
Informs the dialog about a value's change.
Definition: GUIAppEnum.h:579
@ MID_SIMPLE_VIEW_SAVE_DECALS
For the save-decals - button.
Definition: GUIAppEnum.h:593
GUICompleteSchemeStorage gSchemeStorage
#define GUIDesignViewSettingsColorWell2
Definition: GUIDesigns.h:514
#define GUIDesignViewSettingsMatrix3
Definition: GUIDesigns.h:471
#define GUIDesignViewSettingsMainDialog
Definition: GUIDesigns.h:442
#define GUIDesignViewSettingsMatrix5
Definition: GUIDesigns.h:475
#define GUIDesignComboBoxStatic
Combo box static (not editable)
Definition: GUIDesigns.h:270
#define GUIDesignViewSettingsMFXTable
MFX Add/Edit Typed Table.
Definition: GUIDesigns.h:517
#define GUIDesignViewSettingsComboBox1
Combo boxs.
Definition: GUIDesigns.h:478
#define GUIDesignViewSettingsHorizontalFrame3
Definition: GUIDesigns.h:464
#define GUIDesignViewSettingsVerticalFrame6
Definition: GUIDesigns.h:457
#define GUIDesignViewSettingsHorizontalFrame2
Definition: GUIDesigns.h:462
#define GUIDesignViewSettingsButton2
Definition: GUIDesigns.h:503
#define GUIDesignButtonToolbar
little button with icon placed in navigation toolbar
Definition: GUIDesigns.h:100
#define GUIDesignViewSettingsMatrix1
Matrix.
Definition: GUIDesigns.h:467
#define GUIDesignViewSettingsColorWell1
Color wells.
Definition: GUIDesigns.h:512
#define GUIDesignViewSettingsButton4
Definition: GUIDesigns.h:507
#define GUIDesignViewSettingsDialog
Definition: GUIDesigns.h:444
#define GUIDesignViewSettingsMatrix4
Definition: GUIDesigns.h:473
#define GUIDesignViewSettingsSpinDial2
Definition: GUIDesigns.h:485
#define GUIDesignViewSettingsButton5
Definition: GUIDesigns.h:509
#define GUIDesignViewSettingsHorizontalFrame1
Horizontal frames.
Definition: GUIDesigns.h:460
#define GUIDesignViewSettingsSpinDial1
Definition: GUIDesigns.h:483
#define GUIDesignViewSettingsVerticalFrame5
Definition: GUIDesigns.h:455
#define GUIDesignViewSettingsMatrix2
Definition: GUIDesigns.h:469
#define GUIDesignViewSettingsLabel1
Label.
Definition: GUIDesigns.h:493
#define GUIDesignViewSettingsTabBook1
Tab books.
Definition: GUIDesigns.h:488
#define GUIDesignViewSettingsButton3
Definition: GUIDesigns.h:505
#define GUIDesignMatrixViewSettings
FXMatrix used to pack values in Viewsettings.
Definition: GUIDesigns.h:317
#define GUIDesignViewSettingsVerticalFrame2
Definition: GUIDesigns.h:449
#define GUIDesignViewSettingsVerticalFrame3
Definition: GUIDesigns.h:451
#define GUIDesignViewSettingsColorWell
ColorWell.
Definition: GUIDesigns.h:481
#define GUIDesignViewSettingsMFXTableJustify
Definition: GUIDesigns.h:519
#define GUIDesignHorizontalSeparator
Definition: GUIDesigns.h:395
#define GUIDesignViewSettingsVerticalFrame4
Definition: GUIDesigns.h:453
#define GUIDesignViewSettingsTabItemBook1
Definition: GUIDesigns.h:490
#define GUIDesignViewSettingsVerticalFrame1
vertical frames
Definition: GUIDesigns.h:447
#define GUIDesignViewSettingsLabel2
Definition: GUIDesigns.h:495
#define GUIDesignViewSettingsTextField1
textFields
Definition: GUIDesigns.h:498
#define GUIDesignCheckButtonViewSettings
CheckButton for Frames without thick extended over the frame.
Definition: GUIDesigns.h:157
#define GUIDesignViewSettingsButton1
Buttons.
Definition: GUIDesigns.h:501
FXDEFMAP(GUIDialog_ViewSettings) GUIDialog_ViewSettingsMap[]
@ GLO_TAZRELDATA
TAZ relation data.
@ 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:32
@ 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
@ SUMO_ATTR_TIME
trigger: the time of the step
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:30
T MIN2(T a, T b)
Definition: StdDefs.h:74
T MAX2(T a, T b)
Definition: StdDefs.h:80
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
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()
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?
SizePanel(FXMatrix *parent, GUIDialog_ViewSettings *target, const GUIVisualizationSizeSettings &settings)
constructor
void update(const GUIVisualizationSizeSettings &settings)
update
GUIVisualizationSizeSettings getSettings()
get settings
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)
std::vector< FXRealSpinner * > myPersonThresholds
void show()
show view settings dialog
std::vector< FXButton * > myJunctionButtons
MFXIconComboBox * myContainerColorMode
Containers.
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
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.
void buildAdditionalsFrame(FXTabBook *tabbook)
void buildPOIsFrame(FXTabBook *tabbook)
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
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
void fill(MFXIconComboBox &cb)
Fills the given combobox with the names of available colorings.
virtual std::vector< std::string > getPOIParamKeys() const
return list of available vehicle parameters
void setDelay(double delay)
Sets the delay of the parent application.
virtual std::vector< std::string > getRelDataAttrs() const
return list of loaded edgeRelation and tazRelation attributes
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 void recalculateBoundaries()=0
recalculate boundaries
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.
const std::vector< 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
static const std::string SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL
bool drawBoundaries
enable or disable draw boundaries
bool dataValueHideCheck
value below which relation data value should not be rendered
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
GUIVisualizationTextSettings vehicleScaleValue
GUIVisualizationSizeSettings poiSize
bool drawJunctionShape
whether the shape of the junction should be drawn
std::string edgeData
key for coloring by edgeData
GUIVisualizationTextSettings dataValue
bool realisticLinkRules
Information whether link rules (colored bars) shall be drawn with a realistic color scheme.
int personQuality
The quality of person drawing.
GUIColorer poiColorer
The POI colorer.
GUIVisualizationWidthSettings widthSettings
width settings
GUIVisualizationTextSettings poiName
bool showParkingInfo
Set whether parking related information should be shown.
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 scaleLength
Whether vehicle length shall be scaled with length/geometry factor.
bool showVehicleColorLegend
Information whether the vehicle color legend shall be drawn.
double edgeRelWidthExaggeration
The edgeRelation exaggeration (upscale thickness)
bool hideConnectors
flag to show or hidde connectors
GUIScaler vehicleScaler
The size scaling settings for vehicles.
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
double tazRelWidthExaggeration
The tazRelation exaggeration (upscale thickness)
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.
std::string relDataAttr
key for coloring by edgeRelation / tazRelation attribute
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
int poiDetail
The detail level for drawing POIs.
void setCellType(int pos, CellType t)
void setNumberCellParams(int pos, double min, double max, double steps1, double steps2, double steps3, const std::string &format)
ComboBox with icon.
FXString getText() const
Get the text.
FXint getCurrentItem() const
Get the current item's index.
void setCurrentItem(FXint index, FXbool notify=FALSE)
Set the current item (index is zero-based)
void setNumVisible(FXint nvis)
Set the number of visible items in the drop down list.
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon
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:61
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:248
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 startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
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 vehicleTripColor
color for vehicle trips
RGBColor selectionColor
basic selection color
RGBColor selectedEdgeColor
edge selection color
RGBColor selectedPersonPlanColor
person plan selection color (Rides, Walks, stopPersons...)
RGBColor stopPersonColor
color for stopPersons
RGBColor selectedCrossingColor
crossings selection color
RGBColor chargingStationColor
color for chargingStations
RGBColor selectedLaneColor
lane selection color
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
RGBColor selectedEdgeDataColor
edge data selection color
RGBColor trainStopColorSign
color for trainStops signs
RGBColor transhipColor
color for tranships
RGBColor containerStopColor
color for containerStops
RGBColor selectedProhibitionColor
prohibition selection color
RGBColor selectedConnectionColor
connection selection color
RGBColor busStopColorSign
color for busStops signs
RGBColor containerStopColorSign
color for containerStop signs
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
RGBColor transportColor
color for transport
RGBColor busStopColor
color for busStops
RGBColor selectedVehicleColor
vehicle selection color
RGBColor selectedPersonColor
person selection color
RGBColor personTripColor
color for stopPersons
RGBColor stopContainerColor
color for containerStops
RGBColor trainStopColor
color for trainStops
RGBColor chargingStationColorSign
color for chargingStation sign
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 onlySelected
whether only selected objects shall have text drawn
bool constSize
@brif flag to avoid size changes
double personTripWidth
width for person trips
FXTableItem * item