Path: blob/main/src/utils/gui/windows/GUIDialog_ViewSettings.cpp
193674 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GUIDialog_ViewSettings.cpp14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Michael Behrisch17/// @author Laura Bieker18/// @author Mirko Barthauer19/// @date Wed, 21. Dec 200520///21// The dialog to change the view (gui) settings.22/****************************************************************************/23#include <config.h>2425#include <fstream>26#include <fxkeys.h>27#include <utils/gui/windows/GUIAppEnum.h>28#include <utils/gui/windows/GUISUMOAbstractView.h>29#include <utils/foxtools/MFXUtils.h>30#include <utils/foxtools/MFXComboBoxIcon.h>31#include <utils/common/RGBColor.h>32#include <utils/common/ToString.h>33#include <utils/common/StringUtils.h>34#include <utils/common/StringUtils.h>35#include <utils/options/OptionsCont.h>36#include <utils/gui/settings/GUICompleteSchemeStorage.h>37#include <utils/gui/images/GUIIconSubSys.h>38#include <utils/gui/div/GUIIOGlobals.h>39#include <utils/gui/div/GUIDesigns.h>40#include <utils/importio/LineReader.h>41#include <utils/iodevices/OutputDevice.h>42#include <utils/gui/settings/GUISettingsHandler.h>43#include <utils/gui/div/GUIGlobalViewObjectsHandler.h>4445#include "GUIDialog_EditViewport.h"46#include "GUIDialog_ViewSettings.h"474849// ===========================================================================50// FOX callback mapping51// ===========================================================================5253FXDEFMAP(GUIDialog_ViewSettings::SizePanel) GUIDialog_SizeMap[] = {54FXMAPFUNC(SEL_CHANGED, MID_SIMPLE_VIEW_SIZECHANGE, GUIDialog_ViewSettings::SizePanel::onCmdSizeChange),55FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_SIZECHANGE, GUIDialog_ViewSettings::SizePanel::onCmdSizeChange)56};5758FXDEFMAP(GUIDialog_ViewSettings) GUIDialog_ViewSettingsMap[] = {59FXMAPFUNC(SEL_CHANGED, MID_SIMPLE_VIEW_COLORCHANGE, GUIDialog_ViewSettings::onCmdColorChange),60FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_COLORCHANGE, GUIDialog_ViewSettings::onCmdColorChange),61FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_NAMECHANGE, GUIDialog_ViewSettings::onCmdNameChange),62FXMAPFUNC(SEL_COMMAND, MID_SETTINGS_OK, GUIDialog_ViewSettings::onCmdOk),63FXMAPFUNC(SEL_COMMAND, MID_SETTINGS_CANCEL, GUIDialog_ViewSettings::onCmdCancel),64FXMAPFUNC(SEL_KEYPRESS, 0, GUIDialog_ViewSettings::onKeyPress),65// settings66FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_SAVE, GUIDialog_ViewSettings::onCmdSaveSetting),67FXMAPFUNC(SEL_UPDATE, MID_SIMPLE_VIEW_SAVE, GUIDialog_ViewSettings::onUpdSaveSetting),68FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_DELETE, GUIDialog_ViewSettings::onCmdDeleteSetting),69FXMAPFUNC(SEL_UPDATE, MID_SIMPLE_VIEW_DELETE, GUIDialog_ViewSettings::onUpdDeleteSetting),70FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_EXPORT, GUIDialog_ViewSettings::onCmdExportSetting),71FXMAPFUNC(SEL_UPDATE, MID_SIMPLE_VIEW_EXPORT, GUIDialog_ViewSettings::onUpdExportSetting),72FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_IMPORT, GUIDialog_ViewSettings::onCmdImportSetting),73FXMAPFUNC(SEL_UPDATE, MID_SIMPLE_VIEW_IMPORT, GUIDialog_ViewSettings::onUpdImportSetting),74// decals75FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_LOAD_DECAL, GUIDialog_ViewSettings::onCmdLoadDecal),76FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_LOAD_DECALS_XML, GUIDialog_ViewSettings::onCmdLoadXMLDecals),77FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_SAVE_DECALS_XML, GUIDialog_ViewSettings::onCmdSaveXMLDecals),78FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_CLEAR_DECALS, GUIDialog_ViewSettings::onCmdClearDecals),79};8081FXIMPLEMENT(GUIDialog_ViewSettings, FXTopWindow, GUIDialog_ViewSettingsMap, ARRAYNUMBER(GUIDialog_ViewSettingsMap))82FXIMPLEMENT(GUIDialog_ViewSettings::SizePanel, FXObject, GUIDialog_SizeMap, ARRAYNUMBER(GUIDialog_SizeMap))838485// ===========================================================================86// method definitions87// ===========================================================================88#ifdef _MSC_VER89#pragma warning(push)90#pragma warning(disable: 4355) // mask warning about "this" in initializers91#endif92GUIDialog_ViewSettings::GUIDialog_ViewSettings(GUISUMOAbstractView* parent, GUIVisualizationSettings* settings) :93FXTopWindow(parent, TL("View Settings"),94GUIIconSubSys::getIcon(GUIIcon::COLORWHEEL),95GUIIconSubSys::getIcon(GUIIcon::COLORWHEEL),96GUIDesignViewSettingsMainDialog),97GUIPersistentWindowPos(this, "VIEWSETTINGS", true, 20, 40, 700, 500, 400, 20),98myParent(parent),99mySettings(settings),100myBackup(settings->name, settings->netedit) {101// make a backup copy102myBackup.copy(*settings);103// create content frame104FXVerticalFrame* contentFrame = new FXVerticalFrame(this, GUIDesignViewSettingsVerticalFrame1);105// build header106buildHeader(contentFrame);107// create tabbook for every section108FXTabBook* tabbook = new FXTabBook(contentFrame, nullptr, 0, GUIDesignViewSettingsTabBook1);109// build background frame110buildBackgroundFrame(tabbook);111// build streets frame112buildStreetsFrame(tabbook);113// build vehicles frame114buildVehiclesFrame(tabbook);115// build persons frame116buildPersonsFrame(tabbook);117// build containers frame118buildContainersFrame(tabbook);119// build junctions frame120buildJunctionsFrame(tabbook);121// build additionals frame122buildAdditionalsFrame(tabbook);123// build demand frame124if (mySettings->netedit) {125buildDemandFrame(tabbook);126}127// build POIs frame128buildPOIsFrame(tabbook);129// build polygons frame130buildPolygonsFrame(tabbook);131// build selection frame (only in netedit)132if (mySettings->netedit) {133buildSelectionFrame(tabbook);134}135// build data frame (only in netedit)136if (mySettings->netedit) {137buildDataFrame(tabbook);138}139// build legend frame140buildLegendFrame(tabbook);141// build 3D frame142build3DFrame(tabbook);143if (mySettings->netedit) {144myFrame3D->disable();145}146// build openGL frame147buildOpenGLFrame(tabbook);148// build buttons149buildButtons(contentFrame);150// rebuild color matrix151rebuildColorMatrices(false);152setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY));153loadWindowPos();154}155#ifdef _MSC_VER156#pragma warning(pop)157#endif158159160GUIDialog_ViewSettings::~GUIDialog_ViewSettings() {161myParent->remove(this);162// delete name panels163delete myInternalJunctionNamePanel;164delete myInternalEdgeNamePanel;165delete myTLSPhaseIndexPanel;166delete myTLSPhaseNamePanel;167delete myCwaEdgeNamePanel;168delete myStreetNamePanel;169delete myEdgeValuePanel;170delete myEdgeScaleValuePanel;171delete myJunctionIndexPanel;172delete myTLIndexPanel;173delete myJunctionIDPanel;174delete myJunctionNamePanel;175delete myVehicleNamePanel;176delete myVehicleValuePanel;177delete myVehicleScaleValuePanel;178delete myVehicleTextPanel;179delete myPersonNamePanel;180delete myPersonValuePanel;181delete myAddNamePanel;182delete myAddFullNamePanel;183delete myPOINamePanel;184delete myPOITypePanel;185delete myPOITextPanel;186delete myPolyNamePanel;187delete myPolyTypePanel;188delete myEdgeNamePanel;189delete myDataValuePanel;190delete myGeometryIndicesPanel;191// delete size panels192delete myVehicleSizePanel;193delete myPersonSizePanel;194delete myJunctionSizePanel;195delete myPOISizePanel;196delete myPolySizePanel;197delete myAddSizePanel;198// delete rainbow panels199delete myEdgeRainbowPanel;200delete myJunctionRainbowPanel;201delete myDataRainbowPanel;202delete myVehicleRainbowPanel;203}204205206void207GUIDialog_ViewSettings::show() {208// update buttons that can be changed externally209myShowGrid->setCheck(mySettings->showGrid);210myGridXSizeDialer->setValue(mySettings->gridXSize);211myGridYSizeDialer->setValue(mySettings->gridYSize);212// create myNewDecalsTable213myDecalsTable->create();214myDecalsTable->fillTable();215FXTopWindow::show();216}217218219GUISUMOAbstractView*220GUIDialog_ViewSettings::getSUMOAbstractView() {221return myParent;222}223224225void226GUIDialog_ViewSettings::setCurrent(GUIVisualizationSettings* settings) {227mySettings = settings;228myBackup.copy(*settings);229onCmdNameChange(nullptr, 0, nullptr);230}231232233long234GUIDialog_ViewSettings::onCmdOk(FXObject*, FXSelector, void*) {235getApp()->reg().writeIntEntry("SETTINGS", "comboRows", (int)myComboRows->getValue());236getApp()->reg().writeRealEntry("SETTINGS", "uiscale", myUIScale->getValue());237hide();238return 1;239}240241242long243GUIDialog_ViewSettings::onCmdCancel(FXObject*, FXSelector, void*) {244hide();245mySettings->copy(myBackup);246myParent->update();247return 1;248}249250251long252GUIDialog_ViewSettings::onKeyPress(FXObject* o, FXSelector sel, void* ptr) {253const FXEvent* e = (FXEvent*) ptr;254if (e->code == KEY_Escape) {255onCmdCancel(nullptr, 0, nullptr);256return 1;257}258return FXTopWindow::onKeyPress(o, sel, ptr);259}260261262long263GUIDialog_ViewSettings::onCmdNameChange(FXObject*, FXSelector, void* ptr) {264if (ptr != nullptr) {265FXString dataS = (char*) ptr; // !!!unicode266// check whether this item has been added twice267if (dataS.text() == mySchemeName->getItemText(mySchemeName->getNumItems() - 1)) {268for (int i = 0; i < mySchemeName->getNumItems() - 1; ++i) {269if (dataS.text() == mySchemeName->getItemText(i)) {270mySchemeName->removeItem(i);271}272}273}274myBackup.copy(gSchemeStorage.get(dataS.text()));275mySettings = &gSchemeStorage.get(dataS.text());276}277myBackgroundColor->setRGBA(MFXUtils::getFXColor(mySettings->backgroundColor));278279myBusStopColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.busStopColor));280myBusStopColorSign->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.busStopColorSign));281myTrainStopColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.trainStopColor));282myTrainStopColorSign->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.trainStopColorSign));283myContainerStopColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.containerStopColor));284myContainerStopColorSign->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.containerStopColorSign));285myChargingStationColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.chargingStationColor));286myChargingStationColorSign->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.chargingStationColorSign));287if (mySettings->netedit) {288myStopColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.stopColor));289myWaypointColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.waypointColor));290myVehicleTripsColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.vehicleTripColor));291myStopPersonsColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.stopPersonColor));292myPersonTripColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.personTripColor));293myWalkColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.walkColor));294myRideColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.rideColor));295myStopContainersColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.stopContainerColor));296myTransportColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.transportColor));297myTranshipColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.transhipColor));298299myTripWidth->setValue(mySettings->widthSettings.tripWidth);300myPersonTripWidth->setValue(mySettings->widthSettings.personTripWidth);301myWalkWidth->setValue(mySettings->widthSettings.walkWidth);302myRideWidth->setValue(mySettings->widthSettings.rideWidth);303myTransportWidth->setValue(mySettings->widthSettings.transportWidth);304myTranshipWidth->setValue(mySettings->widthSettings.transhipWidth);305306mySelectionColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectionColor));307mySelectedEdgeColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedEdgeColor));308mySelectedLaneColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedLaneColor));309mySelectedConnectionColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedConnectionColor));310mySelectedProhibitionColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedProhibitionColor));311mySelectedCrossingColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedCrossingColor));312mySelectedAdditionalColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedAdditionalColor));313mySelectedRouteColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedRouteColor));314mySelectedVehicleColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedVehicleColor));315mySelectedPersonColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedPersonColor));316mySelectedPersonPlanColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedPersonPlanColor));317mySelectedEdgeDataColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedEdgeDataColor));318319myDataValuePanel->update(mySettings->dataValue);320myDataColorMode->setCurrentItem((FXint) mySettings->dataColorer.getActive());321myDataScaleMode->setCurrentItem((FXint) mySettings->dataScaler.getActive());322myEdgeRelationUpscaleDialer->setValue(mySettings->edgeRelWidthExaggeration);323myTazRelationUpscaleDialer->setValue(mySettings->tazRelWidthExaggeration);324myDataRainbowPanel->update(mySettings->dataValueRainBow);325}326327myLaneEdgeColorMode->setCurrentItem((FXint) mySettings->getLaneEdgeMode());328myLaneEdgeScaleMode->setCurrentItem((FXint) mySettings->getLaneEdgeScaleMode());329myShowLaneBorders->setCheck(mySettings->laneShowBorders);330myShowBikeMarkings->setCheck(mySettings->showBikeMarkings);331myShowLaneDecals->setCheck(mySettings->showLinkDecals);332myRealisticLinkRules->setCheck(mySettings->realisticLinkRules);333myShowLinkRules->setCheck(mySettings->showLinkRules);334myShowRails->setCheck(mySettings->showRails);335mySecondaryShape->setCheck(mySettings->secondaryShape);336myEdgeNamePanel->update(mySettings->edgeName);337myInternalEdgeNamePanel->update(mySettings->internalEdgeName);338myCwaEdgeNamePanel->update(mySettings->cwaEdgeName);339myStreetNamePanel->update(mySettings->streetName);340myEdgeValuePanel->update(mySettings->edgeValue);341myEdgeScaleValuePanel->update(mySettings->edgeScaleValue);342myHideMacroConnectors->setCheck(mySettings->hideConnectors);343myShowLaneDirection->setCheck(mySettings->showLaneDirection);344myShowSublanes->setCheck(mySettings->showSublanes);345mySpreadSuperposed->setCheck(mySettings->spreadSuperposed);346myDisableHideByZoom->setCheck(mySettings->disableHideByZoom);347myEdgeRainbowPanel->update(mySettings->edgeValueRainBow);348myLaneWidthUpscaleDialer->setValue(mySettings->laneWidthExaggeration);349myLaneMinWidthDialer->setValue(mySettings->laneMinSize);350351myVehicleColorMode->setCurrentItem((FXint) mySettings->vehicleColorer.getActive());352myVehicleScaleMode->setCurrentItem((FXint) mySettings->vehicleScaler.getActive());353myVehicleShapeDetail->setCurrentItem(mySettings->vehicleQuality);354myShowBlinker->setCheck(mySettings->showBlinker);355myShowMinGap->setCheck(mySettings->drawMinGap);356myShowBrakeGap->setCheck(mySettings->drawBrakeGap);357myShowBTRange->setCheck(mySettings->showBTRange);358myShowRouteIndex->setCheck(mySettings->showRouteIndex);359myScaleLength->setCheck(mySettings->scaleLength);360myDrawReversed->setCheck(mySettings->drawReversed);361myShowParkingInfo->setCheck(mySettings->showParkingInfo);362myShowChargingInfo->setCheck(mySettings->showChargingInfo);363/*364myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);365*/366myVehicleNamePanel->update(mySettings->vehicleName);367myVehicleValuePanel->update(mySettings->vehicleValue);368myVehicleScaleValuePanel->update(mySettings->vehicleScaleValue);369myVehicleTextPanel->update(mySettings->vehicleText);370myVehicleSizePanel->update(mySettings->vehicleSize);371myVehicleRainbowPanel->update(mySettings->vehicleValueRainBow);372373myPersonColorMode->setCurrentItem((FXint) mySettings->personColorer.getActive());374myPersonShapeDetail->setCurrentItem(mySettings->personQuality);375myPersonNamePanel->update(mySettings->personName);376myPersonValuePanel->update(mySettings->personValue);377myPersonSizePanel->update(mySettings->personSize);378379myContainerColorMode->setCurrentItem((FXint) mySettings->containerColorer.getActive());380myContainerShapeDetail->setCurrentItem(mySettings->containerQuality);381myContainerNamePanel->update(mySettings->containerName);382myContainerSizePanel->update(mySettings->containerSize);383384myJunctionColorMode->setCurrentItem((FXint) mySettings->junctionColorer.getActive());385myTLIndexPanel->update(mySettings->drawLinkTLIndex);386myJunctionIndexPanel->update(mySettings->drawLinkJunctionIndex);387myJunctionIDPanel->update(mySettings->junctionID);388myJunctionNamePanel->update(mySettings->junctionName);389myInternalJunctionNamePanel->update(mySettings->internalJunctionName);390myTLSPhaseIndexPanel->update(mySettings->tlsPhaseIndex);391myTLSPhaseNamePanel->update(mySettings->tlsPhaseName);392myJunctionSizePanel->update(mySettings->junctionSize);393myJunctionRainbowPanel->update(mySettings->junctionValueRainBow);394395myAddNamePanel->update(mySettings->addName);396myAddFullNamePanel->update(mySettings->addFullName);397myAddSizePanel->update(mySettings->addSize);398399myPoiDetail->setValue(mySettings->poiDetail);400myPOIUseCustomLayer->setCheck(mySettings->poiUseCustomLayer);401myPOICustomLayer->setValue(mySettings->poiCustomLayer);402myPOINamePanel->update(mySettings->poiName);403myPOITypePanel->update(mySettings->poiType);404myPOITextPanel->update(mySettings->poiText);405myPOISizePanel->update(mySettings->poiSize);406407myPolyNamePanel->update(mySettings->polyName);408myPolyTypePanel->update(mySettings->polyType);409myPolySizePanel->update(mySettings->polySize);410myPolyUseCustomLayer->setCheck(mySettings->polyUseCustomLayer);411myPolyCustomLayer->setValue(mySettings->polyCustomLayer);412413myShowLane2Lane->setCheck(mySettings->showLane2Lane);414myDrawJunctionShape->setCheck(mySettings->drawJunctionShape);415myDrawCrossingsAndWalkingAreas->setCheck(mySettings->drawCrossingsAndWalkingareas);416myDither->setCheck(mySettings->dither);417myFPS->setCheck(mySettings->fps);418myTrueZ->setCheck(mySettings->trueZ);419myDrawBoundaries->setCheck(mySettings->drawBoundaries);420myForceDrawForRectangleSelection->setCheck(mySettings->forceDrawForRectangleSelection);421myDisableDottedContours->setCheck(mySettings->disableDottedContours);422myGeometryIndicesPanel->update(mySettings->geometryIndices);423myShowSizeLegend->setCheck(mySettings->showSizeLegend);424myShowColorLegend->setCheck(mySettings->showColorLegend);425myShowVehicleColorLegend->setCheck(mySettings->showVehicleColorLegend);426427myShowPedestrianNetwork->setCheck(mySettings->showPedestrianNetwork);428myPedestrianNetworkColor->setRGBA(MFXUtils::getFXColor(mySettings->pedestrianNetworkColor));429430myParent->setColorScheme(mySettings->name);431rebuildColorMatrices(true);432433update();434myParent->update();435return 1;436}437438439bool440GUIDialog_ViewSettings::updateColorRanges(FXObject* sender, std::vector<FXColorWell*>::const_iterator colIt,441std::vector<FXColorWell*>::const_iterator colEnd,442std::vector<FXRealSpinner*>::const_iterator threshIt,443std::vector<FXRealSpinner*>::const_iterator threshEnd,444std::vector<FXButton*>::const_iterator buttonIt,445GUIColorScheme& scheme) {446UNUSED_PARAMETER(threshEnd);447int pos = 0;448while (colIt != colEnd) {449if (scheme.isFixed()) {450if (sender == *colIt) {451scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));452}453} else {454if (sender == *threshIt) {455const double val = (*threshIt)->getValue();456scheme.setThreshold(pos, val);457return false;458}459if (sender == *colIt) {460scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));461return false;462}463if (sender == *buttonIt) {464scheme.addColor(MFXUtils::getRGBColor((*colIt)->getRGBA()), (*threshIt)->getValue());465return true;466} else if (sender == *(buttonIt + 1)) {467scheme.removeColor(pos);468return true;469}470// 2 buttons per item (add / remove)471threshIt++;472buttonIt += 2;473}474++colIt;475pos++;476}477return false;478}479480481bool482GUIDialog_ViewSettings::updateScaleRanges(FXObject* sender, std::vector<FXRealSpinner*>::const_iterator scaleIt,483std::vector<FXRealSpinner*>::const_iterator scaleEnd,484std::vector<FXRealSpinner*>::const_iterator threshIt,485std::vector<FXRealSpinner*>::const_iterator threshEnd,486std::vector<FXButton*>::const_iterator buttonIt,487GUIScaleScheme& scheme) {488int pos = 0;489while (scaleIt != scaleEnd) {490if (scheme.isFixed()) {491if (sender == *scaleIt) {492scheme.setColor(pos, (*scaleIt)->getValue());493}494} else {495if (sender == *threshIt) {496const double val = (*threshIt)->getValue();497double lo, hi;498if (pos != 0) {499threshIt--;500(*threshIt)->getRange(lo, hi);501(*threshIt)->setRange(lo, val);502threshIt++;503}504threshIt++;505if (threshIt != threshEnd) {506(*threshIt)->getRange(lo, hi);507(*threshIt)->setRange(val, hi);508}509scheme.setThreshold(pos, val);510return false;511}512if (sender == *scaleIt) {513scheme.setColor(pos, (*scaleIt)->getValue());514return false;515}516if (sender == *buttonIt) {517scheme.addColor((*scaleIt)->getValue(), (*threshIt)->getValue());518return true;519} else if (sender == *(buttonIt + 1)) {520scheme.removeColor(pos);521return true;522}523threshIt++;524buttonIt += 2;525}526++scaleIt;527pos++;528}529return false;530}531532533long534GUIDialog_ViewSettings::onCmdColorChange(FXObject* sender, FXSelector, void* /*val*/) {535GUIVisualizationSettings tmpSettings(mySettings->name);536tmpSettings.copy(*mySettings);537int prevLaneMode = mySettings->getLaneEdgeMode();538int prevLaneScaleMode = mySettings->getLaneEdgeScaleMode();539int prevVehicleMode = mySettings->vehicleColorer.getActive();540int prevVehicleScaleMode = mySettings->vehicleScaler.getActive();541int prevPersonMode = mySettings->personColorer.getActive();542int prevContainerMode = mySettings->containerColorer.getActive();543int prevJunctionMode = mySettings->junctionColorer.getActive();544int prevPOIMode = mySettings->poiColorer.getActive();545int prevPolyMode = mySettings->polyColorer.getActive();546int prevDataMode = mySettings->dataColorer.getActive();547int prevDataScaleMode = mySettings->dataScaler.getActive();548bool doRebuildColorMatrices = false;549550tmpSettings.name = mySettings->name;551tmpSettings.backgroundColor = MFXUtils::getRGBColor(myBackgroundColor->getRGBA());552553// additionals554tmpSettings.colorSettings.busStopColor = MFXUtils::getRGBColor(myBusStopColor->getRGBA());555tmpSettings.colorSettings.busStopColorSign = MFXUtils::getRGBColor(myBusStopColorSign->getRGBA());556tmpSettings.colorSettings.trainStopColor = MFXUtils::getRGBColor(myTrainStopColor->getRGBA());557tmpSettings.colorSettings.trainStopColorSign = MFXUtils::getRGBColor(myTrainStopColorSign->getRGBA());558tmpSettings.colorSettings.containerStopColor = MFXUtils::getRGBColor(myContainerStopColor->getRGBA());559tmpSettings.colorSettings.containerStopColorSign = MFXUtils::getRGBColor(myContainerStopColorSign->getRGBA());560tmpSettings.colorSettings.chargingStationColor = MFXUtils::getRGBColor(myChargingStationColor->getRGBA());561tmpSettings.colorSettings.chargingStationColorSign = MFXUtils::getRGBColor(myChargingStationColorSign->getRGBA());562if (mySettings->netedit) {563tmpSettings.colorSettings.stopColor = MFXUtils::getRGBColor(myStopColor->getRGBA());564tmpSettings.colorSettings.waypointColor = MFXUtils::getRGBColor(myWaypointColor->getRGBA());565tmpSettings.colorSettings.vehicleTripColor = MFXUtils::getRGBColor(myVehicleTripsColor->getRGBA());566tmpSettings.colorSettings.stopPersonColor = MFXUtils::getRGBColor(myStopPersonsColor->getRGBA());567tmpSettings.colorSettings.personTripColor = MFXUtils::getRGBColor(myPersonTripColor->getRGBA());568tmpSettings.colorSettings.walkColor = MFXUtils::getRGBColor(myWalkColor->getRGBA());569tmpSettings.colorSettings.rideColor = MFXUtils::getRGBColor(myRideColor->getRGBA());570tmpSettings.colorSettings.stopContainerColor = MFXUtils::getRGBColor(myStopContainersColor->getRGBA());571tmpSettings.colorSettings.transportColor = MFXUtils::getRGBColor(myTransportColor->getRGBA());572tmpSettings.colorSettings.transhipColor = MFXUtils::getRGBColor(myTranshipColor->getRGBA());573574tmpSettings.widthSettings.tripWidth = myTripWidth->getValue();575tmpSettings.widthSettings.personTripWidth = myPersonTripWidth->getValue();576tmpSettings.widthSettings.walkWidth = myWalkWidth->getValue();577tmpSettings.widthSettings.rideWidth = myRideWidth->getValue();578tmpSettings.widthSettings.transportWidth = myTransportWidth->getValue();579tmpSettings.widthSettings.transhipWidth = myTranshipWidth->getValue();580581tmpSettings.colorSettings.selectionColor = MFXUtils::getRGBColor(mySelectionColor->getRGBA());582tmpSettings.colorSettings.selectedEdgeColor = MFXUtils::getRGBColor(mySelectedEdgeColor->getRGBA());583tmpSettings.colorSettings.selectedLaneColor = MFXUtils::getRGBColor(mySelectedLaneColor->getRGBA());584tmpSettings.colorSettings.selectedConnectionColor = MFXUtils::getRGBColor(mySelectedConnectionColor->getRGBA());585tmpSettings.colorSettings.selectedProhibitionColor = MFXUtils::getRGBColor(mySelectedProhibitionColor->getRGBA());586tmpSettings.colorSettings.selectedCrossingColor = MFXUtils::getRGBColor(mySelectedCrossingColor->getRGBA());587tmpSettings.colorSettings.selectedAdditionalColor = MFXUtils::getRGBColor(mySelectedAdditionalColor->getRGBA());588tmpSettings.colorSettings.selectedRouteColor = MFXUtils::getRGBColor(mySelectedRouteColor->getRGBA());589tmpSettings.colorSettings.selectedVehicleColor = MFXUtils::getRGBColor(mySelectedVehicleColor->getRGBA());590tmpSettings.colorSettings.selectedPersonColor = MFXUtils::getRGBColor(mySelectedPersonColor->getRGBA());591tmpSettings.colorSettings.selectedPersonPlanColor = MFXUtils::getRGBColor(mySelectedPersonPlanColor->getRGBA());592tmpSettings.colorSettings.selectedEdgeDataColor = MFXUtils::getRGBColor(mySelectedEdgeDataColor->getRGBA());593}594595tmpSettings.showGrid = (myShowGrid->getCheck() != FALSE);596tmpSettings.gridXSize = (double) myGridXSizeDialer->getValue();597tmpSettings.gridYSize = (double) myGridYSizeDialer->getValue();598599if (GUIVisualizationSettings::UseMesoSim) {600tmpSettings.edgeColorer.setActive(myLaneEdgeColorMode->getCurrentItem());601tmpSettings.edgeScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());602} else {603tmpSettings.laneColorer.setActive(myLaneEdgeColorMode->getCurrentItem());604tmpSettings.laneScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());605}606tmpSettings.laneShowBorders = (myShowLaneBorders->getCheck() != FALSE);607tmpSettings.showBikeMarkings = (myShowBikeMarkings->getCheck() != FALSE);608tmpSettings.showLinkDecals = (myShowLaneDecals->getCheck() != FALSE);609tmpSettings.realisticLinkRules = (myRealisticLinkRules->getCheck() != FALSE);610tmpSettings.showLinkRules = (myShowLinkRules->getCheck() != FALSE);611tmpSettings.showRails = (myShowRails->getCheck() != FALSE);612tmpSettings.secondaryShape = (mySecondaryShape->getCheck() != FALSE);613tmpSettings.edgeName = myEdgeNamePanel->getSettings();614tmpSettings.internalEdgeName = myInternalEdgeNamePanel->getSettings();615tmpSettings.cwaEdgeName = myCwaEdgeNamePanel->getSettings();616tmpSettings.streetName = myStreetNamePanel->getSettings();617tmpSettings.edgeValue = myEdgeValuePanel->getSettings();618tmpSettings.edgeScaleValue = myEdgeScaleValuePanel->getSettings();619tmpSettings.hideConnectors = (myHideMacroConnectors->getCheck() != FALSE);620tmpSettings.showLaneDirection = (myShowLaneDirection->getCheck() != FALSE);621tmpSettings.showSublanes = (myShowSublanes->getCheck() != FALSE);622tmpSettings.spreadSuperposed = (mySpreadSuperposed->getCheck() != FALSE);623tmpSettings.disableHideByZoom = (myDisableHideByZoom->getCheck() != FALSE);624if (sender == myParamKey) {625if (tmpSettings.getLaneEdgeScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_EDGE_PARAM_NUMERICAL) {626tmpSettings.edgeParam = myParamKey->getText().text();627} else if (tmpSettings.getLaneEdgeScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_LANE_PARAM_NUMERICAL) {628tmpSettings.laneParam = myParamKey->getText().text();629} else if (tmpSettings.getLaneEdgeScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {630tmpSettings.edgeData = myParamKey->getText().text();631} else if (tmpSettings.getLaneEdgeScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_LIVE) {632tmpSettings.edgeData = myParamKey->getText().text();633}634} else if (sender == myScalingParamKey) {635if (tmpSettings.getLaneEdgeScaleScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {636tmpSettings.edgeDataScaling = myScalingParamKey->getText().text();637}638} else if (sender == myVehicleParamKey) {639if (tmpSettings.vehicleColorer.getScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_PARAM_NUMERICAL) {640tmpSettings.vehicleParam = myVehicleParamKey->getText().text();641}642} else if (sender == myVehicleScalingParamKey) {643if (tmpSettings.vehicleScaler.getScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_PARAM_NUMERICAL) {644tmpSettings.vehicleScaleParam = myVehicleScalingParamKey->getText().text();645}646} else if (sender == myDataParamKey) {647if (tmpSettings.dataColorer.getScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL) {648tmpSettings.relDataAttr = myDataParamKey->getText().text();649}650} else if (sender == myDataScaleParamKey) {651if (tmpSettings.dataScaler.getScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL) {652tmpSettings.relDataScaleAttr = myDataScaleParamKey->getText().text();653}654} else if (sender == myVehicleTextPanel->myCheck) {655updateVehicleParams();656} else if (sender == myVehicleTextParamKey) {657tmpSettings.vehicleTextParam = myVehicleTextParamKey->getText().text();658} else if (sender == myPOITextPanel->myCheck) {659updatePOIParams();660} else if (sender == myPOITextParamKey) {661tmpSettings.poiTextParam = myPOITextParamKey->getText().text();662} else if (sender == myMeanDataID) {663tmpSettings.edgeDataID = myMeanDataID->getText().text();664}665tmpSettings.edgeValueRainBow = myEdgeRainbowPanel->getSettings();666tmpSettings.laneWidthExaggeration = myLaneWidthUpscaleDialer->getValue();667tmpSettings.laneMinSize = myLaneMinWidthDialer->getValue();668669tmpSettings.vehicleColorer.setActive(myVehicleColorMode->getCurrentItem());670tmpSettings.vehicleScaler.setActive(myVehicleScaleMode->getCurrentItem());671tmpSettings.vehicleQuality = myVehicleShapeDetail->getCurrentItem();672tmpSettings.showBlinker = (myShowBlinker->getCheck() != FALSE);673tmpSettings.drawMinGap = (myShowMinGap->getCheck() != FALSE);674tmpSettings.drawBrakeGap = (myShowBrakeGap->getCheck() != FALSE);675tmpSettings.showBTRange = (myShowBTRange->getCheck() != FALSE);676tmpSettings.showRouteIndex = (myShowRouteIndex->getCheck() != FALSE);677tmpSettings.scaleLength = (myScaleLength->getCheck() != FALSE);678tmpSettings.drawReversed = (myDrawReversed->getCheck() != FALSE);679tmpSettings.showParkingInfo = (myShowParkingInfo->getCheck() != FALSE);680tmpSettings.showChargingInfo = (myShowChargingInfo->getCheck() != FALSE);681/*682tmpSettings.drawLaneChangePreference = (myShowLaneChangePreference->getCheck() != FALSE);683*/684tmpSettings.vehicleName = myVehicleNamePanel->getSettings();685tmpSettings.vehicleValue = myVehicleValuePanel->getSettings();686tmpSettings.vehicleScaleValue = myVehicleScaleValuePanel->getSettings();687tmpSettings.vehicleText = myVehicleTextPanel->getSettings();688tmpSettings.vehicleSize = myVehicleSizePanel->getSettings();689tmpSettings.vehicleValueRainBow = myVehicleRainbowPanel->getSettings();690691tmpSettings.personColorer.setActive(myPersonColorMode->getCurrentItem());692tmpSettings.personQuality = myPersonShapeDetail->getCurrentItem();693tmpSettings.personName = myPersonNamePanel->getSettings();694tmpSettings.personValue = myPersonValuePanel->getSettings();695tmpSettings.personSize = myPersonSizePanel->getSettings();696697tmpSettings.containerColorer.setActive(myContainerColorMode->getCurrentItem());698tmpSettings.containerQuality = myContainerShapeDetail->getCurrentItem();699tmpSettings.containerName = myContainerNamePanel->getSettings();700tmpSettings.containerSize = myContainerSizePanel->getSettings();701702tmpSettings.junctionColorer.setActive(myJunctionColorMode->getCurrentItem());703tmpSettings.drawLinkTLIndex = myTLIndexPanel->getSettings();704tmpSettings.drawLinkJunctionIndex = myJunctionIndexPanel->getSettings();705tmpSettings.junctionID = myJunctionIDPanel->getSettings();706tmpSettings.junctionName = myJunctionNamePanel->getSettings();707tmpSettings.internalJunctionName = myInternalJunctionNamePanel->getSettings();708tmpSettings.tlsPhaseIndex = myTLSPhaseIndexPanel->getSettings();709tmpSettings.tlsPhaseName = myTLSPhaseNamePanel->getSettings();710tmpSettings.junctionSize = myJunctionSizePanel->getSettings();711tmpSettings.junctionValueRainBow = myJunctionRainbowPanel->getSettings();712713tmpSettings.addName = myAddNamePanel->getSettings();714tmpSettings.addFullName = myAddFullNamePanel->getSettings();715tmpSettings.addSize = myAddSizePanel->getSettings();716717tmpSettings.poiColorer.setActive(myPOIColorMode->getCurrentItem());718tmpSettings.poiDetail = myPoiDetail->getValue();719tmpSettings.poiName = myPOINamePanel->getSettings();720tmpSettings.poiType = myPOITypePanel->getSettings();721tmpSettings.poiText = myPOITextPanel->getSettings();722tmpSettings.poiSize = myPOISizePanel->getSettings();723tmpSettings.poiUseCustomLayer = myPOIUseCustomLayer->getCheck() != FALSE;724tmpSettings.poiCustomLayer = myPOICustomLayer->getValue();725726tmpSettings.polyColorer.setActive(myPolyColorMode->getCurrentItem());727tmpSettings.polyName = myPolyNamePanel->getSettings();728tmpSettings.polyType = myPolyTypePanel->getSettings();729tmpSettings.polySize = myPolySizePanel->getSettings();730tmpSettings.polyUseCustomLayer = myPolyUseCustomLayer->getCheck() != FALSE;731tmpSettings.polyCustomLayer = myPolyCustomLayer->getValue();732733if (mySettings->netedit) {734tmpSettings.dataValue = myDataValuePanel->getSettings();735tmpSettings.dataColorer.setActive(myDataColorMode->getCurrentItem());736tmpSettings.dataScaler.setActive(myDataScaleMode->getCurrentItem());737tmpSettings.dataValue = myDataValuePanel->getSettings();738tmpSettings.tazRelWidthExaggeration = myTazRelationUpscaleDialer->getValue();739tmpSettings.edgeRelWidthExaggeration = myEdgeRelationUpscaleDialer->getValue();740tmpSettings.dataValueRainBow = myDataRainbowPanel->getSettings();741}742743tmpSettings.showLane2Lane = (myShowLane2Lane->getCheck() != FALSE);744tmpSettings.drawJunctionShape = (myDrawJunctionShape->getCheck() != FALSE);745tmpSettings.drawCrossingsAndWalkingareas = (myDrawCrossingsAndWalkingAreas->getCheck() != FALSE);746tmpSettings.dither = (myDither->getCheck() != FALSE);747tmpSettings.fps = (myFPS->getCheck() != FALSE);748tmpSettings.trueZ = (myTrueZ->getCheck() != FALSE);749tmpSettings.drawBoundaries = (myDrawBoundaries->getCheck() != FALSE);750tmpSettings.forceDrawForRectangleSelection = (myForceDrawForRectangleSelection->getCheck() != FALSE);751tmpSettings.disableDottedContours = (myDisableDottedContours->getCheck() != FALSE);752tmpSettings.geometryIndices = myGeometryIndicesPanel->getSettings();753tmpSettings.showSizeLegend = (myShowSizeLegend->getCheck() != FALSE);754tmpSettings.showColorLegend = (myShowColorLegend->getCheck() != FALSE);755tmpSettings.showVehicleColorLegend = (myShowVehicleColorLegend->getCheck() != FALSE);756tmpSettings.ignoreColorSchemeFor3DVehicles = (myIgnoreColorSchemeFor3DVehicles->getCheck() != FALSE);757tmpSettings.show3DTLSDomes = (myShow3DTLSDomes->getCheck() != FALSE);758tmpSettings.show3DTLSLinkMarkers = (myShow3DTLSLinkMarkers->getCheck() != FALSE);759tmpSettings.show3DHeadUpDisplay = (myShow3DHeadUpDisplay->getCheck() != FALSE);760tmpSettings.generate3DTLSModels = (myGenerate3DTLSModels->getCheck() != FALSE);761const unsigned char lightFactor = (unsigned char)myLight3DFactor->getValue();762tmpSettings.ambient3DLight.set(lightFactor / 2, lightFactor / 2, lightFactor / 2, 255);763tmpSettings.diffuse3DLight.set(lightFactor, lightFactor, lightFactor, 255);764tmpSettings.skyColor = MFXUtils::getRGBColor(mySkyColor->getRGBA());765766// lanes (colors)767if (sender == myEdgeRainbowPanel->myColorRainbow) {768myParent->buildColorRainbow(tmpSettings, tmpSettings.getLaneEdgeScheme(), tmpSettings.getLaneEdgeMode(), GLO_LANE, myEdgeRainbowPanel->getSettings());769doRebuildColorMatrices = true;770} else if (sender == myJunctionRainbowPanel->myColorRainbow) {771myParent->buildColorRainbow(tmpSettings, tmpSettings.junctionColorer.getScheme(), tmpSettings.junctionColorer.getActive(), GLO_JUNCTION, myJunctionRainbowPanel->getSettings());772doRebuildColorMatrices = true;773} else if (sender == myVehicleRainbowPanel->myColorRainbow) {774myParent->buildColorRainbow(tmpSettings, tmpSettings.vehicleColorer.getScheme(), tmpSettings.vehicleColorer.getActive(), GLO_VEHICLE, myVehicleRainbowPanel->getSettings());775doRebuildColorMatrices = true;776} else if (myDataRainbowPanel && sender == myDataRainbowPanel->myColorRainbow) {777myParent->buildColorRainbow(tmpSettings, tmpSettings.dataColorer.getScheme(), tmpSettings.dataColorer.getActive(), GLO_TAZRELDATA, myDataRainbowPanel->getSettings());778doRebuildColorMatrices = true;779}780if (tmpSettings.getLaneEdgeMode() == prevLaneMode) {781if (updateColorRanges(sender, myLaneColors.begin(), myLaneColors.end(),782myLaneThresholds.begin(), myLaneThresholds.end(), myLaneButtons.begin(),783tmpSettings.getLaneEdgeScheme())) {784doRebuildColorMatrices = true;785}786if (sender == myLaneColorInterpolation) {787tmpSettings.getLaneEdgeScheme().setInterpolated(myLaneColorInterpolation->getCheck() != FALSE);788doRebuildColorMatrices = true;789}790} else {791doRebuildColorMatrices = true;792}793// lanes (scaling)794if (tmpSettings.getLaneEdgeScaleMode() == prevLaneScaleMode) {795if (updateScaleRanges(sender, myLaneScales.begin(), myLaneScales.end(),796myLaneScaleThresholds.begin(), myLaneScaleThresholds.end(), myLaneScaleButtons.begin(),797tmpSettings.getLaneEdgeScaleScheme())) {798doRebuildColorMatrices = true;799}800if (sender == myLaneScaleInterpolation) {801tmpSettings.getLaneEdgeScaleScheme().setInterpolated(myLaneScaleInterpolation->getCheck() != FALSE);802doRebuildColorMatrices = true;803}804} else {805doRebuildColorMatrices = true;806}807// vehicles808if (tmpSettings.vehicleColorer.getActive() == prevVehicleMode) {809if (updateColorRanges(sender, myVehicleColors.begin(), myVehicleColors.end(),810myVehicleThresholds.begin(), myVehicleThresholds.end(), myVehicleButtons.begin(),811tmpSettings.vehicleColorer.getScheme())) {812doRebuildColorMatrices = true;813}814if (sender == myVehicleColorInterpolation) {815tmpSettings.vehicleColorer.getScheme().setInterpolated(myVehicleColorInterpolation->getCheck() != FALSE);816doRebuildColorMatrices = true;817}818} else {819doRebuildColorMatrices = true;820}821// vehicles (scaling)822if (tmpSettings.vehicleScaler.getActive() == prevVehicleScaleMode) {823if (updateScaleRanges(sender, myVehicleScales.begin(), myVehicleScales.end(),824myVehicleScaleThresholds.begin(), myVehicleScaleThresholds.end(), myVehicleScaleButtons.begin(),825tmpSettings.vehicleScaler.getScheme())) {826doRebuildColorMatrices = true;827}828if (sender == myVehicleScaleInterpolation) {829tmpSettings.vehicleScaler.getScheme().setInterpolated(myVehicleScaleInterpolation->getCheck() != FALSE);830doRebuildColorMatrices = true;831}832} else {833doRebuildColorMatrices = true;834}835// persons836if (tmpSettings.personColorer.getActive() == prevPersonMode) {837if (updateColorRanges(sender, myPersonColors.begin(), myPersonColors.end(),838myPersonThresholds.begin(), myPersonThresholds.end(), myPersonButtons.begin(),839tmpSettings.personColorer.getScheme())) {840doRebuildColorMatrices = true;841}842if (sender == myPersonColorInterpolation) {843tmpSettings.personColorer.getScheme().setInterpolated(myPersonColorInterpolation->getCheck() != FALSE);844doRebuildColorMatrices = true;845}846} else {847doRebuildColorMatrices = true;848}849// containers850if (tmpSettings.containerColorer.getActive() == prevContainerMode) {851if (updateColorRanges(sender, myContainerColors.begin(), myContainerColors.end(),852myContainerThresholds.begin(), myContainerThresholds.end(), myContainerButtons.begin(),853tmpSettings.containerColorer.getScheme())) {854doRebuildColorMatrices = true;855}856if (sender == myContainerColorInterpolation) {857tmpSettings.containerColorer.getScheme().setInterpolated(myContainerColorInterpolation->getCheck() != FALSE);858doRebuildColorMatrices = true;859}860} else {861doRebuildColorMatrices = true;862}863// junctions864if (tmpSettings.junctionColorer.getActive() == prevJunctionMode) {865if (updateColorRanges(sender, myJunctionColors.begin(), myJunctionColors.end(),866myJunctionThresholds.begin(), myJunctionThresholds.end(), myJunctionButtons.begin(),867tmpSettings.junctionColorer.getScheme())) {868doRebuildColorMatrices = true;869}870if (sender == myJunctionColorInterpolation) {871tmpSettings.junctionColorer.getScheme().setInterpolated(myJunctionColorInterpolation->getCheck() != FALSE);872doRebuildColorMatrices = true;873}874} else {875doRebuildColorMatrices = true;876}877// POIs878if (tmpSettings.poiColorer.getActive() == prevPOIMode) {879if (updateColorRanges(sender, myPOIColors.begin(), myPOIColors.end(),880myPOIThresholds.begin(), myPOIThresholds.end(), myPOIButtons.begin(),881tmpSettings.poiColorer.getScheme())) {882doRebuildColorMatrices = true;883}884if (sender == myPOIColorInterpolation) {885tmpSettings.poiColorer.getScheme().setInterpolated(myPOIColorInterpolation->getCheck() != FALSE);886doRebuildColorMatrices = true;887}888} else {889doRebuildColorMatrices = true;890}891// polygons892if (tmpSettings.polyColorer.getActive() == prevPolyMode) {893if (updateColorRanges(sender, myPolyColors.begin(), myPolyColors.end(),894myPolyThresholds.begin(), myPolyThresholds.end(), myPolyButtons.begin(),895tmpSettings.polyColorer.getScheme())) {896doRebuildColorMatrices = true;897}898if (sender == myPolyColorInterpolation) {899tmpSettings.polyColorer.getScheme().setInterpolated(myPolyColorInterpolation->getCheck() != FALSE);900doRebuildColorMatrices = true;901}902} else {903doRebuildColorMatrices = true;904}905// data906if (tmpSettings.netedit) {907if (tmpSettings.dataColorer.getActive() == prevDataMode) {908if (updateColorRanges(sender, myDataColors.begin(), myDataColors.end(),909myDataThresholds.begin(), myDataThresholds.end(), myDataButtons.begin(),910tmpSettings.dataColorer.getScheme())) {911doRebuildColorMatrices = true;912}913if (sender == myDataColorInterpolation) {914tmpSettings.dataColorer.getScheme().setInterpolated(myDataColorInterpolation->getCheck() != FALSE);915doRebuildColorMatrices = true;916}917} else {918doRebuildColorMatrices = true;919}920// vehicles (scaling)921if (tmpSettings.dataScaler.getActive() == prevDataScaleMode) {922if (updateScaleRanges(sender, myDataScales.begin(), myDataScales.end(),923myDataScaleThresholds.begin(), myDataScaleThresholds.end(), myDataScaleButtons.begin(),924tmpSettings.dataScaler.getScheme())) {925doRebuildColorMatrices = true;926}927if (sender == myDataScaleInterpolation) {928tmpSettings.dataScaler.getScheme().setInterpolated(myDataScaleInterpolation->getCheck() != FALSE);929doRebuildColorMatrices = true;930}931} else {932doRebuildColorMatrices = true;933}934}935// openGL936if (sender == myRecalculateBoundaries) {937myParent->recalculateBoundaries();938}939940if (sender == myShowPedestrianNetwork) {941tmpSettings.showPedestrianNetwork = (myShowPedestrianNetwork->getCheck() != FALSE);942myParent->drawPedestrianNetwork(tmpSettings);943}944945if (sender == myPedestrianNetworkColor) {946tmpSettings.pedestrianNetworkColor = MFXUtils::getRGBColor(myPedestrianNetworkColor->getRGBA());947myParent->changePedestrianNetworkColor(tmpSettings);948}949950if (tmpSettings == *mySettings) {951return 1;952}953954int index = mySchemeName->getCurrentItem();955if (index < (int) gSchemeStorage.getNumInitialSettings()) {956// one of the initial settings is modified957// every time this happens we create a new scheme958int suffix = 1;959while (gSchemeStorage.contains("custom_" + toString(suffix))) {960suffix++;961}962tmpSettings.name = "custom_" + toString(suffix);963// the newly created settings must be entered in several places:964// - the comboBox mySchemeName of this dialog965// - the comboBox of the parent view (set as active)966// - the comboBox of all other views (only append) XXX @todo967index = mySchemeName->appendIconItem(tmpSettings.name.c_str());968mySchemeName->setCurrentItem(index);969myParent->getColoringSchemesCombo()->appendIconItem(tmpSettings.name.c_str());970}971myParent->getColoringSchemesCombo()->setCurrentItem(972myParent->getColoringSchemesCombo()->findItem(tmpSettings.name.c_str()));973gSchemeStorage.add(tmpSettings); // overwrites existing974mySettings = &gSchemeStorage.get(tmpSettings.name);975myParent->setColorScheme(tmpSettings.name);976977if (doRebuildColorMatrices) {978rebuildColorMatrices(true);979}980myParent->handle(this, FXSEL(SEL_CHANGED, MID_SIMPLE_VIEW_COLORCHANGE), nullptr);981myParent->forceRefresh();982getApp()->forceRefresh();983return 1;984}985986987void988GUIDialog_ViewSettings::loadSettings(const std::string& file) {989GUISettingsHandler handler(file, true, mySettings->netedit);990for (std::string settingsName : handler.addSettings(myParent)) {991FXint index = mySchemeName->appendIconItem(settingsName.c_str());992mySchemeName->setCurrentItem(index);993mySettings = &gSchemeStorage.get(settingsName);994}995if (handler.hasDecals()) {996myParent->getDecalsLockMutex().lock();997myParent->getDecals() = handler.getDecals();998myDecalsTable->fillTable();999myParent->update();1000myParent->getDecalsLockMutex().unlock();1001}1002if (handler.getDelay() >= 0) {1003myParent->setDelay(handler.getDelay());1004}1005if (handler.getBreakpoints().size() > 0) {1006myParent->setBreakpoints(handler.getBreakpoints());1007}1008handler.applyViewport(myParent);1009onCmdNameChange(nullptr, 0, nullptr);1010}101110121013void1014GUIDialog_ViewSettings::saveDecals(OutputDevice& dev) const {1015for (const auto& decal : myParent->getDecals()) {1016// only save decals with non empty filename1017if (decal.filename.size() > 0) {1018// check if decal is a light1019const bool isLight = (decal.filename.substr(0, 5) == "light") && (decal.filename.length() == 6) && isdigit(decal.filename[5]);1020if (isLight) {1021dev.openTag(SUMO_TAG_VIEWSETTINGS_LIGHT);1022dev.writeAttr(SUMO_ATTR_INDEX, decal.filename.substr(5, 1));1023} else {1024dev.openTag(SUMO_TAG_VIEWSETTINGS_DECAL);1025dev.writeAttr("file", decal.filename);1026dev.writeAttr("screenRelative", decal.screenRelative);1027}1028dev.writeAttr(SUMO_ATTR_CENTER_X, decal.centerX);1029dev.writeAttr(SUMO_ATTR_CENTER_Y, decal.centerY);1030dev.writeAttr(SUMO_ATTR_CENTER_Z, decal.centerZ);1031dev.writeAttr(SUMO_ATTR_WIDTH, decal.width);1032dev.writeAttr(SUMO_ATTR_HEIGHT, decal.height);1033dev.writeAttr("altitude", decal.altitude);1034dev.writeAttr("rotation", decal.rot);1035dev.writeAttr("tilt", decal.tilt);1036dev.writeAttr("roll", decal.roll);1037dev.writeAttr(SUMO_ATTR_LAYER, decal.layer);1038dev.closeTag();1039}1040}1041}104210431044void1045GUIDialog_ViewSettings::loadDecals(const std::string& file) {1046myParent->getDecalsLockMutex().lock();1047GUISettingsHandler handler(file);1048if (handler.hasDecals()) {1049myParent->getDecals() = handler.getDecals();1050}1051myDecalsTable->fillTable();1052myParent->update();1053myParent->getDecalsLockMutex().unlock();1054}105510561057long1058GUIDialog_ViewSettings::onCmdSaveSetting(FXObject*, FXSelector, void* /*data*/) {1059int index = mySchemeName->getCurrentItem();1060if (index < (int) gSchemeStorage.getNumInitialSettings()) {1061return 1;1062}1063// get the name1064std::string name = "";1065while (name.length() == 0) {1066FXDialogBox dialog(this, TL("Enter a name"), GUIDesignViewSettingsDialog);1067FXVerticalFrame* content = new FXVerticalFrame(&dialog, GUIDesignViewSettingsVerticalFrame5);1068new FXLabel(content, TL("Please enter an alphanumeric name: "), nullptr, GUIDesignViewSettingsLabel2);1069FXTextField* text = new FXTextField(content, 40, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsTextField1);1070new FXHorizontalSeparator(content, GUIDesignHorizontalSeparator);1071FXHorizontalFrame* buttons = new FXHorizontalFrame(content, GUIDesignViewSettingsHorizontalFrame3);1072GUIDesigns::buildFXButton(buttons, TL("&OK"), "", "", nullptr, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsButton4);1073GUIDesigns::buildFXButton(buttons, TL("&Cancel"), "", "", nullptr, &dialog, FXDialogBox::ID_CANCEL, GUIDesignViewSettingsButton5);1074dialog.create();1075text->setFocus();1076if (!dialog.execute()) {1077return 1;1078}1079name = text->getText().text();1080for (int i = 0; i < (int)name.length(); ++i) {1081if (name[i] != '_' && (name[i] < 'a' || name[i] > 'z') && (name[i] < 'A' || name[i] > 'Z') && (name[i] < '0' || name[i] > '9')) {1082name = "";1083break;1084}1085}1086}1087GUIVisualizationSettings tmpSettings(mySettings->name, mySettings->netedit);1088tmpSettings.copy(*mySettings);1089tmpSettings.name = name;1090if (name == mySettings->name || StringUtils::startsWith(mySettings->name, "custom_")) {1091gSchemeStorage.remove(mySettings->name);1092mySchemeName->removeItem(index);1093myParent->getColoringSchemesCombo()->removeItem(index);1094myParent->getColoringSchemesCombo()->insertIconItem(index, name.c_str());1095} else {1096gSchemeStorage.get(mySettings->name).copy(myBackup);1097index = mySchemeName->appendIconItem(name.c_str());1098myParent->getColoringSchemesCombo()->appendIconItem(name.c_str());1099myParent->getColoringSchemesCombo()->setCurrentItem(1100myParent->getColoringSchemesCombo()->findItem(name.c_str()));1101}1102gSchemeStorage.add(tmpSettings);1103mySchemeName->insertIconItem(index, name.c_str());1104myParent->setColorScheme(name);1105mySettings = &gSchemeStorage.get(name);1106myBackup.copy(*mySettings);1107gSchemeStorage.writeSettings(getApp());1108return 1;1109}111011111112long1113GUIDialog_ViewSettings::onUpdSaveSetting(FXObject* sender, FXSelector, void* ptr) {1114sender->handle(this,1115mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()1116? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),1117ptr);1118return 1;1119}112011211122long1123GUIDialog_ViewSettings::onCmdDeleteSetting(FXObject*, FXSelector, void* /*data*/) {1124int index = mySchemeName->getCurrentItem();1125if (index < (int) gSchemeStorage.getNumInitialSettings()) {1126return 1;1127}1128std::string name = mySchemeName->getItemText(index);1129gSchemeStorage.remove(name);1130mySchemeName->removeItem(index);1131myParent->getColoringSchemesCombo()->removeItem(index);1132onCmdNameChange(nullptr, 0, (void*) mySchemeName->getItemText(0).c_str());1133gSchemeStorage.writeSettings(getApp());1134return 1;1135}113611371138long1139GUIDialog_ViewSettings::onUpdDeleteSetting(FXObject* sender, FXSelector, void* ptr) {1140sender->handle(this,1141mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()1142? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),1143ptr);1144return 1;1145}114611471148long1149GUIDialog_ViewSettings::onCmdExportSetting(FXObject*, FXSelector, void* /*data*/) {1150FXString file = MFXUtils::getFilename2Write(this, TL("Export view settings"),1151SUMOXMLDefinitions::XMLFileExtensions.getMultilineString().c_str(),1152GUIIconSubSys::getIcon(GUIIcon::SAVE), gCurrentFolder);1153if (file == "") {1154return 1;1155}1156try {1157OutputDevice& dev = OutputDevice::getDevice(file.text(), false);1158dev.openTag(SUMO_TAG_VIEWSETTINGS);1159if (myParent->is3DView()) {1160dev.writeAttr(SUMO_ATTR_TYPE, "osg");1161}1162mySettings->save(dev);1163if (mySaveViewPort->getCheck()) {1164myParent->getViewportEditor()->writeXML(dev);1165}1166if (mySaveDelay->getCheck()) {1167dev.openTag(SUMO_TAG_DELAY);1168dev.writeAttr(SUMO_ATTR_VALUE, myParent->getDelay());1169dev.closeTag();1170}1171if (mySaveDecals->getCheck()) {1172saveDecals(dev);1173}1174if (!mySettings->netedit && mySaveBreakpoints->getCheck()) {1175for (SUMOTime t : myParent->retrieveBreakpoints()) {1176dev.openTag(SUMO_TAG_BREAKPOINT);1177dev.writeAttr(SUMO_ATTR_TIME, time2string(t));1178dev.closeTag();1179}1180}1181dev.closeTag();1182dev.close();1183} catch (IOError& e) {1184FXMessageBox::error(this, MBOX_OK, TL("Storing failed!"), "%s", e.what());1185}1186return 1;1187}118811891190long1191GUIDialog_ViewSettings::onUpdExportSetting(FXObject* sender, FXSelector, void* ptr) {1192sender->handle(this,1193(mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()1194&& !mySaveViewPort->getCheck() && !mySaveDelay->getCheck() && !mySaveDecals->getCheck() && !mySaveBreakpoints->getCheck()) ?1195FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),1196ptr);1197return 1;1198}119912001201long1202GUIDialog_ViewSettings::onCmdImportSetting(FXObject*, FXSelector, void* /*data*/) {1203FXFileDialog opendialog(this, TL("Import view settings"));1204opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::OPEN));1205opendialog.setSelectMode(SELECTFILE_ANY);1206opendialog.setPatternList(SUMOXMLDefinitions::ViewSettingsFileExtensions.getMultilineString().c_str());1207if (gCurrentFolder.length() != 0) {1208opendialog.setDirectory(gCurrentFolder);1209}1210if (opendialog.execute()) {1211gCurrentFolder = opendialog.getDirectory();1212loadSettings(opendialog.getFilename().text());1213}1214return 1;1215}121612171218long1219GUIDialog_ViewSettings::onCmdLoadDecal(FXObject*, FXSelector, void* /*data*/) {1220FXFileDialog opendialog(this, TL("Load Decals"));1221opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY));1222opendialog.setSelectMode(SELECTFILE_ANY);1223opendialog.setPatternList(SUMOXMLDefinitions::ViewSettingsFileExtensions.getMultilineString().c_str());1224if (gCurrentFolder.length() != 0) {1225opendialog.setDirectory(gCurrentFolder);1226}1227if (opendialog.execute()) {1228gCurrentFolder = opendialog.getDirectory();1229loadDecals(opendialog.getFilename().text());1230}1231return 1;1232}123312341235long1236GUIDialog_ViewSettings::onCmdLoadXMLDecals(FXObject*, FXSelector, void* /*data*/) {1237FXFileDialog opendialog(this, TL("Load Decals"));1238opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY));1239opendialog.setSelectMode(SELECTFILE_ANY);1240opendialog.setPatternList(SUMOXMLDefinitions::ViewSettingsFileExtensions.getMultilineString().c_str());1241if (gCurrentFolder.length() != 0) {1242opendialog.setDirectory(gCurrentFolder);1243}1244if (opendialog.execute()) {1245gCurrentFolder = opendialog.getDirectory();1246loadDecals(opendialog.getFilename().text());1247}1248return 1;1249}125012511252long1253GUIDialog_ViewSettings::onCmdSaveXMLDecals(FXObject*, FXSelector, void* /*data*/) {1254FXString file = MFXUtils::getFilename2Write(this, TL("Save Decals"),1255SUMOXMLDefinitions::XMLFileExtensions.getMultilineString().c_str(),1256GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder);1257if (file == "") {1258return 1;1259}1260try {1261OutputDevice& dev = OutputDevice::getDevice(file.text());1262dev.openTag("decals");1263saveDecals(dev);1264dev.closeTag();1265dev.close();1266} catch (IOError& e) {1267FXMessageBox::error(myParent, MBOX_OK, TL("Storing failed!"), "%s", e.what());1268}1269return 1;1270}127112721273long1274GUIDialog_ViewSettings::onCmdClearDecals(FXObject*, FXSelector, void* /*data*/) {1275// lock decals mutex1276myParent->getDecalsLockMutex().lock();1277// clear decals1278myParent->getDecals().clear();1279// update view1280myParent->update();1281// fill table again1282myDecalsTable->fillTable();1283// unlock decals mutex1284myParent->getDecalsLockMutex().unlock();1285return 1;1286}128712881289long1290GUIDialog_ViewSettings::onUpdImportSetting(FXObject* sender, FXSelector, void* ptr) {1291sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), ptr);1292return 1;1293}129412951296FXMatrix*1297GUIDialog_ViewSettings::rebuildColorMatrix(FXVerticalFrame* frame,1298std::vector<FXColorWell*>& colors,1299std::vector<FXRealSpinner*>& thresholds,1300std::vector<FXButton*>& buttons,1301FXCheckButton* interpolation,1302GUIColorScheme& scheme) {1303MFXUtils::deleteChildren(frame);1304FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);1305colors.clear();1306thresholds.clear();1307buttons.clear();1308const bool fixed = scheme.isFixed();1309std::vector<RGBColor>::const_iterator colIt = scheme.getColors().begin();1310std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();1311std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();1312while (colIt != scheme.getColors().end()) {1313colors.push_back(new FXColorWell(m, MFXUtils::getFXColor(*colIt), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell1));1314if (fixed) {1315new FXLabel(m, nameIt->c_str());1316new FXLabel(m, "");1317new FXLabel(m, "");1318} else {1319const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;1320FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX | dialerOptions);1321threshDialer->setValue(*threshIt);1322thresholds.push_back(threshDialer);1323if (*threshIt == GUIVisualizationSettings::MISSING_DATA) {1324threshDialer->disable();1325threshDialer->hide();1326buttons.push_back(GUIDesigns::buildFXButton(m, "", "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));1327buttons.back()->hide();1328buttons.push_back(GUIDesigns::buildFXButton(m, TL("No Data"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));1329buttons.back()->disable();1330} else {1331buttons.push_back(GUIDesigns::buildFXButton(m, TL("Add"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));1332buttons.push_back(GUIDesigns::buildFXButton(m, TL("Remove"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));1333if (scheme.getColors().size() == 1) {1334buttons.back()->disable();1335}1336}1337}1338colIt++;1339threshIt++;1340nameIt++;1341}1342interpolation->setCheck(scheme.isInterpolated());1343if (fixed) {1344interpolation->disable();1345} else {1346if (colors.size() > 1) {1347interpolation->enable();1348if (interpolation->getCheck() != FALSE) {1349thresholds.front()->enable();1350} else {1351thresholds.front()->disable();1352}1353} else {1354interpolation->disable();1355thresholds.front()->disable();1356}1357}1358return m;1359}136013611362FXMatrix*1363GUIDialog_ViewSettings::rebuildScaleMatrix(FXVerticalFrame* frame,1364std::vector<FXRealSpinner*>& scales,1365std::vector<FXRealSpinner*>& thresholds,1366std::vector<FXButton*>& buttons,1367FXCheckButton* interpolation,1368GUIScaleScheme& scheme) {1369MFXUtils::deleteChildren(frame);1370FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);1371scales.clear();1372thresholds.clear();1373buttons.clear();1374const bool fixed = scheme.isFixed();1375std::vector<double>::const_iterator scaleIt = scheme.getColors().begin();1376std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();1377std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();1378while (scaleIt != scheme.getColors().end()) {1379FXRealSpinner* scaleDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX);1380scaleDialer->setValue(*scaleIt);1381scales.push_back(scaleDialer);1382if (fixed) {1383new FXLabel(m, nameIt->c_str());1384new FXLabel(m, "");1385new FXLabel(m, "");1386} else {1387const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;1388FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX | dialerOptions);1389threshDialer->setValue(*threshIt);1390thresholds.push_back(threshDialer);1391if (*threshIt == GUIVisualizationSettings::MISSING_DATA) {1392threshDialer->disable();1393threshDialer->hide();1394buttons.push_back(GUIDesigns::buildFXButton(m, "", "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));1395buttons.back()->hide();1396buttons.push_back(GUIDesigns::buildFXButton(m, TL("No Data"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));1397buttons.back()->disable();1398} else {1399buttons.push_back(GUIDesigns::buildFXButton(m, TL("Add"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));1400buttons.push_back(GUIDesigns::buildFXButton(m, TL("Remove"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));1401if (scheme.getColors().size() == 1) {1402buttons.back()->disable();1403}1404}1405}1406scaleIt++;1407threshIt++;1408nameIt++;1409}1410interpolation->setCheck(scheme.isInterpolated());1411if (fixed) {1412interpolation->disable();1413} else {1414if (scales.size() > 1) {1415interpolation->enable();1416if (interpolation->getCheck() != FALSE) {1417thresholds.front()->enable();1418} else {1419thresholds.front()->disable();1420}1421} else {1422interpolation->disable();1423thresholds.front()->disable();1424}1425}1426return m;1427}142814291430void1431GUIDialog_ViewSettings::rebuildColorMatrices(bool doCreate) {1432FXMatrix* m = rebuildColorMatrix(myLaneColorSettingFrame, myLaneColors, myLaneThresholds, myLaneButtons, myLaneColorInterpolation, mySettings->getLaneEdgeScheme());1433if (doCreate) {1434m->create();1435}1436if (mySettings->getLaneEdgeScheme().isFixed()) {1437myEdgeRainbowPanel->myColorRainbow->disable();1438} else {1439myEdgeRainbowPanel->myColorRainbow->enable();1440}1441if (mySettings->junctionColorer.getScheme().isFixed()) {1442myJunctionRainbowPanel->myColorRainbow->disable();1443} else {1444myJunctionRainbowPanel->myColorRainbow->enable();1445}1446if (mySettings->vehicleColorer.getScheme().isFixed()) {1447myVehicleRainbowPanel->myColorRainbow->disable();1448} else {1449myVehicleRainbowPanel->myColorRainbow->enable();1450}1451std::string activeSchemeName = myLaneEdgeColorMode->getText().text();1452std::string activeScaleSchemeName = myLaneEdgeScaleMode->getText().text();1453myParamKey->clearItems();1454myScalingParamKey->clearItems();1455myMeanDataID->clearItems();1456myMeanDataID->hide();1457if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGE_PARAM_NUMERICAL) {1458myParamKey->appendItem(mySettings->edgeParam.c_str());1459for (const std::string& attr : myParent->getEdgeLaneParamKeys(true)) {1460if (attr != mySettings->edgeParam) {1461myParamKey->appendItem(attr.c_str());1462}1463}1464myParamKey->enable();1465} else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_LANE_PARAM_NUMERICAL) {1466myParamKey->appendItem(mySettings->laneParam.c_str());1467for (const std::string& attr : myParent->getEdgeLaneParamKeys(false)) {1468if (attr != mySettings->laneParam) {1469myParamKey->appendItem(attr.c_str());1470}1471}1472myParamKey->enable();1473} else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {1474myParamKey->appendItem(mySettings->edgeData.c_str());1475for (const std::string& attr : myParent->getEdgeDataAttrs()) {1476if (attr != mySettings->edgeData) {1477myParamKey->appendItem(attr.c_str());1478}1479}1480myParamKey->enable();1481} else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_LIVE) {1482if (mySettings->edgeDataID != "") {1483myMeanDataID->appendIconItem(mySettings->edgeDataID.c_str());1484}1485for (const std::string& attr : myParent->getMeanDataIDs()) {1486if (attr != mySettings->edgeDataID) {1487myMeanDataID->appendIconItem(attr.c_str());1488}1489}1490if (myMeanDataID->getNumItems() > 0) {1491if (mySettings->edgeDataID == "") {1492mySettings->edgeDataID = myMeanDataID->getItemText(0);1493}1494myMeanDataID->enable();1495myMeanDataID->show();1496myParamKey->appendItem(mySettings->edgeData.c_str());1497for (const std::string& attr : myParent->getMeanDataAttrs(mySettings->edgeDataID)) {1498if (attr != mySettings->edgeData) {1499myParamKey->appendItem(attr.c_str());1500}1501}1502myParamKey->enable();1503}1504} else {1505myParamKey->disable();1506}15071508if (activeScaleSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {1509myScalingParamKey->appendItem(mySettings->edgeDataScaling.c_str());1510for (const std::string& attr : myParent->getEdgeDataAttrs()) {1511if (attr != mySettings->edgeDataScaling) {1512myScalingParamKey->appendItem(attr.c_str());1513}1514}1515myScalingParamKey->enable();1516} else {1517myScalingParamKey->disable();1518}15191520myParamKey->setNumVisible(myParamKey->getNumItems());1521myScalingParamKey->setNumVisible(myScalingParamKey->getNumItems());1522myLaneColorSettingFrame->getParent()->recalc();15231524m = rebuildScaleMatrix(myLaneScaleSettingFrame, myLaneScales, myLaneScaleThresholds, myLaneScaleButtons, myLaneScaleInterpolation, mySettings->getLaneEdgeScaleScheme());1525if (doCreate) {1526m->create();1527}1528myLaneScaleSettingFrame->getParent()->recalc();15291530m = rebuildColorMatrix(myVehicleColorSettingFrame, myVehicleColors, myVehicleThresholds, myVehicleButtons, myVehicleColorInterpolation, mySettings->vehicleColorer.getScheme());1531if (doCreate) {1532m->create();1533}1534activeSchemeName = myVehicleColorMode->getText().text();1535if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_PARAM_NUMERICAL) {1536updateVehicleParams();1537myVehicleParamKey->enable();1538} else {1539myVehicleParamKey->disable();1540}1541myVehicleColorSettingFrame->getParent()->recalc();15421543m = rebuildScaleMatrix(myVehicleScaleSettingFrame, myVehicleScales, myVehicleScaleThresholds, myVehicleScaleButtons, myVehicleScaleInterpolation, mySettings->vehicleScaler.getScheme());1544if (doCreate) {1545m->create();1546}1547myVehicleScaleSettingFrame->getParent()->recalc();1548activeScaleSchemeName = myVehicleScaleMode->getText().text();1549if (activeScaleSchemeName == GUIVisualizationSettings::SCHEME_NAME_PARAM_NUMERICAL) {1550myVehicleScalingParamKey->enable();1551} else {1552myVehicleScalingParamKey->disable();1553}155415551556m = rebuildColorMatrix(myPersonColorSettingFrame, myPersonColors, myPersonThresholds, myPersonButtons, myPersonColorInterpolation, mySettings->personColorer.getScheme());1557if (doCreate) {1558m->create();1559}1560myPersonColorSettingFrame->getParent()->recalc();1561m = rebuildColorMatrix(myContainerColorSettingFrame, myContainerColors, myContainerThresholds, myContainerButtons, myContainerColorInterpolation, mySettings->containerColorer.getScheme());1562if (doCreate) {1563m->create();1564}1565myContainerColorSettingFrame->getParent()->recalc();1566m = rebuildColorMatrix(myJunctionColorSettingFrame, myJunctionColors, myJunctionThresholds, myJunctionButtons, myJunctionColorInterpolation, mySettings->junctionColorer.getScheme());1567if (doCreate) {1568m->create();1569}1570myJunctionColorSettingFrame->getParent()->recalc();1571// POIs1572m = rebuildColorMatrix(myPOIColorSettingFrame, myPOIColors, myPOIThresholds, myPOIButtons, myPOIColorInterpolation, mySettings->poiColorer.getScheme());1573if (doCreate) {1574m->create();1575}1576myPOIColorSettingFrame->getParent()->recalc();1577// polygons1578m = rebuildColorMatrix(myPolyColorSettingFrame, myPolyColors, myPolyThresholds, myPolyButtons, myPolyColorInterpolation, mySettings->polyColorer.getScheme());1579if (doCreate) {1580m->create();1581}1582myPolyColorSettingFrame->getParent()->recalc();15831584// data1585if (mySettings->netedit) {1586if (mySettings->dataColorer.getScheme().isFixed()) {1587myDataRainbowPanel->myColorRainbow->disable();1588} else {1589myDataRainbowPanel->myColorRainbow->enable();1590}1591m = rebuildColorMatrix(myDataColorSettingFrame, myDataColors, myDataThresholds, myDataButtons, myDataColorInterpolation, mySettings->dataColorer.getScheme());1592if (doCreate) {1593m->create();1594}1595activeSchemeName = myDataColorMode->getText().text();1596if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL) {1597myDataParamKey->clearItems();1598myDataParamKey->appendItem(mySettings->relDataAttr.c_str());1599for (const std::string& attr : myParent->getRelDataAttrs()) {1600if (attr != mySettings->relDataAttr) {1601myDataParamKey->appendItem(attr.c_str());1602}1603}1604myDataParamKey->enable();1605} else {1606myDataParamKey->disable();1607}1608myDataColorSettingFrame->getParent()->recalc();16091610// scaling1611m = rebuildScaleMatrix(myDataScaleSettingFrame, myDataScales, myDataScaleThresholds, myDataScaleButtons, myDataScaleInterpolation, mySettings->dataScaler.getScheme());1612if (doCreate) {1613m->create();1614}1615activeScaleSchemeName = myDataScaleMode->getText().text();1616if (activeScaleSchemeName == GUIVisualizationSettings::SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL) {1617myDataScaleParamKey->clearItems();1618myDataScaleParamKey->appendItem(mySettings->relDataScaleAttr.c_str());1619for (const std::string& attr : myParent->getRelDataAttrs()) {1620if (attr != mySettings->relDataScaleAttr) {1621myDataScaleParamKey->appendItem(attr.c_str());1622}1623}1624myDataScaleParamKey->enable();1625} else {1626myDataScaleParamKey->disable();1627}1628myDataScaleSettingFrame->getParent()->recalc();1629}16301631layout();1632update();1633}163416351636void1637GUIDialog_ViewSettings::updateVehicleParams() {1638myVehicleParamKey->clearItems();1639myVehicleTextParamKey->clearItems();1640myVehicleScalingParamKey->clearItems();1641myVehicleParamKey->appendItem(mySettings->vehicleParam.c_str());1642myVehicleTextParamKey->appendItem(mySettings->vehicleTextParam.c_str());1643myVehicleScalingParamKey->appendItem(mySettings->vehicleScaleParam.c_str());1644for (const std::string& attr : myParent->getVehicleParamKeys(false)) {1645myVehicleParamKey->appendItem(attr.c_str());1646myVehicleTextParamKey->appendItem(attr.c_str());1647myVehicleScalingParamKey->appendItem(attr.c_str());1648}1649myVehicleParamKey->setNumVisible(myVehicleParamKey->getNumItems());1650myVehicleTextParamKey->setNumVisible(myVehicleTextParamKey->getNumItems());1651myVehicleScalingParamKey->setNumVisible(myVehicleScalingParamKey->getNumItems());1652}165316541655void1656GUIDialog_ViewSettings::updatePOIParams() {1657myPOITextParamKey->clearItems();1658myPOITextParamKey->appendItem(mySettings->poiTextParam.c_str());1659for (const std::string& attr : myParent->getPOIParamKeys()) {1660myPOITextParamKey->appendItem(attr.c_str());1661}1662myPOITextParamKey->setNumVisible(myPOITextParamKey->getNumItems());1663}166416651666std::string1667GUIDialog_ViewSettings::getCurrentScheme() const {1668return mySchemeName->getItemText(mySchemeName->getCurrentItem());1669}167016711672void1673GUIDialog_ViewSettings::setCurrentScheme(const std::string& name) {1674if (name.c_str() == mySchemeName->getItemText(mySchemeName->getCurrentItem())) {1675return;1676}1677for (int i = 0; i < mySchemeName->getNumItems(); ++i) {1678if (name.c_str() == mySchemeName->getItemText(i)) {1679mySchemeName->setCurrentItem(i);1680onCmdNameChange(nullptr, 0, (void*)name.c_str());1681return;1682}1683}1684}168516861687GUIDialog_ViewSettings::NamePanel::NamePanel(1688FXMatrix* parent,1689GUIDialog_ViewSettings* target,1690const std::string& title,1691const GUIVisualizationTextSettings& settings) {1692myCheck = new FXCheckButton(parent, title.c_str(), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);1693myCheck->setCheck(settings.showText);1694myMatrix0 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);1695mySelectedCheck = new FXCheckButton(myMatrix0, TL("Only for selected"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);1696mySelectedCheck->setCheck(settings.onlySelected);1697myConstSizeCheck = new FXCheckButton(myMatrix0, TL("constant text size"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);1698myConstSizeCheck->setCheck(settings.constSize);1699FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);1700new FXLabel(m1, TL("Size"), nullptr, GUIDesignViewSettingsLabel1);1701mySizeDial = new FXRealSpinner(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);1702mySizeDial->setRange(5, 1000);1703mySizeDial->setValue(settings.size);1704FXMatrix* m2 = new FXMatrix(parent, 4, GUIDesignViewSettingsMatrix5);1705new FXLabel(m2, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);1706myColorWell = new FXColorWell(m2, MFXUtils::getFXColor(settings.color), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell2);1707new FXLabel(m2, TL("Background"), nullptr, GUIDesignViewSettingsLabel1);1708myBGColorWell = new FXColorWell(m2, MFXUtils::getFXColor(settings.bgColor), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell2);1709}171017111712GUIVisualizationTextSettings1713GUIDialog_ViewSettings::NamePanel::getSettings() {1714return GUIVisualizationTextSettings(myCheck->getCheck() != FALSE,1715mySizeDial->getValue(),1716MFXUtils::getRGBColor(myColorWell->getRGBA()),1717MFXUtils::getRGBColor(myBGColorWell->getRGBA()),1718myConstSizeCheck->getCheck() != FALSE,1719mySelectedCheck->getCheck() != FALSE);1720}172117221723void1724GUIDialog_ViewSettings::NamePanel::update(const GUIVisualizationTextSettings& settings) {1725myCheck->setCheck(settings.showText);1726mySizeDial->setValue(settings.size);1727myColorWell->setRGBA(MFXUtils::getFXColor(settings.color));1728myBGColorWell->setRGBA(MFXUtils::getFXColor(settings.bgColor));1729myConstSizeCheck->setCheck(settings.constSize);1730mySelectedCheck->setCheck(settings.onlySelected);1731}173217331734GUIDialog_ViewSettings::SizePanel::SizePanel(FXMatrix* parent, GUIDialog_ViewSettings* target,1735const GUIVisualizationSizeSettings& settings, GUIGlObjectType type):1736myDialogViewSettings(target),1737myType(type) {1738myCheck = new FXCheckButton(parent, TL("Draw with constant size when zoomed out"), this, MID_SIMPLE_VIEW_SIZECHANGE, GUIDesignCheckButtonViewSettings);1739myCheck->setCheck(settings.constantSize);1740myCheckSelected = new FXCheckButton(parent, TL("Only for selected"), this, MID_SIMPLE_VIEW_SIZECHANGE, GUIDesignCheckButtonViewSettings);1741myCheckSelected->setCheck(settings.constantSizeSelected);1742FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);1743new FXLabel(m1, TL("Minimum Size"), nullptr, GUIDesignViewSettingsLabel1);1744myMinSizeDial = new FXRealSpinner(m1, 10, this, MID_SIMPLE_VIEW_SIZECHANGE, GUIDesignViewSettingsSpinDial1);1745myMinSizeDial->setValue(settings.minSize);1746FXMatrix* m2 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);1747new FXLabel(m2, TL("Exaggerate by"), nullptr, GUIDesignViewSettingsLabel1);1748myExaggerateDial = new FXRealSpinner(m2, 10, this, MID_SIMPLE_VIEW_SIZECHANGE, GUIDesignViewSettingsSpinDial2);1749myExaggerateDial->setRange(0, 10000);1750myExaggerateDial->setValue(settings.exaggeration);1751}175217531754GUIVisualizationSizeSettings1755GUIDialog_ViewSettings::SizePanel::getSettings() {1756return GUIVisualizationSizeSettings(1757myMinSizeDial->getValue(), myExaggerateDial->getValue(),1758myCheck->getCheck() != FALSE,1759myCheckSelected->getCheck() != FALSE);1760}176117621763void1764GUIDialog_ViewSettings::SizePanel::update(const GUIVisualizationSizeSettings& settings) {1765myCheck->setCheck(settings.constantSize);1766myCheckSelected->setCheck(settings.constantSizeSelected);1767myMinSizeDial->setValue(settings.minSize);1768myExaggerateDial->setValue(settings.exaggeration);1769}177017711772long1773GUIDialog_ViewSettings::SizePanel::onCmdSizeChange(FXObject* obj, FXSelector sel, void* ptr) {1774// mark boundaries for recomputing1775gViewObjectsHandler.recomputeBoundaries = myType;1776// continue as a normal change1777return myDialogViewSettings->onCmdColorChange(obj, sel, ptr);1778}177917801781GUIDialog_ViewSettings::RainbowPanel::RainbowPanel(1782FXComposite* parent,1783GUIDialog_ViewSettings* target,1784const GUIVisualizationRainbowSettings& settings) {1785FXMatrix* matrixRainbow = new FXMatrix(parent, 9, GUIDesignViewSettingsMatrix3);1786myColorRainbow = GUIDesigns::buildFXButton(matrixRainbow, TL("Recalibrate Rainbow"), "", "", nullptr, target, MID_SIMPLE_VIEW_COLORCHANGE,1787(BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);1788myRainbowStyle = new MFXComboBoxIcon(matrixRainbow, nullptr, false, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsComboBox1);1789for (auto item : GUIVisualizationSettings::RAINBOW_SCHEMES) {1790myRainbowStyle->appendIconItem(item.first.c_str());1791}1792myRainbowStyle->setCurrentItem(settings.rainbowScheme);1793myHideMinCheck = new FXCheckButton(matrixRainbow, TL("min"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);1794myHideMinCheck->setCheck(settings.hideMin);1795myMinThreshold = new FXRealSpinner(matrixRainbow, 6, target, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);1796myMinThreshold->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());1797myMinThreshold->setValue(settings.minThreshold);1798myHideMaxCheck = new FXCheckButton(matrixRainbow, TL("max"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);1799myHideMaxCheck->setCheck(settings.hideMax);1800myMaxThreshold = new FXRealSpinner(matrixRainbow, 6, target, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);1801myMaxThreshold->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());1802myMaxThreshold->setValue(settings.maxThreshold);1803mySetNeutral = new FXCheckButton(matrixRainbow, TL("center"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);1804mySetNeutral->setCheck(settings.setNeutral);1805myNeutralThreshold = new FXRealSpinner(matrixRainbow, 6, target, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);1806myNeutralThreshold->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());1807myNeutralThreshold->setValue(settings.neutralThreshold);1808myFixRange = new FXCheckButton(matrixRainbow, TL("fix range"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);1809myFixRange->setCheck(settings.fixRange);1810}181118121813GUIVisualizationRainbowSettings1814GUIDialog_ViewSettings::RainbowPanel::getSettings() {1815GUIVisualizationRainbowSettings res(myHideMinCheck->getCheck() != FALSE,1816myMinThreshold->getValue(),1817myHideMaxCheck->getCheck() != FALSE,1818myMaxThreshold->getValue(),1819mySetNeutral->getCheck() != FALSE,1820myNeutralThreshold->getValue(),1821myFixRange->getCheck() != FALSE,1822myRainbowStyle->getCurrentItem());1823std::string sName = myRainbowStyle->getItemText(myRainbowStyle->getCurrentItem());1824res.colors = GUIVisualizationSettings::RAINBOW_SCHEMES[sName];1825return res;1826}182718281829void1830GUIDialog_ViewSettings::RainbowPanel::update(const GUIVisualizationRainbowSettings& settings) {1831myHideMinCheck->setCheck(settings.hideMin);1832myMinThreshold->setValue(settings.minThreshold);1833myHideMaxCheck->setCheck(settings.hideMax);1834myMaxThreshold->setValue(settings.maxThreshold);1835mySetNeutral->setCheck(settings.setNeutral);1836myNeutralThreshold->setValue(settings.neutralThreshold);1837myFixRange->setCheck(settings.fixRange);1838myRainbowStyle->setCurrentItem(settings.rainbowScheme);1839}18401841void1842GUIDialog_ViewSettings::buildHeader(FXVerticalFrame* contentFrame) {1843FXHorizontalFrame* horizontalFrame = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame1);1844mySchemeName = new MFXComboBoxIcon(horizontalFrame, nullptr, true, GUIDesignComboBoxVisibleItems,1845this, MID_SIMPLE_VIEW_NAMECHANGE, GUIDesignViewSettingsComboBox1);1846for (const auto& name : gSchemeStorage.getNames()) {1847const int index = mySchemeName->appendIconItem(name.c_str());1848if (name == mySettings->name) {1849mySchemeName->setCurrentItem((FXint)index);1850}1851}18521853GUIDesigns::buildFXButton(horizontalFrame, "", "", TL("Save the setting to registry"), GUIIconSubSys::getIcon(GUIIcon::SAVE_DATABASE), this, MID_SIMPLE_VIEW_SAVE, GUIDesignButtonToolbar);1854GUIDesigns::buildFXButton(horizontalFrame, "", "", TL("Remove the setting from registry"), GUIIconSubSys::getIcon(GUIIcon::REMOVEDB), this, MID_SIMPLE_VIEW_DELETE, GUIDesignButtonToolbar);1855GUIDesigns::buildFXButton(horizontalFrame, "", "", TL("Export setting to file"), GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_SIMPLE_VIEW_EXPORT, GUIDesignButtonToolbar);1856GUIDesigns::buildFXButton(horizontalFrame, "", "", TL("Load setting from file"), GUIIconSubSys::getIcon(GUIIcon::OPEN), this, MID_SIMPLE_VIEW_IMPORT, GUIDesignButtonToolbar);18571858new FXVerticalSeparator(horizontalFrame);1859new FXLabel(horizontalFrame, TL("Export includes:"), nullptr, GUIDesignViewSettingsLabel1);1860mySaveViewPort = new FXCheckButton(horizontalFrame, TL("Viewport"));1861mySaveDelay = new FXCheckButton(horizontalFrame, TL("Delay"));1862mySaveDecals = new FXCheckButton(horizontalFrame, TL("Decals"));1863mySaveBreakpoints = new FXCheckButton(horizontalFrame, TL("Breakpoints"));1864if (mySettings->netedit) {1865mySaveBreakpoints->disable();1866}1867}186818691870void1871GUIDialog_ViewSettings::buildBackgroundFrame(FXTabBook* tabbook) {1872// tab for the background1873new FXTabItem(tabbook, TL("Background"), nullptr, GUIDesignViewSettingsTabItemBook1);1874FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);1875FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);18761877FXMatrix* matrixColor = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);1878new FXLabel(matrixColor, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);1879myBackgroundColor = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->backgroundColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);18801881FXVerticalFrame* verticalFrameDecals = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame3);1882new FXLabel(verticalFrameDecals, TL("Decals:"));1883myDecalsTable = new MFXDecalsTable(this, verticalFrameDecals);1884FXHorizontalFrame* horizontalFrameButtonsDecals = new FXHorizontalFrame(verticalFrameDecals, GUIDesignViewSettingsHorizontalFrame2);1885GUIDesigns::buildFXButton(horizontalFrameButtonsDecals, TL("&Load XML Decals"), "", "", nullptr, this, MID_SIMPLE_VIEW_LOAD_DECALS_XML, GUIDesignViewSettingsButton1);1886GUIDesigns::buildFXButton(horizontalFrameButtonsDecals, TL("&Save XML Decals"), "", "", nullptr, this, MID_SIMPLE_VIEW_SAVE_DECALS_XML, GUIDesignViewSettingsButton1);1887GUIDesigns::buildFXButton(horizontalFrameButtonsDecals, TL("&Clear Decals"), "", "", nullptr, this, MID_SIMPLE_VIEW_CLEAR_DECALS, GUIDesignViewSettingsButton1);18881889new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);18901891FXMatrix* matrixGrid = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);1892myShowGrid = new FXCheckButton(matrixGrid, TL("Toggle grid"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);1893myShowGrid->setCheck(mySettings->showGrid);1894new FXLabel(matrixGrid, "");1895FXMatrix* matrixGridX = new FXMatrix(matrixGrid, 2, GUIDesignViewSettingsMatrix2);1896new FXLabel(matrixGridX, TL("x-spacing"), nullptr, GUIDesignViewSettingsLabel1);1897myGridXSizeDialer = new FXRealSpinner(matrixGridX, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);1898myGridXSizeDialer->setRange(1, 10000);1899myGridXSizeDialer->setValue(mySettings->gridXSize);1900FXMatrix* matrixGridY = new FXMatrix(matrixGrid, 2, GUIDesignViewSettingsMatrix2);1901new FXLabel(matrixGridY, TL("y-spacing"), nullptr, GUIDesignViewSettingsLabel1);1902myGridYSizeDialer = new FXRealSpinner(matrixGridY, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);1903myGridYSizeDialer->setRange(1, 10000);1904myGridYSizeDialer->setValue(mySettings->gridYSize);1905}190619071908void1909GUIDialog_ViewSettings::buildStreetsFrame(FXTabBook* tabbook) {1910new FXTabItem(tabbook, TL("Streets"), nullptr, GUIDesignViewSettingsTabItemBook1);1911FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);1912FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);1913// ... color settings1914FXVerticalFrame* verticalFrameColor = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);1915FXMatrix* matrixColor = new FXMatrix(verticalFrameColor, 5, GUIDesignViewSettingsMatrix3);1916new FXLabel(matrixColor, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);1917myLaneEdgeColorMode = new MFXComboBoxIcon(matrixColor, nullptr, true, GUIDesignComboBoxVisibleItems,1918this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);1919myLaneColorInterpolation = new FXCheckButton(matrixColor, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);1920myLaneColorSettingFrame = new FXVerticalFrame(verticalFrameColor, GUIDesignViewSettingsVerticalFrame4);1921myMeanDataID = new MFXComboBoxIcon(matrixColor, nullptr, false, GUIDesignComboBoxVisibleItems,1922this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);1923myMeanDataID->disable();1924myMeanDataID->hide();1925myParamKey = new FXComboBox(matrixColor, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);1926myParamKey->setEditable(true);1927myParamKey->disable();19281929// rainbow settings1930myEdgeRainbowPanel = new RainbowPanel(verticalFrameColor, this, mySettings->edgeValueRainBow);19311932new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);1933// ... scale settings1934FXVerticalFrame* verticalFrameScale = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);1935FXMatrix* matrixScale = new FXMatrix(verticalFrameScale, 5, GUIDesignViewSettingsMatrix3);1936new FXLabel(matrixScale, TL("Scale width"), nullptr, GUIDesignViewSettingsLabel1);1937myLaneEdgeScaleMode = new MFXComboBoxIcon(matrixScale, nullptr, true, GUIDesignComboBoxVisibleItems,1938this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);1939myLaneScaleInterpolation = new FXCheckButton(matrixScale, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);1940myLaneScaleSettingFrame = new FXVerticalFrame(verticalFrameScale, GUIDesignViewSettingsVerticalFrame4);1941myScalingParamKey = new FXComboBox(matrixScale, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);1942myScalingParamKey->setEditable(true);1943myScalingParamKey->disable();19441945if (GUIVisualizationSettings::UseMesoSim) {1946mySettings->edgeColorer.fill(*myLaneEdgeColorMode);1947mySettings->edgeScaler.fill(*myLaneEdgeScaleMode);1948} else {1949mySettings->laneColorer.fill(*myLaneEdgeColorMode);1950mySettings->laneScaler.fill(*myLaneEdgeScaleMode);1951}19521953new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);1954FXMatrix* matrixLanes = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);19551956myShowBikeMarkings = new FXCheckButton(matrixLanes, TL("Show bike markings"), this, MID_SIMPLE_VIEW_COLORCHANGE);1957myShowBikeMarkings->setCheck(mySettings->showBikeMarkings);1958myShowLaneDecals = new FXCheckButton(matrixLanes, TL("Show turning arrows"), this, MID_SIMPLE_VIEW_COLORCHANGE);1959myShowLaneDecals->setCheck(mySettings->showLinkDecals);19601961myShowLinkRules = new FXCheckButton(matrixLanes, TL("Show right-of-way rules"), this, MID_SIMPLE_VIEW_COLORCHANGE);1962myShowLinkRules->setCheck(mySettings->showLinkRules);1963myRealisticLinkRules = new FXCheckButton(matrixLanes, TL("Realistic stop line colors"), this, MID_SIMPLE_VIEW_COLORCHANGE);1964myRealisticLinkRules->setCheck(mySettings->realisticLinkRules);19651966myShowLaneBorders = new FXCheckButton(matrixLanes, TL("Show lane borders"), this, MID_SIMPLE_VIEW_COLORCHANGE);1967myShowLaneBorders->setCheck(mySettings->laneShowBorders);1968myShowLaneDirection = new FXCheckButton(matrixLanes, TL("Show lane direction"), this, MID_SIMPLE_VIEW_COLORCHANGE);1969myShowLaneDirection->setCheck(mySettings->showLaneDirection);19701971myHideMacroConnectors = new FXCheckButton(matrixLanes, TL("Hide macro connectors"), this, MID_SIMPLE_VIEW_COLORCHANGE);1972myHideMacroConnectors->setCheck(mySettings->hideConnectors);1973myShowSublanes = new FXCheckButton(matrixLanes, TL("Show sublanes"), this, MID_SIMPLE_VIEW_COLORCHANGE);1974myShowSublanes->setCheck(mySettings->showSublanes);19751976myShowRails = new FXCheckButton(matrixLanes, TL("Show rails"), this, MID_SIMPLE_VIEW_COLORCHANGE);1977myShowRails->setCheck(mySettings->showRails);19781979mySpreadSuperposed = new FXCheckButton(matrixLanes, TL("Spread bidirectional railways/roads"), this, MID_SIMPLE_VIEW_COLORCHANGE);1980mySpreadSuperposed->setHelpText(TL("Make both directional edges for a bidirectional railways or roads visible"));1981mySpreadSuperposed->setCheck(mySettings->spreadSuperposed);19821983mySecondaryShape = new FXCheckButton(matrixLanes, TL("Secondary shape"), this, MID_SIMPLE_VIEW_COLORCHANGE);1984mySecondaryShape->setCheck(mySettings->secondaryShape);1985new FXLabel(matrixLanes, " ", nullptr, GUIDesignViewSettingsLabel1);1986if (!OptionsCont::getOptions().exists("alternative-net-file") ||1987!OptionsCont::getOptions().isSet("alternative-net-file")) {1988mySecondaryShape->disable();1989}19901991FXMatrix* tmp0 = new FXMatrix(matrixLanes, 2, GUIDesignViewSettingsMatrix5);1992new FXLabel(tmp0, TL("Exaggerate width by"), nullptr, GUIDesignViewSettingsLabel1);1993myLaneWidthUpscaleDialer = new FXRealSpinner(tmp0, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);1994myLaneWidthUpscaleDialer->setRange(0, 1000000);1995myLaneWidthUpscaleDialer->setValue(mySettings->laneWidthExaggeration);19961997FXMatrix* tmp1 = new FXMatrix(matrixLanes, 2, GUIDesignViewSettingsMatrix5);1998new FXLabel(tmp1, TL("Minimum size"), nullptr, GUIDesignViewSettingsLabel1);1999myLaneMinWidthDialer = new FXRealSpinner(tmp1, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);2000myLaneMinWidthDialer->setRange(0, 1000000);2001myLaneMinWidthDialer->setValue(mySettings->laneMinSize);20022003// edge name2004myEdgeNamePanel = new NamePanel(matrixLanes, this, TL("Show edge id"), mySettings->edgeName);2005myStreetNamePanel = new NamePanel(matrixLanes, this, TL("Show street name"), mySettings->streetName);2006myEdgeValuePanel = new NamePanel(matrixLanes, this, TL("Show edge color value"), mySettings->edgeValue);2007myEdgeScaleValuePanel = new NamePanel(matrixLanes, this, TL("Show edge scale value"), mySettings->edgeScaleValue);2008}200920102011void2012GUIDialog_ViewSettings::buildVehiclesFrame(FXTabBook* tabbook) {2013new FXTabItem(tabbook, TL("Vehicles"), nullptr, GUIDesignViewSettingsTabItemBook1);2014FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);2015FXVerticalFrame* verticalframe = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);20162017FXMatrix* matrixShowAs = new FXMatrix(verticalframe, 2, GUIDesignViewSettingsMatrix3);2018new FXLabel(matrixShowAs, TL("Show As"), nullptr, GUIDesignViewSettingsLabel1);2019myVehicleShapeDetail = new MFXComboBoxIcon(matrixShowAs, nullptr, false, GUIDesignComboBoxVisibleItems,2020this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2021myVehicleShapeDetail->appendIconItem(TL("'triangles'"));2022myVehicleShapeDetail->appendIconItem(TL("'boxes'"));2023myVehicleShapeDetail->appendIconItem(TL("'simple shapes'"));2024myVehicleShapeDetail->appendIconItem(TL("'raster images'"));2025myVehicleShapeDetail->appendIconItem(TL("'circles'"));2026myVehicleShapeDetail->setCurrentItem(mySettings->vehicleQuality);20272028new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);20292030FXMatrix* matrixColor = new FXMatrix(verticalframe, 4, GUIDesignViewSettingsMatrix3);2031new FXLabel(matrixColor, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);2032myVehicleColorMode = new MFXComboBoxIcon(matrixColor, nullptr, true, GUIDesignComboBoxVisibleItems,2033this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2034mySettings->vehicleColorer.fill(*myVehicleColorMode);2035myVehicleColorInterpolation = new FXCheckButton(matrixColor, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);2036myVehicleParamKey = new FXComboBox(matrixColor, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2037myVehicleParamKey->setEditable(true);2038myVehicleParamKey->disable();20392040// rainbow settings2041myVehicleRainbowPanel = new RainbowPanel(verticalframe, this, mySettings->vehicleValueRainBow);20422043myVehicleColorSettingFrame = new FXVerticalFrame(verticalframe, GUIDesignViewSettingsVerticalFrame4);2044new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);20452046// vehicle scale settings2047FXVerticalFrame* verticalFrameScale = new FXVerticalFrame(verticalframe, GUIDesignViewSettingsVerticalFrame6);2048FXMatrix* matrixScale = new FXMatrix(verticalFrameScale, 4, GUIDesignViewSettingsMatrix3);2049new FXLabel(matrixScale, TL("Scale size"), nullptr, GUIDesignViewSettingsLabel1);2050myVehicleScaleMode = new MFXComboBoxIcon(matrixScale, nullptr, true, GUIDesignComboBoxVisibleItems,2051this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2052myVehicleScaleInterpolation = new FXCheckButton(matrixScale, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);2053myVehicleScalingParamKey = new FXComboBox(matrixScale, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2054myVehicleScalingParamKey->setEditable(true);2055myVehicleScalingParamKey->disable();2056myVehicleScaleSettingFrame = new FXVerticalFrame(verticalFrameScale, GUIDesignViewSettingsVerticalFrame4);2057mySettings->vehicleScaler.fill(*myVehicleScaleMode);2058new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);20592060FXMatrix* matrixVehicle = new FXMatrix(verticalframe, 2, GUIDesignMatrixViewSettings);2061myVehicleNamePanel = new NamePanel(matrixVehicle, this, TL("Show vehicle id"), mySettings->vehicleName);2062myVehicleValuePanel = new NamePanel(matrixVehicle, this, TL("Show vehicle color value"), mySettings->vehicleValue);2063myVehicleScaleValuePanel = new NamePanel(matrixVehicle, this, TL("Show vehicle scale value"), mySettings->vehicleScaleValue);2064myVehicleTextPanel = new NamePanel(matrixVehicle, this, TL("Show vehicle text param"), mySettings->vehicleText);2065myVehicleTextParamKey = new FXComboBox(myVehicleTextPanel->myMatrix0, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2066myVehicleTextParamKey->setEditable(true);2067//new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);20682069FXMatrix* matrixShow = new FXMatrix(verticalframe, 2, GUIDesignMatrixViewSettings);2070myShowBlinker = new FXCheckButton(matrixShow, TL("Show blinker / brake lights"), this, MID_SIMPLE_VIEW_COLORCHANGE);2071myShowBlinker->setCheck(mySettings->showBlinker);2072myShowMinGap = new FXCheckButton(matrixShow, TL("Show minimum gap"), this, MID_SIMPLE_VIEW_COLORCHANGE);2073myShowMinGap->setCheck(mySettings->drawMinGap);2074myShowBrakeGap = new FXCheckButton(matrixShow, TL("Show brake gap"), this, MID_SIMPLE_VIEW_COLORCHANGE);2075myShowBrakeGap->setCheck(mySettings->drawBrakeGap);2076myShowBTRange = new FXCheckButton(matrixShow, TL("Show Bluetooth range"), this, MID_SIMPLE_VIEW_COLORCHANGE);2077myShowBTRange->setCheck(mySettings->showBTRange);2078myShowRouteIndex = new FXCheckButton(matrixShow, TL("Show route index"), this, MID_SIMPLE_VIEW_COLORCHANGE);2079myShowRouteIndex->setCheck(mySettings->showRouteIndex);2080myScaleLength = new FXCheckButton(matrixShow, TL("Scale length with geometry"), this, MID_SIMPLE_VIEW_COLORCHANGE);2081myScaleLength->setCheck(mySettings->scaleLength);2082const std::string parkingInfo = mySettings->netedit ? TL("Show stopping info") : TL("Show parking info");2083myShowParkingInfo = new FXCheckButton(matrixShow, parkingInfo.c_str(), this, MID_SIMPLE_VIEW_COLORCHANGE);2084myShowParkingInfo->setCheck(mySettings->showParkingInfo);2085myShowChargingInfo = new FXCheckButton(matrixShow, TL("Show charging info"), this, MID_SIMPLE_VIEW_COLORCHANGE);2086myShowChargingInfo->setCheck(mySettings->showChargingInfo);2087myDrawReversed = new FXCheckButton(matrixShow, TL("Draw reversed vehicles in reverse"), this, MID_SIMPLE_VIEW_COLORCHANGE);2088myDrawReversed->setCheck(mySettings->drawReversed);2089//new FXLabel(matrixShow, " ", nullptr, GUIDesignViewSettingsLabel1);2090//myShowLaneChangePreference = new FXCheckButton(matrixShow, TL("Show lane change preference"), this, MID_SIMPLE_VIEW_COLORCHANGE);2091//myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);2092//tmpc = new FXCheckButton(matrixShow, TL("Show needed headway"), 0 ,0);2093//tmpc->disable();20942095//new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);20962097FXMatrix* matrixSize = new FXMatrix(verticalframe, 2, GUIDesignViewSettingsMatrix1);2098myVehicleSizePanel = new SizePanel(matrixSize, this, mySettings->vehicleSize, GLO_VEHICLE);2099}210021012102void2103GUIDialog_ViewSettings::buildPersonsFrame(FXTabBook* tabbook) {2104new FXTabItem(tabbook, TL("Persons"), nullptr, GUIDesignViewSettingsTabItemBook1);2105FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);2106FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);21072108FXMatrix* m101 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix3);2109new FXLabel(m101, TL("Show As"), nullptr, GUIDesignViewSettingsLabel1);2110myPersonShapeDetail = new MFXComboBoxIcon(m101, nullptr, false, GUIDesignComboBoxVisibleItems,2111this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2112myPersonShapeDetail->appendIconItem(TL("'triangles'"));2113myPersonShapeDetail->appendIconItem(TL("'circles'"));2114myPersonShapeDetail->appendIconItem(TL("'simple shapes'"));2115myPersonShapeDetail->appendIconItem(TL("'raster images'"));2116myPersonShapeDetail->setCurrentItem(mySettings->personQuality);21172118new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);21192120FXMatrix* m102 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);2121new FXLabel(m102, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);2122myPersonColorMode = new MFXComboBoxIcon(m102, nullptr, false, GUIDesignComboBoxVisibleItems,2123this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2124mySettings->personColorer.fill(*myPersonColorMode);2125myPersonColorInterpolation = new FXCheckButton(m102, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);21262127myPersonColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);21282129new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);21302131FXMatrix* m103 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);2132myPersonNamePanel = new NamePanel(m103, this, TL("Show person id"), mySettings->personName);2133myPersonValuePanel = new NamePanel(m103, this, TL("Show person color value"), mySettings->personValue);21342135new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);21362137FXMatrix* m104 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);2138myPersonSizePanel = new SizePanel(m104, this, mySettings->personSize, GLO_PERSON);21392140FXMatrix* m105 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix3);2141myShowPedestrianNetwork = new FXCheckButton(m105, TL("Show JuPedSim pedestrian network"), this, MID_SIMPLE_VIEW_COLORCHANGE);2142myShowPedestrianNetwork->setCheck(mySettings->showPedestrianNetwork);2143myPedestrianNetworkColor = new FXColorWell(m105, MFXUtils::getFXColor(mySettings->pedestrianNetworkColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2144#ifdef JPS_VERSION2145if (mySettings->netedit) {2146#endif2147myShowPedestrianNetwork->disable();2148myPedestrianNetworkColor->disable();2149#ifdef JPS_VERSION2150}2151#endif2152}215321542155void2156GUIDialog_ViewSettings::buildContainersFrame(FXTabBook* tabbook) {2157new FXTabItem(tabbook, TL("Containers"), nullptr, GUIDesignViewSettingsTabItemBook1);2158FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);2159FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);21602161FXMatrix* m101 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix3);2162new FXLabel(m101, TL("Show As"), nullptr, GUIDesignViewSettingsLabel1);2163myContainerShapeDetail = new MFXComboBoxIcon(m101, nullptr, false, GUIDesignComboBoxVisibleItems,2164this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2165myContainerShapeDetail->appendIconItem(TL("'triangles'"));2166myContainerShapeDetail->appendIconItem(TL("'boxes'"));2167myContainerShapeDetail->appendIconItem(TL("'simple shapes'"));2168myContainerShapeDetail->appendIconItem(TL("'raster images'"));2169myContainerShapeDetail->setCurrentItem(mySettings->containerQuality);21702171new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);21722173FXMatrix* m102 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);2174new FXLabel(m102, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);2175myContainerColorMode = new MFXComboBoxIcon(m102, nullptr, false, GUIDesignComboBoxVisibleItems,2176this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2177mySettings->containerColorer.fill(*myContainerColorMode);2178myContainerColorInterpolation = new FXCheckButton(m102, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);21792180myContainerColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);21812182new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);21832184FXMatrix* m103 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);2185myContainerNamePanel = new NamePanel(m103, this, TL("Show container id"), mySettings->containerName);21862187new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);21882189FXMatrix* m104 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);2190myContainerSizePanel = new SizePanel(m104, this, mySettings->containerSize, GLO_CONTAINER);2191}219221932194void2195GUIDialog_ViewSettings::buildJunctionsFrame(FXTabBook* tabbook) {2196new FXTabItem(tabbook, TL("Junctions"), nullptr, GUIDesignViewSettingsTabItemBook1);2197FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);2198FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);2199FXMatrix* m41 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);2200new FXLabel(m41, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);2201myJunctionColorMode = new MFXComboBoxIcon(m41, nullptr, false, GUIDesignComboBoxVisibleItems,2202this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2203mySettings->junctionColorer.fill(*myJunctionColorMode);2204myJunctionColorInterpolation = new FXCheckButton(m41, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);22052206myJunctionColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);2207myJunctionRainbowPanel = new RainbowPanel(verticalFrame, this, mySettings->junctionValueRainBow);22082209new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);2210FXMatrix* m42 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);2211myJunctionSizePanel = new SizePanel(m42, this, mySettings->junctionSize, GLO_JUNCTION);2212myDrawJunctionShape = new FXCheckButton(m42, TL("Draw junction shape"), this, MID_SIMPLE_VIEW_COLORCHANGE);2213myDrawJunctionShape->setCheck(mySettings->drawJunctionShape);2214myDrawCrossingsAndWalkingAreas = new FXCheckButton(m42, TL("Draw crossings/walkingareas"), this, MID_SIMPLE_VIEW_COLORCHANGE);2215myDrawCrossingsAndWalkingAreas->setCheck(mySettings->drawCrossingsAndWalkingareas);2216myShowLane2Lane = new FXCheckButton(m42, TL("Show lane to lane connections"), this, MID_SIMPLE_VIEW_COLORCHANGE);2217myShowLane2Lane->setCheck(mySettings->showLane2Lane);2218new FXLabel(m42, " ", nullptr, GUIDesignViewSettingsLabel1);22192220myTLIndexPanel = new NamePanel(m42, this, TL("Show link tls index"), mySettings->drawLinkTLIndex);2221myJunctionIndexPanel = new NamePanel(m42, this, TL("Show link junction index"), mySettings->drawLinkJunctionIndex);2222myJunctionIDPanel = new NamePanel(m42, this, TL("Show junction id"), mySettings->junctionID);2223myInternalJunctionNamePanel = new NamePanel(m42, this, TL("Show internal junction id"), mySettings->internalJunctionName);2224myInternalEdgeNamePanel = new NamePanel(m42, this, TL("Show internal edge id"), mySettings->internalEdgeName);2225myCwaEdgeNamePanel = new NamePanel(m42, this, TL("Show crossing and walkingarea id"), mySettings->cwaEdgeName);2226myTLSPhaseIndexPanel = new NamePanel(m42, this, TL("Show traffic light phase index"), mySettings->tlsPhaseIndex);2227myTLSPhaseNamePanel = new NamePanel(m42, this, TL("Show traffic light phase name"), mySettings->tlsPhaseName);2228myJunctionNamePanel = new NamePanel(m42, this, TL("Show junction name"), mySettings->junctionName);2229}223022312232void2233GUIDialog_ViewSettings::buildAdditionalsFrame(FXTabBook* tabbook) {2234new FXTabItem(tabbook, TL("Additional"), nullptr, GUIDesignViewSettingsTabItemBook1);2235FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);2236FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);2237// IDs2238FXMatrix* matrixIDs = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);2239myAddNamePanel = new NamePanel(matrixIDs, this, TL("Show object id"), mySettings->addName);2240myAddFullNamePanel = new NamePanel(matrixIDs, this, TL("Show full name"), mySettings->addFullName);2241new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);2242//Sizes2243FXMatrix* matrixSizes = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);2244myAddSizePanel = new SizePanel(matrixSizes, this, mySettings->addSize, GLO_ADDITIONALELEMENT);2245// color2246FXMatrix* matrixColor = new FXMatrix(verticalFrame, 3, GUIDesignMatrixViewSettings);2247new FXLabel(matrixColor, TL("StoppingPlace"), nullptr, GUIDesignViewSettingsLabel1);2248new FXLabel(matrixColor, TL("body"), nullptr, GUIDesignViewSettingsLabel1);2249new FXLabel(matrixColor, TL("sign"), nullptr, GUIDesignViewSettingsLabel1);2250new FXLabel(matrixColor, "busStops", nullptr, GUIDesignViewSettingsLabel1);2251myBusStopColor = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.busStopColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2252myBusStopColorSign = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.busStopColorSign), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2253new FXLabel(matrixColor, "trainStops", nullptr, GUIDesignViewSettingsLabel1);2254myTrainStopColor = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.trainStopColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2255myTrainStopColorSign = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.trainStopColorSign), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2256new FXLabel(matrixColor, "containerStops", nullptr, GUIDesignViewSettingsLabel1);2257myContainerStopColor = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.containerStopColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2258myContainerStopColorSign = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.containerStopColorSign), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2259new FXLabel(matrixColor, "chargingStations", nullptr, GUIDesignViewSettingsLabel1);2260myChargingStationColor = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.chargingStationColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2261myChargingStationColorSign = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.chargingStationColorSign), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2262}226322642265void2266GUIDialog_ViewSettings::buildDemandFrame(FXTabBook* tabbook) {2267new FXTabItem(tabbook, TL("Demand"), nullptr, GUIDesignViewSettingsTabItemBook1);2268FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);2269FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);2270// elements2271FXMatrix* demandMatrix = new FXMatrix(verticalFrame, 3, GUIDesignMatrixViewSettings);2272new FXLabel(demandMatrix, TL("element"), nullptr, GUIDesignViewSettingsLabel1);2273new FXLabel(demandMatrix, TL("color"), nullptr, GUIDesignViewSettingsLabel1);2274new FXLabel(demandMatrix, TL("width"), nullptr, GUIDesignViewSettingsLabel1);2275new FXLabel(demandMatrix, "trips", nullptr, GUIDesignViewSettingsLabel1);2276myVehicleTripsColor = new FXColorWell(demandMatrix, MFXUtils::getFXColor(mySettings->colorSettings.vehicleTripColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2277myTripWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);2278myTripWidth->setValue(mySettings->widthSettings.personTripWidth);2279new FXLabel(demandMatrix, "personTrips", nullptr, GUIDesignViewSettingsLabel1);2280myPersonTripColor = new FXColorWell(demandMatrix, MFXUtils::getFXColor(mySettings->colorSettings.personTripColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2281myPersonTripWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);2282myPersonTripWidth->setValue(mySettings->widthSettings.personTripWidth);2283new FXLabel(demandMatrix, "walks", nullptr, GUIDesignViewSettingsLabel1);2284myWalkColor = new FXColorWell(demandMatrix, MFXUtils::getFXColor(mySettings->colorSettings.walkColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2285myWalkWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);2286myWalkWidth->setValue(mySettings->widthSettings.walkWidth);2287new FXLabel(demandMatrix, "rides", nullptr, GUIDesignViewSettingsLabel1);2288myRideColor = new FXColorWell(demandMatrix, MFXUtils::getFXColor(mySettings->colorSettings.rideColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2289myRideWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);2290myRideWidth->setValue(mySettings->widthSettings.rideWidth);2291new FXLabel(demandMatrix, "transport", nullptr, GUIDesignViewSettingsLabel1);2292myTransportColor = new FXColorWell(demandMatrix, MFXUtils::getFXColor(mySettings->colorSettings.transportColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2293myTransportWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);2294myTransportWidth->setValue(mySettings->widthSettings.transportWidth);2295new FXLabel(demandMatrix, "tranship", nullptr, GUIDesignViewSettingsLabel1);2296myTranshipColor = new FXColorWell(demandMatrix, MFXUtils::getFXColor(mySettings->colorSettings.transhipColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2297myTranshipWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);2298myTranshipWidth->setValue(mySettings->widthSettings.transhipWidth);2299// stops2300FXMatrix* stopMatrix = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);2301new FXLabel(stopMatrix, "stop", nullptr, GUIDesignViewSettingsLabel1);2302myStopColor = new FXColorWell(stopMatrix, MFXUtils::getFXColor(mySettings->colorSettings.stopColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2303new FXLabel(stopMatrix, "waypoint", nullptr, GUIDesignViewSettingsLabel1);2304myWaypointColor = new FXColorWell(stopMatrix, MFXUtils::getFXColor(mySettings->colorSettings.waypointColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2305new FXLabel(stopMatrix, "stop (persons)", nullptr, GUIDesignViewSettingsLabel1);2306myStopPersonsColor = new FXColorWell(stopMatrix, MFXUtils::getFXColor(mySettings->colorSettings.stopPersonColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2307new FXLabel(stopMatrix, "stop (containers)", nullptr, GUIDesignViewSettingsLabel1);2308myStopContainersColor = new FXColorWell(stopMatrix, MFXUtils::getFXColor(mySettings->colorSettings.stopContainerColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2309}231023112312void2313GUIDialog_ViewSettings::buildPOIsFrame(FXTabBook* tabbook) {2314new FXTabItem(tabbook, TL("POIs"), nullptr, GUIDesignViewSettingsTabItemBook1);2315FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);2316FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);23172318FXMatrix* m63 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);2319new FXLabel(m63, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);2320myPOIColorMode = new MFXComboBoxIcon(m63, nullptr, false, GUIDesignComboBoxVisibleItems,2321this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2322mySettings->poiColorer.fill(*myPOIColorMode);2323myPOIColorInterpolation = new FXCheckButton(m63, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);2324myPOIColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);23252326new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);23272328FXMatrix* m61 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);23292330new FXLabel(m61, TL("POI detail"), nullptr, GUIDesignViewSettingsLabel1);2331myPoiDetail = new FXSpinner(m61, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);2332myPoiDetail->setRange(3, 100);2333myPoiDetail->setValue(mySettings->poiDetail);23342335myPOIUseCustomLayer = new FXCheckButton(m61, TL("Custom Layer"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);2336myPOIUseCustomLayer->setCheck(mySettings->poiUseCustomLayer);2337myPOICustomLayer = new FXRealSpinner(m61, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);2338myPOICustomLayer->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());2339myPOICustomLayer->setValue(mySettings->poiCustomLayer);23402341myPOINamePanel = new NamePanel(m61, this, TL("Show poi id"), mySettings->poiName);2342myPOITypePanel = new NamePanel(m61, this, TL("Show poi type"), mySettings->poiType);2343myPOITextPanel = new NamePanel(m61, this, TL("Show poi text param"), mySettings->poiText);2344myPOITextParamKey = new FXComboBox(myPOITextPanel->myMatrix0, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2345myPOITextParamKey->setEditable(true);23462347new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);23482349FXMatrix* m62 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);2350myPOISizePanel = new SizePanel(m62, this, mySettings->poiSize, GLO_POI);2351}235223532354void2355GUIDialog_ViewSettings::buildPolygonsFrame(FXTabBook* tabbook) {2356new FXTabItem(tabbook, TL("Polygons"), nullptr, GUIDesignViewSettingsTabItemBook1);2357FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);2358FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);23592360FXMatrix* m63 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);2361new FXLabel(m63, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);2362myPolyColorMode = new MFXComboBoxIcon(m63, nullptr, false, GUIDesignComboBoxVisibleItems,2363this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2364mySettings->polyColorer.fill(*myPolyColorMode);2365myPolyColorInterpolation = new FXCheckButton(m63, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);2366myPolyColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);23672368new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);23692370FXMatrix* m91 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);23712372myPolyUseCustomLayer = new FXCheckButton(m91, TL("Custom Layer"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);2373myPolyUseCustomLayer->setCheck(mySettings->polyUseCustomLayer);2374myPolyCustomLayer = new FXRealSpinner(m91, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);2375myPolyCustomLayer->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());2376myPolyCustomLayer->setValue(mySettings->polyCustomLayer);23772378myPolyNamePanel = new NamePanel(m91, this, TL("Show polygon id"), mySettings->polyName);2379myPolyTypePanel = new NamePanel(m91, this, TL("Show polygon types"), mySettings->polyType);2380new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);23812382myPolySizePanel = new SizePanel(m91, this, mySettings->polySize, GLO_POLYGON);2383}238423852386void2387GUIDialog_ViewSettings::buildSelectionFrame(FXTabBook* tabbook) {2388new FXTabItem(tabbook, TL("Selection"), nullptr, GUIDesignViewSettingsTabItemBook1);2389FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);2390FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);23912392FXMatrix* m102 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);2393new FXLabel(m102, TL("Default Selection Color"), nullptr, GUIDesignViewSettingsLabel1);2394new FXLabel(m102, "", nullptr, GUIDesignViewSettingsLabel1);23952396new FXLabel(m102, TL("Miscellaneous"), nullptr, GUIDesignViewSettingsLabel1);2397mySelectionColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2398new FXLabel(m102, "Edge", nullptr, GUIDesignViewSettingsLabel1);2399mySelectedEdgeColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedEdgeColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2400new FXLabel(m102, "Lane Edge", nullptr, GUIDesignViewSettingsLabel1);2401mySelectedLaneColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedLaneColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2402new FXLabel(m102, "Connection", nullptr, GUIDesignViewSettingsLabel1);2403mySelectedConnectionColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedConnectionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2404new FXLabel(m102, "Prohibition", nullptr, GUIDesignViewSettingsLabel1);2405mySelectedProhibitionColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedProhibitionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2406new FXLabel(m102, "Crossing", nullptr, GUIDesignViewSettingsLabel1);2407mySelectedCrossingColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedCrossingColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2408new FXLabel(m102, "Additional", nullptr, GUIDesignViewSettingsLabel1);2409mySelectedAdditionalColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedAdditionalColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2410new FXLabel(m102, "Route", nullptr, GUIDesignViewSettingsLabel1);2411mySelectedRouteColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedRouteColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2412new FXLabel(m102, "Vehicle", nullptr, GUIDesignViewSettingsLabel1);2413mySelectedVehicleColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedVehicleColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2414new FXLabel(m102, "Person", nullptr, GUIDesignViewSettingsLabel1);2415mySelectedPersonColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedPersonColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2416new FXLabel(m102, "PersonPlan", nullptr, GUIDesignViewSettingsLabel1);2417mySelectedPersonPlanColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedPersonPlanColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2418new FXLabel(m102, "edgeData", nullptr, GUIDesignViewSettingsLabel1);2419mySelectedEdgeDataColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedEdgeDataColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2420}242124222423void2424GUIDialog_ViewSettings::buildDataFrame(FXTabBook* tabbook) {2425new FXTabItem(tabbook, TL("Data"), nullptr, GUIDesignViewSettingsTabItemBook1);2426FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);2427FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);2428// ... color settings2429FXVerticalFrame* verticalFrame2 = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);2430FXMatrix* m111 = new FXMatrix(verticalFrame2, 4, GUIDesignViewSettingsMatrix3);2431new FXLabel(m111, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);2432myDataColorMode = new MFXComboBoxIcon(m111, nullptr, false, GUIDesignComboBoxVisibleItems,2433this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2434myDataColorInterpolation = new FXCheckButton(m111, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);2435myDataColorSettingFrame = new FXVerticalFrame(verticalFrame2, GUIDesignViewSettingsVerticalFrame4);2436myDataParamKey = new FXComboBox(m111, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxFixed(100));2437myDataParamKey->setEditable(true);2438myDataParamKey->disable();2439mySettings->dataColorer.fill(*myDataColorMode);24402441// rainbow settings2442myDataRainbowPanel = new RainbowPanel(verticalFrame2, this, mySettings->dataValueRainBow);24432444new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);24452446// data scale settings2447FXVerticalFrame* verticalFrameDataScale = new FXVerticalFrame(verticalFrame2, GUIDesignViewSettingsVerticalFrame6);2448FXMatrix* matrixDataScale = new FXMatrix(verticalFrameDataScale, 4, GUIDesignViewSettingsMatrix3);2449new FXLabel(matrixDataScale, TL("Scale size"), nullptr, GUIDesignViewSettingsLabel1);2450myDataScaleMode = new MFXComboBoxIcon(matrixDataScale, nullptr, true, GUIDesignComboBoxVisibleItems,2451this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2452myDataScaleInterpolation = new FXCheckButton(matrixDataScale, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);2453myDataScaleParamKey = new FXComboBox(matrixDataScale, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);2454myDataScaleParamKey->setEditable(true);2455myDataScaleParamKey->disable();2456myDataScaleSettingFrame = new FXVerticalFrame(verticalFrameDataScale, GUIDesignViewSettingsVerticalFrame4);2457mySettings->dataScaler.fill(*myDataScaleMode);2458new FXHorizontalSeparator(verticalFrame2, GUIDesignHorizontalSeparator);24592460FXMatrix* m112 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);24612462new FXLabel(m112, TL("Exaggerate edgeRelation width by"), nullptr, GUIDesignViewSettingsLabel1);2463myEdgeRelationUpscaleDialer = new FXRealSpinner(m112, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);2464myEdgeRelationUpscaleDialer->setRange(0, 1000000);2465myEdgeRelationUpscaleDialer->setValue(mySettings->edgeRelWidthExaggeration);24662467new FXLabel(m112, TL("Exaggerate tazRelation width by"), nullptr, GUIDesignViewSettingsLabel1);2468myTazRelationUpscaleDialer = new FXRealSpinner(m112, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);2469myTazRelationUpscaleDialer->setRange(0, 1000000);2470myTazRelationUpscaleDialer->setValue(mySettings->tazRelWidthExaggeration);24712472// text decoration2473myDataValuePanel = new NamePanel(m112, this, TL("Show data color value"), mySettings->dataValue);2474}247524762477void2478GUIDialog_ViewSettings::buildLegendFrame(FXTabBook* tabbook) {2479new FXTabItem(tabbook, TL("Legend"), nullptr, GUIDesignViewSettingsTabItemBook1);2480FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);2481FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);24822483FXMatrix* m72 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);2484myShowSizeLegend = new FXCheckButton(m72, TL("Show Size Legend"), this, MID_SIMPLE_VIEW_COLORCHANGE);2485myShowSizeLegend->setCheck(mySettings->showSizeLegend);2486new FXLabel(m72, "");2487myShowColorLegend = new FXCheckButton(m72, TL("Show Edge Color Legend"), this, MID_SIMPLE_VIEW_COLORCHANGE);2488myShowColorLegend->setCheck(mySettings->showColorLegend);2489new FXLabel(m72, "");2490myShowVehicleColorLegend = new FXCheckButton(m72, TL("Show Vehicle Color Legend"), this, MID_SIMPLE_VIEW_COLORCHANGE);2491myShowVehicleColorLegend->setCheck(mySettings->showVehicleColorLegend);2492new FXLabel(m72, "");2493}249424952496void2497GUIDialog_ViewSettings::buildOpenGLFrame(FXTabBook* tabbook) {2498new FXTabItem(tabbook, "openGL", nullptr, GUIDesignViewSettingsTabItemBook1);2499FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);2500FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);2501FXMatrix* m90 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);2502new FXLabel(m90, TL("UI Scaling"), nullptr, GUIDesignViewSettingsLabel1);2503myUIScale = new FXRealSpinner(m90, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);2504myUIScale->setValue(getApp()->reg().readRealEntry("SETTINGS", "uiscale", 1));2505FXMatrix* m80 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);2506myTrueZ = new FXCheckButton(m80, "Draw all objects at their true Z-level", this, MID_SIMPLE_VIEW_COLORCHANGE);2507myTrueZ->setCheck(mySettings->trueZ);2508FXMatrix* m81 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);2509new FXLabel(m81, TL("Combobox max rows"), nullptr, GUIDesignViewSettingsLabel1);2510myComboRows = new FXRealSpinner(m81, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);2511myComboRows->setValue(GUIDesignComboBoxVisibleItems);2512FXMatrix* m82 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);2513myDisableHideByZoom = new FXCheckButton(m82, TL("Disable hide by zoom"), this, MID_SIMPLE_VIEW_COLORCHANGE);2514myDisableHideByZoom->setHelpText(TL("Disable hiding edges with high zoom out"));2515myDisableHideByZoom->setCheck(mySettings->disableHideByZoom);2516FXMatrix* m83 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);2517myDither = new FXCheckButton(m83, TL("Dither"), this, MID_SIMPLE_VIEW_COLORCHANGE);2518myDither->setCheck(mySettings->dither);2519FXMatrix* m84 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);2520myFPS = new FXCheckButton(m84, "FPS", this, MID_SIMPLE_VIEW_COLORCHANGE);2521myFPS->setCheck(mySettings->fps);2522FXMatrix* m85 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);2523myDrawBoundaries = new FXCheckButton(m85, TL("Draw boundaries"), this, MID_SIMPLE_VIEW_COLORCHANGE);2524myDrawBoundaries->setCheck(mySettings->drawBoundaries);2525FXMatrix* m86 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);2526myForceDrawForRectangleSelection = new FXCheckButton(m86, TL("Force draw for rectangle selection"), this, MID_SIMPLE_VIEW_COLORCHANGE);2527myForceDrawForRectangleSelection->setCheck(mySettings->forceDrawForRectangleSelection);2528FXMatrix* m87 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);2529myDisableDottedContours = new FXCheckButton(m87, TL("Disable dotted contours during selection/deletion"), this, MID_SIMPLE_VIEW_COLORCHANGE);2530myDisableDottedContours->setCheck(mySettings->disableDottedContours);2531FXMatrix* m88 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);2532myRecalculateBoundaries = GUIDesigns::buildFXButton(m88, TL("Recalculate boundaries"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,2533(BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);2534FXMatrix* m89 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);2535myGeometryIndicesPanel = new NamePanel(m89, this, TL("Show geometry point indices"), mySettings->geometryIndices);2536}253725382539void2540GUIDialog_ViewSettings::build3DFrame(FXTabBook* tabbook) {2541myFrame3D = new FXTabItem(tabbook, TL("3D view"), nullptr, GUIDesignViewSettingsTabItemBook1);2542FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);2543FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);25442545FXMatrix* m82 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);2546myIgnoreColorSchemeFor3DVehicles = new FXCheckButton(m82, TL("Ignore color scheme for vehicles"), this, MID_SIMPLE_VIEW_COLORCHANGE);2547myIgnoreColorSchemeFor3DVehicles->setCheck(mySettings->ignoreColorSchemeFor3DVehicles);2548myShow3DTLSLinkMarkers = new FXCheckButton(m82, TL("Show TLS link markers"), this, MID_SIMPLE_VIEW_COLORCHANGE);2549myShow3DTLSLinkMarkers->setCheck(mySettings->show3DTLSLinkMarkers);2550//FXMatrix* m83 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);2551myShow3DTLSDomes = new FXCheckButton(m82, TL("Show domes around TLS models from decals"), this, MID_SIMPLE_VIEW_COLORCHANGE);2552myShow3DTLSDomes->setCheck(mySettings->show3DTLSDomes);2553//FXMatrix* m84 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);2554myGenerate3DTLSModels = new FXCheckButton(m82, TL("Show auto-generated TLS models"), this, MID_SIMPLE_VIEW_COLORCHANGE);2555myGenerate3DTLSModels->setCheck(mySettings->generate3DTLSModels);2556myShow3DHeadUpDisplay = new FXCheckButton(m82, TL("Show head-up display"), this, MID_SIMPLE_VIEW_COLORCHANGE);2557myShow3DHeadUpDisplay->setCheck(mySettings->show3DHeadUpDisplay);25582559new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);25602561FXMatrix* m2 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);2562new FXLabel(m2, TL("Sun brightness"), nullptr, GUIDesignViewSettingsLabel1);2563myLight3DFactor = new FXSpinner(m2, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);2564myLight3DFactor->setRange(0, 255);2565myLight3DFactor->setValue(mySettings->diffuse3DLight.red());2566/*2567new FXLabel(m2, "Ambient", nullptr, GUIDesignViewSettingsLabel1);2568myAmbient3DLight = new FXColorWell(m2, MFXUtils::getFXColor(mySettings->ambient3DLight), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2569myAmbient3DLight->setOpaqueOnly(true);2570new FXLabel(m2, "Diffuse", nullptr, GUIDesignViewSettingsLabel1);2571myDiffuse3DLight = new FXColorWell(m2, MFXUtils::getFXColor(mySettings->diffuse3DLight), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2572myDiffuse3DLight->setOpaqueOnly(true);2573*/2574new FXLabel(m2, TL("Sky color"), nullptr, GUIDesignViewSettingsLabel1);2575mySkyColor = new FXColorWell(m2, MFXUtils::getFXColor(mySettings->skyColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);2576mySkyColor->setOpaqueOnly(true);25772578#ifdef HAVE_OSG2579UNUSED_PARAMETER(myFrame3D);2580#else2581myFrame3D->disable();2582#endif2583}258425852586void2587GUIDialog_ViewSettings::buildButtons(FXVerticalFrame* contentFrame) {2588FXHorizontalFrame* horizontalFrameButtons = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame2);2589FXButton* OK = GUIDesigns::buildFXButton(horizontalFrameButtons, TL("&OK"), "", "", nullptr, this, MID_SETTINGS_OK, GUIDesignViewSettingsButton2);2590GUIDesigns::buildFXButton(horizontalFrameButtons, TL("&Cancel"), "", "", nullptr, this, MID_SETTINGS_CANCEL, GUIDesignViewSettingsButton3);2591OK->setFocus();2592}25932594/****************************************************************************/259525962597