Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/dialogs/options/GNENetgenerateOptionsDialog.cpp
193723 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 GNENetgenerateOptionsDialog.cpp
15
/// @author Pablo Alvarez Lopez
16
/// @date May 2023
17
///
18
// A Dialog for setting options (see OptionsCont)
19
/****************************************************************************/
20
#include <config.h>
21
22
#include <netedit/GNEApplicationWindow.h>
23
#include <netedit/GNEViewNet.h>
24
#include <netedit/GNEViewParent.h>
25
#include <netedit/frames/common/GNEGroupBoxModule.h>
26
#include <utils/gui/div/GUIDesigns.h>
27
#include <utils/options/OptionsLoader.h>
28
#include <xercesc/parsers/SAXParser.hpp>
29
#include <utils/foxtools/MFXCheckButtonTooltip.h>
30
31
#include "GNENetgenerateOptionsDialog.h"
32
#include "GNEOptionsEditor.h"
33
34
// ===========================================================================
35
// method definitions
36
// ===========================================================================
37
38
GNENetgenerateOptionsDialog::GNENetgenerateOptionsDialog(GNEApplicationWindow* applicationWindow,
39
OptionsCont& optionsContainer, const OptionsCont& originalOptionsContainer) :
40
GNEDialog(applicationWindow, TL("Run netgenerate with advanced options"), GUIIcon::NETGENERATE,
41
DialogType::OPTIONS_NETGENERATE, GNEDialog::Buttons::RUN_CANCEL_RESET, OpenType::MODAL,
42
GNEDialog::ResizeMode::RESIZABLE, 800, 600) {
43
// build options editor
44
myOptionsEditor = new GNEOptionsEditor(this, "Netgenerate", optionsContainer, originalOptionsContainer);
45
// open modal dialog
46
openDialog();
47
}
48
49
50
GNENetgenerateOptionsDialog::~GNENetgenerateOptionsDialog() { }
51
52
53
void
54
GNENetgenerateOptionsDialog::runInternalTest(const InternalTestStep::DialogArgument* dialogArgument) {
55
myOptionsEditor->runInternalTest(dialogArgument);
56
}
57
58
59
bool
60
GNENetgenerateOptionsDialog::isOptionModified() const {
61
return myOptionsEditor->isOptionModified();
62
}
63
64
65
long
66
GNENetgenerateOptionsDialog::onCmdRun(FXObject*, FXSelector, void*) {
67
// close dialog canceling
68
closeDialogCanceling();
69
// run netgenerate
70
return myApplicationWindow->tryHandle(this, FXSEL(SEL_COMMAND, MID_GNE_RUNNETGENERATE), nullptr);
71
}
72
73
74
long
75
GNENetgenerateOptionsDialog::onCmdCancel(FXObject*, FXSelector, void*) {
76
// reset options
77
myOptionsEditor->resetAllOptions();
78
// close dialog canceling
79
return closeDialogCanceling();
80
}
81
82
83
long
84
GNENetgenerateOptionsDialog::onCmdReset(FXObject*, FXSelector, void*) {
85
// reset options
86
myOptionsEditor->resetAllOptions();
87
return 1;
88
}
89
90
/****************************************************************************/
91
92