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