LCOV - code coverage report
Current view: top level - src/utils/gui/windows - GUIMainWindow.h (source / functions) Coverage Total Hit
Test: lcov.info Lines: 0.0 % 16 0
Test Date: 2024-12-21 15:45:41 Functions: 0.0 % 9 0

            Line data    Source code
       1              : /****************************************************************************/
       2              : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
       3              : // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
       4              : // This program and the accompanying materials are made available under the
       5              : // terms of the Eclipse Public License 2.0 which is available at
       6              : // https://www.eclipse.org/legal/epl-2.0/
       7              : // This Source Code may also be made available under the following Secondary
       8              : // Licenses when the conditions for such availability set forth in the Eclipse
       9              : // Public License 2.0 are satisfied: GNU General Public License, version 2
      10              : // or later which is available at
      11              : // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
      12              : // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
      13              : /****************************************************************************/
      14              : /// @file    GUIMainWindow.h
      15              : /// @author  Daniel Krajzewicz
      16              : /// @author  Jakob Erdmann
      17              : /// @author  Michael Behrisch
      18              : /// @date    Fri, 29.04.2005
      19              : ///
      20              : //
      21              : /****************************************************************************/
      22              : #pragma once
      23              : #include <config.h>
      24              : 
      25              : #include <utils/foxtools/fxheader.h>
      26              : #include <vector>
      27              : #include <string>
      28              : #include <map>
      29              : #include <utils/common/StdDefs.h>
      30              : #include <utils/common/SUMOTime.h>
      31              : #include "GUIAppEnum.h"
      32              : 
      33              : 
      34              : // ===========================================================================
      35              : // class declarations
      36              : // ===========================================================================
      37              : class GUIEvent;
      38              : class GUIGlChildWindow;
      39              : class GUISUMOAbstractView;
      40              : class MFXStaticToolTip;
      41              : 
      42              : 
      43              : // ===========================================================================
      44              : // class definitions
      45              : // ===========================================================================
      46              : class GUIMainWindow : public FXMainWindow {
      47              : 
      48              : public:
      49              :     /// @brief constructor
      50              :     GUIMainWindow(FXApp* app);
      51              : 
      52              :     /// @brief destructor
      53              :     virtual ~GUIMainWindow();
      54              : 
      55              :     /// @brief Adds a further child window to the list (GUIGlChildWindow)
      56              :     void addGLChild(GUIGlChildWindow* child);
      57              : 
      58              :     /// @brief Adds a further child window to the list (FXMainWindow)
      59              :     void addChild(FXMainWindow* child);
      60              : 
      61              :     /// @brief removes the given child window from the list (GUIGlChildWindow)
      62              :     void removeGLChild(GUIGlChildWindow* child);
      63              : 
      64              :     /// @brief removes the given child window from the list (FXMainWindow)
      65              :     void removeChild(FXMainWindow* child);
      66              : 
      67              :     /// @brief get top dock
      68              :     FXDockSite* getTopDock();
      69              : 
      70              :     /// @brief get view IDs
      71              :     std::vector<std::string> getViewIDs() const;
      72              : 
      73              :     /// @brief get specific view by ID
      74              :     GUIGlChildWindow* getViewByID(const std::string& id) const;
      75              : 
      76              :     void removeViewByID(const std::string& id);
      77              : 
      78              :     /// @brief get views
      79              :     const std::vector<GUIGlChildWindow*>& getViews() const;
      80              : 
      81              :     /// @brief update childrens
      82              :     void updateChildren(int msg = MID_SIMSTEP);
      83              : 
      84              :     /// @brief get bold front
      85              :     FXFont* getBoldFont();
      86              : 
      87              :     /// @brief get fallback front
      88              :     FXFont* getFallbackFont();
      89              : 
      90              :     /// @brief get GL Visual
      91              :     FXGLVisual* getGLVisual() const;
      92              : 
      93              :     /// @brief get static toolTip for menus
      94              :     MFXStaticToolTip* getStaticTooltipMenu() const;
      95              : 
      96              :     /// @brief get static toolTip for view
      97              :     MFXStaticToolTip* getStaticTooltipView() const;
      98              : 
      99              :     /// @brief get build GL Canvas (must be implemented in all children)
     100              :     virtual FXGLCanvas* getBuildGLCanvas() const = 0;
     101              : 
     102              :     /// @brief get current sim time (must be implemented in all children)
     103              :     virtual SUMOTime getCurrentSimTime() const = 0;
     104              : 
     105              :     /// @brief get tracker interval (must be implemented in all children)
     106              :     virtual double getTrackerInterval() const = 0;
     107              : 
     108              :     /// @brief get status bar text (can be implemented in children)
     109            0 :     virtual void setStatusBarText(const std::string&) { }
     110              : 
     111              :     /// @brief get cartesian label
     112              :     FXLabel* getCartesianLabel();
     113              : 
     114              :     /// @brief get geo label
     115              :     FXLabel* getGeoLabel();
     116              : 
     117              :     /// @brief get test label
     118              :     FXLabel* getTestLabel();
     119              : 
     120              :     /// @brief get test frame
     121              :     FXHorizontalFrame* getTestFrame();
     122              : 
     123              :     /// @brief return whether the gui is in gaming mode
     124              :     bool isGaming() const;
     125              : 
     126              :     /// @brief return whether to list internal structures
     127              :     bool listInternal() const;
     128              : 
     129              :     /// @brief return whether to list parking vehicles
     130              :     bool listParking() const;
     131              : 
     132              :     /// @brief return whether to list teleporting vehicles
     133              :     bool listTeleporting() const;
     134              : 
     135              :     /// @brief get instance
     136              :     static GUIMainWindow* getInstance();
     137              : 
     138              :     /** @brief Returns the delay (should be overwritten by subclasses if applicable)
     139              :      * @return parsed delay in milliseconds
     140              :      */
     141            0 :     virtual double getDelay() const {
     142            0 :         return 0.;
     143              :     }
     144              : 
     145              :     /// @brief Sets the delay of the parent application
     146            0 :     virtual void setDelay(double) {}
     147              : 
     148              :     /// @brief Sets the breakpoints of the parent application
     149            0 :     virtual void setBreakpoints(const std::vector<SUMOTime>&) {}
     150              : 
     151              :     /** @brief Sends an event from the application thread to the GUI and waits until it is handled
     152              :      * @param event the event to send
     153              :      */
     154            0 :     virtual void sendBlockingEvent(GUIEvent* event) {
     155              :         UNUSED_PARAMETER(event);
     156            0 :     }
     157              : 
     158              :     /// @brief get the active view or 0
     159              :     GUISUMOAbstractView* getActiveView() const;
     160              : 
     161              :     /// @brief Toggle full screen mode
     162            0 :     virtual long onCmdFullScreen(FXObject*, FXSelector, void*) {
     163            0 :         return 1;
     164              :     }
     165              : 
     166              :     bool isFullScreen() {
     167            0 :         return myAmFullScreen;
     168              :     }
     169              : 
     170              :     const std::map<std::string, std::string>& getOnlineMaps() const {
     171              :         return myOnlineMaps;
     172              :     }
     173              : 
     174              :     void addOnlineMap(const std::string& name, const std::string& url) {
     175            0 :         myOnlineMaps[name] = url;
     176            0 :     }
     177              : 
     178              :     /// @brief add breakpoint to the application
     179            0 :     virtual void addBreakpoint(SUMOTime /* time */) {}
     180              : 
     181              :     /// @brief retrieve breakpoints if provided by the application
     182            0 :     virtual const std::vector<SUMOTime> retrieveBreakpoints() const {
     183            0 :         return std::vector<SUMOTime>();
     184              :     }
     185              : 
     186              :     // @brief called when changes language
     187              :     long onCmdChangeLanguage(FXObject*, FXSelector, void*);
     188              : 
     189              :     // @brief called when language is updated
     190              :     long onUpdChangeLanguage(FXObject*, FXSelector, void*);
     191              : 
     192              : protected:
     193              :     /// @brief FOX need this
     194            0 :     FOX_CONSTRUCTOR(GUIMainWindow)
     195              : 
     196              :     /// @brief whether to show the window in full screen mode
     197              :     bool myAmFullScreen;
     198              : 
     199              :     /// @brief list of GLWindows
     200              :     std::vector<GUIGlChildWindow*> myGLWindows;
     201              : 
     202              :     /// @brief list of tracker windows
     203              :     std::vector<FXMainWindow*> myTrackerWindows;
     204              : 
     205              :     /// @brief A lock to make the removal and addition of trackers secure
     206              :     FXMutex myTrackerLock;
     207              : 
     208              :     /// @brief Font used for popup-menu titles
     209              :     FXFont* myBoldFont = nullptr;
     210              : 
     211              :     /// @brief Fallback font for extended characters support
     212              :     FXFont* myFallbackFont = nullptr;
     213              : 
     214              :     /// @brief The multi view panel
     215              :     FXMDIClient* myMDIClient = nullptr;
     216              : 
     217              :     /// @brief The status bar
     218              :     FXStatusBar* myStatusbar = nullptr;
     219              : 
     220              :     /// @brief Labels for the current cartesian, geo-coordinate and test coordinates
     221              :     FXLabel* myCartesianCoordinate = nullptr;
     222              :     FXLabel* myGeoCoordinate = nullptr;
     223              :     FXLabel* myTestCoordinate = nullptr;
     224              : 
     225              :     /// @brief frames for coordinates
     226              :     FXHorizontalFrame* myTraCiFrame = nullptr;
     227              :     FXHorizontalFrame* myCartesianFrame = nullptr;
     228              :     FXHorizontalFrame* myGeoFrame = nullptr;
     229              :     FXHorizontalFrame* myTestFrame = nullptr;
     230              : 
     231              :     /// @brief The gl-visual used
     232              :     FXGLVisual* myGLVisual = nullptr;
     233              : 
     234              :     /// @brief dock sites
     235              :     FXDockSite* myTopDock = nullptr;
     236              :     FXDockSite* myBottomDock = nullptr;
     237              :     FXDockSite* myLeftDock = nullptr;
     238              :     FXDockSite* myRightDock = nullptr;
     239              : 
     240              :     /// @brief Language menu common to all applications
     241              :     FXMenuPane* myLanguageMenu = nullptr;
     242              : 
     243              :     /// @brief static toolTip used in menus
     244              :     MFXStaticToolTip* myStaticTooltipMenu = nullptr;
     245              : 
     246              :     /// @brief static toolTip used in view
     247              :     MFXStaticToolTip* myStaticTooltipView = nullptr;
     248              : 
     249              :     /// @brief information whether the gui is currently in gaming mode
     250              :     bool myAmGaming;
     251              : 
     252              :     /// @brief information whether the locator should list internal structures
     253              :     bool myListInternal;
     254              : 
     255              :     /// @brief information whether the locator should list parking vehicles
     256              :     bool myListParking;
     257              : 
     258              :     /// @brief information whether the locator should list teleporting vehicles
     259              :     bool myListTeleporting;
     260              : 
     261              :     /// @brief online mapping services for the context menu
     262              :     std::map<std::string, std::string> myOnlineMaps;
     263              : 
     264              :     /// @brief the singleton window instance
     265              :     static GUIMainWindow* myInstance;
     266              : 
     267              :     /// @brief perform initial window positioning and sizing according to user options / previous call
     268              :     void setWindowSizeAndPos();
     269              : 
     270              :     /// @brief record window position and size in registry
     271              :     void storeWindowSizeAndPos();
     272              : 
     273              :     void buildLanguageMenu(FXMenuBar* menuBar);
     274              : 
     275              : };
        

Generated by: LCOV version 2.0-1