SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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-2015 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;
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 void setStatusBarText(const std::string&) { }
79 
82 
84  bool isGaming() const {
85  return myAmGaming;
86  }
87 
89  bool listInternal() const {
90  return myListInternal;
91  }
92 
93  static GUIMainWindow* getInstance();
94 
98  virtual SUMOReal getDelay() const {
99  return 0;
100  }
101 
105  virtual void sendBlockingEvent(GUIEvent* event) {
106  UNUSED_PARAMETER(event);
107  }
108 
109 protected:
110  std::vector<FXMDIChild*> mySubWindows;
111  std::vector<FXMainWindow*> myTrackerWindows;
114 
116  FXFont* myBoldFont;
117 
119  FXMDIClient* myMDIClient;
120 
122  FXStatusBar* myStatusbar;
123 
127 
128 
130  FXGLVisual* myGLVisual;
131 
133 
136 
139 
142 
143 protected:
145 
146 };
147 
148 
149 #endif
150 
151 /****************************************************************************/
152 
std::vector< FXMainWindow * > myTrackerWindows
FXLabel * myGeoCoordinate
virtual SUMOTime getCurrentSimTime() const =0
virtual SUMOReal getDelay() const
Returns the delay (should be overwritten by subclasses if applicable)
Definition: GUIMainWindow.h:98
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:84
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
FXHorizontalFrame * myCartesianFrame
FXMDIChild * getViewByID(const std::string &id) const
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.
virtual void setStatusBarText(const std::string &)
Definition: GUIMainWindow.h:78
static GUIMainWindow * getInstance()
FXDockSite * myLeftDock
virtual FXGLCanvas * getBuildGLCanvas() const =0
static GUIMainWindow * myInstance
the singleton window instance
FXFont * getBoldFont()
FXGLVisual * getGLVisual() const
bool listInternal() const
return whether to list internal structures
Definition: GUIMainWindow.h:89
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.
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.
FXHorizontalFrame * myGeoFrame
FXDockSite * myTopDock
virtual ~GUIMainWindow()
FXMDIClient * myMDIClient
The multi view panel.
#define SUMOReal
Definition: config.h:215
std::vector< std::string > getViewIDs() const