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