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-2020 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 GNEPersonTypeFrame;
57 class GNERouteFrame;
58 class GNEStopFrame;
59 class GNEVehicleFrame;
61 // data frames
63 class GNEEdgeDataFrame;
65 class GNETAZRelDataFrame;
66 
67 
68 // ===========================================================================
69 // class declarations
70 // ===========================================================================
83  FXDECLARE(GNEViewParent)
84 
85 public:
102  GNEViewParent(FXMDIClient* p, FXMDIMenu* mdimenu,
103  const FXString& name, GNEApplicationWindow* parentWindow,
104  FXGLCanvas* share, GNENet* net, GNEUndoList* undoList,
105  FXIcon* ic = nullptr, FXuint opts = 0, FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0);
106 
108  ~GNEViewParent();
109 
111  void hideAllFrames();
112 
115 
118 
121 
124 
126  GNEMoveFrame* getMoveFrame() const;
127 
130 
133 
136 
139 
141  GNETAZFrame* getTAZFrame() const;
142 
145 
148 
151 
153  GNERouteFrame* getRouteFrame() const;
154 
157 
160 
162  GNEStopFrame* getStopFrame() const;
163 
166 
169 
172 
175 
178 
181 
184  void showFramesArea();
185 
188  void hideFramesArea();
189 
192 
195 
197  void eraseACChooserDialog(GNEDialogACChooser* chooserDialog);
198 
200  void updateUndoRedoButtons();
201 
205  long onCmdMakeSnapshot(FXObject* sender, FXSelector, void*);
206 
208  long onCmdClose(FXObject*, FXSelector, void*);
209 
211  long onCmdLocate(FXObject*, FXSelector, void*);
212 
214  long onKeyPress(FXObject* o, FXSelector sel, void* data);
215 
217  long onKeyRelease(FXObject* o, FXSelector sel, void* data);
218 
220  long onCmdUpdateFrameAreaWidth(FXObject*, FXSelector, void*);
222 
223 protected:
224  FOX_CONSTRUCTOR(GNEViewParent)
225 
226 
227  class CommonFrames {
228 
229  public:
231  CommonFrames();
232 
234  void buildCommonFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);
235 
237  void hideCommonFrames();
238 
240  void setCommonFramesWidth(int frameWidth);
241 
243  bool isCommonFrameShown() const;
244 
247 
250 
253 
256 
259  };
260 
263 
264  public:
266  NetworkFrames();
267 
269  void buildNetworkFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);
270 
272  void hideNetworkFrames();
273 
275  void setNetworkFramesWidth(int frameWidth);
276 
278  bool isNetworkFrameShown() const;
279 
282 
285 
288 
291 
294 
297 
300 
303 
306  };
307 
309  class DemandFrames {
310 
311  public:
313  DemandFrames();
314 
316  void buildDemandFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);
317 
319  void hideDemandFrames();
320 
322  void setDemandFramesWidth(int frameWidth);
323 
325  bool isDemandFrameShown() const;
326 
329 
332 
335 
338 
341 
344 
347 
350  };
351 
353  class DataFrames {
354 
355  public:
357  DataFrames();
358 
360  void buildDataFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);
361 
363  void hideDataFrames();
364 
366  void setDataFramesWidth(int frameWidth);
367 
369  bool isDataFrameShown() const;
370 
373 
376 
379 
382  };
383 
385  class ACChoosers {
386 
387  public:
389  ACChoosers();
390 
392  ~ACChoosers();
393 
396 
399 
402 
405 
408 
411 
414 
417 
420 
423 
426  };
427 
428 private:
431 
433  FXHorizontalFrame* myViewArea;
434 
436  FXHorizontalFrame* myFramesArea;
437 
439  FXButton* myUndoButton;
440 
442  FXButton* myRedoButton;
443 
445  FXSplitter* myFramesSplitter;
446 
449 
452 
455 
458 
461 };
The main window of the Netedit.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:40
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
GNEVehicleTypeFrame * vehicleTypeFrame
frame for DEMAND_VEHICLETYPE
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
GNEPersonTypeFrame * personTypeFrame
frame for DEMAND_PERSONTYPE
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:81
long onCmdMakeSnapshot(FXObject *sender, FXSelector, void *)
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.
GNEViewParent(FXMDIClient *p, FXMDIMenu *mdimenu, const FXString &name, GNEApplicationWindow *parentWindow, FXGLCanvas *share, GNENet *net, GNEUndoList *undoList, FXIcon *ic=nullptr, FXuint opts=0, FXint x=0, FXint y=0, FXint w=0, FXint h=0)
FOX-declaration.
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
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
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
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
GNEVehicleTypeFrame * getVehicleTypeFrame() const
get frame for DEMAND_VEHICLETYPE
GNEApplicationWindow * myGNEAppWindows
pointer to GNEApplicationWindow
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
GNEPersonTypeFrame * getPersonTypeFrame() const
get frame for DEMAND_PERSONTYPE
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
GNERouteFrame * getRouteFrame() const
get frame for DEMAND_ROUTE
GNEFrame * getCurrentShownFrame() const
get current frame (note: it can be null)
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
~GNEViewParent()
Destructor.
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
Called when user releases a key.