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