Eclipse SUMO - Simulation of Urban MObility
GNEViewParent.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2022 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 /****************************************************************************/
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 
27 
28 
29 // ===========================================================================
30 // class declarations
31 // ===========================================================================
32 
34 class GNEDialogACChooser;
35 class GNEFrame;
36 class GNEViewNet;
37 class GNENet;
38 class GNEUndoList;
39 // common frames
40 class GNEDeleteFrame;
41 class GNEInspectorFrame;
42 class GNESelectorFrame;
43 class GNEMoveFrame;
44 // network frames
45 class GNEAdditionalFrame;
46 class GNEConnectorFrame;
47 class GNECreateEdgeFrame;
48 class GNECrossingFrame;
49 class GNEPolygonFrame;
51 class GNETAZFrame;
52 class GNETLSEditorFrame;
53 // demand frames
54 class GNEPersonFrame;
55 class GNEPersonPlanFrame;
56 class GNEContainerFrame;
58 class GNERouteFrame;
59 class GNEStopFrame;
60 class GNEVehicleFrame;
61 class GNETypeFrame;
62 // data frames
64 class GNEEdgeDataFrame;
66 class GNETAZRelDataFrame;
67 
68 
69 // ===========================================================================
70 // class declarations
71 // ===========================================================================
84  FXDECLARE(GNEViewParent)
85 
86 public:
104  GNEViewParent(FXMDIClient* p, FXMDIMenu* mdimenu, const FXString& name, GNEApplicationWindow* parentWindow,
105  FXGLCanvas* share, GNENet* net, const bool newNet, GNEUndoList* undoList, FXIcon* ic = nullptr,
106  FXuint opts = 0, FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0);
107 
109  ~GNEViewParent();
110 
112  void hideAllFrames();
113 
116 
119 
122 
125 
127  GNEMoveFrame* getMoveFrame() const;
128 
131 
134 
137 
140 
142  GNETAZFrame* getTAZFrame() const;
143 
146 
149 
152 
154  GNERouteFrame* getRouteFrame() const;
155 
158 
160  GNETypeFrame* getTypeFrame() const;
161 
163  GNEStopFrame* getStopFrame() const;
164 
167 
170 
173 
176 
179 
182 
185 
188  void showFramesArea();
189 
192  void hideFramesArea();
193 
196 
199 
201  void eraseACChooserDialog(GNEDialogACChooser* chooserDialog);
202 
204  void updateUndoRedoButtons();
205 
209  long onCmdMakeSnapshot(FXObject* sender, FXSelector, void*);
210 
212  long onCmdClose(FXObject*, FXSelector, void*);
213 
215  long onCmdLocate(FXObject*, FXSelector, void*);
216 
218  long onKeyPress(FXObject* o, FXSelector sel, void* data);
219 
221  long onKeyRelease(FXObject* o, FXSelector sel, void* data);
222 
224  long onCmdUpdateFrameAreaWidth(FXObject*, FXSelector, void*);
226 
227  std::vector<GUIGlID> getObjectIDs(int messageId) const;
228 
229 
230 protected:
231  FOX_CONSTRUCTOR(GNEViewParent)
232 
233 
234  class CommonFrames {
235 
236  public:
238  CommonFrames();
239 
241  void buildCommonFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);
242 
244  void hideCommonFrames();
245 
247  void setCommonFramesWidth(int frameWidth);
248 
250  bool isCommonFrameShown() const;
251 
254 
257 
260 
263 
266  };
267 
270 
271  public:
273  NetworkFrames();
274 
276  void buildNetworkFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);
277 
279  void hideNetworkFrames();
280 
282  void setNetworkFramesWidth(int frameWidth);
283 
285  bool isNetworkFrameShown() const;
286 
289 
292 
295 
298 
301 
304 
307 
310 
313  };
314 
316  class DemandFrames {
317 
318  public:
320  DemandFrames();
321 
323  void buildDemandFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);
324 
326  void hideDemandFrames();
327 
329  void setDemandFramesWidth(int frameWidth);
330 
332  bool isDemandFrameShown() const;
333 
336 
339 
342 
345 
348 
351 
354 
357 
360  };
361 
363  class DataFrames {
364 
365  public:
367  DataFrames();
368 
370  void buildDataFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);
371 
373  void hideDataFrames();
374 
376  void setDataFramesWidth(int frameWidth);
377 
379  bool isDataFrameShown() const;
380 
383 
386 
389 
392  };
393 
395  class ACChoosers {
396 
397  public:
399  ACChoosers();
400 
402  ~ACChoosers();
403 
406 
409 
412 
415 
418 
421 
424 
427 
430 
433 
436  };
437 
438 private:
441 
443  FXHorizontalFrame* myViewArea;
444 
446  FXHorizontalFrame* myFramesArea;
447 
449  FXButton* myUndoButton;
450 
452  FXButton* myRedoButton;
453 
456 
458  FXSplitter* myFramesSplitter;
459 
462 
465 
468 
471 
474 };
The main window of the Netedit.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
struct for ACChoosers dialog
GNEDialogACChooser * ACChooserStops
pointer to ACChooser dialog used for locate stops
GNEDialogACChooser * ACChooserEdges
pointer to ACChooser dialog used for locate edges
GNEDialogACChooser * ACChooserPolygon
pointer to ACChooser dialog used for locate Polygons
GNEDialogACChooser * ACChooserPOI
pointer to ACChooser dialog used for locate POIs
GNEDialogACChooser * ACChooserRoutes
pointer to ACChooser dialog used for locate routes
GNEDialogACChooser * ACChooserJunction
pointer to ACChooser dialog used for locate junctions
GNEDialogACChooser * ACChooserVehicles
pointer to ACChooser dialog used for locate vehicles
GNEDialogACChooser * ACChooserTLS
pointer to ACChooser dialog used for locate TLSs
GNEDialogACChooser * ACChooserProhibition
pointer to ACChooser dialog used for locate Prohibitions
GNEDialogACChooser * ACChooserPersons
pointer to ACChooser dialog used for locate persons
GNEDialogACChooser * ACChooserAdditional
pointer to ACChooser dialog used for locate additional
class for common frames
GNEMoveFrame * moveFrame
frame for move elements
GNEDeleteFrame * deleteFrame
frame for delete elemetns
GNESelectorFrame * selectorFrame
frame for select elements
GNEInspectorFrame * inspectorFrame
frame for inspect elements
class for data frames
GNEEdgeDataFrame * edgeDataFrame
frame for DATA_EDGEDATA
void setDataFramesWidth(int frameWidth)
set new width in all data frames
GNEFrame * getCurrentShownFrame() const
get current data frame show
GNETAZRelDataFrame * TAZRelDataFrame
frame for DATA_TAZRELDATA
GNEEdgeRelDataFrame * edgeRelDataFrame
frame for DATA_EDGERELDATA
bool isDataFrameShown() const
return true if at least there is a data frame shown
void hideDataFrames()
hide data frames
void buildDataFrames(GNEViewParent *viewParent, GNEViewNet *viewNet)
build data frames
class for demand frames
GNEPersonFrame * personFrame
frame for DEMAND_PERSON
GNEStopFrame * stopFrame
frame for DEMAND_STOP
GNERouteFrame * routeFrame
frame for DEMAND_ROUTE
GNEContainerFrame * containerFrame
frame for DEMAND_CONTAINER
GNEContainerPlanFrame * containerPlanFrame
frame for DEMAND_CONTAINERPLAN
GNEVehicleFrame * vehicleFrame
frame for DEMAND_VEHICLE
GNEFrame * getCurrentShownFrame() const
get current demand frame show
void setDemandFramesWidth(int frameWidth)
set new width in all demand frames
void buildDemandFrames(GNEViewParent *viewParent, GNEViewNet *viewNet)
build demand frames
GNEPersonPlanFrame * personPlanFrame
frame for DEMAND_PERSONPLAN
bool isDemandFrameShown() const
return true if at least there is a demand frame shown
GNETypeFrame * vehicleTypeFrame
frame for DEMAND_VEHICLETYPE
void hideDemandFrames()
hide demand frames
class for network frames
GNEAdditionalFrame * additionalFrame
frame for NETWORK_ADDITIONAL
bool isNetworkFrameShown() const
return true if at least there is a network frame shown
GNEPolygonFrame * polygonFrame
frame for NETWORK_POLYGON
GNECrossingFrame * crossingFrame
frame for NETWORK_CROSSING
GNEConnectorFrame * connectorFrame
frame for NETWORK_CONNECT
GNECreateEdgeFrame * createEdgeFrame
frame for NETWORK_CREATEDGE
GNEProhibitionFrame * prohibitionFrame
frame for NETWORK_PROHIBITION
GNETAZFrame * TAZFrame
frame for NETWORK_TAZ
GNETLSEditorFrame * TLSEditorFrame
frame for NETWORK_TLS
GNEFrame * getCurrentShownFrame() const
get current network frame show
void hideNetworkFrames()
hide network frames
void setNetworkFramesWidth(int frameWidth)
set new width in all network frames
void buildNetworkFrames(GNEViewParent *viewParent, GNEViewNet *viewNet)
build network frames
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:82
long onCmdMakeSnapshot(FXObject *sender, FXSelector, void *)
FXButton * myComputePathManagerButton
compute Path manager button
GNECrossingFrame * getCrossingFrame() const
get frame for NETWORK_CROSSING
GUIMainWindow * getGUIMainWindow() const
get GUIMainWindow App
GNEConnectorFrame * getConnectorFrame() const
get frame for NETWORK_CONNECT
GNEStopFrame * getStopFrame() const
get frame for DEMAND_STOP
void updateUndoRedoButtons()
update toolbar undo/redo buttons (called when user press Ctrl+Z/Y)
long onCmdUpdateFrameAreaWidth(FXObject *, FXSelector, void *)
Called when user change the splitter between FrameArea and ViewNet.
GNEProhibitionFrame * getProhibitionFrame() const
get frame for NETWORK_PROHIBITION
long onKeyPress(FXObject *o, FXSelector sel, void *data)
Called when user press a key.
GNEPersonPlanFrame * getPersonPlanFrame() const
get frame for DEMAND_PERSONFRAME
DemandFrames myDemandFrames
struct for demand frames
GNEPolygonFrame * getPolygonFrame() const
get frame for NETWORK_POLYGON
GNETAZRelDataFrame * getTAZRelDataFrame() const
get frame for DATA_TAZRELDATA
GNEMoveFrame * getMoveFrame() const
get frame for move elements
long onCmdClose(FXObject *, FXSelector, void *)
Called when the user hits the close button (x)
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
GNEContainerPlanFrame * getContainerPlanFrame() const
get frame for DEMAND_CONTAINERFRAME
void hideFramesArea()
hide frames area if all GNEFrames are hidden
FXButton * myRedoButton
toolbar redo button
FXHorizontalFrame * myViewArea
frame to hold myView and myAttributePanel
GNEEdgeDataFrame * getEdgeDataFrame() const
get frame for DATA_EDGEDATA
GNEDeleteFrame * getDeleteFrame() const
get frame for delete elements
NetworkFrames myNetworkFrames
struct for network frames
ACChoosers myACChoosers
struct for ACChoosers
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
void showFramesArea()
show frames area if at least a GNEFrame is showed
FXButton * myUndoButton
toolbar undo button
void hideAllFrames()
hide all frames
GNETypeFrame * getTypeFrame() const
get frame for DEMAND_VEHICLETYPE
GNETAZFrame * getTAZFrame() const
get frame for NETWORK_TAZ
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for NETWORK_TLS
CommonFrames myCommonFrames
struct for common frames
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
DataFrames myDataFrames
struct for data frames
GNEContainerFrame * getContainerFrame() const
get frame for DEMAND_CONTAINER
GNEAdditionalFrame * getAdditionalFrame() const
get frame for NETWORK_ADDITIONAL
FXHorizontalFrame * myFramesArea
frame to hold GNEFrames
GNEPersonFrame * getPersonFrame() const
get frame for DEMAND_PERSON
FXSplitter * myFramesSplitter
Splitter to divide ViewNet und GNEFrames.
void eraseACChooserDialog(GNEDialogACChooser *chooserDialog)
remove created chooser dialog
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
GNEApplicationWindow * myGNEAppWindows
pointer to GNEApplicationWindow
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
GNEViewParent(FXMDIClient *p, FXMDIMenu *mdimenu, const FXString &name, GNEApplicationWindow *parentWindow, FXGLCanvas *share, GNENet *net, const bool newNet, GNEUndoList *undoList, FXIcon *ic=nullptr, FXuint opts=0, FXint x=0, FXint y=0, FXint w=0, FXint h=0)
FOX-declaration.
GNERouteFrame * getRouteFrame() const
get frame for DEMAND_ROUTE
GNEFrame * getCurrentShownFrame() const
get current frame (note: it can be null)
std::vector< GUIGlID > getObjectIDs(int messageId) const
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
~GNEViewParent()
Destructor.
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
Called when user releases a key.