Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/common/GNEMoveFrame.h
169684 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 GNEMoveFrame.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Jun 2020
17
///
18
// The Widget for move elements
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <netedit/frames/GNEFrame.h>
24
25
// ===========================================================================
26
// class definitions
27
// ===========================================================================
28
29
class GNEMoveFrame : public GNEFrame {
30
31
public:
32
// ===========================================================================
33
// class CommonMoveOptions
34
// ===========================================================================
35
36
class CommonMoveOptions : public MFXGroupBoxModule {
37
38
public:
39
/// @brief constructor
40
CommonMoveOptions(GNEMoveFrame* moveFrameParent);
41
42
/// @brief destructor
43
~CommonMoveOptions();
44
45
/// @brief allow change lane
46
bool getAllowChangeLane() const;
47
48
/// @brief check if merge geometry points
49
bool getMergeGeometryPoints() const;
50
51
private:
52
/// @brief checkbox for enable/disable change lanes
53
FXCheckButton* myAllowChangeLanes;
54
55
/// @brief checkbox for enable/disable merge geometry points
56
FXCheckButton* myMergeGeometryPoints;
57
};
58
59
// ===========================================================================
60
// class NetworkMoveOptions
61
// ===========================================================================
62
63
class NetworkMoveOptions : public MFXGroupBoxModule {
64
/// @brief FOX-declaration
65
FXDECLARE(GNEMoveFrame::NetworkMoveOptions)
66
67
public:
68
/// @brief constructor
69
NetworkMoveOptions(GNEMoveFrame* moveFrameParent);
70
71
/// @brief destructor
72
~NetworkMoveOptions();
73
74
/// @brief show NetworkMoveOptions
75
void showNetworkMoveOptions();
76
77
/// @brief hide NetworkMoveOptions
78
void hideNetworkMoveOptions();
79
80
/// @brief check if option "move whole polygons" is enabled
81
bool getMoveWholePolygons() const;
82
83
/// @brief check if option "force draw geometry points" is enabled
84
bool getForceDrawGeometryPoints() const;
85
86
/// @brief check if option "move only junction center" is enabled
87
bool getMoveOnlyJunctionCenter() const;
88
89
/// @name FOX-callbacks
90
/// @{
91
/// @brief Called after change option
92
long onCmdChangeOption(FXObject*, FXSelector, void*);
93
94
/// @}
95
96
protected:
97
/// @brief FOX need this
98
FOX_CONSTRUCTOR(NetworkMoveOptions)
99
100
private:
101
/// @brief pointer to move frame parent
102
GNEMoveFrame* myMoveFrameParent;
103
104
/// @brief checkbox for enable/disable move whole polygons
105
FXCheckButton* myMoveWholePolygons = nullptr;
106
107
/// @brief checkbox for force draw geometry points
108
FXCheckButton* myForceDrawGeometryPoints = nullptr;
109
110
/// @brief checkbox for move only juntion center
111
FXCheckButton* myMoveOnlyJunctionCenter = nullptr;
112
};
113
114
// ===========================================================================
115
// class DemandMoveOptions
116
// ===========================================================================
117
118
class DemandMoveOptions : public MFXGroupBoxModule {
119
120
public:
121
/// @brief constructor
122
DemandMoveOptions(GNEMoveFrame* moveFrameParent);
123
124
/// @brief destructor
125
~DemandMoveOptions();
126
127
/// @brief show DemandMoveOptions
128
void showDemandMoveOptions();
129
130
/// @brief hide DemandMoveOptions
131
void hideDemandMoveOptions();
132
133
/// @brief check if leave stopPersonConnected is enabled
134
bool getLeaveStopPersonsConnected() const;
135
136
private:
137
/// @brief pointer to move frame parent
138
GNEMoveFrame* myMoveFrameParent = nullptr;
139
140
/// @brief checkbox for enable/disable leave stopPersons connected
141
FXCheckButton* myLeaveStopPersonsConnected = nullptr;
142
};
143
144
// ===========================================================================
145
// class ShiftEdgeSelectedGeometry
146
// ===========================================================================
147
148
class ShiftEdgeSelectedGeometry : public MFXGroupBoxModule {
149
/// @brief FOX-declaration
150
FXDECLARE(GNEMoveFrame::ShiftEdgeSelectedGeometry)
151
152
public:
153
/// @brief constructor
154
ShiftEdgeSelectedGeometry(GNEMoveFrame* moveFrameParent);
155
156
/// @brief destructor
157
~ShiftEdgeSelectedGeometry();
158
159
/// @brief enable shift edge geometry
160
void enableShiftEdgeGeometry();
161
162
/// @brief disable change Z in selection
163
void disableShiftEdgeGeometry();
164
165
/// @name FOX-callbacks
166
/// @{
167
/// @brief Called when user changes Z value
168
long onCmdChangeShiftValue(FXObject*, FXSelector, void*);
169
170
/// @brief Called when user press the apply Z value button
171
long onCmdShiftEdgeGeometry(FXObject*, FXSelector, void*);
172
173
/// @}
174
175
protected:
176
/// @brief FOX need this
177
FOX_CONSTRUCTOR(ShiftEdgeSelectedGeometry)
178
179
private:
180
/// @brief pointer to move frame parent
181
GNEMoveFrame* myMoveFrameParent;
182
183
/// @brief textField for shift value
184
FXTextField* myShiftValueTextField = nullptr;
185
186
/// @brief button for apply Z value
187
FXButton* myApplyZValue = nullptr;
188
};
189
190
// ===========================================================================
191
// class ChangeZInSelection
192
// ===========================================================================
193
194
class ChangeZInSelection : public MFXGroupBoxModule {
195
/// @brief FOX-declaration
196
FXDECLARE(GNEMoveFrame::ChangeZInSelection)
197
198
public:
199
/// @brief constructor
200
ChangeZInSelection(GNEMoveFrame* moveFrameParent);
201
202
/// @brief destructor
203
~ChangeZInSelection();
204
205
/// @brief enabale change Z in selection
206
void enableChangeZInSelection();
207
208
/// @brief disable change Z in selection
209
void disableChangeZInSelection();
210
211
/// @name FOX-callbacks
212
/// @{
213
/// @brief Called when user changes Z value
214
long onCmdChangeZValue(FXObject*, FXSelector, void*);
215
216
/// @brief Called when user changes Z mode
217
long onCmdChangeZMode(FXObject*, FXSelector, void*);
218
219
/// @brief Called when user press the apply Z value button
220
long onCmdApplyZ(FXObject*, FXSelector, void*);
221
222
/// @}
223
224
protected:
225
/// @brief FOX need this
226
FOX_CONSTRUCTOR(ChangeZInSelection)
227
228
/// @brief update label
229
void updateInfoLabel();
230
231
private:
232
/// @brief pointer to move frame parent
233
GNEMoveFrame* myMoveFrameParent;
234
235
/// @brief textField for Z value
236
FXTextField* myZValueTextField = nullptr;
237
238
/// @brief radio button for absolute value
239
FXRadioButton* myAbsoluteValue = nullptr;
240
241
/// @brief apply button
242
FXButton* myApplyButton = nullptr;
243
244
/// @brief radio button for relative value
245
FXRadioButton* myRelativeValue = nullptr;
246
247
/// @brief info label
248
FXLabel* myInfoLabel = nullptr;
249
};
250
251
// ===========================================================================
252
// class ShiftShapeGeometry
253
// ===========================================================================
254
255
class ShiftShapeGeometry : public MFXGroupBoxModule {
256
/// @brief FOX-declaration
257
FXDECLARE(GNEMoveFrame::ShiftShapeGeometry)
258
259
public:
260
/// @brief constructor
261
ShiftShapeGeometry(GNEMoveFrame* moveFrameParent);
262
263
/// @brief destructor
264
~ShiftShapeGeometry();
265
266
/// @brief show shift shape geometry
267
void showShiftShapeGeometry();
268
269
/// @brief hide change Z in selection
270
void hideShiftShapeGeometry();
271
272
/// @name FOX-callbacks
273
/// @{
274
/// @brief Called when user changes Z value
275
long onCmdChangeShiftValue(FXObject*, FXSelector, void*);
276
277
/// @brief Called when user press the apply Z value button
278
long onCmdShiftShapeGeometry(FXObject*, FXSelector, void*);
279
280
/// @}
281
282
protected:
283
/// @brief FOX need this
284
FOX_CONSTRUCTOR(ShiftShapeGeometry)
285
286
private:
287
/// @brief pointer to move frame parent
288
GNEMoveFrame* myMoveFrameParent;
289
290
/// @brief textField for shiftX value
291
FXTextField* myShiftValueXTextField = nullptr;
292
293
/// @brief textField for shiftY value
294
FXTextField* myShiftValueYTextField = nullptr;
295
};
296
297
// ===========================================================================
298
// class Information
299
// ===========================================================================
300
301
class Information : public MFXGroupBoxModule {
302
303
public:
304
/// @brief constructor
305
Information(GNEMoveFrame* moveFrameParent);
306
307
/// @brief destructor
308
~Information();
309
};
310
311
/**@brief Constructor
312
* @brief viewParent GNEViewParent in which this GNEFrame is placed
313
* @brief viewNet viewNet that uses this GNEFrame
314
*/
315
GNEMoveFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
316
317
/// @brief Destructor
318
~GNEMoveFrame();
319
320
/**@brief handle processClick and set the relative coloring
321
* @param[in] clickedPosition clicked position over ViewNet
322
* @param viewObjects collection of objects under cursor after click over view
323
* @param objectsUnderGrippedCursor collection of objects under gripped cursor after click over view
324
*/
325
void processClick(const Position& clickedPosition,
326
const GNEViewNetHelper::ViewObjectsSelector& viewObjects,
327
const GNEViewNetHelper::ViewObjectsSelector& objectsUnderGrippedCursor);
328
329
/// @brief show prohibition frame
330
void show();
331
332
/// @brief hide prohibition frame
333
void hide();
334
335
/// @brief get common mode options
336
CommonMoveOptions* getCommonMoveOptions() const;
337
338
/// @brief get network mode options
339
NetworkMoveOptions* getNetworkMoveOptions() const;
340
341
/// @brief get demand mode options
342
DemandMoveOptions* getDemandMoveOptions() const;
343
344
private:
345
/// @brief modul for CommonMove Options
346
CommonMoveOptions* myCommonMoveOptions = nullptr;
347
348
/// @brief modul for NetworkMove Options
349
NetworkMoveOptions* myNetworkMoveOptions = nullptr;
350
351
/// @brief modul for DemandMove Options
352
DemandMoveOptions* myDemandMoveOptions = nullptr;
353
354
/// @brief modul for shift edge selected geometry
355
ShiftEdgeSelectedGeometry* myShiftEdgeSelectedGeometry = nullptr;
356
357
/// @brief modul for change Z in selection
358
ChangeZInSelection* myChangeZInSelection = nullptr;
359
360
/// @brief modul for show information
361
Information* myInformation = nullptr;
362
363
/// @brief modul for shift shape geometry
364
ShiftShapeGeometry* myShiftShapeGeometry = nullptr;
365
};
366
367