SUMO - Simulation of Urban MObility
GUIMainWindow.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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 //
20 /****************************************************************************/
21 #ifndef GUIMainWindow_h
22 #define GUIMainWindow_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <fx.h>
35 #include <vector>
36 #include <string>
37 #include <map>
38 #include <utils/common/StdDefs.h>
39 #include <utils/common/SUMOTime.h>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class GUIEvent;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
53 class GUIMainWindow : public FXMainWindow {
54 public:
55  GUIMainWindow(FXApp* a);
56  virtual ~GUIMainWindow();
58  void addChild(FXMDIChild* child, bool updateOnSimStep = true);
59  void addChild(FXMainWindow* child, bool updateOnSimStep = true);
60 
62  void removeChild(FXMDIChild* child);
63  void removeChild(FXMainWindow* child);
64 
65  std::vector<std::string> getViewIDs() const;
66  FXMDIChild* getViewByID(const std::string& id) const;
67 
68  void updateChildren();
69 
70  FXFont* getBoldFont();
71 
72  FXGLVisual* getGLVisual() const;
73 
74  virtual FXGLCanvas* getBuildGLCanvas() const = 0;
75 
76  virtual SUMOTime getCurrentSimTime() const = 0;
77 
78  virtual double getTrackerInterval() const = 0;
79 
80  virtual void setStatusBarText(const std::string&) { }
81 
82  FXLabel& getCartesianLabel();
83  FXLabel& getGeoLabel();
84 
86  bool isGaming() const {
87  return myAmGaming;
88  }
89 
91  bool listInternal() const {
92  return myListInternal;
93  }
94 
96  bool listParking() const {
97  return myListParking;
98  }
99 
101  bool listTeleporting() const {
102  return myListTeleporting;
103  }
104 
105  static GUIMainWindow* getInstance();
106 
110  virtual double getDelay() const {
111  return 0;
112  }
113 
116  virtual void setDelay(double) {}
117 
121  virtual void sendBlockingEvent(GUIEvent* event) {
122  UNUSED_PARAMETER(event);
123  }
124 
127 
128 protected:
129  std::vector<FXMDIChild*> mySubWindows;
130  std::vector<FXMainWindow*> myTrackerWindows;
133 
135  FXFont* myBoldFont;
136 
138  FXMDIClient* myMDIClient;
139 
141  FXStatusBar* myStatusbar;
142 
145  FXHorizontalFrame* myCartesianFrame, *myGeoFrame;
146 
148  FXGLVisual* myGLVisual;
149 
151 
154 
157 
160 
163 
166 
167 protected:
169 
171  void setWindowSizeAndPos();
172 
173 
174 };
175 
176 
177 #endif
178 
179 /****************************************************************************/
180 
std::vector< FXMainWindow * > myTrackerWindows
FXLabel * myGeoCoordinate
virtual SUMOTime getCurrentSimTime() const =0
FXGLVisual * getGLVisual() const
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 listTeleporting() const
return whether to list teleporting vehicles
virtual void setDelay(double)
Sets the delay of the parent application.
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
bool myListTeleporting
information whether the locator should list teleporting vehicles
std::vector< std::string > getViewIDs() const
FXHorizontalFrame * myCartesianFrame
FXLabel & getCartesianLabel()
bool myAmGaming
information whether the gui is currently in gaming mode
std::vector< FXMDIChild * > mySubWindows
GUISUMOAbstractView * getActiveView() const
get the active view or 0
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.
virtual void setStatusBarText(const std::string &)
Definition: GUIMainWindow.h:80
static GUIMainWindow * getInstance()
FXDockSite * myLeftDock
virtual FXGLCanvas * getBuildGLCanvas() const =0
bool isGaming() const
return whether the gui is in gaming mode
Definition: GUIMainWindow.h:86
static GUIMainWindow * myInstance
the singleton window instance
FXFont * getBoldFont()
FXLabel & getGeoLabel()
void removeChild(FXMDIChild *child)
removes the given child window from the list
bool myListInternal
information whether the locator should list internal structures
bool listInternal() const
return whether to list internal structures
Definition: GUIMainWindow.h:91
FXStatusBar * myStatusbar
The status bar.
bool listParking() const
return whether to list parking vehicles
Definition: GUIMainWindow.h:96
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.
FXMDIChild * getViewByID(const std::string &id) const
FXHorizontalFrame * myGeoFrame
FXDockSite * myTopDock
virtual ~GUIMainWindow()
virtual double getDelay() const
Returns the delay (should be overwritten by subclasses if applicable)
FXMDIClient * myMDIClient
The multi view panel.
long long int SUMOTime
Definition: TraCIDefs.h:51
virtual double getTrackerInterval() const =0