SUMO - Simulation of Urban MObility
GUIMainWindow.h
Go to the documentation of this file.
1 /****************************************************************************/
9 //
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUIMainWindow_h
23 #define GUIMainWindow_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <fx.h>
36 #include <vector>
37 #include <string>
38 #include <map>
39 #include <utils/common/StdDefs.h>
40 #include <utils/common/SUMOTime.h>
42 
43 
44 // ===========================================================================
45 // class declarations
46 // ===========================================================================
47 class GUIEvent;
49 
50 
51 // ===========================================================================
52 // class definitions
53 // ===========================================================================
54 class GUIMainWindow : public FXMainWindow {
55 public:
56  GUIMainWindow(FXApp* a);
57  virtual ~GUIMainWindow();
59  void addChild(FXMDIChild* child, bool updateOnSimStep = true);
60  void addChild(FXMainWindow* child, bool updateOnSimStep = true);
61 
63  void removeChild(FXMDIChild* child);
64  void removeChild(FXMainWindow* child);
65 
66  std::vector<std::string> getViewIDs() const;
67  FXMDIChild* getViewByID(const std::string& id) const;
68 
69  void updateChildren();
70 
71  FXFont* getBoldFont();
72 
73  FXGLVisual* getGLVisual() const;
74 
75  virtual FXGLCanvas* getBuildGLCanvas() const = 0;
76 
77  virtual SUMOTime getCurrentSimTime() const = 0;
78 
79  virtual void setStatusBarText(const std::string&) { }
80 
81  FXLabel& getCartesianLabel();
82  FXLabel& getGeoLabel();
83 
85  bool isGaming() const {
86  return myAmGaming;
87  }
88 
90  bool listInternal() const {
91  return myListInternal;
92  }
93 
95  bool listParking() const {
96  return myListParking;
97  }
98 
100  bool listTeleporting() const {
101  return myListTeleporting;
102  }
103 
104  static GUIMainWindow* getInstance();
105 
109  virtual SUMOReal getDelay() const {
110  return 0;
111  }
112 
115  virtual void setDelay(SUMOReal) {}
116 
120  virtual void sendBlockingEvent(GUIEvent* event) {
121  UNUSED_PARAMETER(event);
122  }
123 
126 
127 protected:
128  std::vector<FXMDIChild*> mySubWindows;
129  std::vector<FXMainWindow*> myTrackerWindows;
132 
134  FXFont* myBoldFont;
135 
137  FXMDIClient* myMDIClient;
138 
140  FXStatusBar* myStatusbar;
141 
144  FXHorizontalFrame* myCartesianFrame, *myGeoFrame;
145 
147  FXGLVisual* myGLVisual;
148 
150 
153 
156 
159 
162 
165 
166 protected:
168 
170  void setWindowSizeAndPos();
171 
172 
173 };
174 
175 
176 #endif
177 
178 /****************************************************************************/
179 
std::vector< FXMainWindow * > myTrackerWindows
FXLabel * myGeoCoordinate
bool listTeleporting() const
return whether to list teleporting vehicles
long long int SUMOTime
Definition: SUMOTime.h:43
virtual SUMOReal getDelay() const
Returns the delay (should be overwritten by subclasses if applicable)
bool myListParking
information whether the locator should list parking vehicles
void setWindowSizeAndPos()
perform initial window positioning and sizing according to user options / previous call ...
FXFont * myBoldFont
Font used for popup-menu titles.
FXDockSite * myRightDock
FXGLVisual * myGLVisual
The gl-visual used.
bool isGaming() const
return whether the gui is in gaming mode
Definition: GUIMainWindow.h:85
bool listParking() const
return whether to list parking vehicles
Definition: GUIMainWindow.h:95
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:38
bool myListTeleporting
information whether the locator should list teleporting vehicles
FXHorizontalFrame * myCartesianFrame
FXMDIChild * getViewByID(const std::string &id) const
FXLabel & getCartesianLabel()
bool myAmGaming
information whether the gui is currently in gaming mode
virtual void setDelay(SUMOReal)
Sets the delay of the parent application.
std::vector< FXMDIChild * > mySubWindows
virtual void sendBlockingEvent(GUIEvent *event)
Sends an event from the application thread to the GUI and waits until it is handled.
void addChild(FXMDIChild *child, bool updateOnSimStep=true)
Adds a further child window to the list.
GUISUMOAbstractView * getActiveView() const
get the active view or 0
virtual void setStatusBarText(const std::string &)
Definition: GUIMainWindow.h:79
static GUIMainWindow * getInstance()
FXDockSite * myLeftDock
static GUIMainWindow * myInstance
the singleton window instance
FXFont * getBoldFont()
FXGLVisual * getGLVisual() const
bool listInternal() const
return whether to list internal structures
Definition: GUIMainWindow.h:90
FXLabel & getGeoLabel()
void removeChild(FXMDIChild *child)
removes the given child window from the list
bool myListInternal
information whether the locator should list internal structures
FXStatusBar * myStatusbar
The status bar.
virtual SUMOTime getCurrentSimTime() const =0
FXDockSite * myBottomDock
FXLabel * myCartesianCoordinate
Labels for the current cartesian and geo-coordinate.
MFXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
virtual FXGLCanvas * getBuildGLCanvas() const =0
FXHorizontalFrame * myGeoFrame
FXDockSite * myTopDock
virtual ~GUIMainWindow()
FXMDIClient * myMDIClient
The multi view panel.
#define SUMOReal
Definition: config.h:208
std::vector< std::string > getViewIDs() const