Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUIDialog_ViewSettings.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 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/****************************************************************************/
22// The dialog to change the view (gui) settings.
23/****************************************************************************/
24#include <config.h>
25
26#include <fstream>
44
47
48
49// ===========================================================================
50// FOX callback mapping
51// ===========================================================================
52
57
58FXDEFMAP(GUIDialog_ViewSettings) GUIDialog_ViewSettingsMap[] = {
62 FXMAPFUNC(SEL_COMMAND, MID_SETTINGS_OK, GUIDialog_ViewSettings::onCmdOk),
64 // settings
73 // decals
78};
79
80FXIMPLEMENT(GUIDialog_ViewSettings, FXDialogBox, GUIDialog_ViewSettingsMap, ARRAYNUMBER(GUIDialog_ViewSettingsMap))
81FXIMPLEMENT(GUIDialog_ViewSettings::SizePanel, FXObject, GUIDialog_SizeMap, ARRAYNUMBER(GUIDialog_SizeMap))
82
83// ===========================================================================
84// method definitions
85// ===========================================================================
86
88 FXDialogBox(parent, TL("View Settings"), GUIDesignViewSettingsMainDialog),
89 GUIPersistentWindowPos(this, "VIEWSETTINGS", true, 20, 40, 700, 500, 400, 20),
90 myParent(parent),
91 mySettings(settings),
92 myBackup(settings->name, settings->netedit) {
93 // make a backup copy
94 myBackup.copy(*settings);
95 // create content frame
96 FXVerticalFrame* contentFrame = new FXVerticalFrame(this, GUIDesignViewSettingsVerticalFrame1);
97 // build header
98 buildHeader(contentFrame);
99 // create tabbook for every section
100 FXTabBook* tabbook = new FXTabBook(contentFrame, nullptr, 0, GUIDesignViewSettingsTabBook1);
101 // build background frame
102 buildBackgroundFrame(tabbook);
103 // build streets frame
104 buildStreetsFrame(tabbook);
105 // build vehicles frame
106 buildVehiclesFrame(tabbook);
107 // build persons frame
108 buildPersonsFrame(tabbook);
109 // build containers frame
110 buildContainersFrame(tabbook);
111 // build junctions frame
112 buildJunctionsFrame(tabbook);
113 // build additionals frame
114 buildAdditionalsFrame(tabbook);
115 // build demand frame
116 if (mySettings->netedit) {
117 buildDemandFrame(tabbook);
118 }
119 // build POIs frame
120 buildPOIsFrame(tabbook);
121 // build polygons frame
122 buildPolygonsFrame(tabbook);
123 // build selection frame (only in netedit)
124 if (mySettings->netedit) {
125 buildSelectionFrame(tabbook);
126 }
127 // build data frame (only in netedit)
128 if (mySettings->netedit) {
129 buildDataFrame(tabbook);
130 }
131 // build legend frame
132 buildLegendFrame(tabbook);
133 // build 3D frame
134 build3DFrame(tabbook);
135 if (mySettings->netedit) {
136 myFrame3D->disable();
137 }
138 // build openGL frame
139 buildOpenGLFrame(tabbook);
140 // build buttons
141 buildButtons(contentFrame);
142 // rebuild color matrix
143 rebuildColorMatrices(false);
145 loadWindowPos();
146}
147
148
150 myParent->remove(this);
151 // delete name panels
155 delete myTLSPhaseNamePanel;
156 delete myCwaEdgeNamePanel;
157 delete myStreetNamePanel;
158 delete myEdgeValuePanel;
161 delete myTLIndexPanel;
162 delete myJunctionIDPanel;
163 delete myJunctionNamePanel;
164 delete myVehicleNamePanel;
165 delete myVehicleValuePanel;
167 delete myVehicleTextPanel;
168 delete myPersonNamePanel;
169 delete myPersonValuePanel;
170 delete myAddNamePanel;
171 delete myAddFullNamePanel;
172 delete myPOINamePanel;
173 delete myPOITypePanel;
174 delete myPOITextPanel;
175 delete myPolyNamePanel;
176 delete myPolyTypePanel;
177 delete myEdgeNamePanel;
178 delete myDataValuePanel;
180 // delete size panels
181 delete myVehicleSizePanel;
182 delete myPersonSizePanel;
183 delete myJunctionSizePanel;
184 delete myPOISizePanel;
185 delete myPolySizePanel;
186 delete myAddSizePanel;
187 // delete rainbow panels
188 delete myEdgeRainbowPanel;
190 delete myDataRainbowPanel;
191}
192
193
194void
196 // update buttons that can be changed externally
197 myShowGrid->setCheck(mySettings->showGrid);
200 // create myNewDecalsTable
201 myDecalsTable->create();
203 FXDialogBox::show();
204}
205
206
211
212
213void
215 mySettings = settings;
216 myBackup.copy(*settings);
217 onCmdNameChange(nullptr, 0, nullptr);
218}
219
220
221long
222GUIDialog_ViewSettings::onCmdOk(FXObject*, FXSelector, void*) {
223 getApp()->reg().writeIntEntry("SETTINGS", "comboRows", (int)myComboRows->getValue());
224 hide();
225 return 1;
226}
227
228
229long
230GUIDialog_ViewSettings::onCmdCancel(FXObject*, FXSelector, void*) {
231 hide();
233 myParent->update();
234 return 1;
235}
236
237
238long
239GUIDialog_ViewSettings::onCmdNameChange(FXObject*, FXSelector, void* ptr) {
240 if (ptr != nullptr) {
241 FXString dataS = (char*) ptr; // !!!unicode
242 // check whether this item has been added twice
243 if (dataS.text() == mySchemeName->getItemText(mySchemeName->getNumItems() - 1)) {
244 for (int i = 0; i < mySchemeName->getNumItems() - 1; ++i) {
245 if (dataS.text() == mySchemeName->getItemText(i)) {
247 }
248 }
249 }
250 myBackup.copy(gSchemeStorage.get(dataS.text()));
251 mySettings = &gSchemeStorage.get(dataS.text());
252 }
254
263 if (mySettings->netedit) {
274
281
294
300 }
301
309 myShowRails->setCheck(mySettings->showRails);
325
338 /*
339 myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
340 */
346
352
357
368
372
373 myPoiDetail->setValue(mySettings->poiDetail);
380
386
390 myDither->setCheck(mySettings->dither);
391 myFPS->setCheck(mySettings->fps);
392 myTrueZ->setCheck(mySettings->trueZ);
400
403
406
407 update();
408 myParent->update();
409 return 1;
410}
411
412
413bool
414GUIDialog_ViewSettings::updateColorRanges(FXObject* sender, std::vector<FXColorWell*>::const_iterator colIt,
415 std::vector<FXColorWell*>::const_iterator colEnd,
416 std::vector<FXRealSpinner*>::const_iterator threshIt,
417 std::vector<FXRealSpinner*>::const_iterator threshEnd,
418 std::vector<FXButton*>::const_iterator buttonIt,
419 GUIColorScheme& scheme) {
420 UNUSED_PARAMETER(threshEnd);
421 int pos = 0;
422 while (colIt != colEnd) {
423 if (scheme.isFixed()) {
424 if (sender == *colIt) {
425 scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
426 }
427 } else {
428 if (sender == *threshIt) {
429 const double val = (*threshIt)->getValue();
430 scheme.setThreshold(pos, val);
431 return false;
432 }
433 if (sender == *colIt) {
434 scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
435 return false;
436 }
437 if (sender == *buttonIt) {
438 scheme.addColor(MFXUtils::getRGBColor((*colIt)->getRGBA()), (*threshIt)->getValue());
439 return true;
440 } else if (sender == *(buttonIt + 1)) {
441 scheme.removeColor(pos);
442 return true;
443 }
444 // 2 buttons per item (add / remove)
445 threshIt++;
446 buttonIt += 2;
447 }
448 ++colIt;
449 pos++;
450 }
451 return false;
452}
453
454
455bool
456GUIDialog_ViewSettings::updateScaleRanges(FXObject* sender, std::vector<FXRealSpinner*>::const_iterator scaleIt,
457 std::vector<FXRealSpinner*>::const_iterator scaleEnd,
458 std::vector<FXRealSpinner*>::const_iterator threshIt,
459 std::vector<FXRealSpinner*>::const_iterator threshEnd,
460 std::vector<FXButton*>::const_iterator buttonIt,
461 GUIScaleScheme& scheme) {
462 int pos = 0;
463 while (scaleIt != scaleEnd) {
464 if (scheme.isFixed()) {
465 if (sender == *scaleIt) {
466 scheme.setColor(pos, (*scaleIt)->getValue());
467 }
468 } else {
469 if (sender == *threshIt) {
470 const double val = (*threshIt)->getValue();
471 double lo, hi;
472 if (pos != 0) {
473 threshIt--;
474 (*threshIt)->getRange(lo, hi);
475 (*threshIt)->setRange(lo, val);
476 threshIt++;
477 }
478 threshIt++;
479 if (threshIt != threshEnd) {
480 (*threshIt)->getRange(lo, hi);
481 (*threshIt)->setRange(val, hi);
482 }
483 scheme.setThreshold(pos, val);
484 return false;
485 }
486 if (sender == *scaleIt) {
487 scheme.setColor(pos, (*scaleIt)->getValue());
488 return false;
489 }
490 if (sender == *buttonIt) {
491 scheme.addColor((*scaleIt)->getValue(), (*threshIt)->getValue());
492 return true;
493 } else if (sender == *(buttonIt + 1)) {
494 scheme.removeColor(pos);
495 return true;
496 }
497 threshIt++;
498 buttonIt += 2;
499 }
500 ++scaleIt;
501 pos++;
502 }
503 return false;
504}
505
506
507long
508GUIDialog_ViewSettings::onCmdColorChange(FXObject* sender, FXSelector, void* /*val*/) {
510 tmpSettings.copy(*mySettings);
511 int prevLaneMode = mySettings->getLaneEdgeMode();
512 int prevLaneScaleMode = mySettings->getLaneEdgeScaleMode();
513 int prevVehicleMode = mySettings->vehicleColorer.getActive();
514 int prevVehicleScaleMode = mySettings->vehicleScaler.getActive();
515 int prevPersonMode = mySettings->personColorer.getActive();
516 int prevContainerMode = mySettings->containerColorer.getActive();
517 int prevJunctionMode = mySettings->junctionColorer.getActive();
518 int prevPOIMode = mySettings->poiColorer.getActive();
519 int prevPolyMode = mySettings->polyColorer.getActive();
520 int prevDataMode = mySettings->dataColorer.getActive();
521 bool doRebuildColorMatrices = false;
522
523 tmpSettings.name = mySettings->name;
525
526 // additionals
535 if (mySettings->netedit) {
546
547 tmpSettings.widthSettings.tripWidth = myTripWidth->getValue();
548 tmpSettings.widthSettings.personTripWidth = myPersonTripWidth->getValue();
549 tmpSettings.widthSettings.walkWidth = myWalkWidth->getValue();
550 tmpSettings.widthSettings.rideWidth = myRideWidth->getValue();
551 tmpSettings.widthSettings.transportWidth = myTransportWidth->getValue();
552 tmpSettings.widthSettings.transhipWidth = myTranshipWidth->getValue();
553
566 }
567
568 tmpSettings.showGrid = (myShowGrid->getCheck() != FALSE);
569 tmpSettings.gridXSize = (double) myGridXSizeDialer->getValue();
570 tmpSettings.gridYSize = (double) myGridYSizeDialer->getValue();
571
575 } else {
578 }
579 tmpSettings.laneShowBorders = (myShowLaneBorders->getCheck() != FALSE);
580 tmpSettings.showBikeMarkings = (myShowBikeMarkings->getCheck() != FALSE);
581 tmpSettings.showLinkDecals = (myShowLaneDecals->getCheck() != FALSE);
582 tmpSettings.realisticLinkRules = (myRealisticLinkRules->getCheck() != FALSE);
583 tmpSettings.showLinkRules = (myShowLinkRules->getCheck() != FALSE);
584 tmpSettings.showRails = (myShowRails->getCheck() != FALSE);
585 tmpSettings.secondaryShape = (mySecondaryShape->getCheck() != FALSE);
586 tmpSettings.edgeName = myEdgeNamePanel->getSettings();
590 tmpSettings.edgeValue = myEdgeValuePanel->getSettings();
592 tmpSettings.hideConnectors = (myHideMacroConnectors->getCheck() != FALSE);
593 tmpSettings.showLaneDirection = (myShowLaneDirection->getCheck() != FALSE);
594 tmpSettings.showSublanes = (myShowSublanes->getCheck() != FALSE);
595 tmpSettings.spreadSuperposed = (mySpreadSuperposed->getCheck() != FALSE);
596 tmpSettings.disableHideByZoom = (myDisableHideByZoom->getCheck() != FALSE);
597 if (sender == myParamKey) {
599 tmpSettings.edgeParam = myParamKey->getText().text();
601 tmpSettings.laneParam = myParamKey->getText().text();
603 tmpSettings.edgeData = myParamKey->getText().text();
605 tmpSettings.edgeData = myParamKey->getText().text();
606 }
607 } else if (sender == myScalingParamKey) {
609 tmpSettings.edgeDataScaling = myScalingParamKey->getText().text();
610 }
611 } else if (sender == myVehicleParamKey) {
613 tmpSettings.vehicleParam = myVehicleParamKey->getText().text();
614 }
615 } else if (sender == myVehicleScalingParamKey) {
617 tmpSettings.vehicleScaleParam = myVehicleScalingParamKey->getText().text();
618 }
619 } else if (sender == myDataParamKey) {
621 tmpSettings.relDataAttr = myDataParamKey->getText().text();
622 }
623 } else if (sender == myVehicleTextPanel->myCheck) {
625 } else if (sender == myVehicleTextParamKey) {
626 tmpSettings.vehicleTextParam = myVehicleTextParamKey->getText().text();
627 } else if (sender == myPOITextPanel->myCheck) {
629 } else if (sender == myPOITextParamKey) {
630 tmpSettings.poiTextParam = myPOITextParamKey->getText().text();
631 } else if (sender == myMeanDataID) {
632 tmpSettings.edgeDataID = myMeanDataID->getText().text();
633 }
635 tmpSettings.laneWidthExaggeration = myLaneWidthUpscaleDialer->getValue();
636 tmpSettings.laneMinSize = myLaneMinWidthDialer->getValue();
637
641 tmpSettings.showBlinker = (myShowBlinker->getCheck() != FALSE);
642 tmpSettings.drawMinGap = (myShowMinGap->getCheck() != FALSE);
643 tmpSettings.drawBrakeGap = (myShowBrakeGap->getCheck() != FALSE);
644 tmpSettings.showBTRange = (myShowBTRange->getCheck() != FALSE);
645 tmpSettings.showRouteIndex = (myShowRouteIndex->getCheck() != FALSE);
646 tmpSettings.scaleLength = (myScaleLength->getCheck() != FALSE);
647 tmpSettings.drawReversed = (myDrawReversed->getCheck() != FALSE);
648 tmpSettings.showParkingInfo = (myShowParkingInfo->getCheck() != FALSE);
649 tmpSettings.showChargingInfo = (myShowChargingInfo->getCheck() != FALSE);
650 /*
651 tmpSettings.drawLaneChangePreference = (myShowLaneChangePreference->getCheck() != FALSE);
652 */
658
664
669
680
681 tmpSettings.addName = myAddNamePanel->getSettings();
683 tmpSettings.addSize = myAddSizePanel->getSettings();
684
686 tmpSettings.poiDetail = myPoiDetail->getValue();
687 tmpSettings.poiName = myPOINamePanel->getSettings();
688 tmpSettings.poiType = myPOITypePanel->getSettings();
689 tmpSettings.poiText = myPOITextPanel->getSettings();
690 tmpSettings.poiSize = myPOISizePanel->getSettings();
691 tmpSettings.poiUseCustomLayer = myPOIUseCustomLayer->getCheck() != FALSE;
692 tmpSettings.poiCustomLayer = myPOICustomLayer->getValue();
693
695 tmpSettings.polyName = myPolyNamePanel->getSettings();
696 tmpSettings.polyType = myPolyTypePanel->getSettings();
697 tmpSettings.polySize = myPolySizePanel->getSettings();
698 tmpSettings.polyUseCustomLayer = myPolyUseCustomLayer->getCheck() != FALSE;
699 tmpSettings.polyCustomLayer = myPolyCustomLayer->getValue();
700
701 if (mySettings->netedit) {
702 tmpSettings.dataValue = myDataValuePanel->getSettings();
704 tmpSettings.dataValue = myDataValuePanel->getSettings();
705 tmpSettings.tazRelWidthExaggeration = myTazRelationUpscaleDialer->getValue();
708 }
709
710 tmpSettings.showLane2Lane = (myShowLane2Lane->getCheck() != FALSE);
711 tmpSettings.drawJunctionShape = (myDrawJunctionShape->getCheck() != FALSE);
712 tmpSettings.drawCrossingsAndWalkingareas = (myDrawCrossingsAndWalkingAreas->getCheck() != FALSE);
713 tmpSettings.dither = (myDither->getCheck() != FALSE);
714 tmpSettings.fps = (myFPS->getCheck() != FALSE);
715 tmpSettings.trueZ = (myTrueZ->getCheck() != FALSE);
716 tmpSettings.drawBoundaries = (myDrawBoundaries->getCheck() != FALSE);
717 tmpSettings.forceDrawForRectangleSelection = (myForceDrawForRectangleSelection->getCheck() != FALSE);
718 tmpSettings.disableDottedContours = (myDisableDottedContours->getCheck() != FALSE);
720 tmpSettings.showSizeLegend = (myShowSizeLegend->getCheck() != FALSE);
721 tmpSettings.showColorLegend = (myShowColorLegend->getCheck() != FALSE);
722 tmpSettings.showVehicleColorLegend = (myShowVehicleColorLegend->getCheck() != FALSE);
723 tmpSettings.show3DTLSDomes = (myShow3DTLSDomes->getCheck() != FALSE);
724 tmpSettings.show3DTLSLinkMarkers = (myShow3DTLSLinkMarkers->getCheck() != FALSE);
725 tmpSettings.show3DHeadUpDisplay = (myShow3DHeadUpDisplay->getCheck() != FALSE);
726 tmpSettings.generate3DTLSModels = (myGenerate3DTLSModels->getCheck() != FALSE);
727 const unsigned char lightFactor = (unsigned char)myLight3DFactor->getValue();
728 tmpSettings.ambient3DLight.set(lightFactor / 2, lightFactor / 2, lightFactor / 2, 255);
729 tmpSettings.diffuse3DLight.set(lightFactor, lightFactor, lightFactor, 255);
730 tmpSettings.skyColor = MFXUtils::getRGBColor(mySkyColor->getRGBA());
731
732 // lanes (colors)
733 if (sender == myEdgeRainbowPanel->myColorRainbow) {
735 doRebuildColorMatrices = true;
736 } else if (sender == myJunctionRainbowPanel->myColorRainbow) {
738 doRebuildColorMatrices = true;
739 } else if (myDataRainbowPanel && sender == myDataRainbowPanel->myColorRainbow) {
741 doRebuildColorMatrices = true;
742 }
743 if (tmpSettings.getLaneEdgeMode() == prevLaneMode) {
744 if (updateColorRanges(sender, myLaneColors.begin(), myLaneColors.end(),
745 myLaneThresholds.begin(), myLaneThresholds.end(), myLaneButtons.begin(),
746 tmpSettings.getLaneEdgeScheme())) {
747 doRebuildColorMatrices = true;
748 }
749 if (sender == myLaneColorInterpolation) {
750 tmpSettings.getLaneEdgeScheme().setInterpolated(myLaneColorInterpolation->getCheck() != FALSE);
751 doRebuildColorMatrices = true;
752 }
753 } else {
754 doRebuildColorMatrices = true;
755 }
756 // lanes (scaling)
757 if (tmpSettings.getLaneEdgeScaleMode() == prevLaneScaleMode) {
758 if (updateScaleRanges(sender, myLaneScales.begin(), myLaneScales.end(),
760 tmpSettings.getLaneEdgeScaleScheme())) {
761 doRebuildColorMatrices = true;
762 }
763 if (sender == myLaneScaleInterpolation) {
764 tmpSettings.getLaneEdgeScaleScheme().setInterpolated(myLaneScaleInterpolation->getCheck() != FALSE);
765 doRebuildColorMatrices = true;
766 }
767 } else {
768 doRebuildColorMatrices = true;
769 }
770 // vehicles
771 if (tmpSettings.vehicleColorer.getActive() == prevVehicleMode) {
772 if (updateColorRanges(sender, myVehicleColors.begin(), myVehicleColors.end(),
774 tmpSettings.vehicleColorer.getScheme())) {
775 doRebuildColorMatrices = true;
776 }
777 if (sender == myVehicleColorInterpolation) {
778 tmpSettings.vehicleColorer.getScheme().setInterpolated(myVehicleColorInterpolation->getCheck() != FALSE);
779 doRebuildColorMatrices = true;
780 }
781 } else {
782 doRebuildColorMatrices = true;
783 }
784 // vehicles (scaling)
785 if (tmpSettings.vehicleScaler.getActive() == prevVehicleScaleMode) {
786 if (updateScaleRanges(sender, myVehicleScales.begin(), myVehicleScales.end(),
788 tmpSettings.vehicleScaler.getScheme())) {
789 doRebuildColorMatrices = true;
790 }
791 if (sender == myVehicleScaleInterpolation) {
792 tmpSettings.vehicleScaler.getScheme().setInterpolated(myVehicleScaleInterpolation->getCheck() != FALSE);
793 doRebuildColorMatrices = true;
794 }
795 } else {
796 doRebuildColorMatrices = true;
797 }
798 // persons
799 if (tmpSettings.personColorer.getActive() == prevPersonMode) {
800 if (updateColorRanges(sender, myPersonColors.begin(), myPersonColors.end(),
802 tmpSettings.personColorer.getScheme())) {
803 doRebuildColorMatrices = true;
804 }
805 if (sender == myPersonColorInterpolation) {
806 tmpSettings.personColorer.getScheme().setInterpolated(myPersonColorInterpolation->getCheck() != FALSE);
807 doRebuildColorMatrices = true;
808 }
809 } else {
810 doRebuildColorMatrices = true;
811 }
812 // containers
813 if (tmpSettings.containerColorer.getActive() == prevContainerMode) {
814 if (updateColorRanges(sender, myContainerColors.begin(), myContainerColors.end(),
816 tmpSettings.containerColorer.getScheme())) {
817 doRebuildColorMatrices = true;
818 }
819 if (sender == myContainerColorInterpolation) {
821 doRebuildColorMatrices = true;
822 }
823 } else {
824 doRebuildColorMatrices = true;
825 }
826 // junctions
827 if (tmpSettings.junctionColorer.getActive() == prevJunctionMode) {
828 if (updateColorRanges(sender, myJunctionColors.begin(), myJunctionColors.end(),
830 tmpSettings.junctionColorer.getScheme())) {
831 doRebuildColorMatrices = true;
832 }
833 if (sender == myJunctionColorInterpolation) {
834 tmpSettings.junctionColorer.getScheme().setInterpolated(myJunctionColorInterpolation->getCheck() != FALSE);
835 doRebuildColorMatrices = true;
836 }
837 } else {
838 doRebuildColorMatrices = true;
839 }
840 // POIs
841 if (tmpSettings.poiColorer.getActive() == prevPOIMode) {
842 if (updateColorRanges(sender, myPOIColors.begin(), myPOIColors.end(),
843 myPOIThresholds.begin(), myPOIThresholds.end(), myPOIButtons.begin(),
844 tmpSettings.poiColorer.getScheme())) {
845 doRebuildColorMatrices = true;
846 }
847 if (sender == myPOIColorInterpolation) {
848 tmpSettings.poiColorer.getScheme().setInterpolated(myPOIColorInterpolation->getCheck() != FALSE);
849 doRebuildColorMatrices = true;
850 }
851 } else {
852 doRebuildColorMatrices = true;
853 }
854 // polygons
855 if (tmpSettings.polyColorer.getActive() == prevPolyMode) {
856 if (updateColorRanges(sender, myPolyColors.begin(), myPolyColors.end(),
857 myPolyThresholds.begin(), myPolyThresholds.end(), myPolyButtons.begin(),
858 tmpSettings.polyColorer.getScheme())) {
859 doRebuildColorMatrices = true;
860 }
861 if (sender == myPolyColorInterpolation) {
862 tmpSettings.polyColorer.getScheme().setInterpolated(myPolyColorInterpolation->getCheck() != FALSE);
863 doRebuildColorMatrices = true;
864 }
865 } else {
866 doRebuildColorMatrices = true;
867 }
868 // data
869 if (tmpSettings.netedit) {
870 if (tmpSettings.dataColorer.getActive() == prevDataMode) {
871 if (updateColorRanges(sender, myDataColors.begin(), myDataColors.end(),
872 myDataThresholds.begin(), myDataThresholds.end(), myDataButtons.begin(),
873 tmpSettings.dataColorer.getScheme())) {
874 doRebuildColorMatrices = true;
875 }
876 if (sender == myDataColorInterpolation) {
877 tmpSettings.dataColorer.getScheme().setInterpolated(myDataColorInterpolation->getCheck() != FALSE);
878 doRebuildColorMatrices = true;
879 }
880 } else {
881 doRebuildColorMatrices = true;
882 }
883 }
884 // openGL
885 if (sender == myRecalculateBoundaries) {
887 }
888
889 if (sender == myShowPedestrianNetwork) {
890 tmpSettings.showPedestrianNetwork = (myShowPedestrianNetwork->getCheck() != FALSE);
891 myParent->drawPedestrianNetwork(tmpSettings);
892 }
893
894 if (sender == myPedestrianNetworkColor) {
897 }
898
899 if (tmpSettings == *mySettings) {
900 return 1;
901 }
902
903 int index = mySchemeName->getCurrentItem();
904 if (index < (int) gSchemeStorage.getNumInitialSettings()) {
905 // one of the initial settings is modified
906 // every time this happens we create a new scheme
907 int suffix = 1;
908 while (gSchemeStorage.contains("custom_" + toString(suffix))) {
909 suffix++;
910 }
911 tmpSettings.name = "custom_" + toString(suffix);
912 // the newly created settings must be entered in several places:
913 // - the comboBox mySchemeName of this dialog
914 // - the comboBox of the parent view (set as active)
915 // - the comboBox of all other views (only append) XXX @todo
916 index = mySchemeName->appendIconItem(tmpSettings.name.c_str());
918 myParent->getColoringSchemesCombo()->appendIconItem(tmpSettings.name.c_str());
919 }
921 myParent->getColoringSchemesCombo()->findItem(tmpSettings.name.c_str()));
922 gSchemeStorage.add(tmpSettings); // overwrites existing
923 mySettings = &gSchemeStorage.get(tmpSettings.name);
924 myParent->setColorScheme(tmpSettings.name);
925
926 if (doRebuildColorMatrices) {
928 }
929 myParent->handle(this, FXSEL(SEL_CHANGED, MID_SIMPLE_VIEW_COLORCHANGE), nullptr);
930 myParent->forceRefresh();
931 getApp()->forceRefresh();
932 return 1;
933}
934
935
936void
937GUIDialog_ViewSettings::loadSettings(const std::string& file) {
938 GUISettingsHandler handler(file, true, mySettings->netedit);
939 for (std::string settingsName : handler.addSettings(myParent)) {
940 FXint index = mySchemeName->appendIconItem(settingsName.c_str());
942 mySettings = &gSchemeStorage.get(settingsName);
943 }
944 if (handler.hasDecals()) {
946 myParent->getDecals() = handler.getDecals();
948 myParent->update();
949 myParent->getDecalsLockMutex().unlock();
950 }
951 if (handler.getDelay() >= 0) {
952 myParent->setDelay(handler.getDelay());
953 }
954 if (handler.getBreakpoints().size() > 0) {
956 }
957 handler.applyViewport(myParent);
959}
960
961
962void
964 for (const auto& decal : myParent->getDecals()) {
965 // only save decals with non empty filename
966 if (decal.filename.size() > 0) {
967 // check if decal is a light
968 const bool isLight = (decal.filename.substr(0, 5) == "light") && (decal.filename.length() == 6) && isdigit(decal.filename[5]);
969 if (isLight) {
971 dev.writeAttr(SUMO_ATTR_INDEX, decal.filename.substr(5, 1));
972 } else {
974 dev.writeAttr("file", decal.filename);
975 dev.writeAttr("screenRelative", decal.screenRelative);
976 }
977 dev.writeAttr(SUMO_ATTR_CENTER_X, decal.centerX);
978 dev.writeAttr(SUMO_ATTR_CENTER_Y, decal.centerY);
979 dev.writeAttr(SUMO_ATTR_CENTER_Z, decal.centerZ);
980 dev.writeAttr(SUMO_ATTR_WIDTH, decal.width);
981 dev.writeAttr(SUMO_ATTR_HEIGHT, decal.height);
982 dev.writeAttr("altitude", decal.altitude);
983 dev.writeAttr("rotation", decal.rot);
984 dev.writeAttr("tilt", decal.tilt);
985 dev.writeAttr("roll", decal.roll);
986 dev.writeAttr(SUMO_ATTR_LAYER, decal.layer);
987 dev.closeTag();
988 }
989 }
990}
991
992
993void
994GUIDialog_ViewSettings::loadDecals(const std::string& file) {
996 GUISettingsHandler handler(file);
997 if (handler.hasDecals()) {
998 myParent->getDecals() = handler.getDecals();
999 }
1001 myParent->update();
1002 myParent->getDecalsLockMutex().unlock();
1003}
1004
1005
1006long
1007GUIDialog_ViewSettings::onCmdSaveSetting(FXObject*, FXSelector, void* /*data*/) {
1008 int index = mySchemeName->getCurrentItem();
1009 if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1010 return 1;
1011 }
1012 // get the name
1013 std::string name = "";
1014 while (name.length() == 0) {
1015 FXDialogBox dialog(this, TL("Enter a name"), GUIDesignViewSettingsDialog);
1016 FXVerticalFrame* content = new FXVerticalFrame(&dialog, GUIDesignViewSettingsVerticalFrame5);
1017 new FXLabel(content, TL("Please enter an alphanumeric name: "), nullptr, GUIDesignViewSettingsLabel2);
1018 FXTextField* text = new FXTextField(content, 40, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsTextField1);
1019 new FXHorizontalSeparator(content, GUIDesignHorizontalSeparator);
1020 FXHorizontalFrame* buttons = new FXHorizontalFrame(content, GUIDesignViewSettingsHorizontalFrame3);
1021 GUIDesigns::buildFXButton(buttons, TL("&OK"), "", "", nullptr, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsButton4);
1022 GUIDesigns::buildFXButton(buttons, TL("&Cancel"), "", "", nullptr, &dialog, FXDialogBox::ID_CANCEL, GUIDesignViewSettingsButton5);
1023 dialog.create();
1024 text->setFocus();
1025 if (!dialog.execute()) {
1026 return 1;
1027 }
1028 name = text->getText().text();
1029 for (int i = 0; i < (int)name.length(); ++i) {
1030 if (name[i] != '_' && (name[i] < 'a' || name[i] > 'z') && (name[i] < 'A' || name[i] > 'Z') && (name[i] < '0' || name[i] > '9')) {
1031 name = "";
1032 break;
1033 }
1034 }
1035 }
1037 tmpSettings.copy(*mySettings);
1038 tmpSettings.name = name;
1039 if (name == mySettings->name || StringUtils::startsWith(mySettings->name, "custom_")) {
1041 myParent->getColoringSchemesCombo()->insertIconItem(index, name.c_str());
1042 } else {
1044 index = mySchemeName->appendIconItem(name.c_str());
1047 myParent->getColoringSchemesCombo()->findItem(name.c_str()));
1048 }
1049 gSchemeStorage.add(tmpSettings);
1050 mySchemeName->insertIconItem(index, name.c_str());
1051 myParent->setColorScheme(name);
1052 mySettings = &gSchemeStorage.get(name);
1054 gSchemeStorage.writeSettings(getApp());
1055 return 1;
1056}
1057
1058
1059long
1060GUIDialog_ViewSettings::onUpdSaveSetting(FXObject* sender, FXSelector, void* ptr) {
1061 sender->handle(this,
1063 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1064 ptr);
1065 return 1;
1066}
1067
1068
1069long
1070GUIDialog_ViewSettings::onCmdDeleteSetting(FXObject*, FXSelector, void* /*data*/) {
1071 int index = mySchemeName->getCurrentItem();
1072 if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1073 return 1;
1074 }
1075 std::string name = mySchemeName->getItemText(index);
1076 gSchemeStorage.remove(name);
1077 mySchemeName->removeItem(index);
1078 onCmdNameChange(nullptr, 0, (void*) mySchemeName->getItemText(0).c_str());
1079 gSchemeStorage.writeSettings(getApp());
1080 return 1;
1081}
1082
1083
1084long
1085GUIDialog_ViewSettings::onUpdDeleteSetting(FXObject* sender, FXSelector, void* ptr) {
1086 sender->handle(this,
1088 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1089 ptr);
1090 return 1;
1091}
1092
1093
1094long
1095GUIDialog_ViewSettings::onCmdExportSetting(FXObject*, FXSelector, void* /*data*/) {
1096 FXString file = MFXUtils::getFilename2Write(this, TL("Export view settings"), ".xml", GUIIconSubSys::getIcon(GUIIcon::SAVE), gCurrentFolder);
1097 if (file == "") {
1098 return 1;
1099 }
1100 try {
1101 OutputDevice& dev = OutputDevice::getDevice(file.text(), false);
1103 if (myParent->is3DView()) {
1104 dev.writeAttr(SUMO_ATTR_TYPE, "osg");
1105 }
1106 mySettings->save(dev);
1107 if (mySaveViewPort->getCheck()) {
1109 }
1110 if (mySaveDelay->getCheck()) {
1113 dev.closeTag();
1114 }
1115 if (mySaveDecals->getCheck()) {
1116 saveDecals(dev);
1117 }
1118 if (!mySettings->netedit && mySaveBreakpoints->getCheck()) {
1122 dev.closeTag();
1123 }
1124 }
1125 dev.closeTag();
1126 dev.close();
1127 } catch (IOError& e) {
1128 FXMessageBox::error(this, MBOX_OK, TL("Storing failed!"), "%s", e.what());
1129 }
1130 return 1;
1131}
1132
1133
1134long
1135GUIDialog_ViewSettings::onUpdExportSetting(FXObject* sender, FXSelector, void* ptr) {
1136 sender->handle(this,
1138 && !mySaveViewPort->getCheck() && !mySaveDelay->getCheck() && !mySaveDecals->getCheck() && !mySaveBreakpoints->getCheck()) ?
1139 FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1140 ptr);
1141 return 1;
1142}
1143
1144
1145long
1146GUIDialog_ViewSettings::onCmdImportSetting(FXObject*, FXSelector, void* /*data*/) {
1147 FXFileDialog opendialog(this, TL("Import view settings"));
1148 opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::OPEN));
1149 opendialog.setSelectMode(SELECTFILE_ANY);
1150 opendialog.setPatternList("*.xml,*.xml.gz");
1151 if (gCurrentFolder.length() != 0) {
1152 opendialog.setDirectory(gCurrentFolder);
1153 }
1154 if (opendialog.execute()) {
1155 gCurrentFolder = opendialog.getDirectory();
1156 loadSettings(opendialog.getFilename().text());
1157 }
1158 return 1;
1159}
1160
1161
1162long
1163GUIDialog_ViewSettings::onCmdLoadDecal(FXObject*, FXSelector, void* /*data*/) {
1164 FXFileDialog opendialog(this, TL("Load Decals"));
1165 opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY));
1166 opendialog.setSelectMode(SELECTFILE_ANY);
1167 opendialog.setPatternList("*.xml,*.xml.gz");
1168 if (gCurrentFolder.length() != 0) {
1169 opendialog.setDirectory(gCurrentFolder);
1170 }
1171 if (opendialog.execute()) {
1172 gCurrentFolder = opendialog.getDirectory();
1173 loadDecals(opendialog.getFilename().text());
1174 }
1175 return 1;
1176}
1177
1178
1179long
1180GUIDialog_ViewSettings::onCmdLoadXMLDecals(FXObject*, FXSelector, void* /*data*/) {
1181 FXFileDialog opendialog(this, TL("Load Decals"));
1182 opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY));
1183 opendialog.setSelectMode(SELECTFILE_ANY);
1184 opendialog.setPatternList("*.xml,*.xml.gz");
1185 if (gCurrentFolder.length() != 0) {
1186 opendialog.setDirectory(gCurrentFolder);
1187 }
1188 if (opendialog.execute()) {
1189 gCurrentFolder = opendialog.getDirectory();
1190 loadDecals(opendialog.getFilename().text());
1191 }
1192 return 1;
1193}
1194
1195
1196long
1197GUIDialog_ViewSettings::onCmdSaveXMLDecals(FXObject*, FXSelector, void* /*data*/) {
1198 FXString file = MFXUtils::getFilename2Write(this, TL("Save Decals"), ".xml", GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder);
1199 if (file == "") {
1200 return 1;
1201 }
1202 try {
1203 OutputDevice& dev = OutputDevice::getDevice(file.text());
1204 dev.openTag("decals");
1205 saveDecals(dev);
1206 dev.closeTag();
1207 dev.close();
1208 } catch (IOError& e) {
1209 FXMessageBox::error(myParent, MBOX_OK, TL("Storing failed!"), "%s", e.what());
1210 }
1211 return 1;
1212}
1213
1214
1215long
1216GUIDialog_ViewSettings::onCmdClearDecals(FXObject*, FXSelector, void* /*data*/) {
1217 // lock decals mutex
1218 myParent->getDecalsLockMutex().lock();
1219 // clear decals
1220 myParent->getDecals().clear();
1221 // update view
1222 myParent->update();
1223 // fill table again
1225 // unlock decals mutex
1226 myParent->getDecalsLockMutex().unlock();
1227 return 1;
1228}
1229
1230
1231long
1232GUIDialog_ViewSettings::onUpdImportSetting(FXObject* sender, FXSelector, void* ptr) {
1233 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1234 return 1;
1235}
1236
1237
1238FXMatrix*
1240 std::vector<FXColorWell*>& colors,
1241 std::vector<FXRealSpinner*>& thresholds,
1242 std::vector<FXButton*>& buttons,
1243 FXCheckButton* interpolation,
1244 GUIColorScheme& scheme) {
1246 FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1247 colors.clear();
1248 thresholds.clear();
1249 buttons.clear();
1250 const bool fixed = scheme.isFixed();
1251 std::vector<RGBColor>::const_iterator colIt = scheme.getColors().begin();
1252 std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1253 std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1254 while (colIt != scheme.getColors().end()) {
1255 colors.push_back(new FXColorWell(m, MFXUtils::getFXColor(*colIt), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell1));
1256 if (fixed) {
1257 new FXLabel(m, nameIt->c_str());
1258 new FXLabel(m, "");
1259 new FXLabel(m, "");
1260 } else {
1261 const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1262 FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX | dialerOptions);
1263 threshDialer->setValue(*threshIt);
1264 thresholds.push_back(threshDialer);
1265 if (*threshIt == GUIVisualizationSettings::MISSING_DATA) {
1266 threshDialer->disable();
1267 threshDialer->hide();
1268 buttons.push_back(GUIDesigns::buildFXButton(m, "", "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1269 buttons.back()->hide();
1270 buttons.push_back(GUIDesigns::buildFXButton(m, TL("No Data"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1271 buttons.back()->disable();
1272 } else {
1273 buttons.push_back(GUIDesigns::buildFXButton(m, TL("Add"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1274 buttons.push_back(GUIDesigns::buildFXButton(m, TL("Remove"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1275 }
1276 }
1277 colIt++;
1278 threshIt++;
1279 nameIt++;
1280 }
1281 interpolation->setCheck(scheme.isInterpolated());
1282 if (fixed) {
1283 interpolation->disable();
1284 } else {
1285 if (colors.size() > 1) {
1286 interpolation->enable();
1287 if (interpolation->getCheck() != FALSE) {
1288 thresholds.front()->enable();
1289 } else {
1290 thresholds.front()->disable();
1291 }
1292 } else {
1293 interpolation->disable();
1294 thresholds.front()->disable();
1295 }
1296 }
1297 return m;
1298}
1299
1300
1301FXMatrix*
1303 std::vector<FXRealSpinner*>& scales,
1304 std::vector<FXRealSpinner*>& thresholds,
1305 std::vector<FXButton*>& buttons,
1306 FXCheckButton* interpolation,
1307 GUIScaleScheme& scheme) {
1309 FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1310 scales.clear();
1311 thresholds.clear();
1312 buttons.clear();
1313 const bool fixed = scheme.isFixed();
1314 std::vector<double>::const_iterator scaleIt = scheme.getColors().begin();
1315 std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1316 std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1317 while (scaleIt != scheme.getColors().end()) {
1318 FXRealSpinner* scaleDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX);
1319 scaleDialer->setValue(*scaleIt);
1320 scales.push_back(scaleDialer);
1321 if (fixed) {
1322 new FXLabel(m, nameIt->c_str());
1323 new FXLabel(m, "");
1324 new FXLabel(m, "");
1325 } else {
1326 const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1327 FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX | dialerOptions);
1328 threshDialer->setValue(*threshIt);
1329 thresholds.push_back(threshDialer);
1330 if (*threshIt == GUIVisualizationSettings::MISSING_DATA) {
1331 threshDialer->disable();
1332 threshDialer->hide();
1333 buttons.push_back(GUIDesigns::buildFXButton(m, "", "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1334 buttons.back()->hide();
1335 buttons.push_back(GUIDesigns::buildFXButton(m, TL("No Data"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1336 buttons.back()->disable();
1337 } else {
1338 buttons.push_back(GUIDesigns::buildFXButton(m, TL("Add"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1339 buttons.push_back(GUIDesigns::buildFXButton(m, TL("Remove"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1340 }
1341 }
1342 scaleIt++;
1343 threshIt++;
1344 nameIt++;
1345 }
1346 interpolation->setCheck(scheme.isInterpolated());
1347 if (fixed) {
1348 interpolation->disable();
1349 } else {
1350 if (scales.size() > 1) {
1351 interpolation->enable();
1352 if (interpolation->getCheck() != FALSE) {
1353 thresholds.front()->enable();
1354 } else {
1355 thresholds.front()->disable();
1356 }
1357 } else {
1358 interpolation->disable();
1359 thresholds.front()->disable();
1360 }
1361 }
1362 return m;
1363}
1364
1365
1366void
1369 if (doCreate) {
1370 m->create();
1371 }
1374 } else {
1376 }
1379 } else {
1381 }
1382 std::string activeSchemeName = myLaneEdgeColorMode->getText().text();
1383 std::string activeScaleSchemeName = myLaneEdgeScaleMode->getText().text();
1384 myParamKey->clearItems();
1385 myScalingParamKey->clearItems();
1387 myMeanDataID->hide();
1389 myParamKey->appendItem(mySettings->edgeParam.c_str());
1390 for (const std::string& attr : myParent->getEdgeLaneParamKeys(true)) {
1391 if (attr != mySettings->edgeParam) {
1392 myParamKey->appendItem(attr.c_str());
1393 }
1394 }
1395 myParamKey->enable();
1396 } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_LANE_PARAM_NUMERICAL) {
1397 myParamKey->appendItem(mySettings->laneParam.c_str());
1398 for (const std::string& attr : myParent->getEdgeLaneParamKeys(false)) {
1399 if (attr != mySettings->laneParam) {
1400 myParamKey->appendItem(attr.c_str());
1401 }
1402 }
1403 myParamKey->enable();
1404 } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {
1405 myParamKey->appendItem(mySettings->edgeData.c_str());
1406 for (const std::string& attr : myParent->getEdgeDataAttrs()) {
1407 if (attr != mySettings->edgeData) {
1408 myParamKey->appendItem(attr.c_str());
1409 }
1410 }
1411 myParamKey->enable();
1412 } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_LIVE) {
1413 if (mySettings->edgeDataID != "") {
1415 }
1416 for (const std::string& attr : myParent->getMeanDataIDs()) {
1417 if (attr != mySettings->edgeDataID) {
1418 myMeanDataID->appendIconItem(attr.c_str());
1419 }
1420 }
1421 if (myMeanDataID->getNumItems() > 0) {
1422 if (mySettings->edgeDataID == "") {
1424 }
1426 myMeanDataID->show();
1427 myParamKey->appendItem(mySettings->edgeData.c_str());
1428 for (const std::string& attr : myParent->getMeanDataAttrs(mySettings->edgeDataID)) {
1429 if (attr != mySettings->edgeData) {
1430 myParamKey->appendItem(attr.c_str());
1431 }
1432 }
1433 myParamKey->enable();
1434 }
1435 } else {
1436 myParamKey->disable();
1437 }
1438
1439 if (activeScaleSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {
1440 myScalingParamKey->appendItem(mySettings->edgeDataScaling.c_str());
1441 for (const std::string& attr : myParent->getEdgeDataAttrs()) {
1442 if (attr != mySettings->edgeDataScaling) {
1443 myScalingParamKey->appendItem(attr.c_str());
1444 }
1445 }
1446 myScalingParamKey->enable();
1447 } else {
1448 myScalingParamKey->disable();
1449 }
1450
1451 myParamKey->setNumVisible(myParamKey->getNumItems());
1452 myScalingParamKey->setNumVisible(myScalingParamKey->getNumItems());
1453 myLaneColorSettingFrame->getParent()->recalc();
1454
1456 if (doCreate) {
1457 m->create();
1458 }
1459 myLaneScaleSettingFrame->getParent()->recalc();
1460
1462 if (doCreate) {
1463 m->create();
1464 }
1465 activeSchemeName = myVehicleColorMode->getText().text();
1468 myVehicleParamKey->enable();
1469 } else {
1470 myVehicleParamKey->disable();
1471 }
1472 myVehicleColorSettingFrame->getParent()->recalc();
1473
1475 if (doCreate) {
1476 m->create();
1477 }
1478 myVehicleScaleSettingFrame->getParent()->recalc();
1479 activeScaleSchemeName = myVehicleScaleMode->getText().text();
1480 if (activeScaleSchemeName == GUIVisualizationSettings::SCHEME_NAME_PARAM_NUMERICAL) {
1481 myVehicleScalingParamKey->enable();
1482 } else {
1483 myVehicleScalingParamKey->disable();
1484 }
1485
1486
1488 if (doCreate) {
1489 m->create();
1490 }
1491 myPersonColorSettingFrame->getParent()->recalc();
1493 if (doCreate) {
1494 m->create();
1495 }
1496 myContainerColorSettingFrame->getParent()->recalc();
1498 if (doCreate) {
1499 m->create();
1500 }
1501 myJunctionColorSettingFrame->getParent()->recalc();
1502 // POIs
1504 if (doCreate) {
1505 m->create();
1506 }
1507 myPOIColorSettingFrame->getParent()->recalc();
1508 // polygons
1510 if (doCreate) {
1511 m->create();
1512 }
1513 myPolyColorSettingFrame->getParent()->recalc();
1514
1515 // data
1516 if (mySettings->netedit) {
1518 if (doCreate) {
1519 m->create();
1520 }
1521 activeSchemeName = myDataColorMode->getText().text();
1523 myDataParamKey->clearItems();
1524 myDataParamKey->appendItem(mySettings->relDataAttr.c_str());
1525 for (const std::string& attr : myParent->getRelDataAttrs()) {
1526 if (attr != mySettings->relDataAttr) {
1527 myDataParamKey->appendItem(attr.c_str());
1528 }
1529 }
1530 myDataParamKey->enable();
1531 } else {
1532 myDataParamKey->disable();
1533 }
1534 myDataColorSettingFrame->getParent()->recalc();
1535 }
1536
1537 layout();
1538 update();
1539}
1540
1541
1542void
1544 myVehicleParamKey->clearItems();
1545 myVehicleTextParamKey->clearItems();
1546 myVehicleScalingParamKey->clearItems();
1547 myVehicleParamKey->appendItem(mySettings->vehicleParam.c_str());
1550 for (const std::string& attr : myParent->getVehicleParamKeys(false)) {
1551 myVehicleParamKey->appendItem(attr.c_str());
1552 myVehicleTextParamKey->appendItem(attr.c_str());
1553 myVehicleScalingParamKey->appendItem(attr.c_str());
1554 }
1555 myVehicleParamKey->setNumVisible(myVehicleParamKey->getNumItems());
1556 myVehicleTextParamKey->setNumVisible(myVehicleTextParamKey->getNumItems());
1557 myVehicleScalingParamKey->setNumVisible(myVehicleScalingParamKey->getNumItems());
1558}
1559
1560
1561void
1563 myPOITextParamKey->clearItems();
1564 myPOITextParamKey->appendItem(mySettings->poiTextParam.c_str());
1565 for (const std::string& attr : myParent->getPOIParamKeys()) {
1566 myPOITextParamKey->appendItem(attr.c_str());
1567 }
1568 myPOITextParamKey->setNumVisible(myPOITextParamKey->getNumItems());
1569}
1570
1571
1572std::string
1576
1577
1578void
1580 if (name.c_str() == mySchemeName->getItemText(mySchemeName->getCurrentItem())) {
1581 return;
1582 }
1583 for (int i = 0; i < mySchemeName->getNumItems(); ++i) {
1584 if (name.c_str() == mySchemeName->getItemText(i)) {
1586 onCmdNameChange(nullptr, 0, (void*)name.c_str());
1587 return;
1588 }
1589 }
1590}
1591
1592
1594 FXMatrix* parent,
1595 GUIDialog_ViewSettings* target,
1596 const std::string& title,
1597 const GUIVisualizationTextSettings& settings) {
1598 myCheck = new FXCheckButton(parent, title.c_str(), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1599 myCheck->setCheck(settings.showText);
1600 myMatrix0 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1601 mySelectedCheck = new FXCheckButton(myMatrix0, TL("Only for selected"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1602 mySelectedCheck->setCheck(settings.onlySelected);
1603 myConstSizeCheck = new FXCheckButton(myMatrix0, TL("constant text size"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1604 myConstSizeCheck->setCheck(settings.constSize);
1605 FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1606 new FXLabel(m1, TL("Size"), nullptr, GUIDesignViewSettingsLabel1);
1607 mySizeDial = new FXRealSpinner(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1608 mySizeDial->setRange(5, 1000);
1609 mySizeDial->setValue(settings.size);
1610 FXMatrix* m2 = new FXMatrix(parent, 4, GUIDesignViewSettingsMatrix5);
1611 new FXLabel(m2, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
1613 new FXLabel(m2, TL("Background"), nullptr, GUIDesignViewSettingsLabel1);
1615}
1616
1617
1620 return GUIVisualizationTextSettings(myCheck->getCheck() != FALSE,
1621 mySizeDial->getValue(),
1622 MFXUtils::getRGBColor(myColorWell->getRGBA()),
1623 MFXUtils::getRGBColor(myBGColorWell->getRGBA()),
1624 myConstSizeCheck->getCheck() != FALSE,
1625 mySelectedCheck->getCheck() != FALSE);
1626}
1627
1628
1629void
1631 myCheck->setCheck(settings.showText);
1632 mySizeDial->setValue(settings.size);
1633 myColorWell->setRGBA(MFXUtils::getFXColor(settings.color));
1634 myBGColorWell->setRGBA(MFXUtils::getFXColor(settings.bgColor));
1635 myConstSizeCheck->setCheck(settings.constSize);
1636 mySelectedCheck->setCheck(settings.onlySelected);
1637}
1638
1639
1641 const GUIVisualizationSizeSettings& settings, GUIGlObjectType type):
1642 myDialogViewSettings(target),
1643 myType(type) {
1644 myCheck = new FXCheckButton(parent, TL("Draw with constant size when zoomed out"), this, MID_SIMPLE_VIEW_SIZECHANGE, GUIDesignCheckButtonViewSettings);
1645 myCheck->setCheck(settings.constantSize);
1646 myCheckSelected = new FXCheckButton(parent, TL("Only for selected"), this, MID_SIMPLE_VIEW_SIZECHANGE, GUIDesignCheckButtonViewSettings);
1647 myCheckSelected->setCheck(settings.constantSizeSelected);
1648 FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1649 new FXLabel(m1, TL("Minimum Size"), nullptr, GUIDesignViewSettingsLabel1);
1651 myMinSizeDial->setValue(settings.minSize);
1652 FXMatrix* m2 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1653 new FXLabel(m2, TL("Exaggerate by"), nullptr, GUIDesignViewSettingsLabel1);
1655 myExaggerateDial->setRange(0, 10000);
1656 myExaggerateDial->setValue(settings.exaggeration);
1657}
1658
1659
1663 myMinSizeDial->getValue(), myExaggerateDial->getValue(),
1664 myCheck->getCheck() != FALSE,
1665 myCheckSelected->getCheck() != FALSE);
1666}
1667
1668
1669void
1671 myCheck->setCheck(settings.constantSize);
1672 myCheckSelected->setCheck(settings.constantSizeSelected);
1673 myMinSizeDial->setValue(settings.minSize);
1674 myExaggerateDial->setValue(settings.exaggeration);
1675}
1676
1677
1678long
1679GUIDialog_ViewSettings::SizePanel::onCmdSizeChange(FXObject* obj, FXSelector sel, void* ptr) {
1680 // mark boundaries for recomputing
1682 // continue as a normal change
1683 return myDialogViewSettings->onCmdColorChange(obj, sel, ptr);
1684}
1685
1686
1688 FXComposite* parent,
1689 GUIDialog_ViewSettings* target,
1690 const GUIVisualizationRainbowSettings& settings) {
1691 FXMatrix* matrixRainbow = new FXMatrix(parent, 9, GUIDesignViewSettingsMatrix3);
1692 myColorRainbow = GUIDesigns::buildFXButton(matrixRainbow, TL("Recalibrate Rainbow"), "", "", nullptr, target, MID_SIMPLE_VIEW_COLORCHANGE,
1693 (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
1694 myRainbowStyle = new MFXComboBoxIcon(matrixRainbow, 5, false, 10, target, MID_SIMPLE_VIEW_RAINBOW_CHANGE, GUIDesignViewSettingsComboBox1);
1696 myRainbowStyle->appendIconItem(item.first.c_str());
1697 }
1698 myHideMinCheck = new FXCheckButton(matrixRainbow, TL("min"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1699 myHideMinCheck->setCheck(settings.hideMin);
1700 myMinThreshold = new FXRealSpinner(matrixRainbow, 6, target, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);
1701 myMinThreshold->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
1702 myMinThreshold->setValue(settings.minThreshold);
1703 myHideMaxCheck = new FXCheckButton(matrixRainbow, TL("max"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1704 myHideMaxCheck->setCheck(settings.hideMax);
1705 myMaxThreshold = new FXRealSpinner(matrixRainbow, 6, target, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);
1706 myMaxThreshold->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
1707 myMaxThreshold->setValue(settings.maxThreshold);
1708 mySetNeutral = new FXCheckButton(matrixRainbow, TL("center"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1709 mySetNeutral->setCheck(settings.setNeutral);
1710 myNeutralThreshold = new FXRealSpinner(matrixRainbow, 6, target, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);
1711 myNeutralThreshold->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
1712 myNeutralThreshold->setValue(settings.neutralThreshold);
1713 myFixRange = new FXCheckButton(matrixRainbow, TL("fix range"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1714 myFixRange->setCheck(settings.fixRange);
1715}
1716
1717
1720 GUIVisualizationRainbowSettings res(myHideMinCheck->getCheck() != FALSE,
1721 myMinThreshold->getValue(),
1722 myHideMaxCheck->getCheck() != FALSE,
1723 myMaxThreshold->getValue(),
1724 mySetNeutral->getCheck() != FALSE,
1725 myNeutralThreshold->getValue(),
1726 myFixRange->getCheck() != FALSE);
1727 std::string sName = myRainbowStyle->getItemText(myRainbowStyle->getCurrentItem());
1729 return res;
1730}
1731
1732
1733void
1735 myHideMinCheck->setCheck(settings.hideMin);
1736 myMinThreshold->setValue(settings.minThreshold);
1737 myHideMaxCheck->setCheck(settings.hideMax);
1738 myMaxThreshold->setValue(settings.maxThreshold);
1739 mySetNeutral->setCheck(settings.setNeutral);
1740 myNeutralThreshold->setValue(settings.neutralThreshold);
1741 myFixRange->setCheck(settings.fixRange);
1742}
1743
1744void
1745GUIDialog_ViewSettings::buildHeader(FXVerticalFrame* contentFrame) {
1746 FXHorizontalFrame* horizontalFrame = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame1);
1747 mySchemeName = new MFXComboBoxIcon(horizontalFrame, 20, true, GUIDesignComboBoxVisibleItems,
1749 for (const auto& name : gSchemeStorage.getNames()) {
1750 const int index = mySchemeName->appendIconItem(name.c_str());
1751 if (name == mySettings->name) {
1752 mySchemeName->setCurrentItem((FXint)index);
1753 }
1754 }
1755
1756 GUIDesigns::buildFXButton(horizontalFrame, "", "", TL("Save the setting to registry"), GUIIconSubSys::getIcon(GUIIcon::SAVE_DATABASE), this, MID_SIMPLE_VIEW_SAVE, GUIDesignButtonToolbar);
1757 GUIDesigns::buildFXButton(horizontalFrame, "", "", TL("Remove the setting from registry"), GUIIconSubSys::getIcon(GUIIcon::REMOVEDB), this, MID_SIMPLE_VIEW_DELETE, GUIDesignButtonToolbar);
1758 GUIDesigns::buildFXButton(horizontalFrame, "", "", TL("Export setting to file"), GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_SIMPLE_VIEW_EXPORT, GUIDesignButtonToolbar);
1759 GUIDesigns::buildFXButton(horizontalFrame, "", "", TL("Load setting from file"), GUIIconSubSys::getIcon(GUIIcon::OPEN), this, MID_SIMPLE_VIEW_IMPORT, GUIDesignButtonToolbar);
1760
1761 new FXVerticalSeparator(horizontalFrame);
1762 new FXLabel(horizontalFrame, TL("Export includes:"), nullptr, GUIDesignViewSettingsLabel1);
1763 mySaveViewPort = new FXCheckButton(horizontalFrame, TL("Viewport"));
1764 mySaveDelay = new FXCheckButton(horizontalFrame, TL("Delay"));
1765 mySaveDecals = new FXCheckButton(horizontalFrame, TL("Decals"));
1766 mySaveBreakpoints = new FXCheckButton(horizontalFrame, TL("Breakpoints"));
1767 if (mySettings->netedit) {
1768 mySaveBreakpoints->disable();
1769 }
1770}
1771
1772
1773void
1775 // tab for the background
1776 new FXTabItem(tabbook, TL("Background"), nullptr, GUIDesignViewSettingsTabItemBook1);
1777 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
1778 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
1779
1780 FXMatrix* matrixColor = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
1781 new FXLabel(matrixColor, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
1783
1784 FXVerticalFrame* verticalFrameDecals = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame3);
1785 new FXLabel(verticalFrameDecals, TL("Decals:"));
1786 myDecalsTable = new MFXDecalsTable(this, verticalFrameDecals);
1787 FXHorizontalFrame* horizontalFrameButtonsDecals = new FXHorizontalFrame(verticalFrameDecals, GUIDesignViewSettingsHorizontalFrame2);
1788 GUIDesigns::buildFXButton(horizontalFrameButtonsDecals, TL("&Load XML Decals"), "", "", nullptr, this, MID_SIMPLE_VIEW_LOAD_DECALS_XML, GUIDesignViewSettingsButton1);
1789 GUIDesigns::buildFXButton(horizontalFrameButtonsDecals, TL("&Save XML Decals"), "", "", nullptr, this, MID_SIMPLE_VIEW_SAVE_DECALS_XML, GUIDesignViewSettingsButton1);
1790 GUIDesigns::buildFXButton(horizontalFrameButtonsDecals, TL("&Clear Decals"), "", "", nullptr, this, MID_SIMPLE_VIEW_CLEAR_DECALS, GUIDesignViewSettingsButton1);
1791
1792 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1793
1794 FXMatrix* matrixGrid = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
1795 myShowGrid = new FXCheckButton(matrixGrid, TL("Toggle grid"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1796 myShowGrid->setCheck(mySettings->showGrid);
1797 new FXLabel(matrixGrid, "");
1798 FXMatrix* matrixGridX = new FXMatrix(matrixGrid, 2, GUIDesignViewSettingsMatrix2);
1799 new FXLabel(matrixGridX, TL("x-spacing"), nullptr, GUIDesignViewSettingsLabel1);
1800 myGridXSizeDialer = new FXRealSpinner(matrixGridX, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1801 myGridXSizeDialer->setRange(1, 10000);
1803 FXMatrix* matrixGridY = new FXMatrix(matrixGrid, 2, GUIDesignViewSettingsMatrix2);
1804 new FXLabel(matrixGridY, TL("y-spacing"), nullptr, GUIDesignViewSettingsLabel1);
1805 myGridYSizeDialer = new FXRealSpinner(matrixGridY, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1806 myGridYSizeDialer->setRange(1, 10000);
1808}
1809
1810
1811void
1813 new FXTabItem(tabbook, TL("Streets"), nullptr, GUIDesignViewSettingsTabItemBook1);
1814 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
1815 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
1816 // ... color settings
1817 FXVerticalFrame* verticalFrameColor = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);
1818 FXMatrix* matrixColor = new FXMatrix(verticalFrameColor, 5, GUIDesignViewSettingsMatrix3);
1819 new FXLabel(matrixColor, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
1822 myLaneColorInterpolation = new FXCheckButton(matrixColor, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1823 myLaneColorSettingFrame = new FXVerticalFrame(verticalFrameColor, GUIDesignViewSettingsVerticalFrame4);
1824 myMeanDataID = new MFXComboBoxIcon(matrixColor, 1, false, GUIDesignComboBoxVisibleItems,
1827 myMeanDataID->hide();
1828 myParamKey = new FXComboBox(matrixColor, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1829 myParamKey->setEditable(true);
1830 myParamKey->disable();
1831
1832 // rainbow settings
1833 myEdgeRainbowPanel = new RainbowPanel(verticalFrameColor, this, mySettings->edgeValueRainBow);
1834
1835 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1836 // ... scale settings
1837 FXVerticalFrame* verticalFrameScale = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);
1838 FXMatrix* matrixScale = new FXMatrix(verticalFrameScale, 5, GUIDesignViewSettingsMatrix3);
1839 new FXLabel(matrixScale, TL("Scale width"), nullptr, GUIDesignViewSettingsLabel1);
1842 myLaneScaleInterpolation = new FXCheckButton(matrixScale, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1843 myLaneScaleSettingFrame = new FXVerticalFrame(verticalFrameScale, GUIDesignViewSettingsVerticalFrame4);
1844 myScalingParamKey = new FXComboBox(matrixScale, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1845 myScalingParamKey->setEditable(true);
1846 myScalingParamKey->disable();
1847
1851 } else {
1854 }
1855
1856 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1857 FXMatrix* matrixLanes = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
1858
1859 myShowBikeMarkings = new FXCheckButton(matrixLanes, TL("Show bike markings"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1861 myShowLaneDecals = new FXCheckButton(matrixLanes, TL("Show turning arrows"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1863
1864 myShowLinkRules = new FXCheckButton(matrixLanes, TL("Show right-of-way rules"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1866 myRealisticLinkRules = new FXCheckButton(matrixLanes, TL("Realistic stop line colors"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1868
1869 myShowLaneBorders = new FXCheckButton(matrixLanes, TL("Show lane borders"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1871 myShowLaneDirection = new FXCheckButton(matrixLanes, TL("Show lane direction"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1873
1874 myHideMacroConnectors = new FXCheckButton(matrixLanes, TL("Hide macro connectors"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1876 myShowSublanes = new FXCheckButton(matrixLanes, TL("Show sublanes"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1878
1879 myShowRails = new FXCheckButton(matrixLanes, TL("Show rails"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1880 myShowRails->setCheck(mySettings->showRails);
1881
1882 mySpreadSuperposed = new FXCheckButton(matrixLanes, TL("Spread bidirectional railways/roads"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1883 mySpreadSuperposed->setHelpText(TL("Make both directional edges for a bidirectional railways or roads visible"));
1885
1886 mySecondaryShape = new FXCheckButton(matrixLanes, TL("Secondary shape"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1888 new FXLabel(matrixLanes, " ", nullptr, GUIDesignViewSettingsLabel1);
1889 if (!OptionsCont::getOptions().exists("alternative-net-file") ||
1890 !OptionsCont::getOptions().isSet("alternative-net-file")) {
1891 mySecondaryShape->disable();
1892 }
1893
1894 FXMatrix* tmp0 = new FXMatrix(matrixLanes, 2, GUIDesignViewSettingsMatrix5);
1895 new FXLabel(tmp0, TL("Exaggerate width by"), nullptr, GUIDesignViewSettingsLabel1);
1897 myLaneWidthUpscaleDialer->setRange(0, 1000000);
1899
1900 FXMatrix* tmp1 = new FXMatrix(matrixLanes, 2, GUIDesignViewSettingsMatrix5);
1901 new FXLabel(tmp1, TL("Minimum size"), nullptr, GUIDesignViewSettingsLabel1);
1903 myLaneMinWidthDialer->setRange(0, 1000000);
1905
1906 // edge name
1907 myEdgeNamePanel = new NamePanel(matrixLanes, this, TL("Show edge id"), mySettings->edgeName);
1908 myStreetNamePanel = new NamePanel(matrixLanes, this, TL("Show street name"), mySettings->streetName);
1909 myEdgeValuePanel = new NamePanel(matrixLanes, this, TL("Show edge color value"), mySettings->edgeValue);
1910 myEdgeScaleValuePanel = new NamePanel(matrixLanes, this, TL("Show edge scale value"), mySettings->edgeScaleValue);
1911}
1912
1913
1914void
1916 new FXTabItem(tabbook, TL("Vehicles"), nullptr, GUIDesignViewSettingsTabItemBook1);
1917 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
1918 FXVerticalFrame* verticalframe = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
1919
1920 FXMatrix* matrixShowAs = new FXMatrix(verticalframe, 2, GUIDesignViewSettingsMatrix3);
1921 new FXLabel(matrixShowAs, TL("Show As"), nullptr, GUIDesignViewSettingsLabel1);
1924 myVehicleShapeDetail->appendIconItem(TL("'triangles'"));
1926 myVehicleShapeDetail->appendIconItem(TL("'simple shapes'"));
1927 myVehicleShapeDetail->appendIconItem(TL("'raster images'"));
1928 myVehicleShapeDetail->appendIconItem(TL("'circles'"));
1930
1931 new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
1932
1933 FXMatrix* matrixColor = new FXMatrix(verticalframe, 4, GUIDesignViewSettingsMatrix3);
1934 new FXLabel(matrixColor, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
1938 myVehicleColorInterpolation = new FXCheckButton(matrixColor, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1939 myVehicleParamKey = new FXComboBox(matrixColor, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1940 myVehicleParamKey->setEditable(true);
1941 myVehicleParamKey->disable();
1942
1943 myVehicleColorSettingFrame = new FXVerticalFrame(verticalframe, GUIDesignViewSettingsVerticalFrame4);
1944 new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
1945
1946 // vehicle scale settings
1947 FXVerticalFrame* verticalFrameScale = new FXVerticalFrame(verticalframe, GUIDesignViewSettingsVerticalFrame6);
1948 FXMatrix* matrixScale = new FXMatrix(verticalFrameScale, 4, GUIDesignViewSettingsMatrix3);
1949 new FXLabel(matrixScale, TL("Scale size"), nullptr, GUIDesignViewSettingsLabel1);
1952 myVehicleScaleInterpolation = new FXCheckButton(matrixScale, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1953 myVehicleScalingParamKey = new FXComboBox(matrixScale, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1954 myVehicleScalingParamKey->setEditable(true);
1955 myVehicleScalingParamKey->disable();
1956 myVehicleScaleSettingFrame = new FXVerticalFrame(verticalFrameScale, GUIDesignViewSettingsVerticalFrame4);
1958 new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
1959
1960 FXMatrix* matrixVehicle = new FXMatrix(verticalframe, 2, GUIDesignMatrixViewSettings);
1961 myVehicleNamePanel = new NamePanel(matrixVehicle, this, TL("Show vehicle id"), mySettings->vehicleName);
1962 myVehicleValuePanel = new NamePanel(matrixVehicle, this, TL("Show vehicle color value"), mySettings->vehicleValue);
1963 myVehicleScaleValuePanel = new NamePanel(matrixVehicle, this, TL("Show vehicle scale value"), mySettings->vehicleScaleValue);
1964 myVehicleTextPanel = new NamePanel(matrixVehicle, this, TL("Show vehicle text param"), mySettings->vehicleText);
1966 myVehicleTextParamKey->setEditable(true);
1967 //new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
1968
1969 FXMatrix* matrixShow = new FXMatrix(verticalframe, 2, GUIDesignMatrixViewSettings);
1970 myShowBlinker = new FXCheckButton(matrixShow, TL("Show blinker / brake lights"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1972 myShowMinGap = new FXCheckButton(matrixShow, TL("Show minimum gap"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1974 myShowBrakeGap = new FXCheckButton(matrixShow, TL("Show brake gap"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1976 myShowBTRange = new FXCheckButton(matrixShow, TL("Show Bluetooth range"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1978 myShowRouteIndex = new FXCheckButton(matrixShow, TL("Show route index"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1980 myScaleLength = new FXCheckButton(matrixShow, TL("Scale length with geometry"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1982 myShowParkingInfo = new FXCheckButton(matrixShow, TL("Show parking info"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1984 myShowChargingInfo = new FXCheckButton(matrixShow, TL("Show charging info"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1986 myDrawReversed = new FXCheckButton(matrixShow, TL("Draw reversed vehicles in reverse"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1988 //new FXLabel(matrixShow, " ", nullptr, GUIDesignViewSettingsLabel1);
1989 //myShowLaneChangePreference = new FXCheckButton(matrixShow, TL("Show lane change preference"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1990 //myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
1991 //tmpc = new FXCheckButton(matrixShow, TL("Show needed headway"), 0 ,0);
1992 //tmpc->disable();
1993
1994 //new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
1995
1996 FXMatrix* matrixSize = new FXMatrix(verticalframe, 2, GUIDesignViewSettingsMatrix1);
1998}
1999
2000
2001void
2003 new FXTabItem(tabbook, TL("Persons"), nullptr, GUIDesignViewSettingsTabItemBook1);
2004 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2005 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2006
2007 FXMatrix* m101 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix3);
2008 new FXLabel(m101, TL("Show As"), nullptr, GUIDesignViewSettingsLabel1);
2011 myPersonShapeDetail->appendIconItem(TL("'triangles'"));
2012 myPersonShapeDetail->appendIconItem(TL("'circles'"));
2013 myPersonShapeDetail->appendIconItem(TL("'simple shapes'"));
2014 myPersonShapeDetail->appendIconItem(TL("'raster images'"));
2016
2017 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2018
2019 FXMatrix* m102 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2020 new FXLabel(m102, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
2024 myPersonColorInterpolation = new FXCheckButton(m102, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2025
2026 myPersonColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2027
2028 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2029
2030 FXMatrix* m103 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2031 myPersonNamePanel = new NamePanel(m103, this, TL("Show person id"), mySettings->personName);
2032 myPersonValuePanel = new NamePanel(m103, this, TL("Show person color value"), mySettings->personValue);
2033
2034 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2035
2036 FXMatrix* m104 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
2038
2039 FXMatrix* m105 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix3);
2040 myShowPedestrianNetwork = new FXCheckButton(m105, TL("Show JuPedSim pedestrian network"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2043#ifdef JPS_VERSION
2044 if (mySettings->netedit) {
2045#endif
2046 myShowPedestrianNetwork->disable();
2047 myPedestrianNetworkColor->disable();
2048#ifdef JPS_VERSION
2049 }
2050#endif
2051}
2052
2053
2054void
2056 new FXTabItem(tabbook, TL("Containers"), nullptr, GUIDesignViewSettingsTabItemBook1);
2057 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2058 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2059
2060 FXMatrix* m101 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix3);
2061 new FXLabel(m101, TL("Show As"), nullptr, GUIDesignViewSettingsLabel1);
2064 myContainerShapeDetail->appendIconItem(TL("'triangles'"));
2066 myContainerShapeDetail->appendIconItem(TL("'simple shapes'"));
2067 myContainerShapeDetail->appendIconItem(TL("'raster images'"));
2069
2070 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2071
2072 FXMatrix* m102 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2073 new FXLabel(m102, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
2077 myContainerColorInterpolation = new FXCheckButton(m102, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2078
2079 myContainerColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2080
2081 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2082
2083 FXMatrix* m103 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2084 myContainerNamePanel = new NamePanel(m103, this, TL("Show container id"), mySettings->containerName);
2085
2086 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2087
2088 FXMatrix* m104 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
2090}
2091
2092
2093void
2095 new FXTabItem(tabbook, TL("Junctions"), nullptr, GUIDesignViewSettingsTabItemBook1);
2096 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2097 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2098 FXMatrix* m41 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2099 new FXLabel(m41, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
2104
2105 myJunctionColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2107
2108 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2109 FXMatrix* m42 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2111 myDrawJunctionShape = new FXCheckButton(m42, TL("Draw junction shape"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2113 myDrawCrossingsAndWalkingAreas = new FXCheckButton(m42, TL("Draw crossings/walkingareas"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2115 myShowLane2Lane = new FXCheckButton(m42, TL("Show lane to lane connections"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2117 new FXLabel(m42, " ", nullptr, GUIDesignViewSettingsLabel1);
2118
2119 myTLIndexPanel = new NamePanel(m42, this, TL("Show link tls index"), mySettings->drawLinkTLIndex);
2120 myJunctionIndexPanel = new NamePanel(m42, this, TL("Show link junction index"), mySettings->drawLinkJunctionIndex);
2121 myJunctionIDPanel = new NamePanel(m42, this, TL("Show junction id"), mySettings->junctionID);
2122 myInternalJunctionNamePanel = new NamePanel(m42, this, TL("Show internal junction id"), mySettings->internalJunctionName);
2123 myInternalEdgeNamePanel = new NamePanel(m42, this, TL("Show internal edge id"), mySettings->internalEdgeName);
2124 myCwaEdgeNamePanel = new NamePanel(m42, this, TL("Show crossing and walkingarea id"), mySettings->cwaEdgeName);
2125 myTLSPhaseIndexPanel = new NamePanel(m42, this, TL("Show traffic light phase index"), mySettings->tlsPhaseIndex);
2126 myTLSPhaseNamePanel = new NamePanel(m42, this, TL("Show traffic light phase name"), mySettings->tlsPhaseName);
2127 myJunctionNamePanel = new NamePanel(m42, this, TL("Show junction name"), mySettings->junctionName);
2128}
2129
2130
2131void
2133 new FXTabItem(tabbook, TL("Additional"), nullptr, GUIDesignViewSettingsTabItemBook1);
2134 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2135 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2136 // IDs
2137 FXMatrix* matrixIDs = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2138 myAddNamePanel = new NamePanel(matrixIDs, this, TL("Show object id"), mySettings->addName);
2139 myAddFullNamePanel = new NamePanel(matrixIDs, this, TL("Show full name"), mySettings->addFullName);
2140 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2141 //Sizes
2142 FXMatrix* matrixSizes = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2144 // color
2145 FXMatrix* matrixColor = new FXMatrix(verticalFrame, 3, GUIDesignMatrixViewSettings);
2146 new FXLabel(matrixColor, TL("StoppingPlace"), nullptr, GUIDesignViewSettingsLabel1);
2147 new FXLabel(matrixColor, TL("body"), nullptr, GUIDesignViewSettingsLabel1);
2148 new FXLabel(matrixColor, TL("sign"), nullptr, GUIDesignViewSettingsLabel1);
2149 new FXLabel(matrixColor, "busStops", nullptr, GUIDesignViewSettingsLabel1);
2152 new FXLabel(matrixColor, "trainStops", nullptr, GUIDesignViewSettingsLabel1);
2155 new FXLabel(matrixColor, "containerStops", nullptr, GUIDesignViewSettingsLabel1);
2158 new FXLabel(matrixColor, "chargingStations", nullptr, GUIDesignViewSettingsLabel1);
2161}
2162
2163
2164void
2166 new FXTabItem(tabbook, TL("Demand"), nullptr, GUIDesignViewSettingsTabItemBook1);
2167 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2168 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2169 // elements
2170 FXMatrix* demandMatrix = new FXMatrix(verticalFrame, 3, GUIDesignMatrixViewSettings);
2171 new FXLabel(demandMatrix, TL("element"), nullptr, GUIDesignViewSettingsLabel1);
2172 new FXLabel(demandMatrix, TL("color"), nullptr, GUIDesignViewSettingsLabel1);
2173 new FXLabel(demandMatrix, TL("width"), nullptr, GUIDesignViewSettingsLabel1);
2174 new FXLabel(demandMatrix, "trips", nullptr, GUIDesignViewSettingsLabel1);
2176 myTripWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2178 new FXLabel(demandMatrix, "personTrips", nullptr, GUIDesignViewSettingsLabel1);
2180 myPersonTripWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2182 new FXLabel(demandMatrix, "walks", nullptr, GUIDesignViewSettingsLabel1);
2184 myWalkWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2186 new FXLabel(demandMatrix, "rides", nullptr, GUIDesignViewSettingsLabel1);
2188 myRideWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2190 new FXLabel(demandMatrix, "transport", nullptr, GUIDesignViewSettingsLabel1);
2192 myTransportWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2194 new FXLabel(demandMatrix, "tranship", nullptr, GUIDesignViewSettingsLabel1);
2196 myTranshipWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2198 // stops
2199 FXMatrix* stopMatrix = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2200 new FXLabel(stopMatrix, "stop", nullptr, GUIDesignViewSettingsLabel1);
2202 new FXLabel(stopMatrix, "waypoint", nullptr, GUIDesignViewSettingsLabel1);
2204 new FXLabel(stopMatrix, "stop (persons)", nullptr, GUIDesignViewSettingsLabel1);
2206 new FXLabel(stopMatrix, "stop (containers)", nullptr, GUIDesignViewSettingsLabel1);
2208}
2209
2210
2211void
2213 new FXTabItem(tabbook, TL("POIs"), nullptr, GUIDesignViewSettingsTabItemBook1);
2214 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2215 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2216
2217 FXMatrix* m63 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2218 new FXLabel(m63, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
2222 myPOIColorInterpolation = new FXCheckButton(m63, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2223 myPOIColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2224
2225 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2226
2227 FXMatrix* m61 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2228
2229 new FXLabel(m61, TL("POI detail"), nullptr, GUIDesignViewSettingsLabel1);
2231 myPoiDetail->setRange(3, 100);
2232 myPoiDetail->setValue(mySettings->poiDetail);
2233
2234 myPOIUseCustomLayer = new FXCheckButton(m61, TL("Custom Layer"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2237 myPOICustomLayer->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
2239
2240 myPOINamePanel = new NamePanel(m61, this, TL("Show poi id"), mySettings->poiName);
2241 myPOITypePanel = new NamePanel(m61, this, TL("Show poi type"), mySettings->poiType);
2242 myPOITextPanel = new NamePanel(m61, this, TL("Show poi text param"), mySettings->poiText);
2244 myPOITextParamKey->setEditable(true);
2245
2246 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2247
2248 FXMatrix* m62 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2250}
2251
2252
2253void
2255 new FXTabItem(tabbook, TL("Polygons"), nullptr, GUIDesignViewSettingsTabItemBook1);
2256 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2257 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2258
2259 FXMatrix* m63 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2260 new FXLabel(m63, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
2264 myPolyColorInterpolation = new FXCheckButton(m63, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2265 myPolyColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2266
2267 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2268
2269 FXMatrix* m91 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2270
2271 myPolyUseCustomLayer = new FXCheckButton(m91, TL("Custom Layer"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2274 myPolyCustomLayer->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
2276
2277 myPolyNamePanel = new NamePanel(m91, this, TL("Show polygon id"), mySettings->polyName);
2278 myPolyTypePanel = new NamePanel(m91, this, TL("Show polygon types"), mySettings->polyType);
2279 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2280
2282}
2283
2284
2285void
2287 new FXTabItem(tabbook, TL("Selection"), nullptr, GUIDesignViewSettingsTabItemBook1);
2288 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2289 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2290
2291 FXMatrix* m102 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2292 new FXLabel(m102, TL("Default Selection Color"), nullptr, GUIDesignViewSettingsLabel1);
2293 new FXLabel(m102, "", nullptr, GUIDesignViewSettingsLabel1);
2294
2295 new FXLabel(m102, TL("Miscellaneous"), nullptr, GUIDesignViewSettingsLabel1);
2297 new FXLabel(m102, "Edge", nullptr, GUIDesignViewSettingsLabel1);
2299 new FXLabel(m102, "Lane Edge", nullptr, GUIDesignViewSettingsLabel1);
2301 new FXLabel(m102, "Connection", nullptr, GUIDesignViewSettingsLabel1);
2303 new FXLabel(m102, "Prohibition", nullptr, GUIDesignViewSettingsLabel1);
2305 new FXLabel(m102, "Crossing", nullptr, GUIDesignViewSettingsLabel1);
2307 new FXLabel(m102, "Additional", nullptr, GUIDesignViewSettingsLabel1);
2309 new FXLabel(m102, "Route", nullptr, GUIDesignViewSettingsLabel1);
2311 new FXLabel(m102, "Vehicle", nullptr, GUIDesignViewSettingsLabel1);
2313 new FXLabel(m102, "Person", nullptr, GUIDesignViewSettingsLabel1);
2315 new FXLabel(m102, "PersonPlan", nullptr, GUIDesignViewSettingsLabel1);
2317 new FXLabel(m102, "edgeData", nullptr, GUIDesignViewSettingsLabel1);
2319}
2320
2321
2322void
2324 new FXTabItem(tabbook, TL("Data"), nullptr, GUIDesignViewSettingsTabItemBook1);
2325 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2326 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2327 // ... color settings
2328 FXVerticalFrame* verticalFrame2 = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);
2329 FXMatrix* m111 = new FXMatrix(verticalFrame2, 4, GUIDesignViewSettingsMatrix3);
2330 new FXLabel(m111, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
2333 myDataColorInterpolation = new FXCheckButton(m111, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2334 myDataColorSettingFrame = new FXVerticalFrame(verticalFrame2, GUIDesignViewSettingsVerticalFrame4);
2336 myDataParamKey->setEditable(true);
2337 myDataParamKey->disable();
2339
2340 // rainbow settings
2341 myDataRainbowPanel = new RainbowPanel(verticalFrame2, this, mySettings->dataValueRainBow);
2342
2343 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2344 FXMatrix* m112 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
2345
2346 new FXLabel(m112, TL("Exaggerate edgeRelation width by"), nullptr, GUIDesignViewSettingsLabel1);
2348 myEdgeRelationUpscaleDialer->setRange(0, 1000000);
2350
2351 new FXLabel(m112, TL("Exaggerate tazRelation width by"), nullptr, GUIDesignViewSettingsLabel1);
2353 myTazRelationUpscaleDialer->setRange(0, 1000000);
2355
2356 // text decoration
2357 myDataValuePanel = new NamePanel(m112, this, TL("Show data color value"), mySettings->dataValue);
2358}
2359
2360
2361void
2363 new FXTabItem(tabbook, TL("Legend"), nullptr, GUIDesignViewSettingsTabItemBook1);
2364 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2365 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2366
2367 FXMatrix* m72 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2368 myShowSizeLegend = new FXCheckButton(m72, TL("Show Size Legend"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2370 new FXLabel(m72, "");
2371 myShowColorLegend = new FXCheckButton(m72, TL("Show Edge Color Legend"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2373 new FXLabel(m72, "");
2374 myShowVehicleColorLegend = new FXCheckButton(m72, TL("Show Vehicle Color Legend"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2376 new FXLabel(m72, "");
2377}
2378
2379
2380void
2382 new FXTabItem(tabbook, "openGL", nullptr, GUIDesignViewSettingsTabItemBook1);
2383 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2384 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2385
2386 FXMatrix* m80 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2387 myTrueZ = new FXCheckButton(m80, "Draw all objects at their true Z-level", this, MID_SIMPLE_VIEW_COLORCHANGE);
2388 myTrueZ->setCheck(mySettings->trueZ);
2389 FXMatrix* m81 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2390 new FXLabel(m81, TL("Combobox max rows"), nullptr, GUIDesignViewSettingsLabel1);
2391 myComboRows = new FXRealSpinner(m81, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2393 FXMatrix* m82 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2394 myDisableHideByZoom = new FXCheckButton(m82, TL("Disable hide by zoom"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2395 myDisableHideByZoom->setHelpText(TL("Disable hiding edges with high zoom out"));
2397 FXMatrix* m83 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2398 myDither = new FXCheckButton(m83, TL("Dither"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2399 myDither->setCheck(mySettings->dither);
2400 FXMatrix* m84 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2401 myFPS = new FXCheckButton(m84, "FPS", this, MID_SIMPLE_VIEW_COLORCHANGE);
2402 myFPS->setCheck(mySettings->fps);
2403 FXMatrix* m85 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2404 myDrawBoundaries = new FXCheckButton(m85, TL("Draw boundaries"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2406 FXMatrix* m86 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2407 myForceDrawForRectangleSelection = new FXCheckButton(m86, TL("Force draw for rectangle selection"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2409 FXMatrix* m87 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2410 myDisableDottedContours = new FXCheckButton(m87, TL("Disable dotted contours during selection/deletion"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2412 FXMatrix* m88 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2413 myRecalculateBoundaries = GUIDesigns::buildFXButton(m88, TL("Recalculate boundaries"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
2414 (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
2415 FXMatrix* m89 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2416 myGeometryIndicesPanel = new NamePanel(m89, this, TL("Show geometry point indices"), mySettings->geometryIndices);
2417}
2418
2419
2420void
2422 myFrame3D = new FXTabItem(tabbook, TL("3D view"), nullptr, GUIDesignViewSettingsTabItemBook1);
2423 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2424 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2425
2426 FXMatrix* m82 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2427 myShow3DTLSLinkMarkers = new FXCheckButton(m82, TL("Show TLS link markers"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2429 //FXMatrix* m83 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2430 myShow3DTLSDomes = new FXCheckButton(m82, TL("Show domes around TLS models from decals"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2432 //FXMatrix* m84 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2433 myGenerate3DTLSModels = new FXCheckButton(m82, TL("Show auto-generated TLS models"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2435 myShow3DHeadUpDisplay = new FXCheckButton(m82, TL("Show head-up display"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2437
2438 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2439
2440 FXMatrix* m2 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2441 new FXLabel(m2, TL("Sun brightness"), nullptr, GUIDesignViewSettingsLabel1);
2443 myLight3DFactor->setRange(0, 255);
2445 /*
2446 new FXLabel(m2, "Ambient", nullptr, GUIDesignViewSettingsLabel1);
2447 myAmbient3DLight = new FXColorWell(m2, MFXUtils::getFXColor(mySettings->ambient3DLight), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2448 myAmbient3DLight->setOpaqueOnly(true);
2449 new FXLabel(m2, "Diffuse", nullptr, GUIDesignViewSettingsLabel1);
2450 myDiffuse3DLight = new FXColorWell(m2, MFXUtils::getFXColor(mySettings->diffuse3DLight), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2451 myDiffuse3DLight->setOpaqueOnly(true);
2452 */
2453 new FXLabel(m2, TL("Sky color"), nullptr, GUIDesignViewSettingsLabel1);
2455 mySkyColor->setOpaqueOnly(true);
2456
2457#ifdef HAVE_OSG
2459#else
2460 myFrame3D->disable();
2461#endif
2462}
2463
2464
2465void
2466GUIDialog_ViewSettings::buildButtons(FXVerticalFrame* contentFrame) {
2467 FXHorizontalFrame* horizontalFrameButtons = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame2);
2468 FXButton* OK = GUIDesigns::buildFXButton(horizontalFrameButtons, TL("&OK"), "", "", nullptr, this, MID_SETTINGS_OK, GUIDesignViewSettingsButton2);
2469 GUIDesigns::buildFXButton(horizontalFrameButtons, TL("&Cancel"), "", "", nullptr, this, MID_SETTINGS_CANCEL, GUIDesignViewSettingsButton3);
2470 OK->setFocus();
2471}
2472
2473/****************************************************************************/
long long int SUMOTime
Definition GUI.h:36
@ MID_SIMPLE_VIEW_NAMECHANGE
Informs the dialog about switching to another scheme.
Definition GUIAppEnum.h:631
@ MID_SIMPLE_VIEW_CLEAR_DECALS
For the clear-decals - button.
Definition GUIAppEnum.h:647
@ MID_SIMPLE_VIEW_RAINBOW_CHANGE
For changing rainbow style.
Definition GUIAppEnum.h:649
@ MID_SIMPLE_VIEW_SAVE
For the save-to-db - button.
Definition GUIAppEnum.h:633
@ MID_SIMPLE_VIEW_IMPORT
For the import-from-file - button.
Definition GUIAppEnum.h:639
@ MID_SIMPLE_VIEW_EXPORT
For the export-to-file - button.
Definition GUIAppEnum.h:637
@ MID_SIMPLE_VIEW_DELETE
For the delete - button.
Definition GUIAppEnum.h:635
@ MID_SIMPLE_VIEW_LOAD_DECALS_XML
For the load-decals - button.
Definition GUIAppEnum.h:643
@ MID_SIMPLE_VIEW_LOAD_DECAL
For the load-decals - button.
Definition GUIAppEnum.h:641
@ MID_SETTINGS_OK
Ok-button was pushed.
Definition GUIAppEnum.h:551
@ MID_SETTINGS_CANCEL
Cancel-button was pushed.
Definition GUIAppEnum.h:553
@ MID_SIMPLE_VIEW_SIZECHANGE
Informs the dialog about a size value's change.
Definition GUIAppEnum.h:629
@ MID_SIMPLE_VIEW_COLORCHANGE
Informs the dialog about a value's change.
Definition GUIAppEnum.h:627
@ MID_SIMPLE_VIEW_SAVE_DECALS_XML
For the save-decals - button.
Definition GUIAppEnum.h:645
GUICompleteSchemeStorage gSchemeStorage
#define GUIDesignViewSettingsColorWell2
Definition GUIDesigns.h:585
#define GUIDesignViewSettingsMatrix3
Definition GUIDesigns.h:542
#define GUIDesignViewSettingsMainDialog
Definition GUIDesigns.h:513
#define GUIDesignViewSettingsMatrix5
Definition GUIDesigns.h:546
#define GUIDesignComboBoxStatic
Combo box static (not editable)
Definition GUIDesigns.h:296
#define GUIDesignViewSettingsComboBox1
Combo boxes.
Definition GUIDesigns.h:549
#define GUIDesignComboBoxWidth100
comboBox with thick frame, width 100
Definition GUIDesigns.h:308
#define GUIDesignViewSettingsHorizontalFrame3
Definition GUIDesigns.h:535
#define GUIDesignViewSettingsVerticalFrame6
Definition GUIDesigns.h:528
#define GUIDesignViewSettingsHorizontalFrame2
Definition GUIDesigns.h:533
#define GUIDesignViewSettingsButton2
Definition GUIDesigns.h:574
#define GUIDesignButtonToolbar
little button with icon placed in navigation toolbar
Definition GUIDesigns.h:123
#define GUIDesignViewSettingsMatrix1
Matrix.
Definition GUIDesigns.h:538
#define GUIDesignViewSettingsColorWell1
Color wells.
Definition GUIDesigns.h:583
#define GUIDesignViewSettingsButton4
Definition GUIDesigns.h:578
#define GUIDesignViewSettingsDialog
Definition GUIDesigns.h:515
#define GUIDesignViewSettingsMatrix4
Definition GUIDesigns.h:544
#define GUIDesignViewSettingsSpinDial2
Definition GUIDesigns.h:556
#define GUIDesignViewSettingsButton5
Definition GUIDesigns.h:580
#define GUIDesignViewSettingsHorizontalFrame1
Horizontal frames.
Definition GUIDesigns.h:531
#define GUIDesignViewSettingsSpinDial1
Definition GUIDesigns.h:554
#define GUIDesignViewSettingsVerticalFrame5
Definition GUIDesigns.h:526
#define GUIDesignViewSettingsMatrix2
Definition GUIDesigns.h:540
#define GUIDesignViewSettingsLabel1
Label.
Definition GUIDesigns.h:564
#define GUIDesignComboBoxVisibleItems
Definition GUIDesigns.h:49
#define GUIDesignViewSettingsTabBook1
Tab books.
Definition GUIDesigns.h:559
#define GUIDesignViewSettingsButton3
Definition GUIDesigns.h:576
#define GUIDesignMatrixViewSettings
FXMatrix used to pack values in Viewsettings.
Definition GUIDesigns.h:355
#define GUIDesignViewSettingsVerticalFrame2
Definition GUIDesigns.h:520
#define GUIDesignViewSettingsVerticalFrame3
Definition GUIDesigns.h:522
#define GUIDesignViewSettingsColorWell
ColorWell.
Definition GUIDesigns.h:552
#define GUIDesignHorizontalSeparator
Definition GUIDesigns.h:463
#define GUIDesignViewSettingsVerticalFrame4
Definition GUIDesigns.h:524
#define GUIDesignViewSettingsTabItemBook1
Definition GUIDesigns.h:561
#define GUIDesignViewSettingsVerticalFrame1
vertical frames
Definition GUIDesigns.h:518
#define GUIDesignViewSettingsLabel2
Definition GUIDesigns.h:566
#define GUIDesignViewSettingsTextField1
textFields
Definition GUIDesigns.h:569
#define GUIDesignCheckButtonViewSettings
CheckButton for Frames without thick extended over the frame.
Definition GUIDesigns.h:207
#define GUIDesignViewSettingsButton1
Buttons.
Definition GUIDesigns.h:572
FXDEFMAP(GUIDialog_ViewSettings::SizePanel) GUIDialog_SizeMap[]
GUIGlObjectType
@ GLO_TAZRELDATA
TAZ relation data.
@ GLO_JUNCTION
a junction
@ GLO_LANE
a lane
@ GLO_CONTAINER
a container
@ GLO_ADDITIONALELEMENT
reserved GLO type for packing all additionals elements
@ GLO_VEHICLE
a vehicle
@ GLO_PERSON
a person
@ GLO_POI
poi (over view, geo and lane)
@ GLO_POLYGON
polygon
GUIViewObjectsHandler gViewObjectsHandler
FXString gCurrentFolder
The folder used as last.
@ OPEN
open icons
@ SAVE_DATABASE
@ SAVE
save icons
#define TL(string)
Definition MsgHandler.h:315
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
Definition SUMOTime.cpp:69
@ SUMO_TAG_DELAY
@ SUMO_TAG_BREAKPOINT
@ SUMO_TAG_VIEWSETTINGS_DECAL
@ SUMO_TAG_VIEWSETTINGS
@ SUMO_TAG_VIEWSETTINGS_LIGHT
@ SUMO_ATTR_VALUE
@ SUMO_ATTR_CENTER_Y
@ SUMO_ATTR_INDEX
@ SUMO_ATTR_LAYER
A layer number.
@ SUMO_ATTR_HEIGHT
@ SUMO_ATTR_TYPE
@ 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
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.
void remove(const std::string name)
Removes the setting with the given name.
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 writeSettings(FXApp *app)
Writes the current scheme into the registry.
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
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?
void update(const GUIVisualizationRainbowSettings &settings)
update
GUIVisualizationRainbowSettings getSettings()
get settings
RainbowPanel(FXComposite *parent, GUIDialog_ViewSettings *target, const GUIVisualizationRainbowSettings &settings)
constructor
FXCheckButton * myCheckSelected
check selected button
long onCmdSizeChange(FXObject *obj, FXSelector sel, void *ptr)
FXRealSpinner * myMinSizeDial
min size dial
void update(const GUIVisualizationSizeSettings &settings)
update
GUIVisualizationSizeSettings getSettings()
get settings
SizePanel(FXMatrix *parent, GUIDialog_ViewSettings *target, const GUIVisualizationSizeSettings &settings, GUIGlObjectType type)
FOX Declaration.
FXRealSpinner * myExaggerateDial
exaggerate dial
The dialog to change the view (gui) settings.
long onCmdExportSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be exported into a file.
FXVerticalFrame * myVehicleColorSettingFrame
void buildBackgroundFrame(FXTabBook *tabbook)
build frames
FXCheckButton * myVehicleColorInterpolation
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
MFXComboBoxIcon * myPolyColorMode
Polygons.
FXCheckButton * myShowPedestrianNetwork
FXVerticalFrame * myDataColorSettingFrame
GUISUMOAbstractView * myParent
The parent view (which settings are changed)
std::vector< FXColorWell * > myPolyColors
MFXComboBoxIcon * myJunctionColorMode
junctions
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
std::vector< FXColorWell * > myPOIColors
FXColorWell * myBusStopColor
additional colors
std::vector< FXButton * > myLaneScaleButtons
FXCheckButton * myDisableDottedContours
std::vector< FXColorWell * > myPersonColors
MFXComboBoxIcon * myVehicleShapeDetail
std::vector< FXButton * > myDataButtons
std::vector< FXRealSpinner * > myVehicleScales
std::vector< FXRealSpinner * > myPolyThresholds
FXCheckButton * myPOIColorInterpolation
std::vector< FXButton * > myContainerButtons
std::vector< FXRealSpinner * > myJunctionThresholds
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
FXCheckButton * myShowVehicleColorLegend
void buildStreetsFrame(FXTabBook *tabbook)
FXRealSpinner * myTripWidth
demand widths
FXCheckButton * mySaveViewPort
load/save-menu
void buildVehiclesFrame(FXTabBook *tabbook)
std::vector< FXColorWell * > myJunctionColors
MFXComboBoxIcon * myLaneEdgeScaleMode
... lane scaler
FXCheckButton * myPersonColorInterpolation
long onCmdLoadXMLDecals(FXObject *, FXSelector, void *data)
Called if the decals shall be loaded from a file.
FXColorWell * mySelectionColor
selection colors
RainbowPanel * myEdgeRainbowPanel
rainbow panels
FXVerticalFrame * myLaneScaleSettingFrame
std::vector< FXColorWell * > myVehicleColors
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.
std::vector< FXRealSpinner * > myVehicleThresholds
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
FXCheckButton * myPolyColorInterpolation
std::vector< FXButton * > myPersonButtons
FXCheckButton * myJunctionColorInterpolation
FXRealSpinner * myTazRelationUpscaleDialer
void buildHeader(FXVerticalFrame *contentFrame)
build header
long onCmdCancel(FXObject *, FXSelector, void *)
Called if the Cancel-button was pressed.
FXVerticalFrame * myLaneColorSettingFrame
MFXComboBoxIcon * myPersonShapeDetail
FXCheckButton * myLaneScaleInterpolation
void buildDemandFrame(FXTabBook *tabbook)
long onCmdImportSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be read from a file.
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
FXCheckButton * myDrawCrossingsAndWalkingAreas
std::vector< FXButton * > myLaneButtons
FXCheckButton * myLaneColorInterpolation
FXVerticalFrame * myPersonColorSettingFrame
void buildContainersFrame(FXTabBook *tabbook)
MFXComboBoxIcon * myVehicleColorMode
Vehicles.
void buildLegendFrame(FXTabBook *tabbook)
std::vector< FXRealSpinner * > myVehicleScaleThresholds
long onCmdLoadDecal(FXObject *, FXSelector, void *data)
Called if the decal shall be loaded from a file.
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
GUISUMOAbstractView * getSUMOAbstractView()
get GUISUMOAbstractView parent
MFXComboBoxIcon * myContainerColorMode
Containers.
std::vector< FXRealSpinner * > myLaneScaleThresholds
FXCheckButton * myDither
openGL
MFXComboBoxIcon * myContainerShapeDetail
GUIVisualizationSettings myBackup
A backup of the settings (used if the "Cancel" button is pressed)
std::vector< FXRealSpinner * > myContainerThresholds
void buildPersonsFrame(FXTabBook *tabbook)
FXCheckButton * myShow3DTLSLinkMarkers
3D
MFXComboBoxIcon * myPOIColorMode
POIs.
void updatePOIParams()
reload known POI parameters
FXCheckButton * myShowLane2Lane
buttons
std::vector< FXColorWell * > myDataColors
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.
MFXComboBoxIcon * myLaneEdgeColorMode
... lane colorer
long onCmdSaveXMLDecals(FXObject *, FXSelector, void *data)
Called if the decals shall be saved to a file.
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
MFXComboBoxIcon * myVehicleScaleMode
vehicle scaler
std::vector< FXButton * > myVehicleScaleButtons
MFXComboBoxIcon * myPersonColorMode
Persons.
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
void build3DFrame(FXTabBook *tabbook)
long onUpdExportSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to export settings into a file.
MFXComboBoxIcon * myDataColorMode
Data.
std::vector< FXButton * > myPOIButtons
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
Persists window position in the registry.
const std::vector< double > & getThresholds() const
void setColor(const int pos, const T &color)
void setThreshold(const int pos, const double threshold)
const std::vector< std::string > & getNames() const
void removeColor(const int pos)
const std::string & getName() const
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
bool allowsNegativeValues() const
void fill(MFXComboBoxIcon &cb)
Fills the given combobox with the names of available colorings.
MFXComboBoxIcon * getColoringSchemesCombo()
get coloring schemes combo
virtual void buildColorRainbow(const GUIVisualizationSettings &, GUIColorScheme &, int, GUIGlObjectType, const GUIVisualizationRainbowSettings &)
recalibrate color scheme according to the current value range
virtual std::vector< std::string > getMeanDataAttrs(const std::string &meanDataID) const
return list of available attributes for the given meanData id
void setDelay(double delay)
Sets the delay of the parent application.
GUIDialog_EditViewport * getViewportEditor()
get the viewport and create it on first access
std::vector< Decal > & getDecals()
The list of decals to show.
double getDelay() const
Returns the delay of the parent application.
virtual std::vector< std::string > getEdgeLaneParamKeys(bool) const
return list of available edge parameters
virtual std::vector< std::string > getVehicleParamKeys(bool) const
return list of available vehicle parameters
virtual void drawPedestrianNetwork(const GUIVisualizationSettings &) const
Draw (or not) the JuPedSim pedestrian network.
virtual std::vector< std::string > getMeanDataIDs() const
return list of loaded edgeData ids (being computed in the current simulation)
virtual void recalculateBoundaries()
recalculate boundaries
FXMutex & getDecalsLockMutex()
The mutex to use before accessing the decals list in order to avoid thread conflicts.
virtual bool is3DView() const
return whether this is a 3D view
virtual std::vector< std::string > getPOIParamKeys() const
return list of available vehicle parameters
virtual void changePedestrianNetworkColor(const GUIVisualizationSettings &) const
Change the color of the JuPedSim pedestrian network.
void setBreakpoints(const std::vector< SUMOTime > &breakpoints)
Sets the breakpoints of the parent application.
virtual bool setColorScheme(const std::string &)
set color scheme
virtual std::vector< std::string > getRelDataAttrs() const
return list of loaded edgeRelation and tazRelation attributes
virtual const std::vector< SUMOTime > retrieveBreakpoints() const
retrieve breakpoints if provided by the application
void remove(GUIDialog_EditViewport *)
remove viewport
virtual std::vector< std::string > getEdgeDataAttrs() const
return list of loaded edgeData attributes
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.
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
const std::vector< SUMOTime > & getBreakpoints() const
Returns the parsed breakpoints.
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
GUIGlObjectType recomputeBoundaries
recompute boundaries
Stores the information about how to visualize structures.
GUIVisualizationTextSettings addName
GUIVisualizationTextSettings tlsPhaseIndex
bool poiUseCustomLayer
whether the rendering layer of POIs should be overriden
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
bool showPedestrianNetwork
Flag for visualizing the pedestrian network generated for JuPedSim.
RGBColor skyColor
sky background color
double polyCustomLayer
the custom layer for polygons
GUIVisualizationSizeSettings junctionSize
static const std::string SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL
bool drawBoundaries
enable or disable draw boundaries
static const std::string SCHEME_NAME_EDGEDATA_NUMERICAL
bool showBikeMarkings
Information whether bicycle lane marking shall be drawn.
std::string edgeDataID
id for coloring by live edgeData
GUIScaler laneScaler
The lane scaler.
GUIVisualizationTextSettings edgeScaleValue
bool dither
Information whether dithering shall be enabled.
GUIColorer vehicleColorer
The vehicle colorer.
bool disableHideByZoom
disable hide by zoom
static const std::string SCHEME_NAME_EDGEDATA_LIVE
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.
RGBColor pedestrianNetworkColor
The color of the pedestrian network generated for JuPedSim.
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 geometryIndices
GUIVisualizationTextSettings dataValue
bool show3DTLSDomes
whether the semi-transparent domes around 3D TL models should be drawn
bool realisticLinkRules
Information whether link rules (colored bars) shall be drawn with a realistic color scheme.
bool trueZ
drawl all objects according to their z data
int personQuality
The quality of person drawing.
GUIColorer poiColorer
The POI colorer.
GUIVisualizationWidthSettings widthSettings
width settings
GUIVisualizationTextSettings poiName
std::string vehicleScaleParam
key for scaling by vehicle parameter
bool showParkingInfo
Set whether parking related information should be shown.
GUIVisualizationTextSettings vehicleValue
bool disableDottedContours
flag for disable dotted contours in netedit
GUIColorer polyColorer
The polygon colorer.
int vehicleQuality
The quality of vehicle drawing.
GUIVisualizationTextSettings drawLinkJunctionIndex
bool generate3DTLSModels
whether 3D TLS models should be generated automatically
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.
GUIVisualizationRainbowSettings edgeValueRainBow
checks and thresholds for rainbow coloring
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 hide 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.
bool polyUseCustomLayer
whether the rendering layer of polygons should be overriden
int getLaneEdgeMode() const
Returns the number of the active lane (edge) coloring schme.
double poiCustomLayer
the custom layer for POIs
bool showChargingInfo
Set whether the charging search related information should be shown.
RGBColor ambient3DLight
3D material light components
GUIVisualizationRainbowSettings junctionValueRainBow
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.
GUIVisualizationRainbowSettings dataValueRainBow
value below which edgeData and edgeRelation data value should not be rendered
bool secondaryShape
whether secondary lane shape shall be drawn
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.
bool show3DHeadUpDisplay
whether to draw the head up display items
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
Setting bundles for optional drawing names with size and color.
bool showSizeLegend
Information whether the size legend shall be drawn.
double laneMinSize
The minimum visual lane width for drawing.
GUIVisualizationTextSettings drawLinkTLIndex
GUIVisualizationTextSettings containerName
static std::map< std::string, std::vector< RGBColor > > RAINBOW_SCHEMES
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 drawReversed
Whether to draw reversed vehicles in their reversed state.
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.
void copy(const GUIVisualizationSettings &s)
copy all content from another GUIVisualizationSettings (note: DON'T USE in DrawGL functions!...
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.
std::string edgeDataScaling
key for scaling by edgeData
ComboBox with icon.
FXint insertIconItem(FXint index, const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
insert icon item in the given position
long setCurrentItem(const FXint index, FXbool notify=FALSE)
Set the current item (index is zero-based)
FXint getCurrentItem() const
Get the current item's index.
FXint findItem(const FXString &text) const
find item
void removeItem(FXint index)
Remove this item from the list.
FXint getNumItems() const
Return the number of items in the list.
FXString getText() const
Get the text.
void clearItems()
Remove all items from the list.
std::string getItemText(FXint index) const
Get text for specified item.
void disable()
Disable combo box.
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon item in the last position
void enable()
Enable combo box.
void fillTable()
fill table
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 OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
void close()
Closes the device and removes it from the dictionary.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
unsigned char red() const
Returns the red-amount of the color.
Definition RGBColor.cpp:74
void set(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
assigns new values
Definition RGBColor.cpp:98
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
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 waypointColor
color for Waypoints
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
bool hideMax
whether data above threshold should not be colored
bool setNeutral
whether the scale should be centered at a specific value
bool fixRange
whether the color scale should be fixed to the given min/max values
double minThreshold
threshold below which value should not be colored
std::vector< RGBColor > colors
color steps for the rainbow;
bool hideMin
whether data below threshold should not be colored
double neutralThreshold
neutral point of scale
double maxThreshold
threshold above which value should not be colored
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