Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/GNEViewParent.h
169666 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 GNEViewParent.h
15
/// @author Jakob Erdmann
16
/// @date Feb 2011
17
///
18
// A single child window which contains a view of the edited network (adapted
19
// from GUISUMOViewParent)
20
// While we don't actually need MDI for netedit it is easier to adapt existing
21
// structures than to write everything from scratch.
22
/****************************************************************************/
23
#pragma once
24
#include <config.h>
25
26
#include <utils/foxtools/MFXButtonTooltip.h>
27
#include <utils/gui/windows/GUIGlChildWindow.h>
28
29
30
// ===========================================================================
31
// class declarations
32
// ===========================================================================
33
34
class GNEApplicationWindow;
35
class GNEACChooserDialog;
36
class GNEFrame;
37
class GNEViewNet;
38
class GNENet;
39
class GNEUndoList;
40
// common frames
41
class GNEDeleteFrame;
42
class GNEInspectorFrame;
43
class GNESelectorFrame;
44
class GNEMoveFrame;
45
// network frames
46
class GNEAdditionalFrame;
47
class GNEConnectorFrame;
48
class GNECreateEdgeFrame;
49
class GNECrossingFrame;
50
class GNEShapeFrame;
51
class GNEProhibitionFrame;
52
class GNEWireFrame;
53
class GNEDecalFrame;
54
class GNETAZFrame;
55
class GNETLSEditorFrame;
56
// demand frames
57
class GNEPersonFrame;
58
class GNEPersonPlanFrame;
59
class GNEContainerFrame;
60
class GNEContainerPlanFrame;
61
class GNERouteFrame;
62
class GNERouteDistributionFrame;
63
class GNEStopFrame;
64
class GNEVehicleFrame;
65
class GNETypeFrame;
66
class GNETypeDistributionFrame;
67
// data frames
68
class GNEGenericDataFrame;
69
class GNEEdgeDataFrame;
70
class GNEEdgeRelDataFrame;
71
class GNETAZRelDataFrame;
72
class GNEMeanDataFrame;
73
74
75
// ===========================================================================
76
// class declarations
77
// ===========================================================================
78
/**
79
* @class GNEViewParent
80
* @brief A single child window which contains a view of the simulation area
81
*
82
* It is made of a tool-bar containing a field to change the type of display,
83
* buttons that allow to choose an artifact and some other view controlling
84
* options.
85
*
86
* The rest of the window is a canvas that contains the display itself
87
*/
88
class GNEViewParent : public GUIGlChildWindow {
89
/// @brief FOX-declaration
90
FXDECLARE(GNEViewParent)
91
92
public:
93
/**@brief Constructor
94
* also builds the view and calls create()
95
*
96
* @param[in] p The MDI-pane this window is shown within
97
* @param[in] mdimenu The MDI-menu for alignment
98
* @param[in] name The name of the window
99
* @param[in] parentWindow The main window
100
* @param[in] ic The icon of this window
101
* @param[in] opts Window options
102
* @param[in] x Initial x-position
103
* @param[in] y Initial x-position
104
* @param[in] w Initial width
105
* @param[in] h Initial height
106
* @param[in] share A canvas tor get the shared context from
107
* @param[in] net The network to show
108
*/
109
GNEViewParent(FXMDIClient* p, FXMDIMenu* mdimenu, const FXString& name, GNEApplicationWindow* parentWindow,
110
FXGLCanvas* share, GNENet* net, GNEUndoList* undoList, FXIcon* ic = nullptr,
111
FXuint opts = 0, FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0);
112
113
/// @brief Destructor
114
~GNEViewParent();
115
116
/// @brief hide all frames
117
void hideAllFrames();
118
119
/// @brief get current frame (note: it can be null)
120
GNEFrame* getCurrentShownFrame() const;
121
122
/// @brief get frame for inspect elements
123
GNEInspectorFrame* getInspectorFrame() const;
124
125
/// @brief get frame for delete elements
126
GNEDeleteFrame* getDeleteFrame() const;
127
128
/// @brief get frame for select elements
129
GNESelectorFrame* getSelectorFrame() const;
130
131
/// @brief get frame for move elements
132
GNEMoveFrame* getMoveFrame() const;
133
134
/// @brief get frame for NETWORK_CONNECT
135
GNEConnectorFrame* getConnectorFrame() const;
136
137
/// @brief get frame for NETWORK_TLS
138
GNETLSEditorFrame* getTLSEditorFrame() const;
139
140
/// @brief get frame for NETWORK_ADDITIONAL
141
GNEAdditionalFrame* getAdditionalFrame() const;
142
143
/// @brief get frame for NETWORK_CROSSING
144
GNECrossingFrame* getCrossingFrame() const;
145
146
/// @brief get frame for NETWORK_TAZ
147
GNETAZFrame* getTAZFrame() const;
148
149
/// @brief get frame for NETWORK_SHAPE
150
GNEShapeFrame* getShapeFrame() const;
151
152
/// @brief get frame for NETWORK_PROHIBITION
153
GNEProhibitionFrame* getProhibitionFrame() const;
154
155
/// @brief get frame for NETWORK_WIRE
156
GNEWireFrame* getWireFrame() const;
157
158
/// @brief get frame for NETWORK_DECAL
159
GNEDecalFrame* getDecalFrame() const;
160
161
/// @brief get frame for NETWORK_CREATEEDGE
162
GNECreateEdgeFrame* getCreateEdgeFrame() const;
163
164
/// @brief get frame for DEMAND_ROUTE
165
GNERouteFrame* getRouteFrame() const;
166
167
/// @brief get frame for DEMAND_ROUTEDISTRIBUTION
168
GNERouteDistributionFrame* getRouteDistributionFrame() const;
169
170
/// @brief get frame for DEMAND_VEHICLE
171
GNEVehicleFrame* getVehicleFrame() const;
172
173
/// @brief get frame for DEMAND_TYPE
174
GNETypeFrame* getTypeFrame() const;
175
176
/// @brief get frame for DEMAND_TYPEDISTRIBUTION
177
GNETypeDistributionFrame* getTypeDistributionFrame() const;
178
179
/// @brief get frame for DEMAND_STOP
180
GNEStopFrame* getStopFrame() const;
181
182
/// @brief get frame for DEMAND_PERSON
183
GNEPersonFrame* getPersonFrame() const;
184
185
/// @brief get frame for DEMAND_PERSONFRAME
186
GNEPersonPlanFrame* getPersonPlanFrame() const;
187
188
/// @brief get frame for DEMAND_CONTAINER
189
GNEContainerFrame* getContainerFrame() const;
190
191
/// @brief get frame for DEMAND_CONTAINERFRAME
192
GNEContainerPlanFrame* getContainerPlanFrame() const;
193
194
/// @brief get frame for DATA_EDGEDATA
195
GNEEdgeDataFrame* getEdgeDataFrame() const;
196
197
/// @brief get frame for DATA_EDGERELDATA
198
GNEEdgeRelDataFrame* getEdgeRelDataFrame() const;
199
200
/// @brief get frame for DATA_TAZRELDATA
201
GNETAZRelDataFrame* getTAZRelDataFrame() const;
202
203
/// @brief get frame for DATA_TAZRELDATA
204
GNEMeanDataFrame* getMeanDataFrame() const;
205
206
/// @brief show frames area if at least a GNEFrame is showed
207
/// @note this function is called in GNEFrame::Show();
208
void showFramesArea();
209
210
/// @brief hide frames area if all GNEFrames are hidden
211
/// @note this function is called in GNEFrame::Show();
212
void hideFramesArea();
213
214
/// @brief get GUIMainWindow App
215
GUIMainWindow* getGUIMainWindow() const;
216
217
/// @brief get GNE Application Windows
218
GNEApplicationWindow* getGNEAppWindows() const;
219
220
/// @brief remove created chooser dialog
221
void eraseACChooserDialog(GNEACChooserDialog* chooserDialog);
222
223
/// @brief update toolbar undo/redo buttons (called when user press Ctrl+Z/Y)
224
void updateUndoRedoButtons();
225
226
/// @brief get frame area
227
FXVerticalFrame* getFramesArea() const;
228
229
/// @brief get frame area width
230
int getFrameAreaWidth() const;
231
232
/// @brief set frame area width
233
void setFrameAreaWidth(const int frameAreaWith);
234
235
/// @name FOX-callbacks
236
/// @{
237
/// @brief Called if the user wants to make a snapshot (screenshot)
238
long onCmdMakeSnapshot(FXObject* sender, FXSelector, void*);
239
240
/// @brief Called when the user hits the close button (x)
241
long onCmdClose(FXObject*, FXSelector, void*);
242
243
/// @brief locator-callback
244
long onCmdLocate(FXObject*, FXSelector, void*);
245
246
/// @brief Called when user press a key
247
long onKeyPress(FXObject* o, FXSelector sel, void* data);
248
249
/// @brief Called when user releases a key
250
long onKeyRelease(FXObject* o, FXSelector sel, void* data);
251
252
/// @brief Called when user change the splitter between FrameArea and ViewNet
253
long onCmdUpdateFrameAreaWidth(FXObject*, FXSelector, void*);
254
/// @}
255
256
protected:
257
FOX_CONSTRUCTOR(GNEViewParent)
258
259
/// @brief class for common frames
260
class CommonFrames {
261
262
public:
263
/// @brief constructor
264
CommonFrames();
265
266
/// @brief build common frames
267
void buildCommonFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);
268
269
/// @brief hide common frames
270
void hideCommonFrames();
271
272
/// @brief set new width in all common frames
273
void setCommonFramesWidth(int frameWidth);
274
275
/// @brief return true if at least there is a common frame shown
276
bool isCommonFrameShown() const;
277
278
/// @brief get current common frame show
279
GNEFrame* getCurrentShownFrame() const;
280
281
/// @brief frame for inspect elements
282
GNEInspectorFrame* inspectorFrame = nullptr;
283
284
/// @brief frame for delete elements
285
GNEDeleteFrame* deleteFrame = nullptr;
286
287
/// @brief frame for select elements
288
GNESelectorFrame* selectorFrame = nullptr;
289
290
/// @brief frame for move elements
291
GNEMoveFrame* moveFrame = nullptr;
292
};
293
294
/// @brief class for network frames
295
class NetworkFrames {
296
297
public:
298
/// @brief constructor
299
NetworkFrames();
300
301
/// @brief build network frames
302
void buildNetworkFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);
303
304
/// @brief hide network frames
305
void hideNetworkFrames();
306
307
/// @brief set new width in all network frames
308
void setNetworkFramesWidth(int frameWidth);
309
310
/// @brief return true if at least there is a network frame shown
311
bool isNetworkFrameShown() const;
312
313
/// @brief get current network frame show
314
GNEFrame* getCurrentShownFrame() const;
315
316
/// @brief frame for NETWORK_CONNECT
317
GNEConnectorFrame* connectorFrame = nullptr;
318
319
/// @brief frame for NETWORK_TLS
320
GNETLSEditorFrame* TLSEditorFrame = nullptr;
321
322
/// @brief frame for NETWORK_ADDITIONAL
323
GNEAdditionalFrame* additionalFrame = nullptr;
324
325
/// @brief frame for NETWORK_CROSSING
326
GNECrossingFrame* crossingFrame = nullptr;
327
328
/// @brief frame for NETWORK_TAZ
329
GNETAZFrame* TAZFrame = nullptr;
330
331
/// @brief frame for NETWORK_SHAPE
332
GNEShapeFrame* polygonFrame = nullptr;
333
334
/// @brief frame for NETWORK_PROHIBITION
335
GNEProhibitionFrame* prohibitionFrame = nullptr;
336
337
/// @brief frame for NETWORK_WIRE
338
GNEWireFrame* wireFrame = nullptr;
339
340
/// @brief frame for NETWORK_DECAL
341
GNEDecalFrame* decalFrame = nullptr;
342
343
/// @brief frame for NETWORK_CREATEDGE
344
GNECreateEdgeFrame* createEdgeFrame;
345
};
346
347
/// @brief class for demand frames
348
class DemandFrames {
349
350
public:
351
/// @brief constructor
352
DemandFrames();
353
354
/// @brief build demand frames
355
void buildDemandFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);
356
357
/// @brief hide demand frames
358
void hideDemandFrames();
359
360
/// @brief set new width in all demand frames
361
void setDemandFramesWidth(int frameWidth);
362
363
/// @brief return true if at least there is a demand frame shown
364
bool isDemandFrameShown() const;
365
366
/// @brief get current demand frame show
367
GNEFrame* getCurrentShownFrame() const;
368
369
/// @brief frame for DEMAND_ROUTE
370
GNERouteFrame* routeFrame = nullptr;
371
372
/// @brief frame for DEMAND_ROUTEDISTRIBUTION
373
GNERouteDistributionFrame* routeDistributionFrame = nullptr;
374
375
/// @brief frame for DEMAND_VEHICLE
376
GNEVehicleFrame* vehicleFrame = nullptr;
377
378
/// @brief frame for DEMAND_TYPE
379
GNETypeFrame* typeFrame = nullptr;
380
381
/// @brief frame for DEMAND_TYPEDISTRIBUTION
382
GNETypeDistributionFrame* typeDistributionFrame = nullptr;
383
384
/// @brief frame for DEMAND_STOP
385
GNEStopFrame* stopFrame = nullptr;
386
387
/// @brief frame for DEMAND_PERSON
388
GNEPersonFrame* personFrame = nullptr;
389
390
/// @brief frame for DEMAND_PERSONPLAN
391
GNEPersonPlanFrame* personPlanFrame = nullptr;
392
393
/// @brief frame for DEMAND_CONTAINER
394
GNEContainerFrame* containerFrame = nullptr;
395
396
/// @brief frame for DEMAND_CONTAINERPLAN
397
GNEContainerPlanFrame* containerPlanFrame = nullptr;
398
};
399
400
/// @brief class for data frames
401
class DataFrames {
402
403
public:
404
/// @brief constructor
405
DataFrames();
406
407
/// @brief build data frames
408
void buildDataFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);
409
410
/// @brief hide data frames
411
void hideDataFrames();
412
413
/// @brief set new width in all data frames
414
void setDataFramesWidth(int frameWidth);
415
416
/// @brief return true if at least there is a data frame shown
417
bool isDataFrameShown() const;
418
419
/// @brief get current data frame show
420
GNEFrame* getCurrentShownFrame() const;
421
422
/// @brief frame for DATA_EDGEDATA
423
GNEEdgeDataFrame* edgeDataFrame = nullptr;
424
425
/// @brief frame for DATA_EDGERELDATA
426
GNEEdgeRelDataFrame* edgeRelDataFrame = nullptr;
427
428
/// @brief frame for DATA_TAZRELDATA
429
GNETAZRelDataFrame* TAZRelDataFrame = nullptr;
430
431
/// @brief frame for DATA_MEANDATA
432
GNEMeanDataFrame* meanDataFrame = nullptr;
433
};
434
435
/// @brief struct for ACChoosers dialog
436
class ACChoosers {
437
438
public:
439
/// @brief constructor
440
ACChoosers();
441
442
/// @brief destructor
443
~ACChoosers();
444
445
/// @brief pointer to ACChooser dialog used for locate junctions
446
GNEACChooserDialog* ACChooserJunction = nullptr;
447
448
/// @brief pointer to ACChooser dialog used for locate edges
449
GNEACChooserDialog* ACChooserEdges = nullptr;
450
451
/// @brief pointer to ACChooser dialog used for locate walkingareas
452
GNEACChooserDialog* ACChooserWalkingAreas = nullptr;
453
454
/// @brief pointer to ACChooser dialog used for locate vehicles
455
GNEACChooserDialog* ACChooserVehicles = nullptr;
456
457
/// @brief pointer to ACChooser dialog used for locate persons
458
GNEACChooserDialog* ACChooserPersons = nullptr;
459
460
/// @brief pointer to ACChooser dialog used for locate containers
461
GNEACChooserDialog* ACChooserContainers = nullptr;
462
463
/// @brief pointer to ACChooser dialog used for locate routes
464
GNEACChooserDialog* ACChooserRoutes = nullptr;
465
466
/// @brief pointer to ACChooser dialog used for locate stops
467
GNEACChooserDialog* ACChooserStops = nullptr;
468
469
/// @brief pointer to ACChooser dialog used for locate TLSs
470
GNEACChooserDialog* ACChooserTLS = nullptr;
471
472
/// @brief pointer to ACChooser dialog used for locate additional
473
GNEACChooserDialog* ACChooserAdditional = nullptr;
474
475
/// @brief pointer to ACChooser dialog used for locate POIs
476
GNEACChooserDialog* ACChooserPOI = nullptr;
477
478
/// @brief pointer to ACChooser dialog used for locate Polygons
479
GNEACChooserDialog* ACChooserPolygon = nullptr;
480
481
/// @brief pointer to ACChooser dialog used for locate Prohibitions
482
GNEACChooserDialog* ACChooserProhibition = nullptr;
483
484
/// @brief pointer to ACChooser dialog used for locate Wires
485
GNEACChooserDialog* ACChooserWire = nullptr;
486
};
487
488
private:
489
/// @brief pointer to GNEApplicationWindow
490
GNEApplicationWindow* myGNEAppWindows;
491
492
/// @brief frame to hold myView and myAttributePanel
493
FXHorizontalFrame* myViewArea;
494
495
/// @brief frame to hold GNEFrames
496
FXVerticalFrame* myFramesArea;
497
498
/// @brief toolbar undo button
499
MFXButtonTooltip* myUndoButton;
500
501
/// @brief toolbar redo button
502
MFXButtonTooltip* myRedoButton;
503
504
/// @brief compute Path manager button
505
MFXButtonTooltip* myComputePathManagerButton;
506
507
/// @brief Splitter to divide ViewNet und GNEFrames
508
FXSplitter* myFramesSplitter;
509
510
/// @brief struct for common frames
511
CommonFrames myCommonFrames;
512
513
/// @brief struct for network frames
514
NetworkFrames myNetworkFrames;
515
516
/// @brief struct for demand frames
517
DemandFrames myDemandFrames;
518
519
/// @brief struct for data frames
520
DataFrames myDataFrames;
521
522
/// @brief struct for ACChoosers
523
ACChoosers myACChoosers;
524
};
525
526