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 double getDelay() const {
110  return 0;
111  }
112 
115  virtual void setDelay(double) {}
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
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:38
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: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.
bool listParking() const
return whether to list parking vehicles
Definition: GUIMainWindow.h:95
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:52