Eclipse SUMO - Simulation of Urban MObility
GUIDialog_ViewSettings.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
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// ===========================================================================
55};
56
57FXDEFMAP(GUIDialog_ViewSettings) GUIDialog_ViewSettingsMap[] = {
61 FXMAPFUNC(SEL_COMMAND, MID_SETTINGS_OK, GUIDialog_ViewSettings::onCmdOk),
64
73
77};
78
79
80FXIMPLEMENT(GUIDialog_ViewSettings, FXDialogBox, GUIDialog_ViewSettingsMap, ARRAYNUMBER(GUIDialog_ViewSettingsMap))
81FXIMPLEMENT(GUIDialog_ViewSettings::SizePanel, FXObject, GUIDialog_SizeMap, ARRAYNUMBER(GUIDialog_SizeMap))
82
83
84// ===========================================================================
85// method definitions
86// ===========================================================================
88 FXDialogBox(parent, "View Settings", GUIDesignViewSettingsMainDialog),
89 myParent(parent), mySettings(settings), myBackup(settings->name, settings->netedit),
90 myDecals(decals), myDecalsLock(decalsLock), myDecalsTable(nullptr),
91 myDataValuePanel(nullptr) {
92 myBackup.copy(*settings);
93 // create content frame
94 FXVerticalFrame* contentFrame = new FXVerticalFrame(this, GUIDesignViewSettingsVerticalFrame1);
95 // build header
96 buildHeader(contentFrame);
97 // create tabbook for every section
98 FXTabBook* tabbook = new FXTabBook(contentFrame, nullptr, 0, GUIDesignViewSettingsTabBook1);
99 // build background frame
100 buildBackgroundFrame(tabbook);
101 // build streets frame
102 buildStreetsFrame(tabbook);
103 // build vehicles frame
104 buildVehiclesFrame(tabbook);
105 // build persons frame
106 buildPersonsFrame(tabbook);
107 // build containers frame
108 buildContainersFrame(tabbook);
109 // build junctions frame
110 buildJunctionsFrame(tabbook);
111 // build additionals frame
112 buildAdditionalsFrame(tabbook);
113 // build demand frame
114 if (mySettings->netedit) {
115 buildDemandFrame(tabbook);
116 }
117 // build POIs frame
118 buildPOIsFrame(tabbook);
119 // build polygons frame
120 buildPolygonsFrame(tabbook);
121 // build selection frame (only in NETEDIT)
122 if (mySettings->netedit) {
123 buildSelectionFrame(tabbook);
124 }
125 // build data frame (only in NETEDIT)
126 if (mySettings->netedit) {
127 buildDataFrame(tabbook);
128 }
129 // build legend frame
130 buildLegendFrame(tabbook);
131 // build 3D frame
132 build3DFrame(tabbook);
133 if (mySettings->netedit) {
134 myFrame3D->disable();
135 }
136 // build openGL frame
137 buildOpenGLFrame(tabbook);
138 // build buttons
139 buildButtons(contentFrame);
140 // rebuild color matrix
141 rebuildColorMatrices(false);
143 loadWindowSize();
144}
145
146
148 myParent->remove(this);
149 // delete name panels
153 delete myTLSPhaseNamePanel;
154 delete myCwaEdgeNamePanel;
155 delete myStreetNamePanel;
156 delete myEdgeValuePanel;
158 delete myTLIndexPanel;
159 delete myJunctionIDPanel;
160 delete myJunctionNamePanel;
161 delete myVehicleNamePanel;
162 delete myVehicleValuePanel;
164 delete myVehicleTextPanel;
165 delete myPersonNamePanel;
166 delete myPersonValuePanel;
167 delete myAddNamePanel;
168 delete myAddFullNamePanel;
169 delete myPOINamePanel;
170 delete myPOITypePanel;
171 delete myPOITextPanel;
172 delete myPolyNamePanel;
173 delete myPolyTypePanel;
174 delete myEdgeNamePanel;
175 delete myDataValuePanel;
177 // delete size panels
178 delete myVehicleSizePanel;
179 delete myPersonSizePanel;
180 delete myJunctionSizePanel;
181 delete myPOISizePanel;
182 delete myPolySizePanel;
183 delete myAddSizePanel;
184}
185
186
187void
189 // update buttons that can be changed externally
190 myShowGrid->setCheck(mySettings->showGrid);
193 FXDialogBox::show();
194}
195
196
197void
199 mySettings = settings;
200 myBackup.copy(*settings);
201 onCmdNameChange(nullptr, 0, nullptr);
202}
203
204
205long
206GUIDialog_ViewSettings::onCmdOk(FXObject*, FXSelector, void*) {
208 hide();
209 return 1;
210}
211
212
213long
214GUIDialog_ViewSettings::onCmdCancel(FXObject*, FXSelector, void*) {
216 hide();
218 myParent->update();
219 return 1;
220}
221
222
223long
224GUIDialog_ViewSettings::onCmdNameChange(FXObject*, FXSelector, void* ptr) {
225 if (ptr != nullptr) {
226 FXString dataS = (char*) ptr; // !!!unicode
227 // check whether this item has been added twice
228 if (dataS == mySchemeName->getItemText(mySchemeName->getNumItems() - 1)) {
229 for (int i = 0; i < mySchemeName->getNumItems() - 1; ++i) {
230 if (dataS == mySchemeName->getItemText(i)) {
231 mySchemeName->removeItem(i);
232 }
233 }
234 }
235 myBackup.copy(gSchemeStorage.get(dataS.text()));
236 mySettings = &gSchemeStorage.get(dataS.text());
237 }
239
241
250 if (mySettings->netedit) {
261
268
281
288 }
289
297 myShowRails->setCheck(mySettings->showRails);
313
324 /*
325 myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
326 */
332
338
343
353
357
358 myPoiDetail->setValue(mySettings->poiDetail);
363
367
371 myDither->setCheck(mySettings->dither);
372 myFPS->setCheck(mySettings->fps);
380
382 update();
383 myParent->update();
384 return 1;
385}
386
387
388bool
389GUIDialog_ViewSettings::updateColorRanges(FXObject* sender, std::vector<FXColorWell*>::const_iterator colIt,
390 std::vector<FXColorWell*>::const_iterator colEnd,
391 std::vector<FXRealSpinner*>::const_iterator threshIt,
392 std::vector<FXRealSpinner*>::const_iterator threshEnd,
393 std::vector<FXButton*>::const_iterator buttonIt,
394 GUIColorScheme& scheme) {
395 UNUSED_PARAMETER(threshEnd);
396 int pos = 0;
397 while (colIt != colEnd) {
398 if (scheme.isFixed()) {
399 if (sender == *colIt) {
400 scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
401 }
402 } else {
403 if (sender == *threshIt) {
404 const double val = (*threshIt)->getValue();
405 scheme.setThreshold(pos, val);
406 return false;
407 }
408 if (sender == *colIt) {
409 scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
410 return false;
411 }
412 if (sender == *buttonIt) {
413 scheme.addColor(MFXUtils::getRGBColor((*colIt)->getRGBA()), (*threshIt)->getValue());
414 return true;
415 } else if (sender == *(buttonIt + 1)) {
416 scheme.removeColor(pos);
417 return true;
418 }
419 // 2 buttons per item (add / remove)
420 threshIt++;
421 buttonIt += 2;
422 }
423 ++colIt;
424 pos++;
425 }
426 return false;
427}
428
429
430bool
431GUIDialog_ViewSettings::updateScaleRanges(FXObject* sender, std::vector<FXRealSpinner*>::const_iterator scaleIt,
432 std::vector<FXRealSpinner*>::const_iterator scaleEnd,
433 std::vector<FXRealSpinner*>::const_iterator threshIt,
434 std::vector<FXRealSpinner*>::const_iterator threshEnd,
435 std::vector<FXButton*>::const_iterator buttonIt,
436 GUIScaleScheme& scheme) {
437 int pos = 0;
438 while (scaleIt != scaleEnd) {
439 if (scheme.isFixed()) {
440 if (sender == *scaleIt) {
441 scheme.setColor(pos, (*scaleIt)->getValue());
442 }
443 } else {
444 if (sender == *threshIt) {
445 const double val = (*threshIt)->getValue();
446 double lo, hi;
447 if (pos != 0) {
448 threshIt--;
449 (*threshIt)->getRange(lo, hi);
450 (*threshIt)->setRange(lo, val);
451 threshIt++;
452 }
453 threshIt++;
454 if (threshIt != threshEnd) {
455 (*threshIt)->getRange(lo, hi);
456 (*threshIt)->setRange(val, hi);
457 }
458 scheme.setThreshold(pos, val);
459 return false;
460 }
461 if (sender == *scaleIt) {
462 scheme.setColor(pos, (*scaleIt)->getValue());
463 return false;
464 }
465 if (sender == *buttonIt) {
466 scheme.addColor((*scaleIt)->getValue(), (*threshIt)->getValue());
467 return true;
468 } else if (sender == *(buttonIt + 1)) {
469 scheme.removeColor(pos);
470 return true;
471 }
472 threshIt++;
473 buttonIt += 2;
474 }
475 ++scaleIt;
476 pos++;
477 }
478 return false;
479}
480
481
482long
483GUIDialog_ViewSettings::onCmdColorChange(FXObject* sender, FXSelector, void* /*val*/) {
485 tmpSettings.copy(*mySettings);
486 int prevLaneMode = mySettings->getLaneEdgeMode();
487 int prevLaneScaleMode = mySettings->getLaneEdgeScaleMode();
488 int prevVehicleMode = mySettings->vehicleColorer.getActive();
489 int prevVehicleScaleMode = mySettings->vehicleScaler.getActive();
490 int prevPersonMode = mySettings->personColorer.getActive();
491 int prevContainerMode = mySettings->containerColorer.getActive();
492 int prevJunctionMode = mySettings->junctionColorer.getActive();
493 int prevPOIMode = mySettings->poiColorer.getActive();
494 int prevPolyMode = mySettings->polyColorer.getActive();
495 int prevDataMode = mySettings->dataColorer.getActive();
496 bool doRebuildColorMatrices = false;
497
498 tmpSettings.name = mySettings->name;
500
501 // additionals
510 if (mySettings->netedit) {
521
522 tmpSettings.widthSettings.tripWidth = myTripWidth->getValue();
523 tmpSettings.widthSettings.personTripWidth = myPersonTripWidth->getValue();
524 tmpSettings.widthSettings.walkWidth = myWalkWidth->getValue();
525 tmpSettings.widthSettings.rideWidth = myRideWidth->getValue();
526 tmpSettings.widthSettings.transportWidth = myTransportWidth->getValue();
527 tmpSettings.widthSettings.transhipWidth = myTranshipWidth->getValue();
528
541 }
542
543 tmpSettings.showGrid = (myShowGrid->getCheck() != FALSE);
544 tmpSettings.gridXSize = (double) myGridXSizeDialer->getValue();
545 tmpSettings.gridYSize = (double) myGridYSizeDialer->getValue();
546
550 } else {
553 }
554 tmpSettings.laneShowBorders = (myShowLaneBorders->getCheck() != FALSE);
555 tmpSettings.showBikeMarkings = (myShowBikeMarkings->getCheck() != FALSE);
556 tmpSettings.showLinkDecals = (myShowLaneDecals->getCheck() != FALSE);
557 tmpSettings.realisticLinkRules = (myRealisticLinkRules->getCheck() != FALSE);
558 tmpSettings.showLinkRules = (myShowLinkRules->getCheck() != FALSE);
559 tmpSettings.showRails = (myShowRails->getCheck() != FALSE);
560 tmpSettings.edgeName = myEdgeNamePanel->getSettings();
564 tmpSettings.edgeValue = myEdgeValuePanel->getSettings();
565 tmpSettings.hideConnectors = (myHideMacroConnectors->getCheck() != FALSE);
566 tmpSettings.showLaneDirection = (myShowLaneDirection->getCheck() != FALSE);
567 tmpSettings.showSublanes = (myShowSublanes->getCheck() != FALSE);
568 tmpSettings.spreadSuperposed = (mySpreadSuperposed->getCheck() != FALSE);
569 if (sender == myParamKey) {
571 tmpSettings.edgeParam = myParamKey->getText().text();
573 tmpSettings.laneParam = myParamKey->getText().text();
575 tmpSettings.edgeData = myParamKey->getText().text();
577 tmpSettings.edgeData = myParamKey->getText().text();
578 }
579 } else if (sender == myVehicleParamKey) {
581 tmpSettings.vehicleParam = myVehicleParamKey->getText().text();
582 }
583 } else if (sender == myDataParamKey) {
585 tmpSettings.relDataAttr = myDataParamKey->getText().text();
586 }
587 } else if (sender == myVehicleTextPanel->myCheck) {
589 } else if (sender == myVehicleTextParamKey) {
590 tmpSettings.vehicleTextParam = myVehicleTextParamKey->getText().text();
591 } else if (sender == myPOITextPanel->myCheck) {
593 } else if (sender == myPOITextParamKey) {
594 tmpSettings.poiTextParam = myPOITextParamKey->getText().text();
595 } else if (sender == myMeanDataID) {
596 tmpSettings.edgeDataID = myMeanDataID->getText().text();
597 }
598 tmpSettings.edgeValueHideCheck = (myLaneColorRainbowCheck->getCheck() != FALSE);
599 tmpSettings.edgeValueHideThreshold = myLaneColorRainbowThreshold->getValue();
600 tmpSettings.edgeValueHideCheck2 = (myLaneColorRainbowCheck2->getCheck() != FALSE);
602 tmpSettings.laneWidthExaggeration = myLaneWidthUpscaleDialer->getValue();
603 tmpSettings.laneMinSize = myLaneMinWidthDialer->getValue();
604
608 tmpSettings.showBlinker = (myShowBlinker->getCheck() != FALSE);
609 tmpSettings.drawMinGap = (myShowMinGap->getCheck() != FALSE);
610 tmpSettings.drawBrakeGap = (myShowBrakeGap->getCheck() != FALSE);
611 tmpSettings.showBTRange = (myShowBTRange->getCheck() != FALSE);
612 tmpSettings.showRouteIndex = (myShowRouteIndex->getCheck() != FALSE);
613 tmpSettings.scaleLength = (myScaleLength->getCheck() != FALSE);
614 tmpSettings.showParkingInfo = (myShowParkingInfo->getCheck() != FALSE);
615 /*
616 tmpSettings.drawLaneChangePreference = (myShowLaneChangePreference->getCheck() != FALSE);
617 */
623
629
634
644
645 tmpSettings.addName = myAddNamePanel->getSettings();
647 tmpSettings.addSize = myAddSizePanel->getSettings();
648
650 tmpSettings.poiDetail = myPoiDetail->getValue();
651 tmpSettings.poiName = myPOINamePanel->getSettings();
652 tmpSettings.poiType = myPOITypePanel->getSettings();
653 tmpSettings.poiText = myPOITextPanel->getSettings();
654 tmpSettings.poiSize = myPOISizePanel->getSettings();
655
657 tmpSettings.polyName = myPolyNamePanel->getSettings();
658 tmpSettings.polyType = myPolyTypePanel->getSettings();
659 tmpSettings.polySize = myPolySizePanel->getSettings();
660
661 if (mySettings->netedit) {
662 tmpSettings.dataValue = myDataValuePanel->getSettings();
664 tmpSettings.dataValue = myDataValuePanel->getSettings();
665 tmpSettings.tazRelWidthExaggeration = myTazRelationUpscaleDialer->getValue();
667 tmpSettings.dataValueHideCheck = (myDataColorRainbowCheck->getCheck() != FALSE);
668 tmpSettings.dataValueHideThreshold = myDataColorRainbowThreshold->getValue();
669 }
670
671 tmpSettings.showLane2Lane = (myShowLane2Lane->getCheck() != FALSE);
672 tmpSettings.drawJunctionShape = (myDrawJunctionShape->getCheck() != FALSE);
673 tmpSettings.drawCrossingsAndWalkingareas = (myDrawCrossingsAndWalkingAreas->getCheck() != FALSE);
674 tmpSettings.dither = (myDither->getCheck() != FALSE);
675 tmpSettings.fps = (myFPS->getCheck() != FALSE);
676 tmpSettings.drawBoundaries = (myDrawBoundaries->getCheck() != FALSE);
677 tmpSettings.forceDrawForPositionSelection = (myForceDrawForPositionSelection->getCheck() != FALSE);
678 tmpSettings.forceDrawForRectangleSelection = (myForceDrawForRectangleSelection->getCheck() != FALSE);
680 tmpSettings.showSizeLegend = (myShowSizeLegend->getCheck() != FALSE);
681 tmpSettings.showColorLegend = (myShowColorLegend->getCheck() != FALSE);
682 tmpSettings.showVehicleColorLegend = (myShowVehicleColorLegend->getCheck() != FALSE);
683 tmpSettings.show3DTLSDomes = (myShow3DTLSDomes->getCheck() != FALSE);
684 tmpSettings.show3DTLSLinkMarkers = (myShow3DTLSLinkMarkers->getCheck() != FALSE);
685 tmpSettings.generate3DTLSModels = (myGenerate3DTLSModels->getCheck() != FALSE);
686 const unsigned char lightFactor = (unsigned char)myLight3DFactor->getValue();
687 tmpSettings.ambient3DLight.set(lightFactor / 2, lightFactor / 2, lightFactor / 2, 255);
688 tmpSettings.diffuse3DLight.set(lightFactor, lightFactor, lightFactor, 255);
689 tmpSettings.skyColor = MFXUtils::getRGBColor(mySkyColor->getRGBA());
690
691 // lanes (colors)
692 if (sender == myLaneColorRainbow) {
693 myParent->buildColorRainbow(tmpSettings, tmpSettings.getLaneEdgeScheme(), tmpSettings.getLaneEdgeMode(), GLO_LANE,
694 myLaneColorRainbowCheck->getCheck() != FALSE, myLaneColorRainbowThreshold->getValue(),
695 myLaneColorRainbowCheck2->getCheck() != FALSE, myLaneColorRainbowThreshold2->getValue());
696 doRebuildColorMatrices = true;
697 } else if (sender == myJunctionColorRainbow) {
698 myParent->buildColorRainbow(tmpSettings, tmpSettings.junctionColorer.getScheme(), tmpSettings.junctionColorer.getActive(), GLO_JUNCTION);
699 doRebuildColorMatrices = true;
700 } else if (sender == myDataColorRainbow) {
701 myParent->buildColorRainbow(tmpSettings, tmpSettings.dataColorer.getScheme(), tmpSettings.dataColorer.getActive(), GLO_TAZRELDATA,
702 myDataColorRainbowCheck->getCheck() != FALSE, myDataColorRainbowThreshold->getValue());
703 doRebuildColorMatrices = true;
704 }
705 if (tmpSettings.getLaneEdgeMode() == prevLaneMode) {
706 if (updateColorRanges(sender, myLaneColors.begin(), myLaneColors.end(),
707 myLaneThresholds.begin(), myLaneThresholds.end(), myLaneButtons.begin(),
708 tmpSettings.getLaneEdgeScheme())) {
709 doRebuildColorMatrices = true;
710 }
711 if (sender == myLaneColorInterpolation) {
712 tmpSettings.getLaneEdgeScheme().setInterpolated(myLaneColorInterpolation->getCheck() != FALSE);
713 doRebuildColorMatrices = true;
714 }
715 } else {
716 doRebuildColorMatrices = true;
717 }
718 // lanes (scaling)
719 if (tmpSettings.getLaneEdgeScaleMode() == prevLaneScaleMode) {
720 if (updateScaleRanges(sender, myLaneScales.begin(), myLaneScales.end(),
722 tmpSettings.getLaneEdgeScaleScheme())) {
723 doRebuildColorMatrices = true;
724 }
725 if (sender == myLaneScaleInterpolation) {
726 tmpSettings.getLaneEdgeScaleScheme().setInterpolated(myLaneScaleInterpolation->getCheck() != FALSE);
727 doRebuildColorMatrices = true;
728 }
729 } else {
730 doRebuildColorMatrices = true;
731 }
732 // vehicles
733 if (tmpSettings.vehicleColorer.getActive() == prevVehicleMode) {
734 if (updateColorRanges(sender, myVehicleColors.begin(), myVehicleColors.end(),
736 tmpSettings.vehicleColorer.getScheme())) {
737 doRebuildColorMatrices = true;
738 }
739 if (sender == myVehicleColorInterpolation) {
740 tmpSettings.vehicleColorer.getScheme().setInterpolated(myVehicleColorInterpolation->getCheck() != FALSE);
741 doRebuildColorMatrices = true;
742 }
743 } else {
744 doRebuildColorMatrices = true;
745 }
746 // vehicles (scaling)
747 if (tmpSettings.vehicleScaler.getActive() == prevVehicleScaleMode) {
748 if (updateScaleRanges(sender, myVehicleScales.begin(), myVehicleScales.end(),
750 tmpSettings.vehicleScaler.getScheme())) {
751 doRebuildColorMatrices = true;
752 }
753 if (sender == myVehicleScaleInterpolation) {
754 tmpSettings.vehicleScaler.getScheme().setInterpolated(myVehicleScaleInterpolation->getCheck() != FALSE);
755 doRebuildColorMatrices = true;
756 }
757 } else {
758 doRebuildColorMatrices = true;
759 }
760 // persons
761 if (tmpSettings.personColorer.getActive() == prevPersonMode) {
762 if (updateColorRanges(sender, myPersonColors.begin(), myPersonColors.end(),
764 tmpSettings.personColorer.getScheme())) {
765 doRebuildColorMatrices = true;
766 }
767 if (sender == myPersonColorInterpolation) {
768 tmpSettings.personColorer.getScheme().setInterpolated(myPersonColorInterpolation->getCheck() != FALSE);
769 doRebuildColorMatrices = true;
770 }
771 } else {
772 doRebuildColorMatrices = true;
773 }
774 // containers
775 if (tmpSettings.containerColorer.getActive() == prevContainerMode) {
776 if (updateColorRanges(sender, myContainerColors.begin(), myContainerColors.end(),
778 tmpSettings.containerColorer.getScheme())) {
779 doRebuildColorMatrices = true;
780 }
781 if (sender == myContainerColorInterpolation) {
783 doRebuildColorMatrices = true;
784 }
785 } else {
786 doRebuildColorMatrices = true;
787 }
788 // junctions
789 if (tmpSettings.junctionColorer.getActive() == prevJunctionMode) {
790 if (updateColorRanges(sender, myJunctionColors.begin(), myJunctionColors.end(),
792 tmpSettings.junctionColorer.getScheme())) {
793 doRebuildColorMatrices = true;
794 }
795 if (sender == myJunctionColorInterpolation) {
796 tmpSettings.junctionColorer.getScheme().setInterpolated(myJunctionColorInterpolation->getCheck() != FALSE);
797 doRebuildColorMatrices = true;
798 }
799 } else {
800 doRebuildColorMatrices = true;
801 }
802 // POIs
803 if (tmpSettings.poiColorer.getActive() == prevPOIMode) {
804 if (updateColorRanges(sender, myPOIColors.begin(), myPOIColors.end(),
805 myPOIThresholds.begin(), myPOIThresholds.end(), myPOIButtons.begin(),
806 tmpSettings.poiColorer.getScheme())) {
807 doRebuildColorMatrices = true;
808 }
809 if (sender == myPOIColorInterpolation) {
810 tmpSettings.poiColorer.getScheme().setInterpolated(myPOIColorInterpolation->getCheck() != FALSE);
811 doRebuildColorMatrices = true;
812 }
813 } else {
814 doRebuildColorMatrices = true;
815 }
816 // polygons
817 if (tmpSettings.polyColorer.getActive() == prevPolyMode) {
818 if (updateColorRanges(sender, myPolyColors.begin(), myPolyColors.end(),
819 myPolyThresholds.begin(), myPolyThresholds.end(), myPolyButtons.begin(),
820 tmpSettings.polyColorer.getScheme())) {
821 doRebuildColorMatrices = true;
822 }
823 if (sender == myPolyColorInterpolation) {
824 tmpSettings.polyColorer.getScheme().setInterpolated(myPolyColorInterpolation->getCheck() != FALSE);
825 doRebuildColorMatrices = true;
826 }
827 } else {
828 doRebuildColorMatrices = true;
829 }
830 // data
831 if (tmpSettings.netedit) {
832 if (tmpSettings.dataColorer.getActive() == prevDataMode) {
833 if (updateColorRanges(sender, myDataColors.begin(), myDataColors.end(),
834 myDataThresholds.begin(), myDataThresholds.end(), myDataButtons.begin(),
835 tmpSettings.dataColorer.getScheme())) {
836 doRebuildColorMatrices = true;
837 }
838 if (sender == myDataColorInterpolation) {
839 tmpSettings.dataColorer.getScheme().setInterpolated(myDataColorInterpolation->getCheck() != FALSE);
840 doRebuildColorMatrices = true;
841 }
842 } else {
843 doRebuildColorMatrices = true;
844 }
845 }
846 // openGL
847 if (sender == myRecalculateBoundaries) {
849 }
850
851 if (tmpSettings == *mySettings) {
852 return 1;
853 }
854
855 int index = mySchemeName->getCurrentItem();
856 if (index < (int) gSchemeStorage.getNumInitialSettings()) {
857 // one of the initial settings is modified
858 // every time this happens we create a new scheme
859 int suffix = 1;
860 while (gSchemeStorage.contains("custom_" + toString(suffix))) {
861 suffix++;
862 }
863 tmpSettings.name = "custom_" + toString(suffix);
864 // the newly created settings must be entered in several places:
865 // - the comboBox mySchemeName of this dialog
866 // - the comboBox of the parent view (set as active)
867 // - the comboBox of all other views (only append) XXX @todo
868 index = mySchemeName->appendItem(tmpSettings.name.c_str());
869 mySchemeName->setCurrentItem(index);
870 myParent->getColoringSchemesCombo()->appendItem(tmpSettings.name.c_str());
871 }
872 myParent->getColoringSchemesCombo()->setCurrentItem(
873 myParent->getColoringSchemesCombo()->findItem(tmpSettings.name.c_str()));
874 gSchemeStorage.add(tmpSettings); // overwrites existing
875 mySettings = &gSchemeStorage.get(tmpSettings.name);
876 myParent->setColorScheme(tmpSettings.name);
877
878 if (doRebuildColorMatrices) {
880 }
881 myParent->handle(this, FXSEL(SEL_CHANGED, MID_SIMPLE_VIEW_COLORCHANGE), nullptr);
882 myParent->forceRefresh();
883 getApp()->forceRefresh();
884 return 1;
885}
886
887void
888GUIDialog_ViewSettings::loadSettings(const std::string& file) {
889 GUISettingsHandler handler(file, true, mySettings->netedit);
890 for (std::string settingsName : handler.addSettings(myParent)) {
891 FXint index = mySchemeName->appendItem(settingsName.c_str());
892 mySchemeName->setCurrentItem(index);
893 mySettings = &gSchemeStorage.get(settingsName);
894 }
895 if (handler.hasDecals()) {
896 myDecalsLock->lock();
897 (*myDecals) = handler.getDecals();
899 myParent->update();
900 myDecalsLock->unlock();
901 }
902 if (handler.getDelay() >= 0) {
903 myParent->setDelay(handler.getDelay());
904 }
905 if (handler.getBreakpoints().size() > 0) {
907 }
908 handler.applyViewport(myParent);
910}
911
912
913void
915 std::vector<GUISUMOAbstractView::Decal>::iterator j;
916 for (j = myDecals->begin(); j != myDecals->end(); ++j) {
918 bool isLight = d.filename.substr(0, 5) == "light" && d.filename.length() == 6 && isdigit(d.filename[5]);
919 if (isLight) {
921 dev.writeAttr(SUMO_ATTR_INDEX, d.filename.substr(5, 1));
922 } else {
924 dev.writeAttr("file", d.filename);
925 dev.writeAttr("screenRelative", d.screenRelative);
926 }
932 dev.writeAttr("altitude", d.altitude);
933 dev.writeAttr("rotation", d.rot);
934 dev.writeAttr("tilt", d.tilt);
935 dev.writeAttr("roll", d.roll);
937 dev.closeTag();
938 }
939}
940
941
942void
943GUIDialog_ViewSettings::loadDecals(const std::string& file) {
944 myDecalsLock->lock();
945 GUISettingsHandler handler(file);
946 if (handler.hasDecals()) {
947 (*myDecals) = handler.getDecals();
948 }
950 myParent->update();
951 myDecalsLock->unlock();
952}
953
954
955long
956GUIDialog_ViewSettings::onCmdSaveSetting(FXObject*, FXSelector, void* /*data*/) {
957 int index = mySchemeName->getCurrentItem();
958 if (index < (int) gSchemeStorage.getNumInitialSettings()) {
959 return 1;
960 }
961 // get the name
962 std::string name = "";
963 while (name.length() == 0) {
964 FXDialogBox dialog(this, "Enter a name", GUIDesignViewSettingsDialog);
965 FXVerticalFrame* content = new FXVerticalFrame(&dialog, GUIDesignViewSettingsVerticalFrame5);
966 new FXLabel(content, "Please enter an alphanumeric name: ", nullptr, GUIDesignViewSettingsLabel2);
967 FXTextField* text = new FXTextField(content, 40, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsTextField1);
968 new FXHorizontalSeparator(content, GUIDesignHorizontalSeparator);
969 FXHorizontalFrame* buttons = new FXHorizontalFrame(content, GUIDesignViewSettingsHorizontalFrame3);
970 new FXButton(buttons, TL("&OK"), nullptr, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsButton4);
971 new FXButton(buttons, TL("&Cancel"), nullptr, &dialog, FXDialogBox::ID_CANCEL, GUIDesignViewSettingsButton5);
972 dialog.create();
973 text->setFocus();
974 if (!dialog.execute()) {
975 return 1;
976 }
977 name = text->getText().text();
978 for (int i = 0; i < (int)name.length(); ++i) {
979 if (name[i] != '_' && (name[i] < 'a' || name[i] > 'z') && (name[i] < 'A' || name[i] > 'Z') && (name[i] < '0' || name[i] > '9')) {
980 name = "";
981 break;
982 }
983 }
984 }
986 tmpSettings.copy(*mySettings);
987 tmpSettings.name = name;
988 if (name == mySettings->name || StringUtils::startsWith(mySettings->name, "custom_")) {
990 myParent->getColoringSchemesCombo()->setItemText(index, name.c_str());
991 } else {
993 index = mySchemeName->appendItem(name.c_str());
994 myParent->getColoringSchemesCombo()->appendItem(name.c_str());
995 myParent->getColoringSchemesCombo()->setCurrentItem(
996 myParent->getColoringSchemesCombo()->findItem(name.c_str()));
997 }
998 gSchemeStorage.add(tmpSettings);
999 mySchemeName->setItemText(index, name.c_str());
1000 myParent->setColorScheme(name);
1001 mySettings = &gSchemeStorage.get(name);
1003 gSchemeStorage.writeSettings(getApp());
1004 return 1;
1005}
1006
1007
1008long
1009GUIDialog_ViewSettings::onUpdSaveSetting(FXObject* sender, FXSelector, void* ptr) {
1010 sender->handle(this,
1011 mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1012 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1013 ptr);
1014 return 1;
1015}
1016
1017
1018long
1019GUIDialog_ViewSettings::onCmdDeleteSetting(FXObject*, FXSelector, void* /*data*/) {
1020 int index = mySchemeName->getCurrentItem();
1021 if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1022 return 1;
1023 }
1024 std::string name = mySchemeName->getItem(index).text();
1025 gSchemeStorage.remove(name);
1026 mySchemeName->removeItem(index);
1027 onCmdNameChange(nullptr, 0, (void*) mySchemeName->getItem(0).text());
1028 gSchemeStorage.writeSettings(getApp());
1029 return 1;
1030}
1031
1032
1033long
1034GUIDialog_ViewSettings::onUpdDeleteSetting(FXObject* sender, FXSelector, void* ptr) {
1035 sender->handle(this,
1036 mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1037 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1038 ptr);
1039 return 1;
1040}
1041
1042
1043long
1044GUIDialog_ViewSettings::onCmdExportSetting(FXObject*, FXSelector, void* /*data*/) {
1045 FXString file = MFXUtils::getFilename2Write(this, TL("Export view settings"), ".xml", GUIIconSubSys::getIcon(GUIIcon::SAVE), gCurrentFolder);
1046 if (file == "") {
1047 return 1;
1048 }
1049 try {
1050 OutputDevice& dev = OutputDevice::getDevice(file.text(), false);
1052 if (myParent->is3DView()) {
1053 dev.writeAttr(SUMO_ATTR_TYPE, "osg");
1054 }
1055 mySettings->save(dev);
1056 if (mySaveViewPort->getCheck()) {
1058 }
1059 if (mySaveDelay->getCheck()) {
1062 dev.closeTag();
1063 }
1064 if (mySaveDecals->getCheck()) {
1065 saveDecals(dev);
1066 }
1067 if (!mySettings->netedit && mySaveBreakpoints->getCheck()) {
1071 dev.closeTag();
1072 }
1073 }
1074 dev.closeTag();
1075 dev.close();
1076 } catch (IOError& e) {
1077 FXMessageBox::error(this, MBOX_OK, TL("Storing failed!"), "%s", e.what());
1078 }
1079 return 1;
1080}
1081
1082
1083long
1084GUIDialog_ViewSettings::onUpdExportSetting(FXObject* sender, FXSelector, void* ptr) {
1085 sender->handle(this,
1086 (mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1087 && !mySaveViewPort->getCheck() && !mySaveDelay->getCheck() && !mySaveDecals->getCheck() && !mySaveBreakpoints->getCheck()) ?
1088 FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1089 ptr);
1090 return 1;
1091}
1092
1093
1094long
1095GUIDialog_ViewSettings::onCmdImportSetting(FXObject*, FXSelector, void* /*data*/) {
1096 FXFileDialog opendialog(this, TL("Import view settings"));
1097 opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG));
1098 opendialog.setSelectMode(SELECTFILE_ANY);
1099 opendialog.setPatternList("*.xml,*.xml.gz");
1100 if (gCurrentFolder.length() != 0) {
1101 opendialog.setDirectory(gCurrentFolder);
1102 }
1103 if (opendialog.execute()) {
1104 gCurrentFolder = opendialog.getDirectory();
1105 loadSettings(opendialog.getFilename().text());
1106 }
1107 return 1;
1108}
1109
1110
1111long
1112GUIDialog_ViewSettings::onCmdLoadDecals(FXObject*, FXSelector, void* /*data*/) {
1113 FXFileDialog opendialog(this, TL("Load Decals"));
1114 opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY));
1115 opendialog.setSelectMode(SELECTFILE_ANY);
1116 opendialog.setPatternList("*.xml,*.xml.gz");
1117 if (gCurrentFolder.length() != 0) {
1118 opendialog.setDirectory(gCurrentFolder);
1119 }
1120 if (opendialog.execute()) {
1121 gCurrentFolder = opendialog.getDirectory();
1122 loadDecals(opendialog.getFilename().text());
1123 }
1124 return 1;
1125}
1126
1127
1128long
1129GUIDialog_ViewSettings::onCmdSaveDecals(FXObject*, FXSelector, void* /*data*/) {
1130 FXString file = MFXUtils::getFilename2Write(this, TL("Save Decals"), ".xml", GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder);
1131 if (file == "") {
1132 return 1;
1133 }
1134 try {
1135 OutputDevice& dev = OutputDevice::getDevice(file.text());
1136 dev.openTag("decals");
1137 saveDecals(dev);
1138 dev.closeTag();
1139 dev.close();
1140 } catch (IOError& e) {
1141 FXMessageBox::error(myParent, MBOX_OK, TL("Storing failed!"), "%s", e.what());
1142 }
1143 return 1;
1144}
1145
1146
1147long
1148GUIDialog_ViewSettings::onCmdClearDecals(FXObject*, FXSelector, void* /*data*/) {
1149 // lock decals mutex
1150 myDecalsLock->lock();
1151 // clear decals
1152 myDecals->clear();
1153 // rebuild list
1155 // update view
1156 myParent->update();
1157 // unlock decals mutex
1158 myDecalsLock->unlock();
1159 return 1;
1160}
1161
1162
1163long
1164GUIDialog_ViewSettings::onUpdImportSetting(FXObject* sender, FXSelector, void* ptr) {
1165 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1166 return 1;
1167}
1168
1169
1170void
1172 myDecalsTable->clearItems();
1173 const int cols = 8;
1174 // set table attributes
1175 const int numRows = MAX2((int)10, (int)myDecals->size() + 1);
1176 myDecalsTable->setTableSize(numRows, cols);
1177 myDecalsTable->setColumnText(0, "file");
1178 myDecalsTable->setColumnText(1, "centerX");
1179 myDecalsTable->setColumnText(2, "centerY");
1180 myDecalsTable->setColumnText(3, "width");
1181 myDecalsTable->setColumnText(4, "height");
1182 myDecalsTable->setColumnText(5, "rotation");
1183 myDecalsTable->setColumnText(6, "layer");
1184 myDecalsTable->setColumnText(7, "relative");
1185 FXHeader* header = myDecalsTable->getColumnHeader();
1186 header->setHeight(getApp()->getNormalFont()->getFontHeight() + getApp()->getNormalFont()->getFontAscent());
1187 int k;
1188 for (k = 0; k < cols; k++) {
1189 header->setItemJustify(k, GUIDesignViewSettingsMFXTableJustify);
1190 header->setItemSize(k, 60);
1191 }
1192 header->setItemSize(0, 150);
1193 // insert already known decals information into table
1194 FXint row = 0;
1195 for (const GUISUMOAbstractView::Decal& d : *myDecals) {
1196 myDecalsTable->setItemText(row, 0, d.filename.c_str());
1197 myDecalsTable->setItemText(row, 1, toString<double>(d.centerX).c_str());
1198 myDecalsTable->setItemText(row, 2, toString<double>(d.centerY).c_str());
1199 myDecalsTable->setItemText(row, 3, toString<double>(d.width).c_str());
1200 myDecalsTable->setItemText(row, 4, toString<double>(d.height).c_str());
1201 myDecalsTable->setItemText(row, 5, toString<double>(d.rot).c_str());
1202 myDecalsTable->setItemText(row, 6, toString<double>(d.layer).c_str());
1203 myDecalsTable->setItemText(row, 7, toString<double>(d.screenRelative).c_str());
1204 row++;
1205 }
1206 // insert dummy last field
1207 for (k = 0; k < 7; k++) {
1208 myDecalsTable->setItemText(row, k, " ");
1209 }
1210}
1211
1212
1213FXMatrix*
1215 std::vector<FXColorWell*>& colors,
1216 std::vector<FXRealSpinner*>& thresholds,
1217 std::vector<FXButton*>& buttons,
1218 FXCheckButton* interpolation,
1219 GUIColorScheme& scheme) {
1221 FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1222 colors.clear();
1223 thresholds.clear();
1224 buttons.clear();
1225 const bool fixed = scheme.isFixed();
1226 std::vector<RGBColor>::const_iterator colIt = scheme.getColors().begin();
1227 std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1228 std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1229 while (colIt != scheme.getColors().end()) {
1230 colors.push_back(new FXColorWell(m, MFXUtils::getFXColor(*colIt), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell1));
1231 if (fixed) {
1232 new FXLabel(m, nameIt->c_str());
1233 new FXLabel(m, "");
1234 new FXLabel(m, "");
1235 } else {
1236 const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1237 FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX | dialerOptions);
1238 threshDialer->setValue(*threshIt);
1239 thresholds.push_back(threshDialer);
1240 if (*threshIt == GUIVisualizationSettings::MISSING_DATA) {
1241 threshDialer->disable();
1242 threshDialer->hide();
1243 buttons.push_back(new FXButton(m, "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1244 buttons.back()->hide();
1245 buttons.push_back(new FXButton(m, TL("No Data"), nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1246 buttons.back()->disable();
1247 } else {
1248 buttons.push_back(new FXButton(m, TL("Add"), nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1249 buttons.push_back(new FXButton(m, TL("Remove"), nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1250 }
1251 }
1252 colIt++;
1253 threshIt++;
1254 nameIt++;
1255 }
1256 interpolation->setCheck(scheme.isInterpolated());
1257 if (fixed) {
1258 interpolation->disable();
1259 } else {
1260 if (colors.size() > 1) {
1261 interpolation->enable();
1262 if (interpolation->getCheck() != FALSE) {
1263 thresholds.front()->enable();
1264 } else {
1265 thresholds.front()->disable();
1266 }
1267 } else {
1268 interpolation->disable();
1269 thresholds.front()->disable();
1270 }
1271 }
1272 return m;
1273}
1274
1275
1276FXMatrix*
1278 std::vector<FXRealSpinner*>& scales,
1279 std::vector<FXRealSpinner*>& thresholds,
1280 std::vector<FXButton*>& buttons,
1281 FXCheckButton* interpolation,
1282 GUIScaleScheme& scheme) {
1284 FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1285 scales.clear();
1286 thresholds.clear();
1287 buttons.clear();
1288 const bool fixed = scheme.isFixed();
1289 std::vector<double>::const_iterator scaleIt = scheme.getColors().begin();
1290 std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1291 std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1292 while (scaleIt != scheme.getColors().end()) {
1293 FXRealSpinner* scaleDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX);
1294 scaleDialer->setValue(*scaleIt);
1295 scales.push_back(scaleDialer);
1296 if (fixed) {
1297 new FXLabel(m, nameIt->c_str());
1298 new FXLabel(m, "");
1299 new FXLabel(m, "");
1300 } else {
1301 const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1302 FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX | dialerOptions);
1303 threshDialer->setValue(*threshIt);
1304 thresholds.push_back(threshDialer);
1305 buttons.push_back(new FXButton(m, TL("Add"), nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1306 buttons.push_back(new FXButton(m, TL("Remove"), nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1307 }
1308 scaleIt++;
1309 threshIt++;
1310 nameIt++;
1311 }
1312 interpolation->setCheck(scheme.isInterpolated());
1313 if (fixed) {
1314 interpolation->disable();
1315 } else {
1316 if (scales.size() > 1) {
1317 interpolation->enable();
1318 if (interpolation->getCheck() != FALSE) {
1319 thresholds.front()->enable();
1320 } else {
1321 thresholds.front()->disable();
1322 }
1323 } else {
1324 interpolation->disable();
1325 thresholds.front()->disable();
1326 }
1327 }
1328 return m;
1329}
1330
1331
1332void
1334 // decals
1335 delete myDecalsTable;
1337 myDecalsTable->setVisibleRows(5);
1338 myDecalsTable->setVisibleColumns(7);
1339 myDecalsTable->setTableSize(5, 7);
1340 myDecalsTable->setBackColor(FXRGB(255, 255, 255));
1341 myDecalsTable->getRowHeader()->setWidth(0);
1342 for (int i = 1; i <= 5; ++i) {
1344 myDecalsTable->setNumberCellParams(i, -10000000, 10000000, 1, 10, 100, "%.2f");
1345 }
1347 if (doCreate) {
1348 myDecalsTable->create();
1349 }
1351 if (doCreate) {
1352 m->create();
1353 }
1355 myLaneColorRainbow->disable();
1356 } else {
1357 myLaneColorRainbow->enable();
1358 }
1360 myJunctionColorRainbow->disable();
1361 } else {
1362 myJunctionColorRainbow->enable();
1363 }
1364 std::string activeSchemeName = myLaneEdgeColorMode->getText().text();
1365 myParamKey->clearItems();
1366 myMeanDataID->clearItems();
1367 myMeanDataID->hide();
1369 myParamKey->appendItem(mySettings->edgeParam.c_str());
1370 for (const std::string& attr : myParent->getEdgeLaneParamKeys(true)) {
1371 if (attr != mySettings->edgeParam) {
1372 myParamKey->appendItem(attr.c_str());
1373 }
1374 }
1375 myParamKey->enable();
1376 } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_LANE_PARAM_NUMERICAL) {
1377 myParamKey->appendItem(mySettings->laneParam.c_str());
1378 for (const std::string& attr : myParent->getEdgeLaneParamKeys(false)) {
1379 if (attr != mySettings->laneParam) {
1380 myParamKey->appendItem(attr.c_str());
1381 }
1382 }
1383 myParamKey->enable();
1384 } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {
1385 myParamKey->appendItem(mySettings->edgeData.c_str());
1386 for (const std::string& attr : myParent->getEdgeDataAttrs()) {
1387 if (attr != mySettings->edgeData) {
1388 myParamKey->appendItem(attr.c_str());
1389 }
1390 }
1391 myParamKey->enable();
1392 myParamKey->setEditable(false);
1393 } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_LIVE) {
1394 if (mySettings->edgeDataID != "") {
1395 myMeanDataID->appendItem(mySettings->edgeDataID.c_str());
1396 }
1397 for (const std::string& attr : myParent->getMeanDataIDs()) {
1398 if (attr != mySettings->edgeDataID) {
1399 myMeanDataID->appendItem(attr.c_str());
1400 }
1401 }
1402 if (myMeanDataID->getNumItems() > 0) {
1403 if (mySettings->edgeDataID == "") {
1404 mySettings->edgeDataID = myMeanDataID->getItemText(0).text();
1405 }
1406 myMeanDataID->enable();
1407 myMeanDataID->setEditable(false);
1408 myMeanDataID->show();
1409 myMeanDataID->setNumVisible(myMeanDataID->getNumItems());
1410 myParamKey->appendItem(mySettings->edgeData.c_str());
1411 for (const std::string& attr : myParent->getMeanDataAttrs(mySettings->edgeDataID)) {
1412 if (attr != mySettings->edgeData) {
1413 myParamKey->appendItem(attr.c_str());
1414 }
1415 }
1416 myParamKey->enable();
1417 myParamKey->setEditable(false);
1418 }
1419 } else {
1420 myParamKey->disable();
1421 }
1422 myParamKey->setNumVisible(myParamKey->getNumItems());
1423 myLaneColorSettingFrame->getParent()->recalc();
1424
1426 if (doCreate) {
1427 m->create();
1428 }
1429 myLaneScaleSettingFrame->getParent()->recalc();
1430
1432 if (doCreate) {
1433 m->create();
1434 }
1435 activeSchemeName = myVehicleColorMode->getText().text();
1436 myVehicleParamKey->setEditable(true);
1439 myVehicleParamKey->enable();
1440 } else {
1441 myVehicleParamKey->disable();
1442 }
1443 myVehicleColorSettingFrame->getParent()->recalc();
1444
1446 if (doCreate) {
1447 m->create();
1448 }
1449 myVehicleScaleSettingFrame->getParent()->recalc();
1450
1452 if (doCreate) {
1453 m->create();
1454 }
1455 myPersonColorSettingFrame->getParent()->recalc();
1457 if (doCreate) {
1458 m->create();
1459 }
1460 myContainerColorSettingFrame->getParent()->recalc();
1462 if (doCreate) {
1463 m->create();
1464 }
1465 myJunctionColorSettingFrame->getParent()->recalc();
1466 // POIs
1468 if (doCreate) {
1469 m->create();
1470 }
1471 myPOIColorSettingFrame->getParent()->recalc();
1472 // polygons
1474 if (doCreate) {
1475 m->create();
1476 }
1477 myPolyColorSettingFrame->getParent()->recalc();
1478
1479 // data
1480 if (mySettings->netedit) {
1482 if (doCreate) {
1483 m->create();
1484 }
1485 activeSchemeName = myDataColorMode->getText().text();
1486 myDataParamKey->setEditable(true);
1488 myDataParamKey->clearItems();
1489 myDataParamKey->appendItem(mySettings->relDataAttr.c_str());
1490 for (const std::string& attr : myParent->getRelDataAttrs()) {
1491 if (attr != mySettings->relDataAttr) {
1492 myDataParamKey->appendItem(attr.c_str());
1493 }
1494 }
1495 myDataParamKey->enable();
1496 } else {
1497 myDataParamKey->disable();
1498 }
1499 myDataColorSettingFrame->getParent()->recalc();
1500 }
1501
1502 layout();
1503 update();
1504}
1505
1506
1507void
1509 myVehicleParamKey->clearItems();
1510 myVehicleTextParamKey->clearItems();
1511 myVehicleParamKey->appendItem(mySettings->vehicleParam.c_str());
1513 for (const std::string& attr : myParent->getVehicleParamKeys(false)) {
1514 myVehicleParamKey->appendItem(attr.c_str());
1515 myVehicleTextParamKey->appendItem(attr.c_str());
1516 }
1517 myVehicleParamKey->setNumVisible(myVehicleParamKey->getNumItems());
1518 myVehicleTextParamKey->setNumVisible(myVehicleTextParamKey->getNumItems());
1519}
1520
1521void
1523 myPOITextParamKey->clearItems();
1524 myPOITextParamKey->appendItem(mySettings->poiTextParam.c_str());
1525 for (const std::string& attr : myParent->getPOIParamKeys()) {
1526 myPOITextParamKey->appendItem(attr.c_str());
1527 }
1528 myPOITextParamKey->setNumVisible(myPOITextParamKey->getNumItems());
1529}
1530
1531long
1532GUIDialog_ViewSettings::onCmdEditTable(FXObject*, FXSelector, void* ptr) {
1534 std::string value = i->item->getText().text();
1535 // check whether the inserted value is empty
1536 if (value.find_first_not_of(" ") == std::string::npos) {
1537 return 1;
1538 }
1540 int row = i->row;
1541 // check whether we add a new entry or edit an existing entry
1542 if (row == static_cast<int>(myDecals->size())) {
1543 d.filename = "";
1544 d.centerX = double(myParent->getGridWidth() / 2.);
1545 d.centerY = double(myParent->getGridHeight() / 2.);
1546 d.width = 0.;
1547 d.height = 0.;
1548 d.initialised = false;
1549 d.rot = 0;
1550 d.layer = 0;
1551 d.screenRelative = false;
1552 myDecalsLock->lock();
1553 myDecals->push_back(d);
1554 myDecalsLock->unlock();
1555 } else if (row > static_cast<int>(myDecals->size())) {
1556 // ignore clicks two lines below existing entries
1557 return 1;
1558 } else {
1559 d = (*myDecals)[row];
1560 }
1561
1562 switch (i->col) {
1563 case 0:
1564 if (d.initialised && d.filename != value) {
1565 d.initialised = false;
1566 }
1568 break;
1569 case 1:
1570 try {
1571 d.centerX = StringUtils::toDouble(value);
1572 } catch (NumberFormatException&) {
1573 std::string msg = "The value must be a float, is:" + value;
1574 FXMessageBox::error(this, MBOX_OK, TL("Number format error"), "%s", msg.c_str());
1575 }
1576 break;
1577 case 2:
1578 try {
1579 d.centerY = StringUtils::toDouble(value);
1580 } catch (NumberFormatException&) {
1581 std::string msg = "The value must be a float, is:" + value;
1582 FXMessageBox::error(this, MBOX_OK, TL("Number format error"), "%s", msg.c_str());
1583 }
1584 break;
1585 case 3:
1586 try {
1587 d.width = StringUtils::toDouble(value);
1588 } catch (NumberFormatException&) {
1589 std::string msg = "The value must be a float, is:" + value;
1590 FXMessageBox::error(this, MBOX_OK, TL("Number format error"), "%s", msg.c_str());
1591 }
1592 break;
1593 case 4:
1594 try {
1595 d.height = StringUtils::toDouble(value);
1596 } catch (NumberFormatException&) {
1597 std::string msg = "The value must be a float, is:" + value;
1598 FXMessageBox::error(this, MBOX_OK, TL("Number format error"), "%s", msg.c_str());
1599 }
1600 break;
1601 case 5:
1602 try {
1603 d.rot = StringUtils::toDouble(value);
1604 } catch (NumberFormatException&) {
1605 std::string msg = "The value must be a float, is:" + value;
1606 FXMessageBox::error(this, MBOX_OK, TL("Number format error"), "%s", msg.c_str());
1607 }
1608 break;
1609 case 6:
1610 try {
1611 d.layer = StringUtils::toDouble(value);
1612 } catch (NumberFormatException&) {
1613 std::string msg = "The value must be a float, is:" + value;
1614 FXMessageBox::error(this, MBOX_OK, TL("Number format error"), "%s", msg.c_str());
1615 }
1616 break;
1617 case 7:
1618 try {
1620 } catch (NumberFormatException&) {
1621 std::string msg = "The value must be a bool, is:" + value;
1622 FXMessageBox::error(this, MBOX_OK, TL("Number format error"), "%s", msg.c_str());
1623 }
1624 break;
1625 default:
1626 throw 1;
1627 }
1628 (*myDecals)[row] = d;
1629 if (!i->updateOnly) {
1631 }
1632 myParent->update();
1633 return 1;
1634}
1635
1636
1637std::string
1639 return mySchemeName->getItem(mySchemeName->getCurrentItem()).text();
1640}
1641
1642
1643void
1645 if (name.c_str() == mySchemeName->getItemText(mySchemeName->getCurrentItem())) {
1646 return;
1647 }
1648 for (int i = 0; i < mySchemeName->getNumItems(); ++i) {
1649 if (name.c_str() == mySchemeName->getItemText(i)) {
1650 mySchemeName->setCurrentItem(i);
1651 onCmdNameChange(nullptr, 0, (void*)name.c_str());
1652 return;
1653 }
1654 }
1655}
1656
1658 FXMatrix* parent,
1659 GUIDialog_ViewSettings* target,
1660 const std::string& title,
1661 const GUIVisualizationTextSettings& settings) {
1662 myCheck = new FXCheckButton(parent, title.c_str(), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1663 myCheck->setCheck(settings.showText);
1664 myMatrix0 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1665 mySelectedCheck = new FXCheckButton(myMatrix0, "Only for selected", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1666 mySelectedCheck->setCheck(settings.onlySelected);
1667 myConstSizeCheck = new FXCheckButton(myMatrix0, "constant text size", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1668 myConstSizeCheck->setCheck(settings.constSize);
1669 FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1670 new FXLabel(m1, "Size", nullptr, GUIDesignViewSettingsLabel1);
1671 mySizeDial = new FXRealSpinner(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1672 mySizeDial->setRange(5, 1000);
1673 mySizeDial->setValue(settings.size);
1674 FXMatrix* m2 = new FXMatrix(parent, 4, GUIDesignViewSettingsMatrix5);
1675 new FXLabel(m2, "Color", nullptr, GUIDesignViewSettingsLabel1);
1677 new FXLabel(m2, "Background", nullptr, GUIDesignViewSettingsLabel1);
1679}
1680
1681
1684 return GUIVisualizationTextSettings(myCheck->getCheck() != FALSE,
1685 mySizeDial->getValue(),
1686 MFXUtils::getRGBColor(myColorWell->getRGBA()),
1687 MFXUtils::getRGBColor(myBGColorWell->getRGBA()),
1688 myConstSizeCheck->getCheck() != FALSE,
1689 mySelectedCheck->getCheck() != FALSE);
1690}
1691
1692
1693void
1695 myCheck->setCheck(settings.showText);
1696 mySizeDial->setValue(settings.size);
1697 myColorWell->setRGBA(MFXUtils::getFXColor(settings.color));
1698 myBGColorWell->setRGBA(MFXUtils::getFXColor(settings.bgColor));
1699 myConstSizeCheck->setCheck(settings.constSize);
1700 mySelectedCheck->setCheck(settings.onlySelected);
1701}
1702
1703
1705 const GUIVisualizationSizeSettings& settings, GUIGlObjectType type):
1706 myDialogViewSettings(target),
1707 myType(type) {
1708 myCheck = new FXCheckButton(parent, TL("Draw with constant size when zoomed out"), this, MID_SIMPLE_VIEW_SIZECHANGE, GUIDesignCheckButtonViewSettings);
1709 myCheck->setCheck(settings.constantSize);
1710 myCheckSelected = new FXCheckButton(parent, TL("Only for selected"), this, MID_SIMPLE_VIEW_SIZECHANGE, GUIDesignCheckButtonViewSettings);
1711 myCheckSelected->setCheck(settings.constantSizeSelected);
1712 FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1713 new FXLabel(m1, "Minimum Size", nullptr, GUIDesignViewSettingsLabel1);
1715 myMinSizeDial->setValue(settings.minSize);
1716 FXMatrix* m2 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1717 new FXLabel(m2, "Exaggerate by", nullptr, GUIDesignViewSettingsLabel1);
1719 myExaggerateDial->setRange(0, 10000);
1720 myExaggerateDial->setValue(settings.exaggeration);
1721}
1722
1723
1727 myMinSizeDial->getValue(), myExaggerateDial->getValue(),
1728 myCheck->getCheck() != FALSE,
1729 myCheckSelected->getCheck() != FALSE);
1730}
1731
1732
1733void
1735 myCheck->setCheck(settings.constantSize);
1736 myCheckSelected->setCheck(settings.constantSizeSelected);
1737 myMinSizeDial->setValue(settings.minSize);
1738 myExaggerateDial->setValue(settings.exaggeration);
1739}
1740
1741
1742long
1743GUIDialog_ViewSettings::SizePanel::onCmdSizeChange(FXObject* obj, FXSelector sel, void* ptr) {
1744 // mark boundaries for recomputing
1746 // continue as a normal change
1747 return myDialogViewSettings->onCmdColorChange(obj, sel, ptr);
1748}
1749
1750
1751void
1753 getApp()->reg().writeIntEntry("VIEWSETTINGS", "x", getX());
1754 getApp()->reg().writeIntEntry("VIEWSETTINGS", "y", getY());
1755 getApp()->reg().writeIntEntry("VIEWSETTINGS", "width", getWidth());
1756 getApp()->reg().writeIntEntry("VIEWSETTINGS", "height", getHeight());
1757}
1758
1759void
1761 // ensure window is visible after switching screen resolutions
1762 const FXint minSize = 400;
1763 const FXint minTitlebarHeight = 20;
1764 setX(MAX2(0, MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "x", 150),
1765 getApp()->getRootWindow()->getWidth() - minSize)));
1766 setY(MAX2(minTitlebarHeight,
1767 MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "y", 150),
1768 getApp()->getRootWindow()->getHeight() - minSize)));
1769 setWidth(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "width", 700), minSize));
1770 setHeight(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "height", 500), minSize));
1771}
1772
1773
1774void
1775GUIDialog_ViewSettings::buildHeader(FXVerticalFrame* contentFrame) {
1776 FXHorizontalFrame* horizontalFrame = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame1);
1777 mySchemeName = new FXComboBox(horizontalFrame, 20, this, MID_SIMPLE_VIEW_NAMECHANGE, GUIDesignViewSettingsComboBox1);
1778 for (const auto& name : gSchemeStorage.getNames()) {
1779 const int index = mySchemeName->appendItem(name.c_str());
1780 if (name == mySettings->name) {
1781 mySchemeName->setCurrentItem((FXint)index);
1782 }
1783 }
1784 mySchemeName->setNumVisible(5);
1785
1786 new FXButton(horizontalFrame, "\t\tSave the setting to registry", GUIIconSubSys::getIcon(GUIIcon::SAVEDB), this, MID_SIMPLE_VIEW_SAVE, GUIDesignButtonToolbar);
1787 new FXButton(horizontalFrame, "\t\tRemove the setting from registry", GUIIconSubSys::getIcon(GUIIcon::REMOVEDB), this, MID_SIMPLE_VIEW_DELETE, GUIDesignButtonToolbar);
1788 new FXButton(horizontalFrame, "\t\tExport setting to file", GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_SIMPLE_VIEW_EXPORT, GUIDesignButtonToolbar);
1789 new FXButton(horizontalFrame, "\t\tLoad setting from file", GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG), this, MID_SIMPLE_VIEW_IMPORT, GUIDesignButtonToolbar);
1790
1791 new FXVerticalSeparator(horizontalFrame);
1792 new FXLabel(horizontalFrame, "Export includes:", nullptr, GUIDesignViewSettingsLabel1);
1793 mySaveViewPort = new FXCheckButton(horizontalFrame, TL("Viewport"));
1794 mySaveDelay = new FXCheckButton(horizontalFrame, TL("Delay"));
1795 mySaveDecals = new FXCheckButton(horizontalFrame, TL("Decals"));
1796 mySaveBreakpoints = new FXCheckButton(horizontalFrame, TL("Breakpoints"));
1797 if (mySettings->netedit) {
1798 mySaveBreakpoints->disable();
1799 }
1800}
1801
1802
1803void
1805 // tab for the background
1806 new FXTabItem(tabbook, "Background", nullptr, GUIDesignViewSettingsTabItemBook1);
1807 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
1808 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
1809
1810 FXMatrix* matrixColor = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
1811 new FXLabel(matrixColor, "Color", nullptr, GUIDesignViewSettingsLabel1);
1813
1814 FXVerticalFrame* verticalFrameDecals = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame3);
1815 new FXLabel(verticalFrameDecals, "Decals:");
1816 myDecalsFrame = new FXVerticalFrame(verticalFrameDecals);
1817 FXHorizontalFrame* horizontalFrameButtonsDecals = new FXHorizontalFrame(verticalFrameDecals, GUIDesignViewSettingsHorizontalFrame2);
1818 new FXButton(horizontalFrameButtonsDecals, TL("&Load Decals"), nullptr, this, MID_SIMPLE_VIEW_LOAD_DECALS, GUIDesignViewSettingsButton1);
1819 new FXButton(horizontalFrameButtonsDecals, TL("&Save Decals"), nullptr, this, MID_SIMPLE_VIEW_SAVE_DECALS, GUIDesignViewSettingsButton1);
1820 new FXButton(horizontalFrameButtonsDecals, TL("&Clear Decals"), nullptr, this, MID_SIMPLE_VIEW_CLEAR_DECALS, GUIDesignViewSettingsButton1);
1821
1822 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1823
1824 FXMatrix* matrixGrid = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
1825 myShowGrid = new FXCheckButton(matrixGrid, TL("Toggle grid"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1826 myShowGrid->setCheck(mySettings->showGrid);
1827 new FXLabel(matrixGrid, "");
1828 FXMatrix* matrixGridX = new FXMatrix(matrixGrid, 2, GUIDesignViewSettingsMatrix2);
1829 new FXLabel(matrixGridX, "x-spacing", nullptr, GUIDesignViewSettingsLabel1);
1830 myGridXSizeDialer = new FXRealSpinner(matrixGridX, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1831 myGridXSizeDialer->setRange(1, 10000);
1833 FXMatrix* matrixGridY = new FXMatrix(matrixGrid, 2, GUIDesignViewSettingsMatrix2);
1834 new FXLabel(matrixGridY, "y-spacing", nullptr, GUIDesignViewSettingsLabel1);
1835 myGridYSizeDialer = new FXRealSpinner(matrixGridY, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1836 myGridYSizeDialer->setRange(1, 10000);
1838}
1839
1840
1841void
1843 new FXTabItem(tabbook, "Streets", nullptr, GUIDesignViewSettingsTabItemBook1);
1844 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
1845 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
1846 // ... color settings
1847 FXVerticalFrame* verticalFrameColor = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);
1848 FXMatrix* matrixColor = new FXMatrix(verticalFrameColor, 5, GUIDesignViewSettingsMatrix3);
1849 new FXLabel(matrixColor, "Color", nullptr, GUIDesignViewSettingsLabel1);
1851 myLaneColorInterpolation = new FXCheckButton(matrixColor, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1852 myLaneColorSettingFrame = new FXVerticalFrame(verticalFrameColor, GUIDesignViewSettingsVerticalFrame4);
1853 myMeanDataID = new FXComboBox(matrixColor, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1854 myMeanDataID->disable();
1855 myMeanDataID->hide();
1856 myMeanDataID->setEditable(false);
1857 myParamKey = new FXComboBox(matrixColor, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1858 myParamKey->disable();
1859 myParamKey->setEditable(true);
1860
1861 // rainbow settings
1862 FXMatrix* matrixRainbow = new FXMatrix(verticalFrameColor, 5, GUIDesignViewSettingsMatrix3);
1863 myLaneColorRainbow = new FXButton(matrixRainbow, TL("Recalibrate Rainbow"), nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
1864 (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
1865 myLaneColorRainbowCheck = new FXCheckButton(matrixRainbow, TL("hide below"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1866 myLaneColorRainbowThreshold = new FXRealSpinner(matrixRainbow, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);
1867 myLaneColorRainbowThreshold->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
1869 myLaneColorRainbowCheck2 = new FXCheckButton(matrixRainbow, TL("hide above"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1870 myLaneColorRainbowThreshold2 = new FXRealSpinner(matrixRainbow, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);
1871 myLaneColorRainbowThreshold2->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
1873
1874 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1875 // ... scale settings
1876 FXVerticalFrame* verticalFrameScale = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);
1877 FXMatrix* matrixScale = new FXMatrix(verticalFrameScale, 3, GUIDesignViewSettingsMatrix3);
1878 new FXLabel(matrixScale, "Scale width", nullptr, GUIDesignViewSettingsLabel1);
1880 myLaneScaleInterpolation = new FXCheckButton(matrixScale, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1881 myLaneScaleSettingFrame = new FXVerticalFrame(verticalFrameScale, GUIDesignViewSettingsVerticalFrame4);
1882
1888 } else {
1893 }
1894
1895 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1896 FXMatrix* matrixLanes = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
1897
1898 myShowLaneBorders = new FXCheckButton(matrixLanes, TL("Show lane borders"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1900 myShowBikeMarkings = new FXCheckButton(matrixLanes, TL("Show bike markings"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1902
1903 myShowLaneDecals = new FXCheckButton(matrixLanes, TL("Show turning arrows"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1905 new FXLabel(matrixLanes, " ", nullptr, GUIDesignViewSettingsLabel1);
1906
1907 myShowLinkRules = new FXCheckButton(matrixLanes, TL("Show right-of-way rules"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1909 myRealisticLinkRules = new FXCheckButton(matrixLanes, TL("Realistic stop line colors"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1911
1912 myShowRails = new FXCheckButton(matrixLanes, TL("Show rails"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1913 myShowRails->setCheck(mySettings->showRails);
1914 new FXLabel(matrixLanes, " ", nullptr, GUIDesignViewSettingsLabel1);
1915 myHideMacroConnectors = new FXCheckButton(matrixLanes, TL("Hide macro connectors"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1917 new FXLabel(matrixLanes, " ", nullptr, GUIDesignViewSettingsLabel1);
1918 myShowLaneDirection = new FXCheckButton(matrixLanes, TL("Show lane direction"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1920 new FXLabel(matrixLanes, " ", nullptr, GUIDesignViewSettingsLabel1);
1921 myShowSublanes = new FXCheckButton(matrixLanes, TL("Show sublanes"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1923 mySpreadSuperposed = new FXCheckButton(matrixLanes, TL("Spread bidirectional railways/roads\t\tMake both directional edges for a bidirectional railways or roads visible"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1925 new FXLabel(matrixLanes, "Exaggerate width by", nullptr, GUIDesignViewSettingsLabel1);
1926 myLaneWidthUpscaleDialer = new FXRealSpinner(matrixLanes, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
1927 myLaneWidthUpscaleDialer->setRange(0, 1000000);
1929
1930 new FXLabel(matrixLanes, "Minimum size", nullptr, GUIDesignViewSettingsLabel1);
1931 myLaneMinWidthDialer = new FXRealSpinner(matrixLanes, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
1932 myLaneMinWidthDialer->setRange(0, 1000000);
1934
1935 // edge name
1936 myEdgeNamePanel = new NamePanel(matrixLanes, this, "Show edge id", mySettings->edgeName);
1937 myStreetNamePanel = new NamePanel(matrixLanes, this, "Show street name", mySettings->streetName);
1938 myEdgeValuePanel = new NamePanel(matrixLanes, this, "Show edge color value", mySettings->edgeValue);
1939}
1940
1941
1942void
1944 new FXTabItem(tabbook, "Vehicles", nullptr, GUIDesignViewSettingsTabItemBook1);
1945 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
1946 FXVerticalFrame* verticalframe = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
1947
1948 FXMatrix* matrixShowAs = new FXMatrix(verticalframe, 2, GUIDesignViewSettingsMatrix3);
1949 new FXLabel(matrixShowAs, "Show As", nullptr, GUIDesignViewSettingsLabel1);
1951 myVehicleShapeDetail->appendIconItem("'triangles'");
1953 myVehicleShapeDetail->appendIconItem("'simple shapes'");
1954 myVehicleShapeDetail->appendIconItem("'raster images'");
1958
1959 new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
1960
1961 FXMatrix* matrixColor = new FXMatrix(verticalframe, 4, GUIDesignViewSettingsMatrix3);
1962 new FXLabel(matrixColor, "Color", nullptr, GUIDesignViewSettingsLabel1);
1966 myVehicleColorInterpolation = new FXCheckButton(matrixColor, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1967 myVehicleParamKey = new FXComboBox(matrixColor, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1968 myVehicleParamKey->setEditable(true);
1969 myVehicleParamKey->disable();
1970
1971 myVehicleColorSettingFrame = new FXVerticalFrame(verticalframe, GUIDesignViewSettingsVerticalFrame4);
1972 new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
1973
1974 // vehicle scale settings
1975 FXVerticalFrame* verticalFrameScale = new FXVerticalFrame(verticalframe, GUIDesignViewSettingsVerticalFrame6);
1976 FXMatrix* matrixScale = new FXMatrix(verticalFrameScale, 3, GUIDesignViewSettingsMatrix3);
1977 new FXLabel(matrixScale, "Scale size", nullptr, GUIDesignViewSettingsLabel1);
1979 myVehicleScaleInterpolation = new FXCheckButton(matrixScale, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1980 myVehicleScaleSettingFrame = new FXVerticalFrame(verticalFrameScale, GUIDesignViewSettingsVerticalFrame4);
1983 new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
1984
1985 FXMatrix* matrixVehicle = new FXMatrix(verticalframe, 2, GUIDesignMatrixViewSettings);
1986 myVehicleNamePanel = new NamePanel(matrixVehicle, this, "Show vehicle id", mySettings->vehicleName);
1987 myVehicleValuePanel = new NamePanel(matrixVehicle, this, "Show vehicle color value", mySettings->vehicleValue);
1988 myVehicleScaleValuePanel = new NamePanel(matrixVehicle, this, "Show vehicle scale value", mySettings->vehicleScaleValue);
1989 myVehicleTextPanel = new NamePanel(matrixVehicle, this, "Show vehicle text param", mySettings->vehicleText);
1991 myVehicleTextParamKey->setEditable(true);
1992
1993 //new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
1994
1995 FXMatrix* matrixShow = new FXMatrix(verticalframe, 2, GUIDesignMatrixViewSettings);
1996 myShowBlinker = new FXCheckButton(matrixShow, TL("Show blinker / brake lights"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1998 myShowMinGap = new FXCheckButton(matrixShow, TL("Show minimum gap"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2000 myShowBrakeGap = new FXCheckButton(matrixShow, TL("Show brake gap"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2002 myShowBTRange = new FXCheckButton(matrixShow, TL("Show Bluetooth range"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2004 myShowRouteIndex = new FXCheckButton(matrixShow, TL("Show route index"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2006 myScaleLength = new FXCheckButton(matrixShow, TL("Scale length with geometry"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2008 myShowParkingInfo = new FXCheckButton(matrixShow, TL("Show parking info"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2010 //new FXLabel(matrixShow, " ", nullptr, GUIDesignViewSettingsLabel1);
2011 //myShowLaneChangePreference = new FXCheckButton(matrixShow, TL("Show lane change preference"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2012 //myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
2013 //tmpc = new FXCheckButton(matrixShow, TL("Show needed headway"), 0 ,0);
2014 //tmpc->disable();
2015
2016 //new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
2017
2018 FXMatrix* matrixSize = new FXMatrix(verticalframe, 2, GUIDesignViewSettingsMatrix1);
2020}
2021
2022
2023void
2025 new FXTabItem(tabbook, "Persons", nullptr, GUIDesignViewSettingsTabItemBook1);
2026 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2027 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2028
2029 FXMatrix* m101 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix3);
2030 new FXLabel(m101, "Show As", nullptr, GUIDesignViewSettingsLabel1);
2032 myPersonShapeDetail->appendIconItem("'triangles'");
2033 myPersonShapeDetail->appendIconItem("'circles'");
2034 myPersonShapeDetail->appendIconItem("'simple shapes'");
2035 myPersonShapeDetail->appendIconItem("'raster images'");
2038
2039 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2040
2041 FXMatrix* m102 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2042 new FXLabel(m102, "Color", nullptr, GUIDesignViewSettingsLabel1);
2046 myPersonColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2047
2048 myPersonColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2049
2050 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2051
2052 FXMatrix* m103 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2053 myPersonNamePanel = new NamePanel(m103, this, "Show person id", mySettings->personName);
2054 myPersonValuePanel = new NamePanel(m103, this, "Show person color value", mySettings->personValue);
2055
2056 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2057
2058 FXMatrix* m104 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
2060}
2061
2062
2063void
2065 new FXTabItem(tabbook, "Containers", nullptr, GUIDesignViewSettingsTabItemBook1);
2066 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2067 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2068
2069 FXMatrix* m101 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix3);
2070 new FXLabel(m101, "Show As", nullptr, GUIDesignViewSettingsLabel1);
2072 myContainerShapeDetail->appendIconItem("'triangles'");
2074 myContainerShapeDetail->appendIconItem("'simple shapes'");
2075 myContainerShapeDetail->appendIconItem("'raster images'");
2078
2079 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2080
2081 FXMatrix* m102 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2082 new FXLabel(m102, "Color", nullptr, GUIDesignViewSettingsLabel1);
2087
2088 myContainerColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2089
2090 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2091
2092 FXMatrix* m103 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2093 myContainerNamePanel = new NamePanel(m103, this, "Show container id", mySettings->containerName);
2094
2095 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2096
2097 FXMatrix* m104 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
2099}
2100
2101
2102void
2104 new FXTabItem(tabbook, "Junctions", nullptr, GUIDesignViewSettingsTabItemBook1);
2105 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2106 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2107 FXMatrix* m41 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2108 new FXLabel(m41, "Color", nullptr, GUIDesignViewSettingsLabel1);
2113
2114 myJunctionColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2115 myJunctionColorRainbow = new FXButton(verticalFrame, TL("Recalibrate Rainbow"), nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
2116 (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
2117
2118 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2119 FXMatrix* m42 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2121 myDrawJunctionShape = new FXCheckButton(m42, "Draw junction shape", this, MID_SIMPLE_VIEW_COLORCHANGE);
2123 myDrawCrossingsAndWalkingAreas = new FXCheckButton(m42, "Draw crossings/walkingareas", this, MID_SIMPLE_VIEW_COLORCHANGE);
2125 myShowLane2Lane = new FXCheckButton(m42, "Show lane to lane connections", this, MID_SIMPLE_VIEW_COLORCHANGE);
2127 new FXLabel(m42, " ", nullptr, GUIDesignViewSettingsLabel1);
2128
2129 myTLIndexPanel = new NamePanel(m42, this, "Show link tls index", mySettings->drawLinkTLIndex);
2130 myJunctionIndexPanel = new NamePanel(m42, this, "Show link junction index", mySettings->drawLinkJunctionIndex);
2131 myJunctionIDPanel = new NamePanel(m42, this, "Show junction id", mySettings->junctionID);
2132 myInternalJunctionNamePanel = new NamePanel(m42, this, "Show internal junction id", mySettings->internalJunctionName);
2133 myInternalEdgeNamePanel = new NamePanel(m42, this, "Show internal edge id", mySettings->internalEdgeName);
2134 myCwaEdgeNamePanel = new NamePanel(m42, this, "Show crossing and walkingarea id", mySettings->cwaEdgeName);
2135 myTLSPhaseIndexPanel = new NamePanel(m42, this, "Show traffic light phase index", mySettings->tlsPhaseIndex);
2136 myTLSPhaseNamePanel = new NamePanel(m42, this, "Show traffic light phase name", mySettings->tlsPhaseName);
2137 myJunctionNamePanel = new NamePanel(m42, this, "Show junction name", mySettings->junctionName);
2138}
2139
2140
2141void
2143 new FXTabItem(tabbook, "Additional", nullptr, GUIDesignViewSettingsTabItemBook1);
2144 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2145 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2146 // IDs
2147 FXMatrix* matrixIDs = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2148 myAddNamePanel = new NamePanel(matrixIDs, this, "Show object id", mySettings->addName);
2149 myAddFullNamePanel = new NamePanel(matrixIDs, this, "Show full name", mySettings->addFullName);
2150 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2151 //Sizes
2152 FXMatrix* matrixSizes = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2154 // color
2155 FXMatrix* matrixColor = new FXMatrix(verticalFrame, 3, GUIDesignMatrixViewSettings);
2156 new FXLabel(matrixColor, "StoppingPlace", nullptr, GUIDesignViewSettingsLabel1);
2157 new FXLabel(matrixColor, "body", nullptr, GUIDesignViewSettingsLabel1);
2158 new FXLabel(matrixColor, "sign", nullptr, GUIDesignViewSettingsLabel1);
2159 new FXLabel(matrixColor, "busStops", nullptr, GUIDesignViewSettingsLabel1);
2162 new FXLabel(matrixColor, "trainStops", nullptr, GUIDesignViewSettingsLabel1);
2165 new FXLabel(matrixColor, "containerStops", nullptr, GUIDesignViewSettingsLabel1);
2168 new FXLabel(matrixColor, "chargingStations", nullptr, GUIDesignViewSettingsLabel1);
2171}
2172
2173
2174void
2176 new FXTabItem(tabbook, "Demand", nullptr, GUIDesignViewSettingsTabItemBook1);
2177 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2178 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2179 // elements
2180 FXMatrix* demandMatrix = new FXMatrix(verticalFrame, 3, GUIDesignMatrixViewSettings);
2181 new FXLabel(demandMatrix, "element", nullptr, GUIDesignViewSettingsLabel1);
2182 new FXLabel(demandMatrix, "color", nullptr, GUIDesignViewSettingsLabel1);
2183 new FXLabel(demandMatrix, "width", nullptr, GUIDesignViewSettingsLabel1);
2184 new FXLabel(demandMatrix, "trips", nullptr, GUIDesignViewSettingsLabel1);
2186 myTripWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2188 new FXLabel(demandMatrix, "personTrips", nullptr, GUIDesignViewSettingsLabel1);
2190 myPersonTripWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2192 new FXLabel(demandMatrix, "walks", nullptr, GUIDesignViewSettingsLabel1);
2194 myWalkWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2196 new FXLabel(demandMatrix, "rides", nullptr, GUIDesignViewSettingsLabel1);
2198 myRideWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2200 new FXLabel(demandMatrix, "transport", nullptr, GUIDesignViewSettingsLabel1);
2202 myTransportWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2204 new FXLabel(demandMatrix, "tranship", nullptr, GUIDesignViewSettingsLabel1);
2206 myTranshipWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2208 // stops
2209 FXMatrix* stopMatrix = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2210 new FXLabel(stopMatrix, "stop", nullptr, GUIDesignViewSettingsLabel1);
2212 new FXLabel(stopMatrix, "waypoint", nullptr, GUIDesignViewSettingsLabel1);
2214 new FXLabel(stopMatrix, "stop (persons)", nullptr, GUIDesignViewSettingsLabel1);
2216 new FXLabel(stopMatrix, "stop (containers)", nullptr, GUIDesignViewSettingsLabel1);
2218}
2219
2220
2221void
2223 new FXTabItem(tabbook, "POIs", nullptr, GUIDesignViewSettingsTabItemBook1);
2224 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2225 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2226
2227 FXMatrix* m63 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2228 new FXLabel(m63, "Color", nullptr, GUIDesignViewSettingsLabel1);
2232 myPOIColorInterpolation = new FXCheckButton(m63, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2233 myPOIColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2234
2235 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2236
2237 FXMatrix* m61 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2238
2239 new FXLabel(m61, "POI detail", nullptr, GUIDesignViewSettingsLabel1);
2241 myPoiDetail->setRange(3, 100);
2242 myPoiDetail->setValue(mySettings->poiDetail);
2243
2244 myPOINamePanel = new NamePanel(m61, this, "Show poi id", mySettings->poiName);
2245 myPOITypePanel = new NamePanel(m61, this, "Show poi type", mySettings->poiType);
2246 myPOITextPanel = new NamePanel(m61, this, "Show poi text param", mySettings->poiText);
2248 myPOITextParamKey->setEditable(true);
2249 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2250
2251 FXMatrix* m62 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2253}
2254
2255
2256void
2258 new FXTabItem(tabbook, "Polygons", nullptr, GUIDesignViewSettingsTabItemBook1);
2259 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2260 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2261
2262 FXMatrix* m63 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2263 new FXLabel(m63, "Color", nullptr, GUIDesignViewSettingsLabel1);
2267 myPolyColorInterpolation = new FXCheckButton(m63, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2268 myPolyColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2269
2270 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2271
2272 FXMatrix* m91 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2273 myPolyNamePanel = new NamePanel(m91, this, "Show polygon id", mySettings->polyName);
2274 myPolyTypePanel = new NamePanel(m91, this, "Show polygon types", mySettings->polyType);
2275 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2276
2278}
2279
2280
2281void
2283 new FXTabItem(tabbook, "Selection", nullptr, GUIDesignViewSettingsTabItemBook1);
2284 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2285 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2286
2287 FXMatrix* m102 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2288 new FXLabel(m102, "Default Selection Color", nullptr, GUIDesignViewSettingsLabel1);
2289 new FXLabel(m102, "", nullptr, GUIDesignViewSettingsLabel1);
2290
2291 new FXLabel(m102, "Miscellaneous", nullptr, GUIDesignViewSettingsLabel1);
2293 new FXLabel(m102, "Edge", nullptr, GUIDesignViewSettingsLabel1);
2295 new FXLabel(m102, "Lane Edge", nullptr, GUIDesignViewSettingsLabel1);
2297 new FXLabel(m102, "Connection", nullptr, GUIDesignViewSettingsLabel1);
2299 new FXLabel(m102, "Prohibition", nullptr, GUIDesignViewSettingsLabel1);
2301 new FXLabel(m102, "Crossing", nullptr, GUIDesignViewSettingsLabel1);
2303 new FXLabel(m102, "Additional", nullptr, GUIDesignViewSettingsLabel1);
2305 new FXLabel(m102, "Route", nullptr, GUIDesignViewSettingsLabel1);
2307 new FXLabel(m102, "Vehicle", nullptr, GUIDesignViewSettingsLabel1);
2309 new FXLabel(m102, "Person", nullptr, GUIDesignViewSettingsLabel1);
2311 new FXLabel(m102, "PersonPlan", nullptr, GUIDesignViewSettingsLabel1);
2313 new FXLabel(m102, "edgeData", nullptr, GUIDesignViewSettingsLabel1);
2315}
2316
2317
2318void
2320 new FXTabItem(tabbook, "Data", nullptr, GUIDesignViewSettingsTabItemBook1);
2321 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2322 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2323 // ... color settings
2324 FXVerticalFrame* verticalFrame2 = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);
2325 FXMatrix* m111 = new FXMatrix(verticalFrame2, 4, GUIDesignViewSettingsMatrix3);
2326 new FXLabel(m111, "Color", nullptr, GUIDesignViewSettingsLabel1);
2328 myDataColorInterpolation = new FXCheckButton(m111, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2329 myDataColorSettingFrame = new FXVerticalFrame(verticalFrame2, GUIDesignViewSettingsVerticalFrame4);
2330 myDataParamKey = new FXComboBox(m111, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2331 myDataParamKey->disable();
2332 myDataParamKey->setEditable(true);
2335
2336 // rainbow settings
2337 FXMatrix* m113 = new FXMatrix(verticalFrame2, 3, GUIDesignViewSettingsMatrix3);
2338 myDataColorRainbow = new FXButton(m113, "Recalibrate Rainbow", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
2339 (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
2340 myDataColorRainbowCheck = new FXCheckButton(m113, "hide below threshold", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2341 myDataColorRainbowThreshold = new FXRealSpinner(m113, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);
2342 myDataColorRainbowThreshold->setRange(-100000000, 100000000);
2343
2344 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2345 FXMatrix* m112 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
2346
2347 new FXLabel(m112, "Exaggerate edgeRelation width by", nullptr, GUIDesignViewSettingsLabel1);
2349 myEdgeRelationUpscaleDialer->setRange(0, 1000000);
2351
2352 new FXLabel(m112, "Exaggerate tazRelation width by", nullptr, GUIDesignViewSettingsLabel1);
2354 myTazRelationUpscaleDialer->setRange(0, 1000000);
2356
2357 // text decoration
2358 myDataValuePanel = new NamePanel(m112, this, "Show data color value", mySettings->dataValue);
2359}
2360
2361
2362void
2364 new FXTabItem(tabbook, "Legend", nullptr, GUIDesignViewSettingsTabItemBook1);
2365 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2366 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2367
2368 FXMatrix* m72 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2369 myShowSizeLegend = new FXCheckButton(m72, "Show Size Legend", this, MID_SIMPLE_VIEW_COLORCHANGE);
2371 new FXLabel(m72, "");
2372 myShowColorLegend = new FXCheckButton(m72, "Show Edge Color Legend", this, MID_SIMPLE_VIEW_COLORCHANGE);
2374 new FXLabel(m72, "");
2375 myShowVehicleColorLegend = new FXCheckButton(m72, "Show Vehicle Color Legend", this, MID_SIMPLE_VIEW_COLORCHANGE);
2377 new FXLabel(m72, "");
2378}
2379
2380
2381void
2383 new FXTabItem(tabbook, "openGL", nullptr, GUIDesignViewSettingsTabItemBook1);
2384 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2385 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2386
2387 FXMatrix* m82 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2388 myDither = new FXCheckButton(m82, "Dither", this, MID_SIMPLE_VIEW_COLORCHANGE);
2389 myDither->setCheck(mySettings->dither);
2390 FXMatrix* m83 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2391 myFPS = new FXCheckButton(m83, "FPS", this, MID_SIMPLE_VIEW_COLORCHANGE);
2392 myFPS->setCheck(mySettings->fps);
2393 FXMatrix* m84 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2394 myDrawBoundaries = new FXCheckButton(m84, "Draw boundaries", this, MID_SIMPLE_VIEW_COLORCHANGE);
2396 FXMatrix* m85 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2397 myForceDrawForPositionSelection = new FXCheckButton(m85, "Force draw for position selection", this, MID_SIMPLE_VIEW_COLORCHANGE);
2399 FXMatrix* m86 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2400 myForceDrawForRectangleSelection = new FXCheckButton(m86, "Force draw for rectangle selection", this, MID_SIMPLE_VIEW_COLORCHANGE);
2402 FXMatrix* m87 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2403 myRecalculateBoundaries = new FXButton(m87, "Recalculate boundaries", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
2404 (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
2405 FXMatrix* m89 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2406 myGeometryIndicesPanel = new NamePanel(m89, this, "Show geometry point indices", mySettings->geometryIndices);
2407}
2408
2409
2410void
2412 myFrame3D = new FXTabItem(tabbook, "3D view", nullptr, GUIDesignViewSettingsTabItemBook1);
2413 FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2414 FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2415
2416 FXMatrix* m82 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2417 myShow3DTLSLinkMarkers = new FXCheckButton(m82, "Show TLS link markers", this, MID_SIMPLE_VIEW_COLORCHANGE);
2419 FXMatrix* m83 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2420 myShow3DTLSDomes = new FXCheckButton(m83, "Show domes around TLS models from decals", this, MID_SIMPLE_VIEW_COLORCHANGE);
2422 FXMatrix* m84 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2423 myGenerate3DTLSModels = new FXCheckButton(m84, "Show auto-generated TLS models", this, MID_SIMPLE_VIEW_COLORCHANGE);
2425
2426 new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2427
2428 FXMatrix* m2 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2429 new FXLabel(m2, "Sun brightness", nullptr, GUIDesignViewSettingsLabel1);
2431 myLight3DFactor->setRange(0, 255);
2433 /*
2434 new FXLabel(m2, "Ambient", nullptr, GUIDesignViewSettingsLabel1);
2435 myAmbient3DLight = new FXColorWell(m2, MFXUtils::getFXColor(mySettings->ambient3DLight), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2436 myAmbient3DLight->setOpaqueOnly(true);
2437 new FXLabel(m2, "Diffuse", nullptr, GUIDesignViewSettingsLabel1);
2438 myDiffuse3DLight = new FXColorWell(m2, MFXUtils::getFXColor(mySettings->diffuse3DLight), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2439 myDiffuse3DLight->setOpaqueOnly(true);
2440 */
2441 new FXLabel(m2, "Sky color", nullptr, GUIDesignViewSettingsLabel1);
2443 mySkyColor->setOpaqueOnly(true);
2444
2445#ifdef HAVE_OSG
2447#else
2448 myFrame3D->disable();
2449#endif
2450}
2451
2452
2453void
2454GUIDialog_ViewSettings::buildButtons(FXVerticalFrame* contentFrame) {
2455 FXHorizontalFrame* horizontalFrameButtons = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame2);
2456 FXButton* OK = new FXButton(horizontalFrameButtons, TL("&OK"), nullptr, this, MID_SETTINGS_OK, GUIDesignViewSettingsButton2);
2457 new FXButton(horizontalFrameButtons, TL("&Cancel"), nullptr, this, MID_SETTINGS_CANCEL, GUIDesignViewSettingsButton3);
2458 OK->setFocus();
2459}
2460
2461/****************************************************************************/
long long int SUMOTime
Definition: GUI.h:36
@ MID_SIMPLE_VIEW_NAMECHANGE
Informs the dialog about switching to another scheme.
Definition: GUIAppEnum.h:622
@ MID_SIMPLE_VIEW_CLEAR_DECALS
For the clear-decals - button.
Definition: GUIAppEnum.h:636
@ MID_SIMPLE_VIEW_SAVE
For the save-to-db - button.
Definition: GUIAppEnum.h:624
@ MID_TABLE
The Table.
Definition: GUIAppEnum.h:530
@ MID_SIMPLE_VIEW_IMPORT
For the import-from-file - button.
Definition: GUIAppEnum.h:630
@ MID_SIMPLE_VIEW_EXPORT
For the export-to-file - button.
Definition: GUIAppEnum.h:628
@ MID_SIMPLE_VIEW_DELETE
For the delete - button.
Definition: GUIAppEnum.h:626
@ MID_SETTINGS_OK
Ok-button was pushed.
Definition: GUIAppEnum.h:542
@ MID_SETTINGS_CANCEL
Cancel-button was pushed.
Definition: GUIAppEnum.h:544
@ MID_SIMPLE_VIEW_SIZECHANGE
Informs the dialog about a size value's change.
Definition: GUIAppEnum.h:620
@ MID_SIMPLE_VIEW_LOAD_DECALS
For the load-decals - button.
Definition: GUIAppEnum.h:632
@ MID_SIMPLE_VIEW_COLORCHANGE
Informs the dialog about a value's change.
Definition: GUIAppEnum.h:618
@ MID_SIMPLE_VIEW_SAVE_DECALS
For the save-decals - button.
Definition: GUIAppEnum.h:634
GUICompleteSchemeStorage gSchemeStorage
#define GUIDesignViewSettingsColorWell2
Definition: GUIDesigns.h:571
#define GUIDesignViewSettingsMatrix3
Definition: GUIDesigns.h:528
#define GUIDesignViewSettingsMainDialog
Definition: GUIDesigns.h:499
#define GUIDesignViewSettingsMatrix5
Definition: GUIDesigns.h:532
#define GUIDesignComboBoxStatic
Combo box static (not editable)
Definition: GUIDesigns.h:309
#define GUIDesignViewSettingsMFXTable
MFX Add/Edit Typed Table.
Definition: GUIDesigns.h:574
#define GUIDesignViewSettingsComboBox1
Combo boxs.
Definition: GUIDesigns.h:535
#define GUIDesignViewSettingsHorizontalFrame3
Definition: GUIDesigns.h:521
#define GUIDesignViewSettingsVerticalFrame6
Definition: GUIDesigns.h:514
#define GUIDesignViewSettingsHorizontalFrame2
Definition: GUIDesigns.h:519
#define GUIDesignViewSettingsButton2
Definition: GUIDesigns.h:560
#define GUIDesignButtonToolbar
little button with icon placed in navigation toolbar
Definition: GUIDesigns.h:115
#define GUIDesignViewSettingsMatrix1
Matrix.
Definition: GUIDesigns.h:524
#define GUIDesignViewSettingsColorWell1
Color wells.
Definition: GUIDesigns.h:569
#define GUIDesignViewSettingsButton4
Definition: GUIDesigns.h:564
#define GUIDesignViewSettingsDialog
Definition: GUIDesigns.h:501
#define GUIDesignViewSettingsMatrix4
Definition: GUIDesigns.h:530
#define GUIDesignViewSettingsSpinDial2
Definition: GUIDesigns.h:542
#define GUIDesignViewSettingsButton5
Definition: GUIDesigns.h:566
#define GUIDesignViewSettingsHorizontalFrame1
Horizontal frames.
Definition: GUIDesigns.h:517
#define GUIDesignViewSettingsSpinDial1
Definition: GUIDesigns.h:540
#define GUIDesignViewSettingsVerticalFrame5
Definition: GUIDesigns.h:512
#define GUIDesignViewSettingsMatrix2
Definition: GUIDesigns.h:526
#define GUIDesignViewSettingsLabel1
Label.
Definition: GUIDesigns.h:550
#define GUIDesignViewSettingsTabBook1
Tab books.
Definition: GUIDesigns.h:545
#define GUIDesignViewSettingsButton3
Definition: GUIDesigns.h:562
#define GUIDesignMatrixViewSettings
FXMatrix used to pack values in Viewsettings.
Definition: GUIDesigns.h:359
#define GUIDesignViewSettingsVerticalFrame2
Definition: GUIDesigns.h:506
#define GUIDesignViewSettingsVerticalFrame3
Definition: GUIDesigns.h:508
#define GUIDesignViewSettingsColorWell
ColorWell.
Definition: GUIDesigns.h:538
#define GUIDesignViewSettingsMFXTableJustify
Definition: GUIDesigns.h:576
#define GUIDesignHorizontalSeparator
Definition: GUIDesigns.h:452
#define GUIDesignViewSettingsVerticalFrame4
Definition: GUIDesigns.h:510
#define GUIDesignViewSettingsTabItemBook1
Definition: GUIDesigns.h:547
#define GUIDesignViewSettingsVerticalFrame1
vertical frames
Definition: GUIDesigns.h:504
#define GUIDesignViewSettingsLabel2
Definition: GUIDesigns.h:552
#define GUIDesignViewSettingsTextField1
textFields
Definition: GUIDesigns.h:555
#define GUIDesignCheckButtonViewSettings
CheckButton for Frames without thick extended over the frame.
Definition: GUIDesigns.h:181
#define GUIDesignViewSettingsButton1
Buttons.
Definition: GUIDesigns.h:558
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
a poi
@ GLO_POLYGON
a polygon
GUIPostDrawing gPostDrawing
FXString gCurrentFolder
The folder used as last.
#define TL(string)
Definition: MsgHandler.h:282
std::string time2string(SUMOTime t)
convert SUMOTime to string
Definition: SUMOTime.cpp:68
@ 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
T MIN2(T a, T b)
Definition: StdDefs.h:71
T MAX2(T a, T b)
Definition: StdDefs.h:77
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
void add(const GUIVisualizationSettings &scheme)
Adds a visualization scheme.
int getNumInitialSettings() const
Returns the number of initial settings.
void remove(const std::string &name)
Removes the setting with the given name.
void writeSettings(FXApp *app)
Writes the current scheme into the registry.
void writeXML(OutputDevice &dev)
write the settings to the given device
GUIVisualizationTextSettings getSettings()
get settings
FXColorWell * myBGColorWell
BGColor well.
void update(const GUIVisualizationTextSettings &settings)
update
FXCheckButton * myCheck
check button
FXCheckButton * myConstSizeCheck
const size check
NamePanel(FXMatrix *parent, GUIDialog_ViewSettings *target, const std::string &title, const GUIVisualizationTextSettings &settings)
constructor
FXCheckButton * mySelectedCheck
draw only for selected?
FXCheckButton * myCheckSelected
check selected button
FXCheckButton * myCheck
check 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 * myDataColorRainbowCheck
FXCheckButton * myVehicleColorInterpolation
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
FXVerticalFrame * myDataColorSettingFrame
GUISUMOAbstractView * myParent
The parent view (which settings are changed)
FXMutex * myDecalsLock
Lock used when changing the decals.
std::vector< FXColorWell * > myPolyColors
FXVerticalFrame * myJunctionColorSettingFrame
void buildSelectionFrame(FXTabBook *tabbook)
void buildOpenGLFrame(FXTabBook *tabbook)
long onCmdNameChange(FXObject *, FXSelector, void *)
Called if the name of the scheme was changed.
FXVerticalFrame * myContainerColorSettingFrame
FXRealSpinner * myLaneWidthUpscaleDialer
MFXIconComboBox * myPersonShapeDetail
std::vector< FXColorWell * > myPOIColors
FXColorWell * myBusStopColor
additional colors
FXTabItem * myFrame3D
Frame3D.
MFXIconComboBox * myPOIColorMode
POIs.
std::vector< FXButton * > myLaneScaleButtons
MFXIconComboBox * myDataColorMode
Data.
long onCmdSaveDecals(FXObject *, FXSelector, void *data)
Called if the decals shall be saved to a file.
std::vector< FXColorWell * > myPersonColors
std::vector< FXButton * > myDataButtons
std::vector< FXRealSpinner * > myVehicleScales
std::vector< FXRealSpinner * > myPolyThresholds
FXCheckButton * myPOIColorInterpolation
std::vector< GUISUMOAbstractView::Decal > * myDecals
The parent's decals.
std::vector< FXButton * > myContainerButtons
std::vector< FXRealSpinner * > myJunctionThresholds
MFXIconComboBox * myVehicleShapeDetail
FXCheckButton * myVehicleScaleInterpolation
FXMatrix * rebuildColorMatrix(FXVerticalFrame *frame, std::vector< FXColorWell * > &colors, std::vector< FXRealSpinner * > &thresholds, std::vector< FXButton * > &buttons, FXCheckButton *interpolation, GUIColorScheme &scheme)
Rebuilds manipulators for the current coloring scheme.
void buildJunctionsFrame(FXTabBook *tabbook)
std::vector< FXRealSpinner * > myPersonThresholds
FXCheckButton * myRealisticLinkRules
FXRealSpinner * myLaneColorRainbowThreshold2
void show()
show view settings dialog
std::vector< FXButton * > myJunctionButtons
MFXIconComboBox * myContainerColorMode
Containers.
FXColorWell * mySelectedProhibitionColor
FXCheckButton * myGenerate3DTLSModels
FXCheckButton * myShowVehicleColorLegend
void buildStreetsFrame(FXTabBook *tabbook)
FXRealSpinner * myTripWidth
demand widths
FXCheckButton * mySaveViewPort
load/save-menu
void buildVehiclesFrame(FXTabBook *tabbook)
MFXIconComboBox * myLaneEdgeColorMode
... lane colorer
FXCheckButton * myLaneColorRainbowCheck
MFXIconComboBox * myContainerShapeDetail
void rebuildDecalsTable()
Rebuilds the decals table.
std::vector< FXColorWell * > myJunctionColors
FXRealSpinner * myLaneMinWidthDialer
void saveWindowSize()
save window position and size to the registry
FXCheckButton * myPersonColorInterpolation
FXColorWell * mySelectionColor
selection colors
FXVerticalFrame * myLaneScaleSettingFrame
FXCheckButton * myHideMacroConnectors
std::vector< FXColorWell * > myVehicleColors
long onCmdLoadDecals(FXObject *, FXSelector, void *data)
Called if the decals shall be loaded from a file.
FXMatrix * rebuildScaleMatrix(FXVerticalFrame *frame, std::vector< FXRealSpinner * > &scales, std::vector< FXRealSpinner * > &thresholds, std::vector< FXButton * > &buttons, FXCheckButton *interpolation, GUIScaleScheme &scheme)
Rebuilds manipulators for the current scaling scheme.
MFXIconComboBox * myLaneEdgeScaleMode
... lane scaler
std::vector< FXRealSpinner * > myVehicleThresholds
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
FXCheckButton * myPolyColorInterpolation
std::vector< FXButton * > myPersonButtons
void loadWindowSize()
load window position and size from the registry
FXCheckButton * myJunctionColorInterpolation
FXRealSpinner * myTazRelationUpscaleDialer
void buildHeader(FXVerticalFrame *contentFrame)
build header
long onCmdCancel(FXObject *, FXSelector, void *)
Called if the Cancel-button was pressed.
MFXAddEditTypedTable * myDecalsTable
FXVerticalFrame * myLaneColorSettingFrame
FXCheckButton * myLaneScaleInterpolation
void buildDemandFrame(FXTabBook *tabbook)
FXCheckButton * myForceDrawForPositionSelection
long onCmdImportSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be read from a file.
MFXIconComboBox * myJunctionColorMode
junctions
FXVerticalFrame * myVehicleScaleSettingFrame
long onUpdImportSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to read settings from a file.
void setCurrent(GUIVisualizationSettings *settings)
Sets current settings (called if reopened)
void rebuildColorMatrices(bool doCreate=false)
Rebuilds color changing dialogs after choosing another coloring scheme.
void saveDecals(OutputDevice &dev) const
Writes the currently used decals into a file.
FXVerticalFrame * myPolyColorSettingFrame
std::vector< FXRealSpinner * > myLaneScales
void loadSettings(const std::string &file)
Loads a scheme from a file.
long onCmdClearDecals(FXObject *, FXSelector, void *data)
Called if the decals shall be cleared.
std::vector< FXRealSpinner * > myDataThresholds
FXCheckButton * myDataColorInterpolation
MFXIconComboBox * myPersonColorMode
Persons.
FXCheckButton * myDrawCrossingsAndWalkingAreas
std::vector< FXButton * > myLaneButtons
FXCheckButton * myLaneColorInterpolation
FXVerticalFrame * myPersonColorSettingFrame
void buildContainersFrame(FXTabBook *tabbook)
void buildLegendFrame(FXTabBook *tabbook)
std::vector< FXRealSpinner * > myVehicleScaleThresholds
FXCheckButton * myContainerColorInterpolation
std::vector< FXColorWell * > myLaneColors
SizePanel * myVehicleSizePanel
size panels
GUIVisualizationSettings * mySettings
The current settings.
long onCmdDeleteSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be deleted.
void loadDecals(const std::string &file)
Loads decals from a file.
FXVerticalFrame * myPOIColorSettingFrame
long onCmdColorChange(FXObject *, FXSelector, void *)
Called if something (color, width, etc.) has been changed.
std::vector< FXColorWell * > myContainerColors
FXCheckButton * myForceDrawForRectangleSelection
std::vector< FXRealSpinner * > myLaneScaleThresholds
FXRealSpinner * myLaneColorRainbowThreshold
FXCheckButton * myDither
openGL
GUIVisualizationSettings myBackup
A backup of the settings (used if the "Cancel" button is pressed)
std::vector< FXRealSpinner * > myContainerThresholds
void buildPersonsFrame(FXTabBook *tabbook)
FXCheckButton * myShow3DTLSLinkMarkers
3D
void updatePOIParams()
reload known POI parameters
FXCheckButton * myShowLane2Lane
buttons
std::vector< FXColorWell * > myDataColors
long onCmdEditTable(FXObject *, FXSelector, void *data)
Called if the decals-table was changed.
long onCmdOk(FXObject *, FXSelector, void *)
Called if the OK-button was pressed.
long onCmdSaveSetting(FXObject *, FXSelector, void *data)
Called if the settings shall be saved into the registry.
void buildAdditionalsFrame(FXTabBook *tabbook)
void buildPOIsFrame(FXTabBook *tabbook)
void buildPolygonsFrame(FXTabBook *tabbook)
void buildDataFrame(FXTabBook *tabbook)
long onUpdSaveSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to save the settings into the registry.
void buildButtons(FXVerticalFrame *contentFrame)
build buttons
MFXIconComboBox * myVehicleScaleMode
vehicle scaler
std::vector< FXButton * > myVehicleScaleButtons
bool updateColorRanges(FXObject *sender, std::vector< FXColorWell * >::const_iterator colIt, std::vector< FXColorWell * >::const_iterator colEnd, std::vector< FXRealSpinner * >::const_iterator threshIt, std::vector< FXRealSpinner * >::const_iterator threshEnd, std::vector< FXButton * >::const_iterator buttonIt, GUIColorScheme &scheme)
update color ranges
std::vector< FXRealSpinner * > myLaneThresholds
long onUpdDeleteSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to delete settings.
bool updateScaleRanges(FXObject *sender, std::vector< FXRealSpinner * >::const_iterator colIt, std::vector< FXRealSpinner * >::const_iterator colEnd, std::vector< FXRealSpinner * >::const_iterator threshIt, std::vector< FXRealSpinner * >::const_iterator threshEnd, std::vector< FXButton * >::const_iterator buttonIt, GUIScaleScheme &scheme)
update scale ranges
void build3DFrame(FXTabBook *tabbook)
long onUpdExportSetting(FXObject *, FXSelector, void *data)
Called when updating the button that allows to export settings into a file.
std::vector< FXButton * > myPOIButtons
MFXIconComboBox * myVehicleColorMode
Vehicles.
FXRealSpinner * myDataColorRainbowThreshold
MFXIconComboBox * myPolyColorMode
Polygons.
FXCheckButton * myLaneColorRainbowCheck2
FXColorWell * myChargingStationColorSign
NamePanel * myEdgeNamePanel
name panels
FXRealSpinner * myEdgeRelationUpscaleDialer
void updateVehicleParams()
reload known vehicle parameters
std::vector< FXRealSpinner * > myPOIThresholds
std::vector< FXButton * > myPolyButtons
std::vector< FXButton * > myVehicleButtons
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
GUIGlObjectType recomputeBoundaries
recompute boundaries
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(MFXIconComboBox &cb)
Fills the given combobox with the names of available colorings.
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
double getGridWidth() const
get grid width
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 void buildColorRainbow(const GUIVisualizationSettings &, GUIColorScheme &, int, GUIGlObjectType, bool hide=false, double hideThreshold=0, bool hide2=false, double hideThreshold2=0)
recalibrate color scheme according to the current value range
virtual std::vector< std::string > getVehicleParamKeys(bool) const
return list of available vehicle parameters
virtual std::vector< std::string > getMeanDataIDs() const
return list of loaded edgeData ids (being computed in the current simulation)
virtual void recalculateBoundaries()=0
recalculate boundaries
double getGridHeight() const
get grid height
virtual bool is3DView() const
return whether this is a 3D view
virtual std::vector< std::string > getPOIParamKeys() const
return list of available vehicle parameters
void setBreakpoints(const std::vector< SUMOTime > &breakpoints)
Sets the breakpoints of the parent application.
FXComboBox * getColoringSchemesCombo()
get coloring schemes combo
virtual bool setColorScheme(const std::string &)
set color scheme
virtual 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.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings addName
GUIVisualizationTextSettings tlsPhaseIndex
GUIVisualizationTextSettings vehicleName
GUIVisualizationTextSettings junctionName
RGBColor backgroundColor
The background color to use.
GUIVisualizationSizeSettings vehicleSize
GUIVisualizationSizeSettings containerSize
bool showBlinker
Information whether vehicle blinkers shall be drawn.
GUIVisualizationTextSettings internalEdgeName
RGBColor skyColor
sky background color
GUIVisualizationSizeSettings junctionSize
static const std::string SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL
bool drawBoundaries
enable or disable draw boundaries
bool dataValueHideCheck
value below which relation data value should not be rendered
static const std::string SCHEME_NAME_EDGEDATA_NUMERICAL
bool showBikeMarkings
Information whether bicycle lane marking shall be drawn.
std::string edgeDataID
id for coloring by live edgeData
GUIScaler laneScaler
The lane scaler.
bool dither
Information whether dithering shall be enabled.
GUIColorer vehicleColorer
The vehicle colorer.
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.
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.
int personQuality
The quality of person drawing.
GUIColorer poiColorer
The POI colorer.
GUIVisualizationWidthSettings widthSettings
width settings
GUIVisualizationTextSettings poiName
bool showParkingInfo
Set whether parking related information should be shown.
GUIVisualizationTextSettings vehicleValue
GUIColorer polyColorer
The polygon colorer.
int vehicleQuality
The quality of vehicle drawing.
GUIVisualizationTextSettings drawLinkJunctionIndex
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.
bool edgeValueHideCheck2
threshold above which edge data value should not be rendered
std::string vehicleParam
key for coloring by vehicle parameter
bool showRails
Information whether rails shall be drawn.
GUIVisualizationSizeSettings personSize
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
GUIVisualizationTextSettings cwaEdgeName
GUIVisualizationTextSettings junctionID
std::string vehicleTextParam
key for rendering vehicle textual parameter
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
GUIVisualizationColorSettings colorSettings
color settings
bool showSublanes
Whether to show sublane boundaries.
bool showGrid
Information whether a grid shall be shown.
bool scaleLength
Whether vehicle length shall be scaled with length/geometry factor.
bool showVehicleColorLegend
Information whether the vehicle color legend shall be drawn.
double edgeRelWidthExaggeration
The edgeRelation exaggeration (upscale thickness)
bool hideConnectors
flag to show or 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.
int getLaneEdgeMode() const
Returns the number of the active lane (edge) coloring schme.
RGBColor ambient3DLight
3D material light components
bool forceDrawForRectangleSelection
flag to force draw for rectangle selection (see drawForRectangleSelection)
bool netedit
Whether the settings are for Netedit.
bool showLaneDirection
Whether to show direction indicators for lanes.
bool edgeValueHideCheck
threshold below which edge data value should not be rendered
GUIColorScheme & getLaneEdgeScheme()
Returns the current lane (edge) coloring schme.
GUIScaler edgeScaler
The mesoscopic edge scaler.
bool drawMinGap
Information whether the minimum gap shall be drawn.
GUIVisualizationTextSettings streetName
GUIVisualizationTextSettings poiText
GUIVisualizationTextSettings vehicleText
int getLaneEdgeScaleMode() const
Returns the number of the active lane (edge) scaling schme.
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
GUIColorer laneColorer
The lane colorer.
GUIVisualizationTextSettings polyName
double tazRelWidthExaggeration
The tazRelation exaggeration (upscale thickness)
bool laneShowBorders
Information whether lane borders shall be drawn.
GUIVisualizationTextSettings tlsPhaseName
GUIVisualizationTextSettings edgeName
bool showSizeLegend
Information whether the size legend shall be drawn.
double laneMinSize
The minimum visual lane width for drawing.
GUIVisualizationTextSettings drawLinkTLIndex
GUIVisualizationTextSettings containerName
GUIVisualizationSizeSettings polySize
GUIColorer containerColorer
The container colorer.
double gridXSize
Information about the grid spacings.
bool showBTRange
Information whether the communication range shall be drawn.
bool forceDrawForPositionSelection
flag to force draw for position selection (see drawForPositionSelection)
GUIVisualizationTextSettings personName
bool showColorLegend
Information whether the edge color legend shall be drawn.
std::string poiTextParam
key for rendering poi textual parameter
bool showRouteIndex
Information whether the route index should be shown.
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
static const std::string SCHEME_NAME_EDGE_PARAM_NUMERICAL
scheme names
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
std::string relDataAttr
key for coloring by edgeRelation / tazRelation attribute
GUIColorer junctionColorer
The junction colorer.
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.
void setCellType(int pos, CellType t)
void setNumberCellParams(int pos, double min, double max, double steps1, double steps2, double steps3, const std::string &format)
ComboBox with icon.
FXString getText() const
Get the text.
FXint getCurrentItem() const
Get the current item's index.
void setCurrentItem(FXint index, FXbool notify=FALSE)
Set the current item (index is zero-based)
void setNumVisible(FXint nvis)
Set the number of visible items in the drop down list.
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon
static void deleteChildren(FXWindow *w)
Deletes all children of the given window.
Definition: MFXUtils.cpp:30
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition: MFXUtils.cpp:82
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:112
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:106
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:251
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 std::string trim(const std::string s, const std::string &t=" \t\n")
remove leading and trailing whitespace
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
static std::string substituteEnvironment(const std::string &str, const std::chrono::time_point< std::chrono::system_clock > *const timeRef=nullptr)
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
Definition: json.hpp:4471
A decal (an image) that can be shown.
double tilt
The tilt of the image to the ground plane (in degrees)
double centerX
The center of the image in x-direction (net coordinates, in m)
double height
The height of the image (net coordinates in y-direction, in m)
double width
The width of the image (net coordinates in x-direction, in m)
bool initialised
Whether this image was initialised (inserted as a texture)
double rot
The rotation of the image in the ground plane (in degrees)
double layer
The layer of the image.
double altitude
The altitude of the image (net coordinates in z-direction, in m)
double centerY
The center of the image in y-direction (net coordinates, in m)
double centerZ
The center of the image in z-direction (net coordinates, in m)
std::string filename
The path to the file the image is located at.
double roll
The roll of the image to the ground plane (in degrees)
bool screenRelative
Whether this image should be skipped in 2D-views.
RGBColor vehicleTripColor
color for vehicle trips
RGBColor selectionColor
basic selection color
RGBColor selectedEdgeColor
edge selection color
RGBColor selectedPersonPlanColor
person plan selection color (Rides, Walks, stopPersons...)
RGBColor stopPersonColor
color for stopPersons
RGBColor selectedCrossingColor
crossings selection color
RGBColor chargingStationColor
color for chargingStations
RGBColor selectedLaneColor
lane selection color
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
RGBColor selectedEdgeDataColor
edge data selection color
RGBColor trainStopColorSign
color for trainStops signs
RGBColor transhipColor
color for tranships
RGBColor 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
double exaggeration
The size exaggeration (upscale)
bool constantSize
whether the object shall be drawn with constant size regardless of zoom
double minSize
The minimum size to draw this object.
bool constantSizeSelected
whether only selected objects shall be drawn with constant
RGBColor bgColor
background text color
bool onlySelected
whether only selected objects shall have text drawn
bool constSize
@brif flag to avoid size changes
double personTripWidth
width for person trips
FXTableItem * item