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