Line data Source code
1 : /****************************************************************************/
2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 : // Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4 : // This program and the accompanying materials are made available under the
5 : // terms of the Eclipse Public License 2.0 which is available at
6 : // https://www.eclipse.org/legal/epl-2.0/
7 : // This Source Code may also be made available under the following Secondary
8 : // Licenses when the conditions for such availability set forth in the Eclipse
9 : // Public License 2.0 are satisfied: GNU General Public License, version 2
10 : // or later which is available at
11 : // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 : // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 : /****************************************************************************/
14 : /// @file GUIDialog_ViewSettings.cpp
15 : /// @author Daniel Krajzewicz
16 : /// @author Jakob Erdmann
17 : /// @author Michael Behrisch
18 : /// @author Laura Bieker
19 : /// @author Mirko Barthauer
20 : /// @date Wed, 21. Dec 2005
21 : ///
22 : // The dialog to change the view (gui) settings.
23 : /****************************************************************************/
24 : #include <config.h>
25 :
26 : #include <fstream>
27 : #include <fxkeys.h>
28 : #include <utils/gui/windows/GUIAppEnum.h>
29 : #include <utils/gui/windows/GUISUMOAbstractView.h>
30 : #include <utils/foxtools/MFXUtils.h>
31 : #include <utils/foxtools/MFXComboBoxIcon.h>
32 : #include <utils/common/RGBColor.h>
33 : #include <utils/common/ToString.h>
34 : #include <utils/common/StringUtils.h>
35 : #include <utils/common/StringUtils.h>
36 : #include <utils/options/OptionsCont.h>
37 : #include <utils/gui/settings/GUICompleteSchemeStorage.h>
38 : #include <utils/gui/images/GUIIconSubSys.h>
39 : #include <utils/gui/div/GUIIOGlobals.h>
40 : #include <utils/gui/div/GUIDesigns.h>
41 : #include <utils/importio/LineReader.h>
42 : #include <utils/iodevices/OutputDevice.h>
43 : #include <utils/gui/settings/GUISettingsHandler.h>
44 : #include <utils/gui/div/GUIGlobalViewObjectsHandler.h>
45 :
46 : #include "GUIDialog_EditViewport.h"
47 : #include "GUIDialog_ViewSettings.h"
48 :
49 :
50 : // ===========================================================================
51 : // FOX callback mapping
52 : // ===========================================================================
53 :
54 : FXDEFMAP(GUIDialog_ViewSettings::SizePanel) GUIDialog_SizeMap[] = {
55 : FXMAPFUNC(SEL_CHANGED, MID_SIMPLE_VIEW_SIZECHANGE, GUIDialog_ViewSettings::SizePanel::onCmdSizeChange),
56 : FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_SIZECHANGE, GUIDialog_ViewSettings::SizePanel::onCmdSizeChange)
57 : };
58 :
59 : FXDEFMAP(GUIDialog_ViewSettings) GUIDialog_ViewSettingsMap[] = {
60 : FXMAPFUNC(SEL_CHANGED, MID_SIMPLE_VIEW_COLORCHANGE, GUIDialog_ViewSettings::onCmdColorChange),
61 : FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_COLORCHANGE, GUIDialog_ViewSettings::onCmdColorChange),
62 : FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_NAMECHANGE, GUIDialog_ViewSettings::onCmdNameChange),
63 : FXMAPFUNC(SEL_COMMAND, MID_SETTINGS_OK, GUIDialog_ViewSettings::onCmdOk),
64 : FXMAPFUNC(SEL_COMMAND, MID_SETTINGS_CANCEL, GUIDialog_ViewSettings::onCmdCancel),
65 : FXMAPFUNC(SEL_KEYPRESS, 0, GUIDialog_ViewSettings::onKeyPress),
66 : // settings
67 : FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_SAVE, GUIDialog_ViewSettings::onCmdSaveSetting),
68 : FXMAPFUNC(SEL_UPDATE, MID_SIMPLE_VIEW_SAVE, GUIDialog_ViewSettings::onUpdSaveSetting),
69 : FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_DELETE, GUIDialog_ViewSettings::onCmdDeleteSetting),
70 : FXMAPFUNC(SEL_UPDATE, MID_SIMPLE_VIEW_DELETE, GUIDialog_ViewSettings::onUpdDeleteSetting),
71 : FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_EXPORT, GUIDialog_ViewSettings::onCmdExportSetting),
72 : FXMAPFUNC(SEL_UPDATE, MID_SIMPLE_VIEW_EXPORT, GUIDialog_ViewSettings::onUpdExportSetting),
73 : FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_IMPORT, GUIDialog_ViewSettings::onCmdImportSetting),
74 : FXMAPFUNC(SEL_UPDATE, MID_SIMPLE_VIEW_IMPORT, GUIDialog_ViewSettings::onUpdImportSetting),
75 : // decals
76 : FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_LOAD_DECAL, GUIDialog_ViewSettings::onCmdLoadDecal),
77 : FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_LOAD_DECALS_XML, GUIDialog_ViewSettings::onCmdLoadXMLDecals),
78 : FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_SAVE_DECALS_XML, GUIDialog_ViewSettings::onCmdSaveXMLDecals),
79 : FXMAPFUNC(SEL_COMMAND, MID_SIMPLE_VIEW_CLEAR_DECALS, GUIDialog_ViewSettings::onCmdClearDecals),
80 : };
81 :
82 0 : FXIMPLEMENT(GUIDialog_ViewSettings, FXTopWindow, GUIDialog_ViewSettingsMap, ARRAYNUMBER(GUIDialog_ViewSettingsMap))
83 0 : FXIMPLEMENT(GUIDialog_ViewSettings::SizePanel, FXObject, GUIDialog_SizeMap, ARRAYNUMBER(GUIDialog_SizeMap))
84 :
85 :
86 : // ===========================================================================
87 : // method definitions
88 : // ===========================================================================
89 : #ifdef _MSC_VER
90 : #pragma warning(push)
91 : #pragma warning(disable: 4355) // mask warning about "this" in initializers
92 : #endif
93 0 : GUIDialog_ViewSettings::GUIDialog_ViewSettings(GUISUMOAbstractView* parent, GUIVisualizationSettings* settings) :
94 0 : FXTopWindow(parent, TL("View Settings"),
95 : GUIIconSubSys::getIcon(GUIIcon::COLORWHEEL),
96 : GUIIconSubSys::getIcon(GUIIcon::COLORWHEEL),
97 : GUIDesignViewSettingsMainDialog),
98 : GUIPersistentWindowPos(this, "VIEWSETTINGS", true, 20, 40, 700, 500, 400, 20),
99 0 : myParent(parent),
100 0 : mySettings(settings),
101 0 : myBackup(settings->name, settings->netedit) {
102 : // make a backup copy
103 0 : myBackup.copy(*settings);
104 : // create content frame
105 0 : FXVerticalFrame* contentFrame = new FXVerticalFrame(this, GUIDesignViewSettingsVerticalFrame1);
106 : // build header
107 0 : buildHeader(contentFrame);
108 : // create tabbook for every section
109 0 : FXTabBook* tabbook = new FXTabBook(contentFrame, nullptr, 0, GUIDesignViewSettingsTabBook1);
110 : // build background frame
111 0 : buildBackgroundFrame(tabbook);
112 : // build streets frame
113 0 : buildStreetsFrame(tabbook);
114 : // build vehicles frame
115 0 : buildVehiclesFrame(tabbook);
116 : // build persons frame
117 0 : buildPersonsFrame(tabbook);
118 : // build containers frame
119 0 : buildContainersFrame(tabbook);
120 : // build junctions frame
121 0 : buildJunctionsFrame(tabbook);
122 : // build additionals frame
123 0 : buildAdditionalsFrame(tabbook);
124 : // build demand frame
125 0 : if (mySettings->netedit) {
126 0 : buildDemandFrame(tabbook);
127 : }
128 : // build POIs frame
129 0 : buildPOIsFrame(tabbook);
130 : // build polygons frame
131 0 : buildPolygonsFrame(tabbook);
132 : // build selection frame (only in netedit)
133 0 : if (mySettings->netedit) {
134 0 : buildSelectionFrame(tabbook);
135 : }
136 : // build data frame (only in netedit)
137 0 : if (mySettings->netedit) {
138 0 : buildDataFrame(tabbook);
139 : }
140 : // build legend frame
141 0 : buildLegendFrame(tabbook);
142 : // build 3D frame
143 0 : build3DFrame(tabbook);
144 0 : if (mySettings->netedit) {
145 0 : myFrame3D->disable();
146 : }
147 : // build openGL frame
148 0 : buildOpenGLFrame(tabbook);
149 : // build buttons
150 0 : buildButtons(contentFrame);
151 : // rebuild color matrix
152 0 : rebuildColorMatrices(false);
153 0 : setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY));
154 0 : loadWindowPos();
155 0 : }
156 : #ifdef _MSC_VER
157 : #pragma warning(pop)
158 : #endif
159 :
160 :
161 0 : GUIDialog_ViewSettings::~GUIDialog_ViewSettings() {
162 0 : myParent->remove(this);
163 : // delete name panels
164 0 : delete myInternalJunctionNamePanel;
165 0 : delete myInternalEdgeNamePanel;
166 0 : delete myTLSPhaseIndexPanel;
167 0 : delete myTLSPhaseNamePanel;
168 0 : delete myCwaEdgeNamePanel;
169 0 : delete myStreetNamePanel;
170 0 : delete myEdgeValuePanel;
171 0 : delete myEdgeScaleValuePanel;
172 0 : delete myJunctionIndexPanel;
173 0 : delete myTLIndexPanel;
174 0 : delete myJunctionIDPanel;
175 0 : delete myJunctionNamePanel;
176 0 : delete myVehicleNamePanel;
177 0 : delete myVehicleValuePanel;
178 0 : delete myVehicleScaleValuePanel;
179 0 : delete myVehicleTextPanel;
180 0 : delete myPersonNamePanel;
181 0 : delete myPersonValuePanel;
182 0 : delete myAddNamePanel;
183 0 : delete myAddFullNamePanel;
184 0 : delete myPOINamePanel;
185 0 : delete myPOITypePanel;
186 0 : delete myPOITextPanel;
187 0 : delete myPolyNamePanel;
188 0 : delete myPolyTypePanel;
189 0 : delete myEdgeNamePanel;
190 0 : delete myDataValuePanel;
191 0 : delete myGeometryIndicesPanel;
192 : // delete size panels
193 0 : delete myVehicleSizePanel;
194 0 : delete myPersonSizePanel;
195 0 : delete myJunctionSizePanel;
196 0 : delete myPOISizePanel;
197 0 : delete myPolySizePanel;
198 0 : delete myAddSizePanel;
199 : // delete rainbow panels
200 0 : delete myEdgeRainbowPanel;
201 0 : delete myJunctionRainbowPanel;
202 0 : delete myDataRainbowPanel;
203 0 : delete myVehicleRainbowPanel;
204 0 : }
205 :
206 :
207 : void
208 0 : GUIDialog_ViewSettings::show() {
209 : // update buttons that can be changed externally
210 0 : myShowGrid->setCheck(mySettings->showGrid);
211 0 : myGridXSizeDialer->setValue(mySettings->gridXSize);
212 0 : myGridYSizeDialer->setValue(mySettings->gridYSize);
213 : // create myNewDecalsTable
214 0 : myDecalsTable->create();
215 0 : myDecalsTable->fillTable();
216 0 : FXTopWindow::show();
217 0 : }
218 :
219 :
220 : GUISUMOAbstractView*
221 0 : GUIDialog_ViewSettings::getSUMOAbstractView() {
222 0 : return myParent;
223 : }
224 :
225 :
226 : void
227 0 : GUIDialog_ViewSettings::setCurrent(GUIVisualizationSettings* settings) {
228 0 : mySettings = settings;
229 0 : myBackup.copy(*settings);
230 0 : onCmdNameChange(nullptr, 0, nullptr);
231 0 : }
232 :
233 :
234 : long
235 0 : GUIDialog_ViewSettings::onCmdOk(FXObject*, FXSelector, void*) {
236 0 : getApp()->reg().writeIntEntry("SETTINGS", "comboRows", (int)myComboRows->getValue());
237 0 : getApp()->reg().writeRealEntry("SETTINGS", "uiscale", myUIScale->getValue());
238 0 : hide();
239 0 : return 1;
240 : }
241 :
242 :
243 : long
244 0 : GUIDialog_ViewSettings::onCmdCancel(FXObject*, FXSelector, void*) {
245 0 : hide();
246 0 : mySettings->copy(myBackup);
247 0 : myParent->update();
248 0 : return 1;
249 : }
250 :
251 :
252 : long
253 0 : GUIDialog_ViewSettings::onKeyPress(FXObject* o, FXSelector sel, void* ptr) {
254 : const FXEvent* e = (FXEvent*) ptr;
255 0 : if(e->code==KEY_Escape){
256 0 : onCmdCancel(nullptr, 0, nullptr);
257 0 : return 1;
258 : }
259 0 : return FXTopWindow::onKeyPress(o, sel, ptr);
260 : }
261 :
262 :
263 : long
264 0 : GUIDialog_ViewSettings::onCmdNameChange(FXObject*, FXSelector, void* ptr) {
265 0 : if (ptr != nullptr) {
266 0 : FXString dataS = (char*) ptr; // !!!unicode
267 : // check whether this item has been added twice
268 0 : if (dataS.text() == mySchemeName->getItemText(mySchemeName->getNumItems() - 1)) {
269 0 : for (int i = 0; i < mySchemeName->getNumItems() - 1; ++i) {
270 0 : if (dataS.text() == mySchemeName->getItemText(i)) {
271 0 : mySchemeName->removeItem(i);
272 : }
273 : }
274 : }
275 0 : myBackup.copy(gSchemeStorage.get(dataS.text()));
276 0 : mySettings = &gSchemeStorage.get(dataS.text());
277 0 : }
278 0 : myBackgroundColor->setRGBA(MFXUtils::getFXColor(mySettings->backgroundColor));
279 :
280 0 : myBusStopColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.busStopColor));
281 0 : myBusStopColorSign->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.busStopColorSign));
282 0 : myTrainStopColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.trainStopColor));
283 0 : myTrainStopColorSign->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.trainStopColorSign));
284 0 : myContainerStopColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.containerStopColor));
285 0 : myContainerStopColorSign->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.containerStopColorSign));
286 0 : myChargingStationColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.chargingStationColor));
287 0 : myChargingStationColorSign->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.chargingStationColorSign));
288 0 : if (mySettings->netedit) {
289 0 : myStopColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.stopColor));
290 0 : myWaypointColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.waypointColor));
291 0 : myVehicleTripsColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.vehicleTripColor));
292 0 : myStopPersonsColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.stopPersonColor));
293 0 : myPersonTripColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.personTripColor));
294 0 : myWalkColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.walkColor));
295 0 : myRideColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.rideColor));
296 0 : myStopContainersColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.stopContainerColor));
297 0 : myTransportColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.transportColor));
298 0 : myTranshipColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.transhipColor));
299 :
300 0 : myTripWidth->setValue(mySettings->widthSettings.tripWidth);
301 0 : myPersonTripWidth->setValue(mySettings->widthSettings.personTripWidth);
302 0 : myWalkWidth->setValue(mySettings->widthSettings.walkWidth);
303 0 : myRideWidth->setValue(mySettings->widthSettings.rideWidth);
304 0 : myTransportWidth->setValue(mySettings->widthSettings.transportWidth);
305 0 : myTranshipWidth->setValue(mySettings->widthSettings.transhipWidth);
306 :
307 0 : mySelectionColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectionColor));
308 0 : mySelectedEdgeColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedEdgeColor));
309 0 : mySelectedLaneColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedLaneColor));
310 0 : mySelectedConnectionColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedConnectionColor));
311 0 : mySelectedProhibitionColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedProhibitionColor));
312 0 : mySelectedCrossingColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedCrossingColor));
313 0 : mySelectedAdditionalColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedAdditionalColor));
314 0 : mySelectedRouteColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedRouteColor));
315 0 : mySelectedVehicleColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedVehicleColor));
316 0 : mySelectedPersonColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedPersonColor));
317 0 : mySelectedPersonPlanColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedPersonPlanColor));
318 0 : mySelectedEdgeDataColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedEdgeDataColor));
319 :
320 0 : myDataValuePanel->update(mySettings->dataValue);
321 0 : myDataColorMode->setCurrentItem((FXint) mySettings->dataColorer.getActive());
322 0 : myDataScaleMode->setCurrentItem((FXint) mySettings->dataScaler.getActive());
323 0 : myEdgeRelationUpscaleDialer->setValue(mySettings->edgeRelWidthExaggeration);
324 0 : myTazRelationUpscaleDialer->setValue(mySettings->tazRelWidthExaggeration);
325 0 : myDataRainbowPanel->update(mySettings->dataValueRainBow);
326 : }
327 :
328 0 : myLaneEdgeColorMode->setCurrentItem((FXint) mySettings->getLaneEdgeMode());
329 0 : myLaneEdgeScaleMode->setCurrentItem((FXint) mySettings->getLaneEdgeScaleMode());
330 0 : myShowLaneBorders->setCheck(mySettings->laneShowBorders);
331 0 : myShowBikeMarkings->setCheck(mySettings->showBikeMarkings);
332 0 : myShowLaneDecals->setCheck(mySettings->showLinkDecals);
333 0 : myRealisticLinkRules->setCheck(mySettings->realisticLinkRules);
334 0 : myShowLinkRules->setCheck(mySettings->showLinkRules);
335 0 : myShowRails->setCheck(mySettings->showRails);
336 0 : mySecondaryShape->setCheck(mySettings->secondaryShape);
337 0 : myEdgeNamePanel->update(mySettings->edgeName);
338 0 : myInternalEdgeNamePanel->update(mySettings->internalEdgeName);
339 0 : myCwaEdgeNamePanel->update(mySettings->cwaEdgeName);
340 0 : myStreetNamePanel->update(mySettings->streetName);
341 0 : myEdgeValuePanel->update(mySettings->edgeValue);
342 0 : myEdgeScaleValuePanel->update(mySettings->edgeScaleValue);
343 0 : myHideMacroConnectors->setCheck(mySettings->hideConnectors);
344 0 : myShowLaneDirection->setCheck(mySettings->showLaneDirection);
345 0 : myShowSublanes->setCheck(mySettings->showSublanes);
346 0 : mySpreadSuperposed->setCheck(mySettings->spreadSuperposed);
347 0 : myDisableHideByZoom->setCheck(mySettings->disableHideByZoom);
348 0 : myEdgeRainbowPanel->update(mySettings->edgeValueRainBow);
349 0 : myLaneWidthUpscaleDialer->setValue(mySettings->laneWidthExaggeration);
350 0 : myLaneMinWidthDialer->setValue(mySettings->laneMinSize);
351 :
352 0 : myVehicleColorMode->setCurrentItem((FXint) mySettings->vehicleColorer.getActive());
353 0 : myVehicleScaleMode->setCurrentItem((FXint) mySettings->vehicleScaler.getActive());
354 0 : myVehicleShapeDetail->setCurrentItem(mySettings->vehicleQuality);
355 0 : myShowBlinker->setCheck(mySettings->showBlinker);
356 0 : myShowMinGap->setCheck(mySettings->drawMinGap);
357 0 : myShowBrakeGap->setCheck(mySettings->drawBrakeGap);
358 0 : myShowBTRange->setCheck(mySettings->showBTRange);
359 0 : myShowRouteIndex->setCheck(mySettings->showRouteIndex);
360 0 : myScaleLength->setCheck(mySettings->scaleLength);
361 0 : myDrawReversed->setCheck(mySettings->drawReversed);
362 0 : myShowParkingInfo->setCheck(mySettings->showParkingInfo);
363 0 : myShowChargingInfo->setCheck(mySettings->showChargingInfo);
364 : /*
365 : myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
366 : */
367 0 : myVehicleNamePanel->update(mySettings->vehicleName);
368 0 : myVehicleValuePanel->update(mySettings->vehicleValue);
369 0 : myVehicleScaleValuePanel->update(mySettings->vehicleScaleValue);
370 0 : myVehicleTextPanel->update(mySettings->vehicleText);
371 0 : myVehicleSizePanel->update(mySettings->vehicleSize);
372 0 : myVehicleRainbowPanel->update(mySettings->vehicleValueRainBow);
373 :
374 0 : myPersonColorMode->setCurrentItem((FXint) mySettings->personColorer.getActive());
375 0 : myPersonShapeDetail->setCurrentItem(mySettings->personQuality);
376 0 : myPersonNamePanel->update(mySettings->personName);
377 0 : myPersonValuePanel->update(mySettings->personValue);
378 0 : myPersonSizePanel->update(mySettings->personSize);
379 :
380 0 : myContainerColorMode->setCurrentItem((FXint) mySettings->containerColorer.getActive());
381 0 : myContainerShapeDetail->setCurrentItem(mySettings->containerQuality);
382 0 : myContainerNamePanel->update(mySettings->containerName);
383 0 : myContainerSizePanel->update(mySettings->containerSize);
384 :
385 0 : myJunctionColorMode->setCurrentItem((FXint) mySettings->junctionColorer.getActive());
386 0 : myTLIndexPanel->update(mySettings->drawLinkTLIndex);
387 0 : myJunctionIndexPanel->update(mySettings->drawLinkJunctionIndex);
388 0 : myJunctionIDPanel->update(mySettings->junctionID);
389 0 : myJunctionNamePanel->update(mySettings->junctionName);
390 0 : myInternalJunctionNamePanel->update(mySettings->internalJunctionName);
391 0 : myTLSPhaseIndexPanel->update(mySettings->tlsPhaseIndex);
392 0 : myTLSPhaseNamePanel->update(mySettings->tlsPhaseName);
393 0 : myJunctionSizePanel->update(mySettings->junctionSize);
394 0 : myJunctionRainbowPanel->update(mySettings->junctionValueRainBow);
395 :
396 0 : myAddNamePanel->update(mySettings->addName);
397 0 : myAddFullNamePanel->update(mySettings->addFullName);
398 0 : myAddSizePanel->update(mySettings->addSize);
399 :
400 0 : myPoiDetail->setValue(mySettings->poiDetail);
401 0 : myPOIUseCustomLayer->setCheck(mySettings->poiUseCustomLayer);
402 0 : myPOICustomLayer->setValue(mySettings->poiCustomLayer);
403 0 : myPOINamePanel->update(mySettings->poiName);
404 0 : myPOITypePanel->update(mySettings->poiType);
405 0 : myPOITextPanel->update(mySettings->poiText);
406 0 : myPOISizePanel->update(mySettings->poiSize);
407 :
408 0 : myPolyNamePanel->update(mySettings->polyName);
409 0 : myPolyTypePanel->update(mySettings->polyType);
410 0 : myPolySizePanel->update(mySettings->polySize);
411 0 : myPolyUseCustomLayer->setCheck(mySettings->polyUseCustomLayer);
412 0 : myPolyCustomLayer->setValue(mySettings->polyCustomLayer);
413 :
414 0 : myShowLane2Lane->setCheck(mySettings->showLane2Lane);
415 0 : myDrawJunctionShape->setCheck(mySettings->drawJunctionShape);
416 0 : myDrawCrossingsAndWalkingAreas->setCheck(mySettings->drawCrossingsAndWalkingareas);
417 0 : myDither->setCheck(mySettings->dither);
418 0 : myFPS->setCheck(mySettings->fps);
419 0 : myTrueZ->setCheck(mySettings->trueZ);
420 0 : myDrawBoundaries->setCheck(mySettings->drawBoundaries);
421 0 : myForceDrawForRectangleSelection->setCheck(mySettings->forceDrawForRectangleSelection);
422 0 : myDisableDottedContours->setCheck(mySettings->disableDottedContours);
423 0 : myGeometryIndicesPanel->update(mySettings->geometryIndices);
424 0 : myShowSizeLegend->setCheck(mySettings->showSizeLegend);
425 0 : myShowColorLegend->setCheck(mySettings->showColorLegend);
426 0 : myShowVehicleColorLegend->setCheck(mySettings->showVehicleColorLegend);
427 :
428 0 : myShowPedestrianNetwork->setCheck(mySettings->showPedestrianNetwork);
429 0 : myPedestrianNetworkColor->setRGBA(MFXUtils::getFXColor(mySettings->pedestrianNetworkColor));
430 :
431 0 : myParent->setColorScheme(mySettings->name);
432 0 : rebuildColorMatrices(true);
433 :
434 0 : update();
435 0 : myParent->update();
436 0 : return 1;
437 : }
438 :
439 :
440 : bool
441 0 : GUIDialog_ViewSettings::updateColorRanges(FXObject* sender, std::vector<FXColorWell*>::const_iterator colIt,
442 : std::vector<FXColorWell*>::const_iterator colEnd,
443 : std::vector<FXRealSpinner*>::const_iterator threshIt,
444 : std::vector<FXRealSpinner*>::const_iterator threshEnd,
445 : std::vector<FXButton*>::const_iterator buttonIt,
446 : GUIColorScheme& scheme) {
447 : UNUSED_PARAMETER(threshEnd);
448 : int pos = 0;
449 0 : while (colIt != colEnd) {
450 0 : if (scheme.isFixed()) {
451 0 : if (sender == *colIt) {
452 0 : scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
453 : }
454 : } else {
455 0 : if (sender == *threshIt) {
456 : const double val = (*threshIt)->getValue();
457 : scheme.setThreshold(pos, val);
458 0 : return false;
459 : }
460 0 : if (sender == *colIt) {
461 0 : scheme.setColor(pos, MFXUtils::getRGBColor((*colIt)->getRGBA()));
462 0 : return false;
463 : }
464 0 : if (sender == *buttonIt) {
465 0 : scheme.addColor(MFXUtils::getRGBColor((*colIt)->getRGBA()), (*threshIt)->getValue());
466 0 : return true;
467 0 : } else if (sender == *(buttonIt + 1)) {
468 0 : scheme.removeColor(pos);
469 0 : return true;
470 : }
471 : // 2 buttons per item (add / remove)
472 : threshIt++;
473 : buttonIt += 2;
474 : }
475 : ++colIt;
476 0 : pos++;
477 : }
478 : return false;
479 : }
480 :
481 :
482 : bool
483 0 : GUIDialog_ViewSettings::updateScaleRanges(FXObject* sender, std::vector<FXRealSpinner*>::const_iterator scaleIt,
484 : std::vector<FXRealSpinner*>::const_iterator scaleEnd,
485 : std::vector<FXRealSpinner*>::const_iterator threshIt,
486 : std::vector<FXRealSpinner*>::const_iterator threshEnd,
487 : std::vector<FXButton*>::const_iterator buttonIt,
488 : GUIScaleScheme& scheme) {
489 : int pos = 0;
490 0 : while (scaleIt != scaleEnd) {
491 0 : if (scheme.isFixed()) {
492 0 : if (sender == *scaleIt) {
493 : scheme.setColor(pos, (*scaleIt)->getValue());
494 : }
495 : } else {
496 0 : if (sender == *threshIt) {
497 : const double val = (*threshIt)->getValue();
498 : double lo, hi;
499 0 : if (pos != 0) {
500 : threshIt--;
501 0 : (*threshIt)->getRange(lo, hi);
502 0 : (*threshIt)->setRange(lo, val);
503 : threshIt++;
504 : }
505 : threshIt++;
506 0 : if (threshIt != threshEnd) {
507 0 : (*threshIt)->getRange(lo, hi);
508 0 : (*threshIt)->setRange(val, hi);
509 : }
510 : scheme.setThreshold(pos, val);
511 : return false;
512 : }
513 0 : if (sender == *scaleIt) {
514 : scheme.setColor(pos, (*scaleIt)->getValue());
515 0 : return false;
516 : }
517 0 : if (sender == *buttonIt) {
518 0 : scheme.addColor((*scaleIt)->getValue(), (*threshIt)->getValue());
519 0 : return true;
520 0 : } else if (sender == *(buttonIt + 1)) {
521 0 : scheme.removeColor(pos);
522 0 : return true;
523 : }
524 : threshIt++;
525 : buttonIt += 2;
526 : }
527 : ++scaleIt;
528 0 : pos++;
529 : }
530 : return false;
531 : }
532 :
533 :
534 : long
535 0 : GUIDialog_ViewSettings::onCmdColorChange(FXObject* sender, FXSelector, void* /*val*/) {
536 0 : GUIVisualizationSettings tmpSettings(mySettings->name);
537 0 : tmpSettings.copy(*mySettings);
538 0 : int prevLaneMode = mySettings->getLaneEdgeMode();
539 0 : int prevLaneScaleMode = mySettings->getLaneEdgeScaleMode();
540 0 : int prevVehicleMode = mySettings->vehicleColorer.getActive();
541 : int prevVehicleScaleMode = mySettings->vehicleScaler.getActive();
542 : int prevPersonMode = mySettings->personColorer.getActive();
543 : int prevContainerMode = mySettings->containerColorer.getActive();
544 : int prevJunctionMode = mySettings->junctionColorer.getActive();
545 : int prevPOIMode = mySettings->poiColorer.getActive();
546 : int prevPolyMode = mySettings->polyColorer.getActive();
547 : int prevDataMode = mySettings->dataColorer.getActive();
548 : int prevDataScaleMode = mySettings->dataScaler.getActive();
549 : bool doRebuildColorMatrices = false;
550 :
551 0 : tmpSettings.name = mySettings->name;
552 0 : tmpSettings.backgroundColor = MFXUtils::getRGBColor(myBackgroundColor->getRGBA());
553 :
554 : // additionals
555 0 : tmpSettings.colorSettings.busStopColor = MFXUtils::getRGBColor(myBusStopColor->getRGBA());
556 0 : tmpSettings.colorSettings.busStopColorSign = MFXUtils::getRGBColor(myBusStopColorSign->getRGBA());
557 0 : tmpSettings.colorSettings.trainStopColor = MFXUtils::getRGBColor(myTrainStopColor->getRGBA());
558 0 : tmpSettings.colorSettings.trainStopColorSign = MFXUtils::getRGBColor(myTrainStopColorSign->getRGBA());
559 0 : tmpSettings.colorSettings.containerStopColor = MFXUtils::getRGBColor(myContainerStopColor->getRGBA());
560 0 : tmpSettings.colorSettings.containerStopColorSign = MFXUtils::getRGBColor(myContainerStopColorSign->getRGBA());
561 0 : tmpSettings.colorSettings.chargingStationColor = MFXUtils::getRGBColor(myChargingStationColor->getRGBA());
562 0 : tmpSettings.colorSettings.chargingStationColorSign = MFXUtils::getRGBColor(myChargingStationColorSign->getRGBA());
563 0 : if (mySettings->netedit) {
564 0 : tmpSettings.colorSettings.stopColor = MFXUtils::getRGBColor(myStopColor->getRGBA());
565 0 : tmpSettings.colorSettings.waypointColor = MFXUtils::getRGBColor(myWaypointColor->getRGBA());
566 0 : tmpSettings.colorSettings.vehicleTripColor = MFXUtils::getRGBColor(myVehicleTripsColor->getRGBA());
567 0 : tmpSettings.colorSettings.stopPersonColor = MFXUtils::getRGBColor(myStopPersonsColor->getRGBA());
568 0 : tmpSettings.colorSettings.personTripColor = MFXUtils::getRGBColor(myPersonTripColor->getRGBA());
569 0 : tmpSettings.colorSettings.walkColor = MFXUtils::getRGBColor(myWalkColor->getRGBA());
570 0 : tmpSettings.colorSettings.rideColor = MFXUtils::getRGBColor(myRideColor->getRGBA());
571 0 : tmpSettings.colorSettings.stopContainerColor = MFXUtils::getRGBColor(myStopContainersColor->getRGBA());
572 0 : tmpSettings.colorSettings.transportColor = MFXUtils::getRGBColor(myTransportColor->getRGBA());
573 0 : tmpSettings.colorSettings.transhipColor = MFXUtils::getRGBColor(myTranshipColor->getRGBA());
574 :
575 0 : tmpSettings.widthSettings.tripWidth = myTripWidth->getValue();
576 0 : tmpSettings.widthSettings.personTripWidth = myPersonTripWidth->getValue();
577 0 : tmpSettings.widthSettings.walkWidth = myWalkWidth->getValue();
578 0 : tmpSettings.widthSettings.rideWidth = myRideWidth->getValue();
579 0 : tmpSettings.widthSettings.transportWidth = myTransportWidth->getValue();
580 0 : tmpSettings.widthSettings.transhipWidth = myTranshipWidth->getValue();
581 :
582 0 : tmpSettings.colorSettings.selectionColor = MFXUtils::getRGBColor(mySelectionColor->getRGBA());
583 0 : tmpSettings.colorSettings.selectedEdgeColor = MFXUtils::getRGBColor(mySelectedEdgeColor->getRGBA());
584 0 : tmpSettings.colorSettings.selectedLaneColor = MFXUtils::getRGBColor(mySelectedLaneColor->getRGBA());
585 0 : tmpSettings.colorSettings.selectedConnectionColor = MFXUtils::getRGBColor(mySelectedConnectionColor->getRGBA());
586 0 : tmpSettings.colorSettings.selectedProhibitionColor = MFXUtils::getRGBColor(mySelectedProhibitionColor->getRGBA());
587 0 : tmpSettings.colorSettings.selectedCrossingColor = MFXUtils::getRGBColor(mySelectedCrossingColor->getRGBA());
588 0 : tmpSettings.colorSettings.selectedAdditionalColor = MFXUtils::getRGBColor(mySelectedAdditionalColor->getRGBA());
589 0 : tmpSettings.colorSettings.selectedRouteColor = MFXUtils::getRGBColor(mySelectedRouteColor->getRGBA());
590 0 : tmpSettings.colorSettings.selectedVehicleColor = MFXUtils::getRGBColor(mySelectedVehicleColor->getRGBA());
591 0 : tmpSettings.colorSettings.selectedPersonColor = MFXUtils::getRGBColor(mySelectedPersonColor->getRGBA());
592 0 : tmpSettings.colorSettings.selectedPersonPlanColor = MFXUtils::getRGBColor(mySelectedPersonPlanColor->getRGBA());
593 0 : tmpSettings.colorSettings.selectedEdgeDataColor = MFXUtils::getRGBColor(mySelectedEdgeDataColor->getRGBA());
594 : }
595 :
596 0 : tmpSettings.showGrid = (myShowGrid->getCheck() != FALSE);
597 0 : tmpSettings.gridXSize = (double) myGridXSizeDialer->getValue();
598 0 : tmpSettings.gridYSize = (double) myGridYSizeDialer->getValue();
599 :
600 0 : if (GUIVisualizationSettings::UseMesoSim) {
601 0 : tmpSettings.edgeColorer.setActive(myLaneEdgeColorMode->getCurrentItem());
602 0 : tmpSettings.edgeScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());
603 : } else {
604 0 : tmpSettings.laneColorer.setActive(myLaneEdgeColorMode->getCurrentItem());
605 0 : tmpSettings.laneScaler.setActive(myLaneEdgeScaleMode->getCurrentItem());
606 : }
607 0 : tmpSettings.laneShowBorders = (myShowLaneBorders->getCheck() != FALSE);
608 0 : tmpSettings.showBikeMarkings = (myShowBikeMarkings->getCheck() != FALSE);
609 0 : tmpSettings.showLinkDecals = (myShowLaneDecals->getCheck() != FALSE);
610 0 : tmpSettings.realisticLinkRules = (myRealisticLinkRules->getCheck() != FALSE);
611 0 : tmpSettings.showLinkRules = (myShowLinkRules->getCheck() != FALSE);
612 0 : tmpSettings.showRails = (myShowRails->getCheck() != FALSE);
613 0 : tmpSettings.secondaryShape = (mySecondaryShape->getCheck() != FALSE);
614 0 : tmpSettings.edgeName = myEdgeNamePanel->getSettings();
615 0 : tmpSettings.internalEdgeName = myInternalEdgeNamePanel->getSettings();
616 0 : tmpSettings.cwaEdgeName = myCwaEdgeNamePanel->getSettings();
617 0 : tmpSettings.streetName = myStreetNamePanel->getSettings();
618 0 : tmpSettings.edgeValue = myEdgeValuePanel->getSettings();
619 0 : tmpSettings.edgeScaleValue = myEdgeScaleValuePanel->getSettings();
620 0 : tmpSettings.hideConnectors = (myHideMacroConnectors->getCheck() != FALSE);
621 0 : tmpSettings.showLaneDirection = (myShowLaneDirection->getCheck() != FALSE);
622 0 : tmpSettings.showSublanes = (myShowSublanes->getCheck() != FALSE);
623 0 : tmpSettings.spreadSuperposed = (mySpreadSuperposed->getCheck() != FALSE);
624 0 : tmpSettings.disableHideByZoom = (myDisableHideByZoom->getCheck() != FALSE);
625 0 : if (sender == myParamKey) {
626 0 : if (tmpSettings.getLaneEdgeScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_EDGE_PARAM_NUMERICAL) {
627 0 : tmpSettings.edgeParam = myParamKey->getText().text();
628 0 : } else if (tmpSettings.getLaneEdgeScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_LANE_PARAM_NUMERICAL) {
629 0 : tmpSettings.laneParam = myParamKey->getText().text();
630 0 : } else if (tmpSettings.getLaneEdgeScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {
631 0 : tmpSettings.edgeData = myParamKey->getText().text();
632 0 : } else if (tmpSettings.getLaneEdgeScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_LIVE) {
633 0 : tmpSettings.edgeData = myParamKey->getText().text();
634 : }
635 0 : } else if (sender == myScalingParamKey) {
636 0 : if (tmpSettings.getLaneEdgeScaleScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {
637 0 : tmpSettings.edgeDataScaling = myScalingParamKey->getText().text();
638 : }
639 0 : } else if (sender == myVehicleParamKey) {
640 0 : if (tmpSettings.vehicleColorer.getScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_PARAM_NUMERICAL) {
641 0 : tmpSettings.vehicleParam = myVehicleParamKey->getText().text();
642 : }
643 0 : } else if (sender == myVehicleScalingParamKey) {
644 0 : if (tmpSettings.vehicleScaler.getScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_PARAM_NUMERICAL) {
645 0 : tmpSettings.vehicleScaleParam = myVehicleScalingParamKey->getText().text();
646 : }
647 0 : } else if (sender == myDataParamKey) {
648 0 : if (tmpSettings.dataColorer.getScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL) {
649 0 : tmpSettings.relDataAttr = myDataParamKey->getText().text();
650 : }
651 0 : } else if (sender == myDataScaleParamKey) {
652 0 : if (tmpSettings.dataScaler.getScheme().getName() == GUIVisualizationSettings::SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL) {
653 0 : tmpSettings.relDataScaleAttr = myDataScaleParamKey->getText().text();
654 : }
655 0 : } else if (sender == myVehicleTextPanel->myCheck) {
656 0 : updateVehicleParams();
657 0 : } else if (sender == myVehicleTextParamKey) {
658 0 : tmpSettings.vehicleTextParam = myVehicleTextParamKey->getText().text();
659 0 : } else if (sender == myPOITextPanel->myCheck) {
660 0 : updatePOIParams();
661 0 : } else if (sender == myPOITextParamKey) {
662 0 : tmpSettings.poiTextParam = myPOITextParamKey->getText().text();
663 0 : } else if (sender == myMeanDataID) {
664 0 : tmpSettings.edgeDataID = myMeanDataID->getText().text();
665 : }
666 0 : tmpSettings.edgeValueRainBow = myEdgeRainbowPanel->getSettings();
667 0 : tmpSettings.laneWidthExaggeration = myLaneWidthUpscaleDialer->getValue();
668 0 : tmpSettings.laneMinSize = myLaneMinWidthDialer->getValue();
669 :
670 0 : tmpSettings.vehicleColorer.setActive(myVehicleColorMode->getCurrentItem());
671 0 : tmpSettings.vehicleScaler.setActive(myVehicleScaleMode->getCurrentItem());
672 0 : tmpSettings.vehicleQuality = myVehicleShapeDetail->getCurrentItem();
673 0 : tmpSettings.showBlinker = (myShowBlinker->getCheck() != FALSE);
674 0 : tmpSettings.drawMinGap = (myShowMinGap->getCheck() != FALSE);
675 0 : tmpSettings.drawBrakeGap = (myShowBrakeGap->getCheck() != FALSE);
676 0 : tmpSettings.showBTRange = (myShowBTRange->getCheck() != FALSE);
677 0 : tmpSettings.showRouteIndex = (myShowRouteIndex->getCheck() != FALSE);
678 0 : tmpSettings.scaleLength = (myScaleLength->getCheck() != FALSE);
679 0 : tmpSettings.drawReversed = (myDrawReversed->getCheck() != FALSE);
680 0 : tmpSettings.showParkingInfo = (myShowParkingInfo->getCheck() != FALSE);
681 0 : tmpSettings.showChargingInfo = (myShowChargingInfo->getCheck() != FALSE);
682 : /*
683 : tmpSettings.drawLaneChangePreference = (myShowLaneChangePreference->getCheck() != FALSE);
684 : */
685 0 : tmpSettings.vehicleName = myVehicleNamePanel->getSettings();
686 0 : tmpSettings.vehicleValue = myVehicleValuePanel->getSettings();
687 0 : tmpSettings.vehicleScaleValue = myVehicleScaleValuePanel->getSettings();
688 0 : tmpSettings.vehicleText = myVehicleTextPanel->getSettings();
689 0 : tmpSettings.vehicleSize = myVehicleSizePanel->getSettings();
690 0 : tmpSettings.vehicleValueRainBow = myVehicleRainbowPanel->getSettings();
691 :
692 0 : tmpSettings.personColorer.setActive(myPersonColorMode->getCurrentItem());
693 0 : tmpSettings.personQuality = myPersonShapeDetail->getCurrentItem();
694 0 : tmpSettings.personName = myPersonNamePanel->getSettings();
695 0 : tmpSettings.personValue = myPersonValuePanel->getSettings();
696 0 : tmpSettings.personSize = myPersonSizePanel->getSettings();
697 :
698 0 : tmpSettings.containerColorer.setActive(myContainerColorMode->getCurrentItem());
699 0 : tmpSettings.containerQuality = myContainerShapeDetail->getCurrentItem();
700 0 : tmpSettings.containerName = myContainerNamePanel->getSettings();
701 0 : tmpSettings.containerSize = myContainerSizePanel->getSettings();
702 :
703 0 : tmpSettings.junctionColorer.setActive(myJunctionColorMode->getCurrentItem());
704 0 : tmpSettings.drawLinkTLIndex = myTLIndexPanel->getSettings();
705 0 : tmpSettings.drawLinkJunctionIndex = myJunctionIndexPanel->getSettings();
706 0 : tmpSettings.junctionID = myJunctionIDPanel->getSettings();
707 0 : tmpSettings.junctionName = myJunctionNamePanel->getSettings();
708 0 : tmpSettings.internalJunctionName = myInternalJunctionNamePanel->getSettings();
709 0 : tmpSettings.tlsPhaseIndex = myTLSPhaseIndexPanel->getSettings();
710 0 : tmpSettings.tlsPhaseName = myTLSPhaseNamePanel->getSettings();
711 0 : tmpSettings.junctionSize = myJunctionSizePanel->getSettings();
712 0 : tmpSettings.junctionValueRainBow = myJunctionRainbowPanel->getSettings();
713 :
714 0 : tmpSettings.addName = myAddNamePanel->getSettings();
715 0 : tmpSettings.addFullName = myAddFullNamePanel->getSettings();
716 0 : tmpSettings.addSize = myAddSizePanel->getSettings();
717 :
718 0 : tmpSettings.poiColorer.setActive(myPOIColorMode->getCurrentItem());
719 0 : tmpSettings.poiDetail = myPoiDetail->getValue();
720 0 : tmpSettings.poiName = myPOINamePanel->getSettings();
721 0 : tmpSettings.poiType = myPOITypePanel->getSettings();
722 0 : tmpSettings.poiText = myPOITextPanel->getSettings();
723 0 : tmpSettings.poiSize = myPOISizePanel->getSettings();
724 0 : tmpSettings.poiUseCustomLayer = myPOIUseCustomLayer->getCheck() != FALSE;
725 0 : tmpSettings.poiCustomLayer = myPOICustomLayer->getValue();
726 :
727 0 : tmpSettings.polyColorer.setActive(myPolyColorMode->getCurrentItem());
728 0 : tmpSettings.polyName = myPolyNamePanel->getSettings();
729 0 : tmpSettings.polyType = myPolyTypePanel->getSettings();
730 0 : tmpSettings.polySize = myPolySizePanel->getSettings();
731 0 : tmpSettings.polyUseCustomLayer = myPolyUseCustomLayer->getCheck() != FALSE;
732 0 : tmpSettings.polyCustomLayer = myPolyCustomLayer->getValue();
733 :
734 0 : if (mySettings->netedit) {
735 0 : tmpSettings.dataValue = myDataValuePanel->getSettings();
736 0 : tmpSettings.dataColorer.setActive(myDataColorMode->getCurrentItem());
737 0 : tmpSettings.dataScaler.setActive(myDataScaleMode->getCurrentItem());
738 0 : tmpSettings.dataValue = myDataValuePanel->getSettings();
739 0 : tmpSettings.tazRelWidthExaggeration = myTazRelationUpscaleDialer->getValue();
740 0 : tmpSettings.edgeRelWidthExaggeration = myEdgeRelationUpscaleDialer->getValue();
741 0 : tmpSettings.dataValueRainBow = myDataRainbowPanel->getSettings();
742 : }
743 :
744 0 : tmpSettings.showLane2Lane = (myShowLane2Lane->getCheck() != FALSE);
745 0 : tmpSettings.drawJunctionShape = (myDrawJunctionShape->getCheck() != FALSE);
746 0 : tmpSettings.drawCrossingsAndWalkingareas = (myDrawCrossingsAndWalkingAreas->getCheck() != FALSE);
747 0 : tmpSettings.dither = (myDither->getCheck() != FALSE);
748 0 : tmpSettings.fps = (myFPS->getCheck() != FALSE);
749 0 : tmpSettings.trueZ = (myTrueZ->getCheck() != FALSE);
750 0 : tmpSettings.drawBoundaries = (myDrawBoundaries->getCheck() != FALSE);
751 0 : tmpSettings.forceDrawForRectangleSelection = (myForceDrawForRectangleSelection->getCheck() != FALSE);
752 0 : tmpSettings.disableDottedContours = (myDisableDottedContours->getCheck() != FALSE);
753 0 : tmpSettings.geometryIndices = myGeometryIndicesPanel->getSettings();
754 0 : tmpSettings.showSizeLegend = (myShowSizeLegend->getCheck() != FALSE);
755 0 : tmpSettings.showColorLegend = (myShowColorLegend->getCheck() != FALSE);
756 0 : tmpSettings.showVehicleColorLegend = (myShowVehicleColorLegend->getCheck() != FALSE);
757 0 : tmpSettings.ignoreColorSchemeFor3DVehicles = (myIgnoreColorSchemeFor3DVehicles->getCheck() != FALSE);
758 0 : tmpSettings.show3DTLSDomes = (myShow3DTLSDomes->getCheck() != FALSE);
759 0 : tmpSettings.show3DTLSLinkMarkers = (myShow3DTLSLinkMarkers->getCheck() != FALSE);
760 0 : tmpSettings.show3DHeadUpDisplay = (myShow3DHeadUpDisplay->getCheck() != FALSE);
761 0 : tmpSettings.generate3DTLSModels = (myGenerate3DTLSModels->getCheck() != FALSE);
762 0 : const unsigned char lightFactor = (unsigned char)myLight3DFactor->getValue();
763 0 : tmpSettings.ambient3DLight.set(lightFactor / 2, lightFactor / 2, lightFactor / 2, 255);
764 0 : tmpSettings.diffuse3DLight.set(lightFactor, lightFactor, lightFactor, 255);
765 0 : tmpSettings.skyColor = MFXUtils::getRGBColor(mySkyColor->getRGBA());
766 :
767 : // lanes (colors)
768 0 : if (sender == myEdgeRainbowPanel->myColorRainbow) {
769 0 : myParent->buildColorRainbow(tmpSettings, tmpSettings.getLaneEdgeScheme(), tmpSettings.getLaneEdgeMode(), GLO_LANE, myEdgeRainbowPanel->getSettings());
770 : doRebuildColorMatrices = true;
771 0 : } else if (sender == myJunctionRainbowPanel->myColorRainbow) {
772 0 : myParent->buildColorRainbow(tmpSettings, tmpSettings.junctionColorer.getScheme(), tmpSettings.junctionColorer.getActive(), GLO_JUNCTION, myJunctionRainbowPanel->getSettings());
773 : doRebuildColorMatrices = true;
774 0 : } else if (sender == myVehicleRainbowPanel->myColorRainbow) {
775 0 : myParent->buildColorRainbow(tmpSettings, tmpSettings.vehicleColorer.getScheme(), tmpSettings.vehicleColorer.getActive(), GLO_VEHICLE, myVehicleRainbowPanel->getSettings());
776 : doRebuildColorMatrices = true;
777 0 : } else if (myDataRainbowPanel && sender == myDataRainbowPanel->myColorRainbow) {
778 0 : myParent->buildColorRainbow(tmpSettings, tmpSettings.dataColorer.getScheme(), tmpSettings.dataColorer.getActive(), GLO_TAZRELDATA, myDataRainbowPanel->getSettings());
779 : doRebuildColorMatrices = true;
780 : }
781 0 : if (tmpSettings.getLaneEdgeMode() == prevLaneMode) {
782 0 : if (updateColorRanges(sender, myLaneColors.begin(), myLaneColors.end(),
783 : myLaneThresholds.begin(), myLaneThresholds.end(), myLaneButtons.begin(),
784 : tmpSettings.getLaneEdgeScheme())) {
785 : doRebuildColorMatrices = true;
786 : }
787 0 : if (sender == myLaneColorInterpolation) {
788 0 : tmpSettings.getLaneEdgeScheme().setInterpolated(myLaneColorInterpolation->getCheck() != FALSE);
789 : doRebuildColorMatrices = true;
790 : }
791 : } else {
792 : doRebuildColorMatrices = true;
793 : }
794 : // lanes (scaling)
795 0 : if (tmpSettings.getLaneEdgeScaleMode() == prevLaneScaleMode) {
796 0 : if (updateScaleRanges(sender, myLaneScales.begin(), myLaneScales.end(),
797 : myLaneScaleThresholds.begin(), myLaneScaleThresholds.end(), myLaneScaleButtons.begin(),
798 : tmpSettings.getLaneEdgeScaleScheme())) {
799 : doRebuildColorMatrices = true;
800 : }
801 0 : if (sender == myLaneScaleInterpolation) {
802 0 : tmpSettings.getLaneEdgeScaleScheme().setInterpolated(myLaneScaleInterpolation->getCheck() != FALSE);
803 : doRebuildColorMatrices = true;
804 : }
805 : } else {
806 : doRebuildColorMatrices = true;
807 : }
808 : // vehicles
809 0 : if (tmpSettings.vehicleColorer.getActive() == prevVehicleMode) {
810 0 : if (updateColorRanges(sender, myVehicleColors.begin(), myVehicleColors.end(),
811 : myVehicleThresholds.begin(), myVehicleThresholds.end(), myVehicleButtons.begin(),
812 : tmpSettings.vehicleColorer.getScheme())) {
813 : doRebuildColorMatrices = true;
814 : }
815 0 : if (sender == myVehicleColorInterpolation) {
816 0 : tmpSettings.vehicleColorer.getScheme().setInterpolated(myVehicleColorInterpolation->getCheck() != FALSE);
817 : doRebuildColorMatrices = true;
818 : }
819 : } else {
820 : doRebuildColorMatrices = true;
821 : }
822 : // vehicles (scaling)
823 0 : if (tmpSettings.vehicleScaler.getActive() == prevVehicleScaleMode) {
824 0 : if (updateScaleRanges(sender, myVehicleScales.begin(), myVehicleScales.end(),
825 : myVehicleScaleThresholds.begin(), myVehicleScaleThresholds.end(), myVehicleScaleButtons.begin(),
826 : tmpSettings.vehicleScaler.getScheme())) {
827 : doRebuildColorMatrices = true;
828 : }
829 0 : if (sender == myVehicleScaleInterpolation) {
830 0 : tmpSettings.vehicleScaler.getScheme().setInterpolated(myVehicleScaleInterpolation->getCheck() != FALSE);
831 : doRebuildColorMatrices = true;
832 : }
833 : } else {
834 : doRebuildColorMatrices = true;
835 : }
836 : // persons
837 0 : if (tmpSettings.personColorer.getActive() == prevPersonMode) {
838 0 : if (updateColorRanges(sender, myPersonColors.begin(), myPersonColors.end(),
839 : myPersonThresholds.begin(), myPersonThresholds.end(), myPersonButtons.begin(),
840 : tmpSettings.personColorer.getScheme())) {
841 : doRebuildColorMatrices = true;
842 : }
843 0 : if (sender == myPersonColorInterpolation) {
844 0 : tmpSettings.personColorer.getScheme().setInterpolated(myPersonColorInterpolation->getCheck() != FALSE);
845 : doRebuildColorMatrices = true;
846 : }
847 : } else {
848 : doRebuildColorMatrices = true;
849 : }
850 : // containers
851 0 : if (tmpSettings.containerColorer.getActive() == prevContainerMode) {
852 0 : if (updateColorRanges(sender, myContainerColors.begin(), myContainerColors.end(),
853 : myContainerThresholds.begin(), myContainerThresholds.end(), myContainerButtons.begin(),
854 : tmpSettings.containerColorer.getScheme())) {
855 : doRebuildColorMatrices = true;
856 : }
857 0 : if (sender == myContainerColorInterpolation) {
858 0 : tmpSettings.containerColorer.getScheme().setInterpolated(myContainerColorInterpolation->getCheck() != FALSE);
859 : doRebuildColorMatrices = true;
860 : }
861 : } else {
862 : doRebuildColorMatrices = true;
863 : }
864 : // junctions
865 0 : if (tmpSettings.junctionColorer.getActive() == prevJunctionMode) {
866 0 : if (updateColorRanges(sender, myJunctionColors.begin(), myJunctionColors.end(),
867 : myJunctionThresholds.begin(), myJunctionThresholds.end(), myJunctionButtons.begin(),
868 : tmpSettings.junctionColorer.getScheme())) {
869 : doRebuildColorMatrices = true;
870 : }
871 0 : if (sender == myJunctionColorInterpolation) {
872 0 : tmpSettings.junctionColorer.getScheme().setInterpolated(myJunctionColorInterpolation->getCheck() != FALSE);
873 : doRebuildColorMatrices = true;
874 : }
875 : } else {
876 : doRebuildColorMatrices = true;
877 : }
878 : // POIs
879 0 : if (tmpSettings.poiColorer.getActive() == prevPOIMode) {
880 0 : if (updateColorRanges(sender, myPOIColors.begin(), myPOIColors.end(),
881 : myPOIThresholds.begin(), myPOIThresholds.end(), myPOIButtons.begin(),
882 : tmpSettings.poiColorer.getScheme())) {
883 : doRebuildColorMatrices = true;
884 : }
885 0 : if (sender == myPOIColorInterpolation) {
886 0 : tmpSettings.poiColorer.getScheme().setInterpolated(myPOIColorInterpolation->getCheck() != FALSE);
887 : doRebuildColorMatrices = true;
888 : }
889 : } else {
890 : doRebuildColorMatrices = true;
891 : }
892 : // polygons
893 0 : if (tmpSettings.polyColorer.getActive() == prevPolyMode) {
894 0 : if (updateColorRanges(sender, myPolyColors.begin(), myPolyColors.end(),
895 : myPolyThresholds.begin(), myPolyThresholds.end(), myPolyButtons.begin(),
896 : tmpSettings.polyColorer.getScheme())) {
897 : doRebuildColorMatrices = true;
898 : }
899 0 : if (sender == myPolyColorInterpolation) {
900 0 : tmpSettings.polyColorer.getScheme().setInterpolated(myPolyColorInterpolation->getCheck() != FALSE);
901 : doRebuildColorMatrices = true;
902 : }
903 : } else {
904 : doRebuildColorMatrices = true;
905 : }
906 : // data
907 0 : if (tmpSettings.netedit) {
908 0 : if (tmpSettings.dataColorer.getActive() == prevDataMode) {
909 0 : if (updateColorRanges(sender, myDataColors.begin(), myDataColors.end(),
910 : myDataThresholds.begin(), myDataThresholds.end(), myDataButtons.begin(),
911 : tmpSettings.dataColorer.getScheme())) {
912 : doRebuildColorMatrices = true;
913 : }
914 0 : if (sender == myDataColorInterpolation) {
915 0 : tmpSettings.dataColorer.getScheme().setInterpolated(myDataColorInterpolation->getCheck() != FALSE);
916 : doRebuildColorMatrices = true;
917 : }
918 : } else {
919 : doRebuildColorMatrices = true;
920 : }
921 : // vehicles (scaling)
922 0 : if (tmpSettings.dataScaler.getActive() == prevDataScaleMode) {
923 0 : if (updateScaleRanges(sender, myDataScales.begin(), myDataScales.end(),
924 : myDataScaleThresholds.begin(), myDataScaleThresholds.end(), myDataScaleButtons.begin(),
925 : tmpSettings.dataScaler.getScheme())) {
926 : doRebuildColorMatrices = true;
927 : }
928 0 : if (sender == myDataScaleInterpolation) {
929 0 : tmpSettings.dataScaler.getScheme().setInterpolated(myDataScaleInterpolation->getCheck() != FALSE);
930 : doRebuildColorMatrices = true;
931 : }
932 : } else {
933 : doRebuildColorMatrices = true;
934 : }
935 : }
936 : // openGL
937 0 : if (sender == myRecalculateBoundaries) {
938 0 : myParent->recalculateBoundaries();
939 : }
940 :
941 0 : if (sender == myShowPedestrianNetwork) {
942 0 : tmpSettings.showPedestrianNetwork = (myShowPedestrianNetwork->getCheck() != FALSE);
943 0 : myParent->drawPedestrianNetwork(tmpSettings);
944 : }
945 :
946 0 : if (sender == myPedestrianNetworkColor) {
947 0 : tmpSettings.pedestrianNetworkColor = MFXUtils::getRGBColor(myPedestrianNetworkColor->getRGBA());
948 0 : myParent->changePedestrianNetworkColor(tmpSettings);
949 : }
950 :
951 0 : if (tmpSettings == *mySettings) {
952 : return 1;
953 : }
954 :
955 0 : int index = mySchemeName->getCurrentItem();
956 0 : if (index < (int) gSchemeStorage.getNumInitialSettings()) {
957 : // one of the initial settings is modified
958 : // every time this happens we create a new scheme
959 0 : int suffix = 1;
960 0 : while (gSchemeStorage.contains("custom_" + toString(suffix))) {
961 0 : suffix++;
962 : }
963 0 : tmpSettings.name = "custom_" + toString(suffix);
964 : // the newly created settings must be entered in several places:
965 : // - the comboBox mySchemeName of this dialog
966 : // - the comboBox of the parent view (set as active)
967 : // - the comboBox of all other views (only append) XXX @todo
968 0 : index = mySchemeName->appendIconItem(tmpSettings.name.c_str());
969 0 : mySchemeName->setCurrentItem(index);
970 0 : myParent->getColoringSchemesCombo()->appendIconItem(tmpSettings.name.c_str());
971 : }
972 0 : myParent->getColoringSchemesCombo()->setCurrentItem(
973 0 : myParent->getColoringSchemesCombo()->findItem(tmpSettings.name.c_str()));
974 0 : gSchemeStorage.add(tmpSettings); // overwrites existing
975 0 : mySettings = &gSchemeStorage.get(tmpSettings.name);
976 0 : myParent->setColorScheme(tmpSettings.name);
977 :
978 0 : if (doRebuildColorMatrices) {
979 0 : rebuildColorMatrices(true);
980 : }
981 0 : myParent->handle(this, FXSEL(SEL_CHANGED, MID_SIMPLE_VIEW_COLORCHANGE), nullptr);
982 0 : myParent->forceRefresh();
983 0 : getApp()->forceRefresh();
984 : return 1;
985 0 : }
986 :
987 :
988 : void
989 0 : GUIDialog_ViewSettings::loadSettings(const std::string& file) {
990 0 : GUISettingsHandler handler(file, true, mySettings->netedit);
991 0 : for (std::string settingsName : handler.addSettings(myParent)) {
992 0 : FXint index = mySchemeName->appendIconItem(settingsName.c_str());
993 0 : mySchemeName->setCurrentItem(index);
994 0 : mySettings = &gSchemeStorage.get(settingsName);
995 : }
996 0 : if (handler.hasDecals()) {
997 0 : myParent->getDecalsLockMutex().lock();
998 0 : myParent->getDecals() = handler.getDecals();
999 0 : myDecalsTable->fillTable();
1000 0 : myParent->update();
1001 0 : myParent->getDecalsLockMutex().unlock();
1002 : }
1003 0 : if (handler.getDelay() >= 0) {
1004 0 : myParent->setDelay(handler.getDelay());
1005 : }
1006 0 : if (handler.getBreakpoints().size() > 0) {
1007 0 : myParent->setBreakpoints(handler.getBreakpoints());
1008 : }
1009 0 : handler.applyViewport(myParent);
1010 0 : onCmdNameChange(nullptr, 0, nullptr);
1011 0 : }
1012 :
1013 :
1014 : void
1015 0 : GUIDialog_ViewSettings::saveDecals(OutputDevice& dev) const {
1016 0 : for (const auto& decal : myParent->getDecals()) {
1017 : // only save decals with non empty filename
1018 0 : if (decal.filename.size() > 0) {
1019 : // check if decal is a light
1020 0 : const bool isLight = (decal.filename.substr(0, 5) == "light") && (decal.filename.length() == 6) && isdigit(decal.filename[5]);
1021 0 : if (isLight) {
1022 0 : dev.openTag(SUMO_TAG_VIEWSETTINGS_LIGHT);
1023 0 : dev.writeAttr(SUMO_ATTR_INDEX, decal.filename.substr(5, 1));
1024 : } else {
1025 0 : dev.openTag(SUMO_TAG_VIEWSETTINGS_DECAL);
1026 0 : dev.writeAttr("file", decal.filename);
1027 0 : dev.writeAttr("screenRelative", decal.screenRelative);
1028 : }
1029 0 : dev.writeAttr(SUMO_ATTR_CENTER_X, decal.centerX);
1030 0 : dev.writeAttr(SUMO_ATTR_CENTER_Y, decal.centerY);
1031 0 : dev.writeAttr(SUMO_ATTR_CENTER_Z, decal.centerZ);
1032 0 : dev.writeAttr(SUMO_ATTR_WIDTH, decal.width);
1033 0 : dev.writeAttr(SUMO_ATTR_HEIGHT, decal.height);
1034 0 : dev.writeAttr("altitude", decal.altitude);
1035 0 : dev.writeAttr("rotation", decal.rot);
1036 0 : dev.writeAttr("tilt", decal.tilt);
1037 0 : dev.writeAttr("roll", decal.roll);
1038 0 : dev.writeAttr(SUMO_ATTR_LAYER, decal.layer);
1039 0 : dev.closeTag();
1040 : }
1041 : }
1042 0 : }
1043 :
1044 :
1045 : void
1046 0 : GUIDialog_ViewSettings::loadDecals(const std::string& file) {
1047 0 : myParent->getDecalsLockMutex().lock();
1048 0 : GUISettingsHandler handler(file);
1049 0 : if (handler.hasDecals()) {
1050 0 : myParent->getDecals() = handler.getDecals();
1051 : }
1052 0 : myDecalsTable->fillTable();
1053 0 : myParent->update();
1054 0 : myParent->getDecalsLockMutex().unlock();
1055 0 : }
1056 :
1057 :
1058 : long
1059 0 : GUIDialog_ViewSettings::onCmdSaveSetting(FXObject*, FXSelector, void* /*data*/) {
1060 0 : int index = mySchemeName->getCurrentItem();
1061 0 : if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1062 : return 1;
1063 : }
1064 : // get the name
1065 0 : std::string name = "";
1066 0 : while (name.length() == 0) {
1067 0 : FXDialogBox dialog(this, TL("Enter a name"), GUIDesignViewSettingsDialog);
1068 0 : FXVerticalFrame* content = new FXVerticalFrame(&dialog, GUIDesignViewSettingsVerticalFrame5);
1069 0 : new FXLabel(content, TL("Please enter an alphanumeric name: "), nullptr, GUIDesignViewSettingsLabel2);
1070 0 : FXTextField* text = new FXTextField(content, 40, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsTextField1);
1071 0 : new FXHorizontalSeparator(content, GUIDesignHorizontalSeparator);
1072 0 : FXHorizontalFrame* buttons = new FXHorizontalFrame(content, GUIDesignViewSettingsHorizontalFrame3);
1073 0 : GUIDesigns::buildFXButton(buttons, TL("&OK"), "", "", nullptr, &dialog, FXDialogBox::ID_ACCEPT, GUIDesignViewSettingsButton4);
1074 0 : GUIDesigns::buildFXButton(buttons, TL("&Cancel"), "", "", nullptr, &dialog, FXDialogBox::ID_CANCEL, GUIDesignViewSettingsButton5);
1075 0 : dialog.create();
1076 0 : text->setFocus();
1077 0 : if (!dialog.execute()) {
1078 : return 1;
1079 : }
1080 0 : name = text->getText().text();
1081 0 : for (int i = 0; i < (int)name.length(); ++i) {
1082 0 : if (name[i] != '_' && (name[i] < 'a' || name[i] > 'z') && (name[i] < 'A' || name[i] > 'Z') && (name[i] < '0' || name[i] > '9')) {
1083 : name = "";
1084 : break;
1085 : }
1086 : }
1087 : }
1088 0 : GUIVisualizationSettings tmpSettings(mySettings->name, mySettings->netedit);
1089 0 : tmpSettings.copy(*mySettings);
1090 : tmpSettings.name = name;
1091 0 : if (name == mySettings->name || StringUtils::startsWith(mySettings->name, "custom_")) {
1092 0 : gSchemeStorage.remove(mySettings->name);
1093 0 : mySchemeName->removeItem(index);
1094 0 : myParent->getColoringSchemesCombo()->removeItem(index);
1095 0 : myParent->getColoringSchemesCombo()->insertIconItem(index, name.c_str());
1096 : } else {
1097 0 : gSchemeStorage.get(mySettings->name).copy(myBackup);
1098 0 : index = mySchemeName->appendIconItem(name.c_str());
1099 0 : myParent->getColoringSchemesCombo()->appendIconItem(name.c_str());
1100 0 : myParent->getColoringSchemesCombo()->setCurrentItem(
1101 0 : myParent->getColoringSchemesCombo()->findItem(name.c_str()));
1102 : }
1103 0 : gSchemeStorage.add(tmpSettings);
1104 0 : mySchemeName->insertIconItem(index, name.c_str());
1105 0 : myParent->setColorScheme(name);
1106 0 : mySettings = &gSchemeStorage.get(name);
1107 0 : myBackup.copy(*mySettings);
1108 0 : gSchemeStorage.writeSettings(getApp());
1109 : return 1;
1110 0 : }
1111 :
1112 :
1113 : long
1114 0 : GUIDialog_ViewSettings::onUpdSaveSetting(FXObject* sender, FXSelector, void* ptr) {
1115 0 : sender->handle(this,
1116 0 : mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1117 : ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1118 : ptr);
1119 0 : return 1;
1120 : }
1121 :
1122 :
1123 : long
1124 0 : GUIDialog_ViewSettings::onCmdDeleteSetting(FXObject*, FXSelector, void* /*data*/) {
1125 0 : int index = mySchemeName->getCurrentItem();
1126 0 : if (index < (int) gSchemeStorage.getNumInitialSettings()) {
1127 : return 1;
1128 : }
1129 0 : std::string name = mySchemeName->getItemText(index);
1130 0 : gSchemeStorage.remove(name);
1131 0 : mySchemeName->removeItem(index);
1132 0 : myParent->getColoringSchemesCombo()->removeItem(index);
1133 0 : onCmdNameChange(nullptr, 0, (void*) mySchemeName->getItemText(0).c_str());
1134 0 : gSchemeStorage.writeSettings(getApp());
1135 : return 1;
1136 : }
1137 :
1138 :
1139 : long
1140 0 : GUIDialog_ViewSettings::onUpdDeleteSetting(FXObject* sender, FXSelector, void* ptr) {
1141 0 : sender->handle(this,
1142 0 : mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1143 : ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1144 : ptr);
1145 0 : return 1;
1146 : }
1147 :
1148 :
1149 : long
1150 0 : GUIDialog_ViewSettings::onCmdExportSetting(FXObject*, FXSelector, void* /*data*/) {
1151 0 : FXString file = MFXUtils::getFilename2Write(this, TL("Export view settings"),
1152 0 : SUMOXMLDefinitions::XMLFileExtensions.getMultilineString().c_str(),
1153 0 : GUIIconSubSys::getIcon(GUIIcon::SAVE), gCurrentFolder);
1154 0 : if (file == "") {
1155 : return 1;
1156 : }
1157 : try {
1158 0 : OutputDevice& dev = OutputDevice::getDevice(file.text(), false);
1159 0 : dev.openTag(SUMO_TAG_VIEWSETTINGS);
1160 0 : if (myParent->is3DView()) {
1161 0 : dev.writeAttr(SUMO_ATTR_TYPE, "osg");
1162 : }
1163 0 : mySettings->save(dev);
1164 0 : if (mySaveViewPort->getCheck()) {
1165 0 : myParent->getViewportEditor()->writeXML(dev);
1166 : }
1167 0 : if (mySaveDelay->getCheck()) {
1168 0 : dev.openTag(SUMO_TAG_DELAY);
1169 0 : dev.writeAttr(SUMO_ATTR_VALUE, myParent->getDelay());
1170 0 : dev.closeTag();
1171 : }
1172 0 : if (mySaveDecals->getCheck()) {
1173 0 : saveDecals(dev);
1174 : }
1175 0 : if (!mySettings->netedit && mySaveBreakpoints->getCheck()) {
1176 0 : for (SUMOTime t : myParent->retrieveBreakpoints()) {
1177 0 : dev.openTag(SUMO_TAG_BREAKPOINT);
1178 0 : dev.writeAttr(SUMO_ATTR_TIME, time2string(t));
1179 0 : dev.closeTag();
1180 0 : }
1181 : }
1182 0 : dev.closeTag();
1183 0 : dev.close();
1184 0 : } catch (IOError& e) {
1185 0 : FXMessageBox::error(this, MBOX_OK, TL("Storing failed!"), "%s", e.what());
1186 0 : }
1187 : return 1;
1188 0 : }
1189 :
1190 :
1191 : long
1192 0 : GUIDialog_ViewSettings::onUpdExportSetting(FXObject* sender, FXSelector, void* ptr) {
1193 0 : sender->handle(this,
1194 0 : (mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings()
1195 0 : && !mySaveViewPort->getCheck() && !mySaveDelay->getCheck() && !mySaveDecals->getCheck() && !mySaveBreakpoints->getCheck()) ?
1196 : FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1197 : ptr);
1198 0 : return 1;
1199 : }
1200 :
1201 :
1202 : long
1203 0 : GUIDialog_ViewSettings::onCmdImportSetting(FXObject*, FXSelector, void* /*data*/) {
1204 0 : FXFileDialog opendialog(this, TL("Import view settings"));
1205 0 : opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::OPEN));
1206 0 : opendialog.setSelectMode(SELECTFILE_ANY);
1207 0 : opendialog.setPatternList(SUMOXMLDefinitions::ViewSettingsFileExtensions.getMultilineString().c_str());
1208 0 : if (gCurrentFolder.length() != 0) {
1209 0 : opendialog.setDirectory(gCurrentFolder);
1210 : }
1211 0 : if (opendialog.execute()) {
1212 0 : gCurrentFolder = opendialog.getDirectory();
1213 0 : loadSettings(opendialog.getFilename().text());
1214 : }
1215 0 : return 1;
1216 0 : }
1217 :
1218 :
1219 : long
1220 0 : GUIDialog_ViewSettings::onCmdLoadDecal(FXObject*, FXSelector, void* /*data*/) {
1221 0 : FXFileDialog opendialog(this, TL("Load Decals"));
1222 0 : opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY));
1223 0 : opendialog.setSelectMode(SELECTFILE_ANY);
1224 0 : opendialog.setPatternList(SUMOXMLDefinitions::ViewSettingsFileExtensions.getMultilineString().c_str());
1225 0 : if (gCurrentFolder.length() != 0) {
1226 0 : opendialog.setDirectory(gCurrentFolder);
1227 : }
1228 0 : if (opendialog.execute()) {
1229 0 : gCurrentFolder = opendialog.getDirectory();
1230 0 : loadDecals(opendialog.getFilename().text());
1231 : }
1232 0 : return 1;
1233 0 : }
1234 :
1235 :
1236 : long
1237 0 : GUIDialog_ViewSettings::onCmdLoadXMLDecals(FXObject*, FXSelector, void* /*data*/) {
1238 0 : FXFileDialog opendialog(this, TL("Load Decals"));
1239 0 : opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY));
1240 0 : opendialog.setSelectMode(SELECTFILE_ANY);
1241 0 : opendialog.setPatternList(SUMOXMLDefinitions::ViewSettingsFileExtensions.getMultilineString().c_str());
1242 0 : if (gCurrentFolder.length() != 0) {
1243 0 : opendialog.setDirectory(gCurrentFolder);
1244 : }
1245 0 : if (opendialog.execute()) {
1246 0 : gCurrentFolder = opendialog.getDirectory();
1247 0 : loadDecals(opendialog.getFilename().text());
1248 : }
1249 0 : return 1;
1250 0 : }
1251 :
1252 :
1253 : long
1254 0 : GUIDialog_ViewSettings::onCmdSaveXMLDecals(FXObject*, FXSelector, void* /*data*/) {
1255 0 : FXString file = MFXUtils::getFilename2Write(this, TL("Save Decals"),
1256 0 : SUMOXMLDefinitions::XMLFileExtensions.getMultilineString().c_str(),
1257 0 : GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder);
1258 0 : if (file == "") {
1259 : return 1;
1260 : }
1261 : try {
1262 0 : OutputDevice& dev = OutputDevice::getDevice(file.text());
1263 0 : dev.openTag("decals");
1264 0 : saveDecals(dev);
1265 0 : dev.closeTag();
1266 0 : dev.close();
1267 0 : } catch (IOError& e) {
1268 0 : FXMessageBox::error(myParent, MBOX_OK, TL("Storing failed!"), "%s", e.what());
1269 0 : }
1270 : return 1;
1271 0 : }
1272 :
1273 :
1274 : long
1275 0 : GUIDialog_ViewSettings::onCmdClearDecals(FXObject*, FXSelector, void* /*data*/) {
1276 : // lock decals mutex
1277 0 : myParent->getDecalsLockMutex().lock();
1278 : // clear decals
1279 0 : myParent->getDecals().clear();
1280 : // update view
1281 0 : myParent->update();
1282 : // fill table again
1283 0 : myDecalsTable->fillTable();
1284 : // unlock decals mutex
1285 0 : myParent->getDecalsLockMutex().unlock();
1286 0 : return 1;
1287 : }
1288 :
1289 :
1290 : long
1291 0 : GUIDialog_ViewSettings::onUpdImportSetting(FXObject* sender, FXSelector, void* ptr) {
1292 0 : sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1293 0 : return 1;
1294 : }
1295 :
1296 :
1297 : FXMatrix*
1298 0 : GUIDialog_ViewSettings::rebuildColorMatrix(FXVerticalFrame* frame,
1299 : std::vector<FXColorWell*>& colors,
1300 : std::vector<FXRealSpinner*>& thresholds,
1301 : std::vector<FXButton*>& buttons,
1302 : FXCheckButton* interpolation,
1303 : GUIColorScheme& scheme) {
1304 0 : MFXUtils::deleteChildren(frame);
1305 0 : FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1306 : colors.clear();
1307 : thresholds.clear();
1308 : buttons.clear();
1309 : const bool fixed = scheme.isFixed();
1310 : std::vector<RGBColor>::const_iterator colIt = scheme.getColors().begin();
1311 : std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1312 : std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1313 0 : while (colIt != scheme.getColors().end()) {
1314 0 : colors.push_back(new FXColorWell(m, MFXUtils::getFXColor(*colIt), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell1));
1315 0 : if (fixed) {
1316 0 : new FXLabel(m, nameIt->c_str());
1317 0 : new FXLabel(m, "");
1318 0 : new FXLabel(m, "");
1319 : } else {
1320 0 : const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1321 0 : FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX | dialerOptions);
1322 0 : threshDialer->setValue(*threshIt);
1323 0 : thresholds.push_back(threshDialer);
1324 0 : if (*threshIt == GUIVisualizationSettings::MISSING_DATA) {
1325 0 : threshDialer->disable();
1326 0 : threshDialer->hide();
1327 0 : buttons.push_back(GUIDesigns::buildFXButton(m, "", "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1328 0 : buttons.back()->hide();
1329 0 : buttons.push_back(GUIDesigns::buildFXButton(m, TL("No Data"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1330 0 : buttons.back()->disable();
1331 : } else {
1332 0 : buttons.push_back(GUIDesigns::buildFXButton(m, TL("Add"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1333 0 : buttons.push_back(GUIDesigns::buildFXButton(m, TL("Remove"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1334 0 : if (scheme.getColors().size() == 1) {
1335 0 : buttons.back()->disable();
1336 : }
1337 : }
1338 : }
1339 : colIt++;
1340 : threshIt++;
1341 : nameIt++;
1342 : }
1343 0 : interpolation->setCheck(scheme.isInterpolated());
1344 0 : if (fixed) {
1345 0 : interpolation->disable();
1346 : } else {
1347 0 : if (colors.size() > 1) {
1348 0 : interpolation->enable();
1349 0 : if (interpolation->getCheck() != FALSE) {
1350 0 : thresholds.front()->enable();
1351 : } else {
1352 0 : thresholds.front()->disable();
1353 : }
1354 : } else {
1355 0 : interpolation->disable();
1356 0 : thresholds.front()->disable();
1357 : }
1358 : }
1359 0 : return m;
1360 : }
1361 :
1362 :
1363 : FXMatrix*
1364 0 : GUIDialog_ViewSettings::rebuildScaleMatrix(FXVerticalFrame* frame,
1365 : std::vector<FXRealSpinner*>& scales,
1366 : std::vector<FXRealSpinner*>& thresholds,
1367 : std::vector<FXButton*>& buttons,
1368 : FXCheckButton* interpolation,
1369 : GUIScaleScheme& scheme) {
1370 0 : MFXUtils::deleteChildren(frame);
1371 0 : FXMatrix* m = new FXMatrix(frame, 4, GUIDesignViewSettingsMatrix4);
1372 : scales.clear();
1373 : thresholds.clear();
1374 : buttons.clear();
1375 : const bool fixed = scheme.isFixed();
1376 : std::vector<double>::const_iterator scaleIt = scheme.getColors().begin();
1377 : std::vector<double>::const_iterator threshIt = scheme.getThresholds().begin();
1378 : std::vector<std::string>::const_iterator nameIt = scheme.getNames().begin();
1379 0 : while (scaleIt != scheme.getColors().end()) {
1380 0 : FXRealSpinner* scaleDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX);
1381 0 : scaleDialer->setValue(*scaleIt);
1382 0 : scales.push_back(scaleDialer);
1383 0 : if (fixed) {
1384 0 : new FXLabel(m, nameIt->c_str());
1385 0 : new FXLabel(m, "");
1386 0 : new FXLabel(m, "");
1387 : } else {
1388 0 : const int dialerOptions = scheme.allowsNegativeValues() ? SPIN_NOMIN : 0;
1389 0 : FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_THICK | FRAME_SUNKEN | LAYOUT_TOP | LAYOUT_CENTER_Y | SPIN_NOMAX | dialerOptions);
1390 0 : threshDialer->setValue(*threshIt);
1391 0 : thresholds.push_back(threshDialer);
1392 0 : if (*threshIt == GUIVisualizationSettings::MISSING_DATA) {
1393 0 : threshDialer->disable();
1394 0 : threshDialer->hide();
1395 0 : buttons.push_back(GUIDesigns::buildFXButton(m, "", "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1396 0 : buttons.back()->hide();
1397 0 : buttons.push_back(GUIDesigns::buildFXButton(m, TL("No Data"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1398 0 : buttons.back()->disable();
1399 : } else {
1400 0 : buttons.push_back(GUIDesigns::buildFXButton(m, TL("Add"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1401 0 : buttons.push_back(GUIDesigns::buildFXButton(m, TL("Remove"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1));
1402 0 : if (scheme.getColors().size() == 1) {
1403 0 : buttons.back()->disable();
1404 : }
1405 : }
1406 : }
1407 : scaleIt++;
1408 : threshIt++;
1409 : nameIt++;
1410 : }
1411 0 : interpolation->setCheck(scheme.isInterpolated());
1412 0 : if (fixed) {
1413 0 : interpolation->disable();
1414 : } else {
1415 0 : if (scales.size() > 1) {
1416 0 : interpolation->enable();
1417 0 : if (interpolation->getCheck() != FALSE) {
1418 0 : thresholds.front()->enable();
1419 : } else {
1420 0 : thresholds.front()->disable();
1421 : }
1422 : } else {
1423 0 : interpolation->disable();
1424 0 : thresholds.front()->disable();
1425 : }
1426 : }
1427 0 : return m;
1428 : }
1429 :
1430 :
1431 : void
1432 0 : GUIDialog_ViewSettings::rebuildColorMatrices(bool doCreate) {
1433 0 : FXMatrix* m = rebuildColorMatrix(myLaneColorSettingFrame, myLaneColors, myLaneThresholds, myLaneButtons, myLaneColorInterpolation, mySettings->getLaneEdgeScheme());
1434 0 : if (doCreate) {
1435 0 : m->create();
1436 : }
1437 0 : if (mySettings->getLaneEdgeScheme().isFixed()) {
1438 0 : myEdgeRainbowPanel->myColorRainbow->disable();
1439 : } else {
1440 0 : myEdgeRainbowPanel->myColorRainbow->enable();
1441 : }
1442 0 : if (mySettings->junctionColorer.getScheme().isFixed()) {
1443 0 : myJunctionRainbowPanel->myColorRainbow->disable();
1444 : } else {
1445 0 : myJunctionRainbowPanel->myColorRainbow->enable();
1446 : }
1447 0 : if (mySettings->vehicleColorer.getScheme().isFixed()) {
1448 0 : myVehicleRainbowPanel->myColorRainbow->disable();
1449 : } else {
1450 0 : myVehicleRainbowPanel->myColorRainbow->enable();
1451 : }
1452 0 : std::string activeSchemeName = myLaneEdgeColorMode->getText().text();
1453 0 : std::string activeScaleSchemeName = myLaneEdgeScaleMode->getText().text();
1454 0 : myParamKey->clearItems();
1455 0 : myScalingParamKey->clearItems();
1456 0 : myMeanDataID->clearItems();
1457 0 : myMeanDataID->hide();
1458 0 : if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGE_PARAM_NUMERICAL) {
1459 0 : myParamKey->appendItem(mySettings->edgeParam.c_str());
1460 0 : for (const std::string& attr : myParent->getEdgeLaneParamKeys(true)) {
1461 0 : if (attr != mySettings->edgeParam) {
1462 0 : myParamKey->appendItem(attr.c_str());
1463 : }
1464 0 : }
1465 0 : myParamKey->enable();
1466 0 : } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_LANE_PARAM_NUMERICAL) {
1467 0 : myParamKey->appendItem(mySettings->laneParam.c_str());
1468 0 : for (const std::string& attr : myParent->getEdgeLaneParamKeys(false)) {
1469 0 : if (attr != mySettings->laneParam) {
1470 0 : myParamKey->appendItem(attr.c_str());
1471 : }
1472 0 : }
1473 0 : myParamKey->enable();
1474 0 : } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {
1475 0 : myParamKey->appendItem(mySettings->edgeData.c_str());
1476 0 : for (const std::string& attr : myParent->getEdgeDataAttrs()) {
1477 0 : if (attr != mySettings->edgeData) {
1478 0 : myParamKey->appendItem(attr.c_str());
1479 : }
1480 0 : }
1481 0 : myParamKey->enable();
1482 0 : } else if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_LIVE) {
1483 0 : if (mySettings->edgeDataID != "") {
1484 0 : myMeanDataID->appendIconItem(mySettings->edgeDataID.c_str());
1485 : }
1486 0 : for (const std::string& attr : myParent->getMeanDataIDs()) {
1487 0 : if (attr != mySettings->edgeDataID) {
1488 0 : myMeanDataID->appendIconItem(attr.c_str());
1489 : }
1490 0 : }
1491 0 : if (myMeanDataID->getNumItems() > 0) {
1492 0 : if (mySettings->edgeDataID == "") {
1493 0 : mySettings->edgeDataID = myMeanDataID->getItemText(0);
1494 : }
1495 0 : myMeanDataID->enable();
1496 0 : myMeanDataID->show();
1497 0 : myParamKey->appendItem(mySettings->edgeData.c_str());
1498 0 : for (const std::string& attr : myParent->getMeanDataAttrs(mySettings->edgeDataID)) {
1499 0 : if (attr != mySettings->edgeData) {
1500 0 : myParamKey->appendItem(attr.c_str());
1501 : }
1502 0 : }
1503 0 : myParamKey->enable();
1504 : }
1505 : } else {
1506 0 : myParamKey->disable();
1507 : }
1508 :
1509 0 : if (activeScaleSchemeName == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) {
1510 0 : myScalingParamKey->appendItem(mySettings->edgeDataScaling.c_str());
1511 0 : for (const std::string& attr : myParent->getEdgeDataAttrs()) {
1512 0 : if (attr != mySettings->edgeDataScaling) {
1513 0 : myScalingParamKey->appendItem(attr.c_str());
1514 : }
1515 0 : }
1516 0 : myScalingParamKey->enable();
1517 : } else {
1518 0 : myScalingParamKey->disable();
1519 : }
1520 :
1521 0 : myParamKey->setNumVisible(myParamKey->getNumItems());
1522 0 : myScalingParamKey->setNumVisible(myScalingParamKey->getNumItems());
1523 0 : myLaneColorSettingFrame->getParent()->recalc();
1524 :
1525 0 : m = rebuildScaleMatrix(myLaneScaleSettingFrame, myLaneScales, myLaneScaleThresholds, myLaneScaleButtons, myLaneScaleInterpolation, mySettings->getLaneEdgeScaleScheme());
1526 0 : if (doCreate) {
1527 0 : m->create();
1528 : }
1529 0 : myLaneScaleSettingFrame->getParent()->recalc();
1530 :
1531 0 : m = rebuildColorMatrix(myVehicleColorSettingFrame, myVehicleColors, myVehicleThresholds, myVehicleButtons, myVehicleColorInterpolation, mySettings->vehicleColorer.getScheme());
1532 0 : if (doCreate) {
1533 0 : m->create();
1534 : }
1535 0 : activeSchemeName = myVehicleColorMode->getText().text();
1536 0 : if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_PARAM_NUMERICAL) {
1537 0 : updateVehicleParams();
1538 0 : myVehicleParamKey->enable();
1539 : } else {
1540 0 : myVehicleParamKey->disable();
1541 : }
1542 0 : myVehicleColorSettingFrame->getParent()->recalc();
1543 :
1544 0 : m = rebuildScaleMatrix(myVehicleScaleSettingFrame, myVehicleScales, myVehicleScaleThresholds, myVehicleScaleButtons, myVehicleScaleInterpolation, mySettings->vehicleScaler.getScheme());
1545 0 : if (doCreate) {
1546 0 : m->create();
1547 : }
1548 0 : myVehicleScaleSettingFrame->getParent()->recalc();
1549 0 : activeScaleSchemeName = myVehicleScaleMode->getText().text();
1550 0 : if (activeScaleSchemeName == GUIVisualizationSettings::SCHEME_NAME_PARAM_NUMERICAL) {
1551 0 : myVehicleScalingParamKey->enable();
1552 : } else {
1553 0 : myVehicleScalingParamKey->disable();
1554 : }
1555 :
1556 :
1557 0 : m = rebuildColorMatrix(myPersonColorSettingFrame, myPersonColors, myPersonThresholds, myPersonButtons, myPersonColorInterpolation, mySettings->personColorer.getScheme());
1558 0 : if (doCreate) {
1559 0 : m->create();
1560 : }
1561 0 : myPersonColorSettingFrame->getParent()->recalc();
1562 0 : m = rebuildColorMatrix(myContainerColorSettingFrame, myContainerColors, myContainerThresholds, myContainerButtons, myContainerColorInterpolation, mySettings->containerColorer.getScheme());
1563 0 : if (doCreate) {
1564 0 : m->create();
1565 : }
1566 0 : myContainerColorSettingFrame->getParent()->recalc();
1567 0 : m = rebuildColorMatrix(myJunctionColorSettingFrame, myJunctionColors, myJunctionThresholds, myJunctionButtons, myJunctionColorInterpolation, mySettings->junctionColorer.getScheme());
1568 0 : if (doCreate) {
1569 0 : m->create();
1570 : }
1571 0 : myJunctionColorSettingFrame->getParent()->recalc();
1572 : // POIs
1573 0 : m = rebuildColorMatrix(myPOIColorSettingFrame, myPOIColors, myPOIThresholds, myPOIButtons, myPOIColorInterpolation, mySettings->poiColorer.getScheme());
1574 0 : if (doCreate) {
1575 0 : m->create();
1576 : }
1577 0 : myPOIColorSettingFrame->getParent()->recalc();
1578 : // polygons
1579 0 : m = rebuildColorMatrix(myPolyColorSettingFrame, myPolyColors, myPolyThresholds, myPolyButtons, myPolyColorInterpolation, mySettings->polyColorer.getScheme());
1580 0 : if (doCreate) {
1581 0 : m->create();
1582 : }
1583 0 : myPolyColorSettingFrame->getParent()->recalc();
1584 :
1585 : // data
1586 0 : if (mySettings->netedit) {
1587 0 : if (mySettings->dataColorer.getScheme().isFixed()) {
1588 0 : myDataRainbowPanel->myColorRainbow->disable();
1589 : } else {
1590 0 : myDataRainbowPanel->myColorRainbow->enable();
1591 : }
1592 0 : m = rebuildColorMatrix(myDataColorSettingFrame, myDataColors, myDataThresholds, myDataButtons, myDataColorInterpolation, mySettings->dataColorer.getScheme());
1593 0 : if (doCreate) {
1594 0 : m->create();
1595 : }
1596 0 : activeSchemeName = myDataColorMode->getText().text();
1597 0 : if (activeSchemeName == GUIVisualizationSettings::SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL) {
1598 0 : myDataParamKey->clearItems();
1599 0 : myDataParamKey->appendItem(mySettings->relDataAttr.c_str());
1600 0 : for (const std::string& attr : myParent->getRelDataAttrs()) {
1601 0 : if (attr != mySettings->relDataAttr) {
1602 0 : myDataParamKey->appendItem(attr.c_str());
1603 : }
1604 0 : }
1605 0 : myDataParamKey->enable();
1606 : } else {
1607 0 : myDataParamKey->disable();
1608 : }
1609 0 : myDataColorSettingFrame->getParent()->recalc();
1610 :
1611 : // scaling
1612 0 : m = rebuildScaleMatrix(myDataScaleSettingFrame, myDataScales, myDataScaleThresholds, myDataScaleButtons, myDataScaleInterpolation, mySettings->dataScaler.getScheme());
1613 0 : if (doCreate) {
1614 0 : m->create();
1615 : }
1616 0 : activeScaleSchemeName = myDataScaleMode->getText().text();
1617 0 : if (activeScaleSchemeName == GUIVisualizationSettings::SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL) {
1618 0 : myDataScaleParamKey->clearItems();
1619 0 : myDataScaleParamKey->appendItem(mySettings->relDataScaleAttr.c_str());
1620 0 : for (const std::string& attr : myParent->getRelDataAttrs()) {
1621 0 : if (attr != mySettings->relDataScaleAttr) {
1622 0 : myDataScaleParamKey->appendItem(attr.c_str());
1623 : }
1624 0 : }
1625 0 : myDataScaleParamKey->enable();
1626 : } else {
1627 0 : myDataScaleParamKey->disable();
1628 : }
1629 0 : myDataScaleSettingFrame->getParent()->recalc();
1630 : }
1631 :
1632 0 : layout();
1633 0 : update();
1634 0 : }
1635 :
1636 :
1637 : void
1638 0 : GUIDialog_ViewSettings::updateVehicleParams() {
1639 0 : myVehicleParamKey->clearItems();
1640 0 : myVehicleTextParamKey->clearItems();
1641 0 : myVehicleScalingParamKey->clearItems();
1642 0 : myVehicleParamKey->appendItem(mySettings->vehicleParam.c_str());
1643 0 : myVehicleTextParamKey->appendItem(mySettings->vehicleTextParam.c_str());
1644 0 : myVehicleScalingParamKey->appendItem(mySettings->vehicleScaleParam.c_str());
1645 0 : for (const std::string& attr : myParent->getVehicleParamKeys(false)) {
1646 0 : myVehicleParamKey->appendItem(attr.c_str());
1647 0 : myVehicleTextParamKey->appendItem(attr.c_str());
1648 0 : myVehicleScalingParamKey->appendItem(attr.c_str());
1649 0 : }
1650 0 : myVehicleParamKey->setNumVisible(myVehicleParamKey->getNumItems());
1651 0 : myVehicleTextParamKey->setNumVisible(myVehicleTextParamKey->getNumItems());
1652 0 : myVehicleScalingParamKey->setNumVisible(myVehicleScalingParamKey->getNumItems());
1653 0 : }
1654 :
1655 :
1656 : void
1657 0 : GUIDialog_ViewSettings::updatePOIParams() {
1658 0 : myPOITextParamKey->clearItems();
1659 0 : myPOITextParamKey->appendItem(mySettings->poiTextParam.c_str());
1660 0 : for (const std::string& attr : myParent->getPOIParamKeys()) {
1661 0 : myPOITextParamKey->appendItem(attr.c_str());
1662 0 : }
1663 0 : myPOITextParamKey->setNumVisible(myPOITextParamKey->getNumItems());
1664 0 : }
1665 :
1666 :
1667 : std::string
1668 0 : GUIDialog_ViewSettings::getCurrentScheme() const {
1669 0 : return mySchemeName->getItemText(mySchemeName->getCurrentItem());
1670 : }
1671 :
1672 :
1673 : void
1674 0 : GUIDialog_ViewSettings::setCurrentScheme(const std::string& name) {
1675 0 : if (name.c_str() == mySchemeName->getItemText(mySchemeName->getCurrentItem())) {
1676 : return;
1677 : }
1678 0 : for (int i = 0; i < mySchemeName->getNumItems(); ++i) {
1679 0 : if (name.c_str() == mySchemeName->getItemText(i)) {
1680 0 : mySchemeName->setCurrentItem(i);
1681 0 : onCmdNameChange(nullptr, 0, (void*)name.c_str());
1682 0 : return;
1683 : }
1684 : }
1685 : }
1686 :
1687 :
1688 0 : GUIDialog_ViewSettings::NamePanel::NamePanel(
1689 : FXMatrix* parent,
1690 : GUIDialog_ViewSettings* target,
1691 : const std::string& title,
1692 0 : const GUIVisualizationTextSettings& settings) {
1693 0 : myCheck = new FXCheckButton(parent, title.c_str(), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1694 0 : myCheck->setCheck(settings.showText);
1695 0 : myMatrix0 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1696 0 : mySelectedCheck = new FXCheckButton(myMatrix0, TL("Only for selected"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1697 0 : mySelectedCheck->setCheck(settings.onlySelected);
1698 0 : myConstSizeCheck = new FXCheckButton(myMatrix0, TL("constant text size"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1699 0 : myConstSizeCheck->setCheck(settings.constSize);
1700 0 : FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1701 0 : new FXLabel(m1, TL("Size"), nullptr, GUIDesignViewSettingsLabel1);
1702 0 : mySizeDial = new FXRealSpinner(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1703 0 : mySizeDial->setRange(5, 1000);
1704 0 : mySizeDial->setValue(settings.size);
1705 0 : FXMatrix* m2 = new FXMatrix(parent, 4, GUIDesignViewSettingsMatrix5);
1706 0 : new FXLabel(m2, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
1707 0 : myColorWell = new FXColorWell(m2, MFXUtils::getFXColor(settings.color), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell2);
1708 0 : new FXLabel(m2, TL("Background"), nullptr, GUIDesignViewSettingsLabel1);
1709 0 : myBGColorWell = new FXColorWell(m2, MFXUtils::getFXColor(settings.bgColor), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell2);
1710 0 : }
1711 :
1712 :
1713 : GUIVisualizationTextSettings
1714 0 : GUIDialog_ViewSettings::NamePanel::getSettings() {
1715 0 : return GUIVisualizationTextSettings(myCheck->getCheck() != FALSE,
1716 0 : mySizeDial->getValue(),
1717 0 : MFXUtils::getRGBColor(myColorWell->getRGBA()),
1718 0 : MFXUtils::getRGBColor(myBGColorWell->getRGBA()),
1719 0 : myConstSizeCheck->getCheck() != FALSE,
1720 0 : mySelectedCheck->getCheck() != FALSE);
1721 : }
1722 :
1723 :
1724 : void
1725 0 : GUIDialog_ViewSettings::NamePanel::update(const GUIVisualizationTextSettings& settings) {
1726 0 : myCheck->setCheck(settings.showText);
1727 0 : mySizeDial->setValue(settings.size);
1728 0 : myColorWell->setRGBA(MFXUtils::getFXColor(settings.color));
1729 0 : myBGColorWell->setRGBA(MFXUtils::getFXColor(settings.bgColor));
1730 0 : myConstSizeCheck->setCheck(settings.constSize);
1731 0 : mySelectedCheck->setCheck(settings.onlySelected);
1732 0 : }
1733 :
1734 :
1735 0 : GUIDialog_ViewSettings::SizePanel::SizePanel(FXMatrix* parent, GUIDialog_ViewSettings* target,
1736 0 : const GUIVisualizationSizeSettings& settings, GUIGlObjectType type):
1737 0 : myDialogViewSettings(target),
1738 0 : myType(type) {
1739 0 : myCheck = new FXCheckButton(parent, TL("Draw with constant size when zoomed out"), this, MID_SIMPLE_VIEW_SIZECHANGE, GUIDesignCheckButtonViewSettings);
1740 0 : myCheck->setCheck(settings.constantSize);
1741 0 : myCheckSelected = new FXCheckButton(parent, TL("Only for selected"), this, MID_SIMPLE_VIEW_SIZECHANGE, GUIDesignCheckButtonViewSettings);
1742 0 : myCheckSelected->setCheck(settings.constantSizeSelected);
1743 0 : FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1744 0 : new FXLabel(m1, TL("Minimum Size"), nullptr, GUIDesignViewSettingsLabel1);
1745 0 : myMinSizeDial = new FXRealSpinner(m1, 10, this, MID_SIMPLE_VIEW_SIZECHANGE, GUIDesignViewSettingsSpinDial1);
1746 0 : myMinSizeDial->setValue(settings.minSize);
1747 0 : FXMatrix* m2 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5);
1748 0 : new FXLabel(m2, TL("Exaggerate by"), nullptr, GUIDesignViewSettingsLabel1);
1749 0 : myExaggerateDial = new FXRealSpinner(m2, 10, this, MID_SIMPLE_VIEW_SIZECHANGE, GUIDesignViewSettingsSpinDial2);
1750 0 : myExaggerateDial->setRange(0, 10000);
1751 0 : myExaggerateDial->setValue(settings.exaggeration);
1752 0 : }
1753 :
1754 :
1755 : GUIVisualizationSizeSettings
1756 0 : GUIDialog_ViewSettings::SizePanel::getSettings() {
1757 : return GUIVisualizationSizeSettings(
1758 0 : myMinSizeDial->getValue(), myExaggerateDial->getValue(),
1759 0 : myCheck->getCheck() != FALSE,
1760 0 : myCheckSelected->getCheck() != FALSE);
1761 : }
1762 :
1763 :
1764 : void
1765 0 : GUIDialog_ViewSettings::SizePanel::update(const GUIVisualizationSizeSettings& settings) {
1766 0 : myCheck->setCheck(settings.constantSize);
1767 0 : myCheckSelected->setCheck(settings.constantSizeSelected);
1768 0 : myMinSizeDial->setValue(settings.minSize);
1769 0 : myExaggerateDial->setValue(settings.exaggeration);
1770 0 : }
1771 :
1772 :
1773 : long
1774 0 : GUIDialog_ViewSettings::SizePanel::onCmdSizeChange(FXObject* obj, FXSelector sel, void* ptr) {
1775 : // mark boundaries for recomputing
1776 0 : gViewObjectsHandler.recomputeBoundaries = myType;
1777 : // continue as a normal change
1778 0 : return myDialogViewSettings->onCmdColorChange(obj, sel, ptr);
1779 : }
1780 :
1781 :
1782 0 : GUIDialog_ViewSettings::RainbowPanel::RainbowPanel(
1783 : FXComposite* parent,
1784 : GUIDialog_ViewSettings* target,
1785 0 : const GUIVisualizationRainbowSettings& settings) {
1786 0 : FXMatrix* matrixRainbow = new FXMatrix(parent, 9, GUIDesignViewSettingsMatrix3);
1787 0 : myColorRainbow = GUIDesigns::buildFXButton(matrixRainbow, TL("Recalibrate Rainbow"), "", "", nullptr, target, MID_SIMPLE_VIEW_COLORCHANGE,
1788 : (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
1789 0 : myRainbowStyle = new MFXComboBoxIcon(matrixRainbow, nullptr, false, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsComboBox1);
1790 0 : for (auto item : GUIVisualizationSettings::RAINBOW_SCHEMES) {
1791 0 : myRainbowStyle->appendIconItem(item.first.c_str());
1792 : }
1793 0 : myRainbowStyle->setCurrentItem(settings.rainbowScheme);
1794 0 : myHideMinCheck = new FXCheckButton(matrixRainbow, TL("min"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1795 0 : myHideMinCheck->setCheck(settings.hideMin);
1796 0 : myMinThreshold = new FXRealSpinner(matrixRainbow, 6, target, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);
1797 0 : myMinThreshold->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
1798 0 : myMinThreshold->setValue(settings.minThreshold);
1799 0 : myHideMaxCheck = new FXCheckButton(matrixRainbow, TL("max"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1800 0 : myHideMaxCheck->setCheck(settings.hideMax);
1801 0 : myMaxThreshold = new FXRealSpinner(matrixRainbow, 6, target, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);
1802 0 : myMaxThreshold->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
1803 0 : myMaxThreshold->setValue(settings.maxThreshold);
1804 0 : mySetNeutral = new FXCheckButton(matrixRainbow, TL("center"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1805 0 : mySetNeutral->setCheck(settings.setNeutral);
1806 0 : myNeutralThreshold = new FXRealSpinner(matrixRainbow, 6, target, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2);
1807 0 : myNeutralThreshold->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
1808 0 : myNeutralThreshold->setValue(settings.neutralThreshold);
1809 0 : myFixRange = new FXCheckButton(matrixRainbow, TL("fix range"), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1810 0 : myFixRange->setCheck(settings.fixRange);
1811 0 : }
1812 :
1813 :
1814 : GUIVisualizationRainbowSettings
1815 0 : GUIDialog_ViewSettings::RainbowPanel::getSettings() {
1816 0 : GUIVisualizationRainbowSettings res(myHideMinCheck->getCheck() != FALSE,
1817 0 : myMinThreshold->getValue(),
1818 0 : myHideMaxCheck->getCheck() != FALSE,
1819 0 : myMaxThreshold->getValue(),
1820 0 : mySetNeutral->getCheck() != FALSE,
1821 0 : myNeutralThreshold->getValue(),
1822 0 : myFixRange->getCheck() != FALSE,
1823 0 : myRainbowStyle->getCurrentItem());
1824 0 : std::string sName = myRainbowStyle->getItemText(myRainbowStyle->getCurrentItem());
1825 0 : res.colors = GUIVisualizationSettings::RAINBOW_SCHEMES[sName];
1826 0 : return res;
1827 : }
1828 :
1829 :
1830 : void
1831 0 : GUIDialog_ViewSettings::RainbowPanel::update(const GUIVisualizationRainbowSettings& settings) {
1832 0 : myHideMinCheck->setCheck(settings.hideMin);
1833 0 : myMinThreshold->setValue(settings.minThreshold);
1834 0 : myHideMaxCheck->setCheck(settings.hideMax);
1835 0 : myMaxThreshold->setValue(settings.maxThreshold);
1836 0 : mySetNeutral->setCheck(settings.setNeutral);
1837 0 : myNeutralThreshold->setValue(settings.neutralThreshold);
1838 0 : myFixRange->setCheck(settings.fixRange);
1839 0 : myRainbowStyle->setCurrentItem(settings.rainbowScheme);
1840 0 : }
1841 :
1842 : void
1843 0 : GUIDialog_ViewSettings::buildHeader(FXVerticalFrame* contentFrame) {
1844 0 : FXHorizontalFrame* horizontalFrame = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame1);
1845 0 : mySchemeName = new MFXComboBoxIcon(horizontalFrame, nullptr, true, GUIDesignComboBoxVisibleItems,
1846 0 : this, MID_SIMPLE_VIEW_NAMECHANGE, GUIDesignViewSettingsComboBox1);
1847 0 : for (const auto& name : gSchemeStorage.getNames()) {
1848 0 : const int index = mySchemeName->appendIconItem(name.c_str());
1849 0 : if (name == mySettings->name) {
1850 0 : mySchemeName->setCurrentItem((FXint)index);
1851 : }
1852 : }
1853 :
1854 0 : GUIDesigns::buildFXButton(horizontalFrame, "", "", TL("Save the setting to registry"), GUIIconSubSys::getIcon(GUIIcon::SAVE_DATABASE), this, MID_SIMPLE_VIEW_SAVE, GUIDesignButtonToolbar);
1855 0 : GUIDesigns::buildFXButton(horizontalFrame, "", "", TL("Remove the setting from registry"), GUIIconSubSys::getIcon(GUIIcon::REMOVEDB), this, MID_SIMPLE_VIEW_DELETE, GUIDesignButtonToolbar);
1856 0 : GUIDesigns::buildFXButton(horizontalFrame, "", "", TL("Export setting to file"), GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_SIMPLE_VIEW_EXPORT, GUIDesignButtonToolbar);
1857 0 : GUIDesigns::buildFXButton(horizontalFrame, "", "", TL("Load setting from file"), GUIIconSubSys::getIcon(GUIIcon::OPEN), this, MID_SIMPLE_VIEW_IMPORT, GUIDesignButtonToolbar);
1858 :
1859 0 : new FXVerticalSeparator(horizontalFrame);
1860 0 : new FXLabel(horizontalFrame, TL("Export includes:"), nullptr, GUIDesignViewSettingsLabel1);
1861 0 : mySaveViewPort = new FXCheckButton(horizontalFrame, TL("Viewport"));
1862 0 : mySaveDelay = new FXCheckButton(horizontalFrame, TL("Delay"));
1863 0 : mySaveDecals = new FXCheckButton(horizontalFrame, TL("Decals"));
1864 0 : mySaveBreakpoints = new FXCheckButton(horizontalFrame, TL("Breakpoints"));
1865 0 : if (mySettings->netedit) {
1866 0 : mySaveBreakpoints->disable();
1867 : }
1868 0 : }
1869 :
1870 :
1871 : void
1872 0 : GUIDialog_ViewSettings::buildBackgroundFrame(FXTabBook* tabbook) {
1873 : // tab for the background
1874 0 : new FXTabItem(tabbook, TL("Background"), nullptr, GUIDesignViewSettingsTabItemBook1);
1875 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
1876 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
1877 :
1878 0 : FXMatrix* matrixColor = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
1879 0 : new FXLabel(matrixColor, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
1880 0 : myBackgroundColor = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->backgroundColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
1881 :
1882 0 : FXVerticalFrame* verticalFrameDecals = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame3);
1883 0 : new FXLabel(verticalFrameDecals, TL("Decals:"));
1884 0 : myDecalsTable = new MFXDecalsTable(this, verticalFrameDecals);
1885 0 : FXHorizontalFrame* horizontalFrameButtonsDecals = new FXHorizontalFrame(verticalFrameDecals, GUIDesignViewSettingsHorizontalFrame2);
1886 0 : GUIDesigns::buildFXButton(horizontalFrameButtonsDecals, TL("&Load XML Decals"), "", "", nullptr, this, MID_SIMPLE_VIEW_LOAD_DECALS_XML, GUIDesignViewSettingsButton1);
1887 0 : GUIDesigns::buildFXButton(horizontalFrameButtonsDecals, TL("&Save XML Decals"), "", "", nullptr, this, MID_SIMPLE_VIEW_SAVE_DECALS_XML, GUIDesignViewSettingsButton1);
1888 0 : GUIDesigns::buildFXButton(horizontalFrameButtonsDecals, TL("&Clear Decals"), "", "", nullptr, this, MID_SIMPLE_VIEW_CLEAR_DECALS, GUIDesignViewSettingsButton1);
1889 :
1890 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1891 :
1892 0 : FXMatrix* matrixGrid = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
1893 0 : myShowGrid = new FXCheckButton(matrixGrid, TL("Toggle grid"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1894 0 : myShowGrid->setCheck(mySettings->showGrid);
1895 0 : new FXLabel(matrixGrid, "");
1896 0 : FXMatrix* matrixGridX = new FXMatrix(matrixGrid, 2, GUIDesignViewSettingsMatrix2);
1897 0 : new FXLabel(matrixGridX, TL("x-spacing"), nullptr, GUIDesignViewSettingsLabel1);
1898 0 : myGridXSizeDialer = new FXRealSpinner(matrixGridX, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1899 0 : myGridXSizeDialer->setRange(1, 10000);
1900 0 : myGridXSizeDialer->setValue(mySettings->gridXSize);
1901 0 : FXMatrix* matrixGridY = new FXMatrix(matrixGrid, 2, GUIDesignViewSettingsMatrix2);
1902 0 : new FXLabel(matrixGridY, TL("y-spacing"), nullptr, GUIDesignViewSettingsLabel1);
1903 0 : myGridYSizeDialer = new FXRealSpinner(matrixGridY, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
1904 0 : myGridYSizeDialer->setRange(1, 10000);
1905 0 : myGridYSizeDialer->setValue(mySettings->gridYSize);
1906 0 : }
1907 :
1908 :
1909 : void
1910 0 : GUIDialog_ViewSettings::buildStreetsFrame(FXTabBook* tabbook) {
1911 0 : new FXTabItem(tabbook, TL("Streets"), nullptr, GUIDesignViewSettingsTabItemBook1);
1912 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
1913 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
1914 : // ... color settings
1915 0 : FXVerticalFrame* verticalFrameColor = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);
1916 0 : FXMatrix* matrixColor = new FXMatrix(verticalFrameColor, 5, GUIDesignViewSettingsMatrix3);
1917 0 : new FXLabel(matrixColor, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
1918 0 : myLaneEdgeColorMode = new MFXComboBoxIcon(matrixColor, nullptr, true, GUIDesignComboBoxVisibleItems,
1919 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1920 0 : myLaneColorInterpolation = new FXCheckButton(matrixColor, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1921 0 : myLaneColorSettingFrame = new FXVerticalFrame(verticalFrameColor, GUIDesignViewSettingsVerticalFrame4);
1922 0 : myMeanDataID = new MFXComboBoxIcon(matrixColor, nullptr, false, GUIDesignComboBoxVisibleItems,
1923 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1924 0 : myMeanDataID->disable();
1925 0 : myMeanDataID->hide();
1926 0 : myParamKey = new FXComboBox(matrixColor, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1927 0 : myParamKey->setEditable(true);
1928 0 : myParamKey->disable();
1929 :
1930 : // rainbow settings
1931 0 : myEdgeRainbowPanel = new RainbowPanel(verticalFrameColor, this, mySettings->edgeValueRainBow);
1932 :
1933 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1934 : // ... scale settings
1935 0 : FXVerticalFrame* verticalFrameScale = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);
1936 0 : FXMatrix* matrixScale = new FXMatrix(verticalFrameScale, 5, GUIDesignViewSettingsMatrix3);
1937 0 : new FXLabel(matrixScale, TL("Scale width"), nullptr, GUIDesignViewSettingsLabel1);
1938 0 : myLaneEdgeScaleMode = new MFXComboBoxIcon(matrixScale, nullptr, true, GUIDesignComboBoxVisibleItems,
1939 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1940 0 : myLaneScaleInterpolation = new FXCheckButton(matrixScale, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
1941 0 : myLaneScaleSettingFrame = new FXVerticalFrame(verticalFrameScale, GUIDesignViewSettingsVerticalFrame4);
1942 0 : myScalingParamKey = new FXComboBox(matrixScale, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
1943 0 : myScalingParamKey->setEditable(true);
1944 0 : myScalingParamKey->disable();
1945 :
1946 0 : if (GUIVisualizationSettings::UseMesoSim) {
1947 0 : mySettings->edgeColorer.fill(*myLaneEdgeColorMode);
1948 0 : mySettings->edgeScaler.fill(*myLaneEdgeScaleMode);
1949 : } else {
1950 0 : mySettings->laneColorer.fill(*myLaneEdgeColorMode);
1951 0 : mySettings->laneScaler.fill(*myLaneEdgeScaleMode);
1952 : }
1953 :
1954 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
1955 0 : FXMatrix* matrixLanes = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
1956 :
1957 0 : myShowBikeMarkings = new FXCheckButton(matrixLanes, TL("Show bike markings"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1958 0 : myShowBikeMarkings->setCheck(mySettings->showBikeMarkings);
1959 0 : myShowLaneDecals = new FXCheckButton(matrixLanes, TL("Show turning arrows"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1960 0 : myShowLaneDecals->setCheck(mySettings->showLinkDecals);
1961 :
1962 0 : myShowLinkRules = new FXCheckButton(matrixLanes, TL("Show right-of-way rules"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1963 0 : myShowLinkRules->setCheck(mySettings->showLinkRules);
1964 0 : myRealisticLinkRules = new FXCheckButton(matrixLanes, TL("Realistic stop line colors"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1965 0 : myRealisticLinkRules->setCheck(mySettings->realisticLinkRules);
1966 :
1967 0 : myShowLaneBorders = new FXCheckButton(matrixLanes, TL("Show lane borders"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1968 0 : myShowLaneBorders->setCheck(mySettings->laneShowBorders);
1969 0 : myShowLaneDirection = new FXCheckButton(matrixLanes, TL("Show lane direction"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1970 0 : myShowLaneDirection->setCheck(mySettings->showLaneDirection);
1971 :
1972 0 : myHideMacroConnectors = new FXCheckButton(matrixLanes, TL("Hide macro connectors"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1973 0 : myHideMacroConnectors->setCheck(mySettings->hideConnectors);
1974 0 : myShowSublanes = new FXCheckButton(matrixLanes, TL("Show sublanes"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1975 0 : myShowSublanes->setCheck(mySettings->showSublanes);
1976 :
1977 0 : myShowRails = new FXCheckButton(matrixLanes, TL("Show rails"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1978 0 : myShowRails->setCheck(mySettings->showRails);
1979 :
1980 0 : mySpreadSuperposed = new FXCheckButton(matrixLanes, TL("Spread bidirectional railways/roads"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1981 0 : mySpreadSuperposed->setHelpText(TL("Make both directional edges for a bidirectional railways or roads visible"));
1982 0 : mySpreadSuperposed->setCheck(mySettings->spreadSuperposed);
1983 :
1984 0 : mySecondaryShape = new FXCheckButton(matrixLanes, TL("Secondary shape"), this, MID_SIMPLE_VIEW_COLORCHANGE);
1985 0 : mySecondaryShape->setCheck(mySettings->secondaryShape);
1986 0 : new FXLabel(matrixLanes, " ", nullptr, GUIDesignViewSettingsLabel1);
1987 0 : if (!OptionsCont::getOptions().exists("alternative-net-file") ||
1988 0 : !OptionsCont::getOptions().isSet("alternative-net-file")) {
1989 0 : mySecondaryShape->disable();
1990 : }
1991 :
1992 0 : FXMatrix* tmp0 = new FXMatrix(matrixLanes, 2, GUIDesignViewSettingsMatrix5);
1993 0 : new FXLabel(tmp0, TL("Exaggerate width by"), nullptr, GUIDesignViewSettingsLabel1);
1994 0 : myLaneWidthUpscaleDialer = new FXRealSpinner(tmp0, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
1995 0 : myLaneWidthUpscaleDialer->setRange(0, 1000000);
1996 0 : myLaneWidthUpscaleDialer->setValue(mySettings->laneWidthExaggeration);
1997 :
1998 0 : FXMatrix* tmp1 = new FXMatrix(matrixLanes, 2, GUIDesignViewSettingsMatrix5);
1999 0 : new FXLabel(tmp1, TL("Minimum size"), nullptr, GUIDesignViewSettingsLabel1);
2000 0 : myLaneMinWidthDialer = new FXRealSpinner(tmp1, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
2001 0 : myLaneMinWidthDialer->setRange(0, 1000000);
2002 0 : myLaneMinWidthDialer->setValue(mySettings->laneMinSize);
2003 :
2004 : // edge name
2005 0 : myEdgeNamePanel = new NamePanel(matrixLanes, this, TL("Show edge id"), mySettings->edgeName);
2006 0 : myStreetNamePanel = new NamePanel(matrixLanes, this, TL("Show street name"), mySettings->streetName);
2007 0 : myEdgeValuePanel = new NamePanel(matrixLanes, this, TL("Show edge color value"), mySettings->edgeValue);
2008 0 : myEdgeScaleValuePanel = new NamePanel(matrixLanes, this, TL("Show edge scale value"), mySettings->edgeScaleValue);
2009 0 : }
2010 :
2011 :
2012 : void
2013 0 : GUIDialog_ViewSettings::buildVehiclesFrame(FXTabBook* tabbook) {
2014 0 : new FXTabItem(tabbook, TL("Vehicles"), nullptr, GUIDesignViewSettingsTabItemBook1);
2015 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2016 0 : FXVerticalFrame* verticalframe = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2017 :
2018 0 : FXMatrix* matrixShowAs = new FXMatrix(verticalframe, 2, GUIDesignViewSettingsMatrix3);
2019 0 : new FXLabel(matrixShowAs, TL("Show As"), nullptr, GUIDesignViewSettingsLabel1);
2020 0 : myVehicleShapeDetail = new MFXComboBoxIcon(matrixShowAs, nullptr, false, GUIDesignComboBoxVisibleItems,
2021 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2022 0 : myVehicleShapeDetail->appendIconItem(TL("'triangles'"));
2023 0 : myVehicleShapeDetail->appendIconItem(TL("'boxes'"));
2024 0 : myVehicleShapeDetail->appendIconItem(TL("'simple shapes'"));
2025 0 : myVehicleShapeDetail->appendIconItem(TL("'raster images'"));
2026 0 : myVehicleShapeDetail->appendIconItem(TL("'circles'"));
2027 0 : myVehicleShapeDetail->setCurrentItem(mySettings->vehicleQuality);
2028 :
2029 0 : new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
2030 :
2031 0 : FXMatrix* matrixColor = new FXMatrix(verticalframe, 4, GUIDesignViewSettingsMatrix3);
2032 0 : new FXLabel(matrixColor, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
2033 0 : myVehicleColorMode = new MFXComboBoxIcon(matrixColor, nullptr, true, GUIDesignComboBoxVisibleItems,
2034 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2035 0 : mySettings->vehicleColorer.fill(*myVehicleColorMode);
2036 0 : myVehicleColorInterpolation = new FXCheckButton(matrixColor, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2037 0 : myVehicleParamKey = new FXComboBox(matrixColor, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2038 0 : myVehicleParamKey->setEditable(true);
2039 0 : myVehicleParamKey->disable();
2040 :
2041 : // rainbow settings
2042 0 : myVehicleRainbowPanel = new RainbowPanel(verticalframe, this, mySettings->vehicleValueRainBow);
2043 :
2044 0 : myVehicleColorSettingFrame = new FXVerticalFrame(verticalframe, GUIDesignViewSettingsVerticalFrame4);
2045 0 : new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
2046 :
2047 : // vehicle scale settings
2048 0 : FXVerticalFrame* verticalFrameScale = new FXVerticalFrame(verticalframe, GUIDesignViewSettingsVerticalFrame6);
2049 0 : FXMatrix* matrixScale = new FXMatrix(verticalFrameScale, 4, GUIDesignViewSettingsMatrix3);
2050 0 : new FXLabel(matrixScale, TL("Scale size"), nullptr, GUIDesignViewSettingsLabel1);
2051 0 : myVehicleScaleMode = new MFXComboBoxIcon(matrixScale, nullptr, true, GUIDesignComboBoxVisibleItems,
2052 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2053 0 : myVehicleScaleInterpolation = new FXCheckButton(matrixScale, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2054 0 : myVehicleScalingParamKey = new FXComboBox(matrixScale, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2055 0 : myVehicleScalingParamKey->setEditable(true);
2056 0 : myVehicleScalingParamKey->disable();
2057 0 : myVehicleScaleSettingFrame = new FXVerticalFrame(verticalFrameScale, GUIDesignViewSettingsVerticalFrame4);
2058 0 : mySettings->vehicleScaler.fill(*myVehicleScaleMode);
2059 0 : new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
2060 :
2061 0 : FXMatrix* matrixVehicle = new FXMatrix(verticalframe, 2, GUIDesignMatrixViewSettings);
2062 0 : myVehicleNamePanel = new NamePanel(matrixVehicle, this, TL("Show vehicle id"), mySettings->vehicleName);
2063 0 : myVehicleValuePanel = new NamePanel(matrixVehicle, this, TL("Show vehicle color value"), mySettings->vehicleValue);
2064 0 : myVehicleScaleValuePanel = new NamePanel(matrixVehicle, this, TL("Show vehicle scale value"), mySettings->vehicleScaleValue);
2065 0 : myVehicleTextPanel = new NamePanel(matrixVehicle, this, TL("Show vehicle text param"), mySettings->vehicleText);
2066 0 : myVehicleTextParamKey = new FXComboBox(myVehicleTextPanel->myMatrix0, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2067 0 : myVehicleTextParamKey->setEditable(true);
2068 : //new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator);
2069 :
2070 0 : FXMatrix* matrixShow = new FXMatrix(verticalframe, 2, GUIDesignMatrixViewSettings);
2071 0 : myShowBlinker = new FXCheckButton(matrixShow, TL("Show blinker / brake lights"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2072 0 : myShowBlinker->setCheck(mySettings->showBlinker);
2073 0 : myShowMinGap = new FXCheckButton(matrixShow, TL("Show minimum gap"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2074 0 : myShowMinGap->setCheck(mySettings->drawMinGap);
2075 0 : myShowBrakeGap = new FXCheckButton(matrixShow, TL("Show brake gap"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2076 0 : myShowBrakeGap->setCheck(mySettings->drawBrakeGap);
2077 0 : myShowBTRange = new FXCheckButton(matrixShow, TL("Show Bluetooth range"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2078 0 : myShowBTRange->setCheck(mySettings->showBTRange);
2079 0 : myShowRouteIndex = new FXCheckButton(matrixShow, TL("Show route index"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2080 0 : myShowRouteIndex->setCheck(mySettings->showRouteIndex);
2081 0 : myScaleLength = new FXCheckButton(matrixShow, TL("Scale length with geometry"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2082 0 : myScaleLength->setCheck(mySettings->scaleLength);
2083 0 : const std::string parkingInfo = mySettings->netedit ? TL("Show stopping info") : TL("Show parking info");
2084 0 : myShowParkingInfo = new FXCheckButton(matrixShow, parkingInfo.c_str(), this, MID_SIMPLE_VIEW_COLORCHANGE);
2085 0 : myShowParkingInfo->setCheck(mySettings->showParkingInfo);
2086 0 : myShowChargingInfo = new FXCheckButton(matrixShow, TL("Show charging info"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2087 0 : myShowChargingInfo->setCheck(mySettings->showChargingInfo);
2088 0 : myDrawReversed = new FXCheckButton(matrixShow, TL("Draw reversed vehicles in reverse"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2089 0 : myDrawReversed->setCheck(mySettings->drawReversed);
2090 : //new FXLabel(matrixShow, " ", nullptr, GUIDesignViewSettingsLabel1);
2091 : //myShowLaneChangePreference = new FXCheckButton(matrixShow, TL("Show lane change preference"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2092 : //myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference);
2093 : //tmpc = new FXCheckButton(matrixShow, TL("Show needed headway"), 0 ,0);
2094 : //tmpc->disable();
2095 :
2096 : //new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator);
2097 :
2098 0 : FXMatrix* matrixSize = new FXMatrix(verticalframe, 2, GUIDesignViewSettingsMatrix1);
2099 0 : myVehicleSizePanel = new SizePanel(matrixSize, this, mySettings->vehicleSize, GLO_VEHICLE);
2100 0 : }
2101 :
2102 :
2103 : void
2104 0 : GUIDialog_ViewSettings::buildPersonsFrame(FXTabBook* tabbook) {
2105 0 : new FXTabItem(tabbook, TL("Persons"), nullptr, GUIDesignViewSettingsTabItemBook1);
2106 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2107 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2108 :
2109 0 : FXMatrix* m101 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix3);
2110 0 : new FXLabel(m101, TL("Show As"), nullptr, GUIDesignViewSettingsLabel1);
2111 0 : myPersonShapeDetail = new MFXComboBoxIcon(m101, nullptr, false, GUIDesignComboBoxVisibleItems,
2112 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2113 0 : myPersonShapeDetail->appendIconItem(TL("'triangles'"));
2114 0 : myPersonShapeDetail->appendIconItem(TL("'circles'"));
2115 0 : myPersonShapeDetail->appendIconItem(TL("'simple shapes'"));
2116 0 : myPersonShapeDetail->appendIconItem(TL("'raster images'"));
2117 0 : myPersonShapeDetail->setCurrentItem(mySettings->personQuality);
2118 :
2119 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2120 :
2121 0 : FXMatrix* m102 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2122 0 : new FXLabel(m102, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
2123 0 : myPersonColorMode = new MFXComboBoxIcon(m102, nullptr, false, GUIDesignComboBoxVisibleItems,
2124 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2125 0 : mySettings->personColorer.fill(*myPersonColorMode);
2126 0 : myPersonColorInterpolation = new FXCheckButton(m102, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2127 :
2128 0 : myPersonColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2129 :
2130 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2131 :
2132 0 : FXMatrix* m103 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2133 0 : myPersonNamePanel = new NamePanel(m103, this, TL("Show person id"), mySettings->personName);
2134 0 : myPersonValuePanel = new NamePanel(m103, this, TL("Show person color value"), mySettings->personValue);
2135 :
2136 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2137 :
2138 0 : FXMatrix* m104 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
2139 0 : myPersonSizePanel = new SizePanel(m104, this, mySettings->personSize, GLO_PERSON);
2140 :
2141 0 : FXMatrix* m105 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix3);
2142 0 : myShowPedestrianNetwork = new FXCheckButton(m105, TL("Show JuPedSim pedestrian network"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2143 0 : myShowPedestrianNetwork->setCheck(mySettings->showPedestrianNetwork);
2144 0 : myPedestrianNetworkColor = new FXColorWell(m105, MFXUtils::getFXColor(mySettings->pedestrianNetworkColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2145 : #ifdef JPS_VERSION
2146 : if (mySettings->netedit) {
2147 : #endif
2148 0 : myShowPedestrianNetwork->disable();
2149 0 : myPedestrianNetworkColor->disable();
2150 : #ifdef JPS_VERSION
2151 : }
2152 : #endif
2153 0 : }
2154 :
2155 :
2156 : void
2157 0 : GUIDialog_ViewSettings::buildContainersFrame(FXTabBook* tabbook) {
2158 0 : new FXTabItem(tabbook, TL("Containers"), nullptr, GUIDesignViewSettingsTabItemBook1);
2159 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2160 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2161 :
2162 0 : FXMatrix* m101 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix3);
2163 0 : new FXLabel(m101, TL("Show As"), nullptr, GUIDesignViewSettingsLabel1);
2164 0 : myContainerShapeDetail = new MFXComboBoxIcon(m101, nullptr, false, GUIDesignComboBoxVisibleItems,
2165 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2166 0 : myContainerShapeDetail->appendIconItem(TL("'triangles'"));
2167 0 : myContainerShapeDetail->appendIconItem(TL("'boxes'"));
2168 0 : myContainerShapeDetail->appendIconItem(TL("'simple shapes'"));
2169 0 : myContainerShapeDetail->appendIconItem(TL("'raster images'"));
2170 0 : myContainerShapeDetail->setCurrentItem(mySettings->containerQuality);
2171 :
2172 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2173 :
2174 0 : FXMatrix* m102 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2175 0 : new FXLabel(m102, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
2176 0 : myContainerColorMode = new MFXComboBoxIcon(m102, nullptr, false, GUIDesignComboBoxVisibleItems,
2177 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2178 0 : mySettings->containerColorer.fill(*myContainerColorMode);
2179 0 : myContainerColorInterpolation = new FXCheckButton(m102, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2180 :
2181 0 : myContainerColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2182 :
2183 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2184 :
2185 0 : FXMatrix* m103 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2186 0 : myContainerNamePanel = new NamePanel(m103, this, TL("Show container id"), mySettings->containerName);
2187 :
2188 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2189 :
2190 0 : FXMatrix* m104 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
2191 0 : myContainerSizePanel = new SizePanel(m104, this, mySettings->containerSize, GLO_CONTAINER);
2192 0 : }
2193 :
2194 :
2195 : void
2196 0 : GUIDialog_ViewSettings::buildJunctionsFrame(FXTabBook* tabbook) {
2197 0 : new FXTabItem(tabbook, TL("Junctions"), nullptr, GUIDesignViewSettingsTabItemBook1);
2198 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2199 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2200 0 : FXMatrix* m41 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2201 0 : new FXLabel(m41, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
2202 0 : myJunctionColorMode = new MFXComboBoxIcon(m41, nullptr, false, GUIDesignComboBoxVisibleItems,
2203 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2204 0 : mySettings->junctionColorer.fill(*myJunctionColorMode);
2205 0 : myJunctionColorInterpolation = new FXCheckButton(m41, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2206 :
2207 0 : myJunctionColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2208 0 : myJunctionRainbowPanel = new RainbowPanel(verticalFrame, this, mySettings->junctionValueRainBow);
2209 :
2210 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2211 0 : FXMatrix* m42 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2212 0 : myJunctionSizePanel = new SizePanel(m42, this, mySettings->junctionSize, GLO_JUNCTION);
2213 0 : myDrawJunctionShape = new FXCheckButton(m42, TL("Draw junction shape"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2214 0 : myDrawJunctionShape->setCheck(mySettings->drawJunctionShape);
2215 0 : myDrawCrossingsAndWalkingAreas = new FXCheckButton(m42, TL("Draw crossings/walkingareas"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2216 0 : myDrawCrossingsAndWalkingAreas->setCheck(mySettings->drawCrossingsAndWalkingareas);
2217 0 : myShowLane2Lane = new FXCheckButton(m42, TL("Show lane to lane connections"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2218 0 : myShowLane2Lane->setCheck(mySettings->showLane2Lane);
2219 0 : new FXLabel(m42, " ", nullptr, GUIDesignViewSettingsLabel1);
2220 :
2221 0 : myTLIndexPanel = new NamePanel(m42, this, TL("Show link tls index"), mySettings->drawLinkTLIndex);
2222 0 : myJunctionIndexPanel = new NamePanel(m42, this, TL("Show link junction index"), mySettings->drawLinkJunctionIndex);
2223 0 : myJunctionIDPanel = new NamePanel(m42, this, TL("Show junction id"), mySettings->junctionID);
2224 0 : myInternalJunctionNamePanel = new NamePanel(m42, this, TL("Show internal junction id"), mySettings->internalJunctionName);
2225 0 : myInternalEdgeNamePanel = new NamePanel(m42, this, TL("Show internal edge id"), mySettings->internalEdgeName);
2226 0 : myCwaEdgeNamePanel = new NamePanel(m42, this, TL("Show crossing and walkingarea id"), mySettings->cwaEdgeName);
2227 0 : myTLSPhaseIndexPanel = new NamePanel(m42, this, TL("Show traffic light phase index"), mySettings->tlsPhaseIndex);
2228 0 : myTLSPhaseNamePanel = new NamePanel(m42, this, TL("Show traffic light phase name"), mySettings->tlsPhaseName);
2229 0 : myJunctionNamePanel = new NamePanel(m42, this, TL("Show junction name"), mySettings->junctionName);
2230 0 : }
2231 :
2232 :
2233 : void
2234 0 : GUIDialog_ViewSettings::buildAdditionalsFrame(FXTabBook* tabbook) {
2235 0 : new FXTabItem(tabbook, TL("Additional"), nullptr, GUIDesignViewSettingsTabItemBook1);
2236 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2237 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2238 : // IDs
2239 0 : FXMatrix* matrixIDs = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2240 0 : myAddNamePanel = new NamePanel(matrixIDs, this, TL("Show object id"), mySettings->addName);
2241 0 : myAddFullNamePanel = new NamePanel(matrixIDs, this, TL("Show full name"), mySettings->addFullName);
2242 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2243 : //Sizes
2244 0 : FXMatrix* matrixSizes = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2245 0 : myAddSizePanel = new SizePanel(matrixSizes, this, mySettings->addSize, GLO_ADDITIONALELEMENT);
2246 : // color
2247 0 : FXMatrix* matrixColor = new FXMatrix(verticalFrame, 3, GUIDesignMatrixViewSettings);
2248 0 : new FXLabel(matrixColor, TL("StoppingPlace"), nullptr, GUIDesignViewSettingsLabel1);
2249 0 : new FXLabel(matrixColor, TL("body"), nullptr, GUIDesignViewSettingsLabel1);
2250 0 : new FXLabel(matrixColor, TL("sign"), nullptr, GUIDesignViewSettingsLabel1);
2251 0 : new FXLabel(matrixColor, "busStops", nullptr, GUIDesignViewSettingsLabel1);
2252 0 : myBusStopColor = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.busStopColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2253 0 : myBusStopColorSign = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.busStopColorSign), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2254 0 : new FXLabel(matrixColor, "trainStops", nullptr, GUIDesignViewSettingsLabel1);
2255 0 : myTrainStopColor = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.trainStopColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2256 0 : myTrainStopColorSign = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.trainStopColorSign), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2257 0 : new FXLabel(matrixColor, "containerStops", nullptr, GUIDesignViewSettingsLabel1);
2258 0 : myContainerStopColor = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.containerStopColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2259 0 : myContainerStopColorSign = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.containerStopColorSign), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2260 0 : new FXLabel(matrixColor, "chargingStations", nullptr, GUIDesignViewSettingsLabel1);
2261 0 : myChargingStationColor = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.chargingStationColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2262 0 : myChargingStationColorSign = new FXColorWell(matrixColor, MFXUtils::getFXColor(mySettings->colorSettings.chargingStationColorSign), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2263 0 : }
2264 :
2265 :
2266 : void
2267 0 : GUIDialog_ViewSettings::buildDemandFrame(FXTabBook* tabbook) {
2268 0 : new FXTabItem(tabbook, TL("Demand"), nullptr, GUIDesignViewSettingsTabItemBook1);
2269 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2270 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2271 : // elements
2272 0 : FXMatrix* demandMatrix = new FXMatrix(verticalFrame, 3, GUIDesignMatrixViewSettings);
2273 0 : new FXLabel(demandMatrix, TL("element"), nullptr, GUIDesignViewSettingsLabel1);
2274 0 : new FXLabel(demandMatrix, TL("color"), nullptr, GUIDesignViewSettingsLabel1);
2275 0 : new FXLabel(demandMatrix, TL("width"), nullptr, GUIDesignViewSettingsLabel1);
2276 0 : new FXLabel(demandMatrix, "trips", nullptr, GUIDesignViewSettingsLabel1);
2277 0 : myVehicleTripsColor = new FXColorWell(demandMatrix, MFXUtils::getFXColor(mySettings->colorSettings.vehicleTripColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2278 0 : myTripWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2279 0 : myTripWidth->setValue(mySettings->widthSettings.personTripWidth);
2280 0 : new FXLabel(demandMatrix, "personTrips", nullptr, GUIDesignViewSettingsLabel1);
2281 0 : myPersonTripColor = new FXColorWell(demandMatrix, MFXUtils::getFXColor(mySettings->colorSettings.personTripColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2282 0 : myPersonTripWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2283 0 : myPersonTripWidth->setValue(mySettings->widthSettings.personTripWidth);
2284 0 : new FXLabel(demandMatrix, "walks", nullptr, GUIDesignViewSettingsLabel1);
2285 0 : myWalkColor = new FXColorWell(demandMatrix, MFXUtils::getFXColor(mySettings->colorSettings.walkColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2286 0 : myWalkWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2287 0 : myWalkWidth->setValue(mySettings->widthSettings.walkWidth);
2288 0 : new FXLabel(demandMatrix, "rides", nullptr, GUIDesignViewSettingsLabel1);
2289 0 : myRideColor = new FXColorWell(demandMatrix, MFXUtils::getFXColor(mySettings->colorSettings.rideColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2290 0 : myRideWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2291 0 : myRideWidth->setValue(mySettings->widthSettings.rideWidth);
2292 0 : new FXLabel(demandMatrix, "transport", nullptr, GUIDesignViewSettingsLabel1);
2293 0 : myTransportColor = new FXColorWell(demandMatrix, MFXUtils::getFXColor(mySettings->colorSettings.transportColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2294 0 : myTransportWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2295 0 : myTransportWidth->setValue(mySettings->widthSettings.transportWidth);
2296 0 : new FXLabel(demandMatrix, "tranship", nullptr, GUIDesignViewSettingsLabel1);
2297 0 : myTranshipColor = new FXColorWell(demandMatrix, MFXUtils::getFXColor(mySettings->colorSettings.transhipColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2298 0 : myTranshipWidth = new FXRealSpinner(demandMatrix, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2299 0 : myTranshipWidth->setValue(mySettings->widthSettings.transhipWidth);
2300 : // stops
2301 0 : FXMatrix* stopMatrix = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2302 0 : new FXLabel(stopMatrix, "stop", nullptr, GUIDesignViewSettingsLabel1);
2303 0 : myStopColor = new FXColorWell(stopMatrix, MFXUtils::getFXColor(mySettings->colorSettings.stopColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2304 0 : new FXLabel(stopMatrix, "waypoint", nullptr, GUIDesignViewSettingsLabel1);
2305 0 : myWaypointColor = new FXColorWell(stopMatrix, MFXUtils::getFXColor(mySettings->colorSettings.waypointColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2306 0 : new FXLabel(stopMatrix, "stop (persons)", nullptr, GUIDesignViewSettingsLabel1);
2307 0 : myStopPersonsColor = new FXColorWell(stopMatrix, MFXUtils::getFXColor(mySettings->colorSettings.stopPersonColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2308 0 : new FXLabel(stopMatrix, "stop (containers)", nullptr, GUIDesignViewSettingsLabel1);
2309 0 : myStopContainersColor = new FXColorWell(stopMatrix, MFXUtils::getFXColor(mySettings->colorSettings.stopContainerColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2310 0 : }
2311 :
2312 :
2313 : void
2314 0 : GUIDialog_ViewSettings::buildPOIsFrame(FXTabBook* tabbook) {
2315 0 : new FXTabItem(tabbook, TL("POIs"), nullptr, GUIDesignViewSettingsTabItemBook1);
2316 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2317 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2318 :
2319 0 : FXMatrix* m63 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2320 0 : new FXLabel(m63, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
2321 0 : myPOIColorMode = new MFXComboBoxIcon(m63, nullptr, false, GUIDesignComboBoxVisibleItems,
2322 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2323 0 : mySettings->poiColorer.fill(*myPOIColorMode);
2324 0 : myPOIColorInterpolation = new FXCheckButton(m63, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2325 0 : myPOIColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2326 :
2327 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2328 :
2329 0 : FXMatrix* m61 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2330 :
2331 0 : new FXLabel(m61, TL("POI detail"), nullptr, GUIDesignViewSettingsLabel1);
2332 0 : myPoiDetail = new FXSpinner(m61, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
2333 0 : myPoiDetail->setRange(3, 100);
2334 0 : myPoiDetail->setValue(mySettings->poiDetail);
2335 :
2336 0 : myPOIUseCustomLayer = new FXCheckButton(m61, TL("Custom Layer"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2337 0 : myPOIUseCustomLayer->setCheck(mySettings->poiUseCustomLayer);
2338 0 : myPOICustomLayer = new FXRealSpinner(m61, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
2339 0 : myPOICustomLayer->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
2340 0 : myPOICustomLayer->setValue(mySettings->poiCustomLayer);
2341 :
2342 0 : myPOINamePanel = new NamePanel(m61, this, TL("Show poi id"), mySettings->poiName);
2343 0 : myPOITypePanel = new NamePanel(m61, this, TL("Show poi type"), mySettings->poiType);
2344 0 : myPOITextPanel = new NamePanel(m61, this, TL("Show poi text param"), mySettings->poiText);
2345 0 : myPOITextParamKey = new FXComboBox(myPOITextPanel->myMatrix0, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2346 0 : myPOITextParamKey->setEditable(true);
2347 :
2348 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2349 :
2350 0 : FXMatrix* m62 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2351 0 : myPOISizePanel = new SizePanel(m62, this, mySettings->poiSize, GLO_POI);
2352 0 : }
2353 :
2354 :
2355 : void
2356 0 : GUIDialog_ViewSettings::buildPolygonsFrame(FXTabBook* tabbook) {
2357 0 : new FXTabItem(tabbook, TL("Polygons"), nullptr, GUIDesignViewSettingsTabItemBook1);
2358 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2359 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2360 :
2361 0 : FXMatrix* m63 = new FXMatrix(verticalFrame, 3, GUIDesignViewSettingsMatrix3);
2362 0 : new FXLabel(m63, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
2363 0 : myPolyColorMode = new MFXComboBoxIcon(m63, nullptr, false, GUIDesignComboBoxVisibleItems,
2364 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2365 0 : mySettings->polyColorer.fill(*myPolyColorMode);
2366 0 : myPolyColorInterpolation = new FXCheckButton(m63, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2367 0 : myPolyColorSettingFrame = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame4);
2368 :
2369 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2370 :
2371 0 : FXMatrix* m91 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2372 :
2373 0 : myPolyUseCustomLayer = new FXCheckButton(m91, TL("Custom Layer"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2374 0 : myPolyUseCustomLayer->setCheck(mySettings->polyUseCustomLayer);
2375 0 : myPolyCustomLayer = new FXRealSpinner(m91, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
2376 0 : myPolyCustomLayer->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
2377 0 : myPolyCustomLayer->setValue(mySettings->polyCustomLayer);
2378 :
2379 0 : myPolyNamePanel = new NamePanel(m91, this, TL("Show polygon id"), mySettings->polyName);
2380 0 : myPolyTypePanel = new NamePanel(m91, this, TL("Show polygon types"), mySettings->polyType);
2381 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2382 :
2383 0 : myPolySizePanel = new SizePanel(m91, this, mySettings->polySize, GLO_POLYGON);
2384 0 : }
2385 :
2386 :
2387 : void
2388 0 : GUIDialog_ViewSettings::buildSelectionFrame(FXTabBook* tabbook) {
2389 0 : new FXTabItem(tabbook, TL("Selection"), nullptr, GUIDesignViewSettingsTabItemBook1);
2390 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2391 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2392 :
2393 0 : FXMatrix* m102 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2394 0 : new FXLabel(m102, TL("Default Selection Color"), nullptr, GUIDesignViewSettingsLabel1);
2395 0 : new FXLabel(m102, "", nullptr, GUIDesignViewSettingsLabel1);
2396 :
2397 0 : new FXLabel(m102, TL("Miscellaneous"), nullptr, GUIDesignViewSettingsLabel1);
2398 0 : mySelectionColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2399 0 : new FXLabel(m102, "Edge", nullptr, GUIDesignViewSettingsLabel1);
2400 0 : mySelectedEdgeColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedEdgeColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2401 0 : new FXLabel(m102, "Lane Edge", nullptr, GUIDesignViewSettingsLabel1);
2402 0 : mySelectedLaneColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedLaneColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2403 0 : new FXLabel(m102, "Connection", nullptr, GUIDesignViewSettingsLabel1);
2404 0 : mySelectedConnectionColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedConnectionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2405 0 : new FXLabel(m102, "Prohibition", nullptr, GUIDesignViewSettingsLabel1);
2406 0 : mySelectedProhibitionColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedProhibitionColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2407 0 : new FXLabel(m102, "Crossing", nullptr, GUIDesignViewSettingsLabel1);
2408 0 : mySelectedCrossingColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedCrossingColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2409 0 : new FXLabel(m102, "Additional", nullptr, GUIDesignViewSettingsLabel1);
2410 0 : mySelectedAdditionalColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedAdditionalColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2411 0 : new FXLabel(m102, "Route", nullptr, GUIDesignViewSettingsLabel1);
2412 0 : mySelectedRouteColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedRouteColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2413 0 : new FXLabel(m102, "Vehicle", nullptr, GUIDesignViewSettingsLabel1);
2414 0 : mySelectedVehicleColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedVehicleColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2415 0 : new FXLabel(m102, "Person", nullptr, GUIDesignViewSettingsLabel1);
2416 0 : mySelectedPersonColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedPersonColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2417 0 : new FXLabel(m102, "PersonPlan", nullptr, GUIDesignViewSettingsLabel1);
2418 0 : mySelectedPersonPlanColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedPersonPlanColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2419 0 : new FXLabel(m102, "edgeData", nullptr, GUIDesignViewSettingsLabel1);
2420 0 : mySelectedEdgeDataColor = new FXColorWell(m102, MFXUtils::getFXColor(mySettings->colorSettings.selectedEdgeDataColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2421 0 : }
2422 :
2423 :
2424 : void
2425 0 : GUIDialog_ViewSettings::buildDataFrame(FXTabBook* tabbook) {
2426 0 : new FXTabItem(tabbook, TL("Data"), nullptr, GUIDesignViewSettingsTabItemBook1);
2427 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2428 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2429 : // ... color settings
2430 0 : FXVerticalFrame* verticalFrame2 = new FXVerticalFrame(verticalFrame, GUIDesignViewSettingsVerticalFrame6);
2431 0 : FXMatrix* m111 = new FXMatrix(verticalFrame2, 4, GUIDesignViewSettingsMatrix3);
2432 0 : new FXLabel(m111, TL("Color"), nullptr, GUIDesignViewSettingsLabel1);
2433 0 : myDataColorMode = new MFXComboBoxIcon(m111, nullptr, false, GUIDesignComboBoxVisibleItems,
2434 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2435 0 : myDataColorInterpolation = new FXCheckButton(m111, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2436 0 : myDataColorSettingFrame = new FXVerticalFrame(verticalFrame2, GUIDesignViewSettingsVerticalFrame4);
2437 0 : myDataParamKey = new FXComboBox(m111, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxFixed(100));
2438 0 : myDataParamKey->setEditable(true);
2439 0 : myDataParamKey->disable();
2440 0 : mySettings->dataColorer.fill(*myDataColorMode);
2441 :
2442 : // rainbow settings
2443 0 : myDataRainbowPanel = new RainbowPanel(verticalFrame2, this, mySettings->dataValueRainBow);
2444 :
2445 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2446 :
2447 : // data scale settings
2448 0 : FXVerticalFrame* verticalFrameDataScale = new FXVerticalFrame(verticalFrame2, GUIDesignViewSettingsVerticalFrame6);
2449 0 : FXMatrix* matrixDataScale = new FXMatrix(verticalFrameDataScale, 4, GUIDesignViewSettingsMatrix3);
2450 0 : new FXLabel(matrixDataScale, TL("Scale size"), nullptr, GUIDesignViewSettingsLabel1);
2451 0 : myDataScaleMode = new MFXComboBoxIcon(matrixDataScale, nullptr, true, GUIDesignComboBoxVisibleItems,
2452 0 : this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2453 0 : myDataScaleInterpolation = new FXCheckButton(matrixDataScale, TL("Interpolate"), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings);
2454 0 : myDataScaleParamKey = new FXComboBox(matrixDataScale, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic);
2455 0 : myDataScaleParamKey->setEditable(true);
2456 0 : myDataScaleParamKey->disable();
2457 0 : myDataScaleSettingFrame = new FXVerticalFrame(verticalFrameDataScale, GUIDesignViewSettingsVerticalFrame4);
2458 0 : mySettings->dataScaler.fill(*myDataScaleMode);
2459 0 : new FXHorizontalSeparator(verticalFrame2, GUIDesignHorizontalSeparator);
2460 :
2461 0 : FXMatrix* m112 = new FXMatrix(verticalFrame, 2, GUIDesignViewSettingsMatrix1);
2462 :
2463 0 : new FXLabel(m112, TL("Exaggerate edgeRelation width by"), nullptr, GUIDesignViewSettingsLabel1);
2464 0 : myEdgeRelationUpscaleDialer = new FXRealSpinner(m112, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
2465 0 : myEdgeRelationUpscaleDialer->setRange(0, 1000000);
2466 0 : myEdgeRelationUpscaleDialer->setValue(mySettings->edgeRelWidthExaggeration);
2467 :
2468 0 : new FXLabel(m112, TL("Exaggerate tazRelation width by"), nullptr, GUIDesignViewSettingsLabel1);
2469 0 : myTazRelationUpscaleDialer = new FXRealSpinner(m112, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2);
2470 0 : myTazRelationUpscaleDialer->setRange(0, 1000000);
2471 0 : myTazRelationUpscaleDialer->setValue(mySettings->tazRelWidthExaggeration);
2472 :
2473 : // text decoration
2474 0 : myDataValuePanel = new NamePanel(m112, this, TL("Show data color value"), mySettings->dataValue);
2475 0 : }
2476 :
2477 :
2478 : void
2479 0 : GUIDialog_ViewSettings::buildLegendFrame(FXTabBook* tabbook) {
2480 0 : new FXTabItem(tabbook, TL("Legend"), nullptr, GUIDesignViewSettingsTabItemBook1);
2481 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2482 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2483 :
2484 0 : FXMatrix* m72 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2485 0 : myShowSizeLegend = new FXCheckButton(m72, TL("Show Size Legend"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2486 0 : myShowSizeLegend->setCheck(mySettings->showSizeLegend);
2487 0 : new FXLabel(m72, "");
2488 0 : myShowColorLegend = new FXCheckButton(m72, TL("Show Edge Color Legend"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2489 0 : myShowColorLegend->setCheck(mySettings->showColorLegend);
2490 0 : new FXLabel(m72, "");
2491 0 : myShowVehicleColorLegend = new FXCheckButton(m72, TL("Show Vehicle Color Legend"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2492 0 : myShowVehicleColorLegend->setCheck(mySettings->showVehicleColorLegend);
2493 0 : new FXLabel(m72, "");
2494 0 : }
2495 :
2496 :
2497 : void
2498 0 : GUIDialog_ViewSettings::buildOpenGLFrame(FXTabBook* tabbook) {
2499 0 : new FXTabItem(tabbook, "openGL", nullptr, GUIDesignViewSettingsTabItemBook1);
2500 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2501 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2502 0 : FXMatrix* m90 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2503 0 : new FXLabel(m90, TL("UI Scaling"), nullptr, GUIDesignViewSettingsLabel1);
2504 0 : myUIScale = new FXRealSpinner(m90, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2505 0 : myUIScale->setValue(getApp()->reg().readRealEntry("SETTINGS", "uiscale", 1));
2506 0 : FXMatrix* m80 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2507 0 : myTrueZ = new FXCheckButton(m80, "Draw all objects at their true Z-level", this, MID_SIMPLE_VIEW_COLORCHANGE);
2508 0 : myTrueZ->setCheck(mySettings->trueZ);
2509 0 : FXMatrix* m81 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2510 0 : new FXLabel(m81, TL("Combobox max rows"), nullptr, GUIDesignViewSettingsLabel1);
2511 0 : myComboRows = new FXRealSpinner(m81, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2512 0 : myComboRows->setValue(GUIDesignComboBoxVisibleItems);
2513 0 : FXMatrix* m82 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2514 0 : myDisableHideByZoom = new FXCheckButton(m82, TL("Disable hide by zoom"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2515 0 : myDisableHideByZoom->setHelpText(TL("Disable hiding edges with high zoom out"));
2516 0 : myDisableHideByZoom->setCheck(mySettings->disableHideByZoom);
2517 0 : FXMatrix* m83 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2518 0 : myDither = new FXCheckButton(m83, TL("Dither"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2519 0 : myDither->setCheck(mySettings->dither);
2520 0 : FXMatrix* m84 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2521 0 : myFPS = new FXCheckButton(m84, "FPS", this, MID_SIMPLE_VIEW_COLORCHANGE);
2522 0 : myFPS->setCheck(mySettings->fps);
2523 0 : FXMatrix* m85 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2524 0 : myDrawBoundaries = new FXCheckButton(m85, TL("Draw boundaries"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2525 0 : myDrawBoundaries->setCheck(mySettings->drawBoundaries);
2526 0 : FXMatrix* m86 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2527 0 : myForceDrawForRectangleSelection = new FXCheckButton(m86, TL("Force draw for rectangle selection"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2528 0 : myForceDrawForRectangleSelection->setCheck(mySettings->forceDrawForRectangleSelection);
2529 0 : FXMatrix* m87 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2530 0 : myDisableDottedContours = new FXCheckButton(m87, TL("Disable dotted contours during selection/deletion"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2531 0 : myDisableDottedContours->setCheck(mySettings->disableDottedContours);
2532 0 : FXMatrix* m88 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2533 0 : myRecalculateBoundaries = GUIDesigns::buildFXButton(m88, TL("Recalculate boundaries"), "", "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE,
2534 : (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4);
2535 0 : FXMatrix* m89 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2536 0 : myGeometryIndicesPanel = new NamePanel(m89, this, TL("Show geometry point indices"), mySettings->geometryIndices);
2537 0 : }
2538 :
2539 :
2540 : void
2541 0 : GUIDialog_ViewSettings::build3DFrame(FXTabBook* tabbook) {
2542 0 : myFrame3D = new FXTabItem(tabbook, TL("3D view"), nullptr, GUIDesignViewSettingsTabItemBook1);
2543 0 : FXScrollWindow* scrollWindow = new FXScrollWindow(tabbook);
2544 0 : FXVerticalFrame* verticalFrame = new FXVerticalFrame(scrollWindow, GUIDesignViewSettingsVerticalFrame2);
2545 :
2546 0 : FXMatrix* m82 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2547 0 : myIgnoreColorSchemeFor3DVehicles = new FXCheckButton(m82, TL("Ignore color scheme for vehicles"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2548 0 : myIgnoreColorSchemeFor3DVehicles->setCheck(mySettings->ignoreColorSchemeFor3DVehicles);
2549 0 : myShow3DTLSLinkMarkers = new FXCheckButton(m82, TL("Show TLS link markers"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2550 0 : myShow3DTLSLinkMarkers->setCheck(mySettings->show3DTLSLinkMarkers);
2551 : //FXMatrix* m83 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2552 0 : myShow3DTLSDomes = new FXCheckButton(m82, TL("Show domes around TLS models from decals"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2553 0 : myShow3DTLSDomes->setCheck(mySettings->show3DTLSDomes);
2554 : //FXMatrix* m84 = new FXMatrix(verticalFrame, 1, GUIDesignMatrixViewSettings);
2555 0 : myGenerate3DTLSModels = new FXCheckButton(m82, TL("Show auto-generated TLS models"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2556 0 : myGenerate3DTLSModels->setCheck(mySettings->generate3DTLSModels);
2557 0 : myShow3DHeadUpDisplay = new FXCheckButton(m82, TL("Show head-up display"), this, MID_SIMPLE_VIEW_COLORCHANGE);
2558 0 : myShow3DHeadUpDisplay->setCheck(mySettings->show3DHeadUpDisplay);
2559 :
2560 0 : new FXHorizontalSeparator(verticalFrame, GUIDesignHorizontalSeparator);
2561 :
2562 0 : FXMatrix* m2 = new FXMatrix(verticalFrame, 2, GUIDesignMatrixViewSettings);
2563 0 : new FXLabel(m2, TL("Sun brightness"), nullptr, GUIDesignViewSettingsLabel1);
2564 0 : myLight3DFactor = new FXSpinner(m2, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial1);
2565 0 : myLight3DFactor->setRange(0, 255);
2566 0 : myLight3DFactor->setValue(mySettings->diffuse3DLight.red());
2567 : /*
2568 : new FXLabel(m2, "Ambient", nullptr, GUIDesignViewSettingsLabel1);
2569 : myAmbient3DLight = new FXColorWell(m2, MFXUtils::getFXColor(mySettings->ambient3DLight), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2570 : myAmbient3DLight->setOpaqueOnly(true);
2571 : new FXLabel(m2, "Diffuse", nullptr, GUIDesignViewSettingsLabel1);
2572 : myDiffuse3DLight = new FXColorWell(m2, MFXUtils::getFXColor(mySettings->diffuse3DLight), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2573 : myDiffuse3DLight->setOpaqueOnly(true);
2574 : */
2575 0 : new FXLabel(m2, TL("Sky color"), nullptr, GUIDesignViewSettingsLabel1);
2576 0 : mySkyColor = new FXColorWell(m2, MFXUtils::getFXColor(mySettings->skyColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell);
2577 0 : mySkyColor->setOpaqueOnly(true);
2578 :
2579 : #ifdef HAVE_OSG
2580 : UNUSED_PARAMETER(myFrame3D);
2581 : #else
2582 : myFrame3D->disable();
2583 : #endif
2584 0 : }
2585 :
2586 :
2587 : void
2588 0 : GUIDialog_ViewSettings::buildButtons(FXVerticalFrame* contentFrame) {
2589 0 : FXHorizontalFrame* horizontalFrameButtons = new FXHorizontalFrame(contentFrame, GUIDesignViewSettingsHorizontalFrame2);
2590 0 : FXButton* OK = GUIDesigns::buildFXButton(horizontalFrameButtons, TL("&OK"), "", "", nullptr, this, MID_SETTINGS_OK, GUIDesignViewSettingsButton2);
2591 0 : GUIDesigns::buildFXButton(horizontalFrameButtons, TL("&Cancel"), "", "", nullptr, this, MID_SETTINGS_CANCEL, GUIDesignViewSettingsButton3);
2592 0 : OK->setFocus();
2593 0 : }
2594 :
2595 : /****************************************************************************/
|