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 double getTrackerInterval() const = 0;
80 
81  virtual void setStatusBarText(const std::string&) { }
82 
83  FXLabel& getCartesianLabel();
84  FXLabel& getGeoLabel();
85 
87  bool isGaming() const {
88  return myAmGaming;
89  }
90 
92  bool listInternal() const {
93  return myListInternal;
94  }
95 
97  bool listParking() const {
98  return myListParking;
99  }
100 
102  bool listTeleporting() const {
103  return myListTeleporting;
104  }
105 
106  static GUIMainWindow* getInstance();
107 
111  virtual double getDelay() const {
112  return 0;
113  }
114 
117  virtual void setDelay(double) {}
118 
122  virtual void sendBlockingEvent(GUIEvent* event) {
123  UNUSED_PARAMETER(event);
124  }
125 
128 
129 protected:
130  std::vector<FXMDIChild*> mySubWindows;
131  std::vector<FXMainWindow*> myTrackerWindows;
134 
136  FXFont* myBoldFont;
137 
139  FXMDIClient* myMDIClient;
140 
142  FXStatusBar* myStatusbar;
143 
146  FXHorizontalFrame* myCartesianFrame, *myGeoFrame;
147 
149  FXGLVisual* myGLVisual;
150 
152 
155 
158 
161 
164 
167 
168 protected:
170 
172  void setWindowSizeAndPos();
173 
174 
175 };
176 
177 
178 #endif
179 
180 /****************************************************************************/
181 
std::vector< FXMainWindow * > myTrackerWindows
FXLabel * myGeoCoordinate
bool listTeleporting() const
return whether to list teleporting vehicles
virtual double 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:87
virtual void setDelay(double)
Sets the delay of the parent application.
bool listParking() const
return whether to list parking vehicles
Definition: GUIMainWindow.h:97
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:40
bool myListTeleporting
information whether the locator should list teleporting vehicles
FXHorizontalFrame * myCartesianFrame
FXMDIChild * getViewByID(const std::string &id) const
virtual double getTrackerInterval() const =0
FXLabel & getCartesianLabel()
bool myAmGaming
information whether the gui is currently in gaming mode
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:81
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:92
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.
long long int SUMOTime
Definition: TraCIDefs.h:52
std::vector< std::string > getViewIDs() const