Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/dialogs/GNEVClassesDialog.h
169678 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
14
/// @file GNEVClassesDialog.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Feb 2017
17
///
18
// Dialog for edit allow VClass attribute
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <utils/common/SUMOVehicleClass.h>
24
25
#include "GNEDialog.h"
26
27
// ===========================================================================
28
// class definitions
29
// ===========================================================================
30
31
class GNEAttributeCarrier;
32
33
// ===========================================================================
34
// class definitions
35
// ===========================================================================
36
37
class GNEVClassesDialog : public GNEDialog {
38
/// @brief FOX-declaration
39
FXDECLARE(GNEVClassesDialog)
40
41
public:
42
/// @brief vclass row
43
class VClassRow : protected FXHorizontalFrame {
44
/// @brief FOX-declaration
45
FXDECLARE(VClassRow)
46
47
public:
48
/// @brief Constructor
49
VClassRow(FXVerticalFrame* contentsFrame, SUMOVehicleClass vClass,
50
GUIIcon vClassIcon, const std::string& description);
51
52
/// @brief destructor
53
~VClassRow();
54
55
/// @brief get vclass in string format
56
const std::string& getVClassString() const;
57
58
/// @brief set vClass button status
59
void setVClassButtonStatus(const bool enabled);
60
61
/// @brief check if vClass button is enabled
62
bool isVClassButtonEnabled() const;
63
64
/// @name FOX-callbacks
65
/// @{
66
67
/// @brief event when user toogle the vClass button
68
long onCmdToggleVClass(FXObject*, FXSelector, void*);
69
70
/// @}
71
72
protected:
73
/// @brief FOX need this
74
FOX_CONSTRUCTOR(VClassRow)
75
76
/// @brief vclass button
77
FXButton* myVClassButton = nullptr;
78
79
/// @brief vclass in string format
80
const std::string myVClassString;
81
82
private:
83
/// @brief Invalidated copy constructor.
84
VClassRow(const VClassRow&) = delete;
85
86
/// @brief Invalidated assignment operator.
87
VClassRow& operator=(const VClassRow&) = delete;
88
};
89
90
/// @brief Constructor
91
GNEVClassesDialog(GNEApplicationWindow* mainWindow, SumoXMLAttr attr,
92
const std::string originalVClasses);
93
94
/// @brief destructor
95
~GNEVClassesDialog();
96
97
/// @brief run internal test
98
void runInternalTest(const InternalTestStep::DialogArgument* dialogArgument);
99
100
/// @brief get vClasses modified by this dialog
101
std::string getModifiedVClasses() const;
102
103
/// @name FOX-callbacks
104
/// @{
105
106
/// @brief event when user press select all VClasses button
107
long onCmdSelectAll(FXObject*, FXSelector, void*);
108
109
/// @brief event when user press unselect all VClasses button
110
long onCmdUnselectAll(FXObject*, FXSelector, void*);
111
112
/// @brief event when user press select only road button
113
long onCmdSelectOnlyRoad(FXObject*, FXSelector, void*);
114
115
/// @brief event when user press select only rail button
116
long onCmdSelectOnlyRail(FXObject*, FXSelector, void*);
117
118
/// @brief event after press accept button
119
long onCmdAccept(FXObject*, FXSelector, void*);
120
121
/// @brief event after press cancel button
122
long onCmdCancel(FXObject*, FXSelector, void*);
123
124
/// @brief event after press reset button
125
long onCmdReset(FXObject*, FXSelector, void*);
126
127
/// @}
128
129
protected:
130
/// @brief FOX need this
131
FOX_CONSTRUCTOR(GNEVClassesDialog)
132
133
/// @brief original vClasses (used for reset)
134
const std::string myOriginalVClasses;
135
136
/// @brief edited vClasses
137
std::string myEditedVClasses;
138
139
/// @brief map with the buttons for every VClass
140
std::map<SUMOVehicleClass, VClassRow* > myVClassMap;
141
142
private:
143
/// @brief Invalidated copy constructor.
144
GNEVClassesDialog(const GNEVClassesDialog&) = delete;
145
146
/// @brief Invalidated assignment operator.
147
GNEVClassesDialog& operator=(const GNEVClassesDialog&) = delete;
148
};
149
150