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-2016 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 
94  static GUIMainWindow* getInstance();
95 
99  virtual SUMOReal getDelay() const {
100  return 0;
101  }
102 
105  virtual void setDelay(SUMOReal) {}
106 
110  virtual void sendBlockingEvent(GUIEvent* event) {
111  UNUSED_PARAMETER(event);
112  }
113 
116 
117 protected:
118  std::vector<FXMDIChild*> mySubWindows;
119  std::vector<FXMainWindow*> myTrackerWindows;
122 
124  FXFont* myBoldFont;
125 
127  FXMDIClient* myMDIClient;
128 
130  FXStatusBar* myStatusbar;
131 
134  FXHorizontalFrame* myCartesianFrame, *myGeoFrame;
135 
137  FXGLVisual* myGLVisual;
138 
140 
143 
146 
149 
150 protected:
152 
153 };
154 
155 
156 #endif
157 
158 /****************************************************************************/
159 
std::vector< FXMainWindow * > myTrackerWindows
FXLabel * myGeoCoordinate
virtual SUMOTime getCurrentSimTime() const =0
FXGLVisual * getGLVisual() const
virtual SUMOReal getDelay() const
Returns the delay (should be overwritten by subclasses if applicable)
Definition: GUIMainWindow.h:99
long long int SUMOTime
Definition: SUMOTime.h:43
FXFont * myBoldFont
Font used for popup-menu titles.
FXDockSite * myRightDock
FXGLVisual * myGLVisual
The gl-visual used.
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
std::vector< std::string > getViewIDs() const
FXHorizontalFrame * myCartesianFrame
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
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:79
static GUIMainWindow * getInstance()
FXDockSite * myLeftDock
virtual FXGLCanvas * getBuildGLCanvas() const =0
bool isGaming() const
return whether the gui is in gaming mode
Definition: GUIMainWindow.h:85
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:90
FXStatusBar * myStatusbar
The status bar.
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()
FXMDIClient * myMDIClient
The multi view panel.
#define SUMOReal
Definition: config.h:213