/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GUISUMOViewParent.h14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Michael Behrisch17/// @author Andreas Gaubatz18/// @date Sept 200219///20// A single child window which contains a view of the simulation area21/****************************************************************************/22#pragma once23#include <config.h>2425#include <utils/gui/windows/GUIGlChildWindow.h>26#include <utils/distribution/RandomDistributor.h>27#include <utils/foxtools/MFXSynchQue.h>28#include <utils/foxtools/MFXThreadEvent.h>2930// ===========================================================================31// class declarations32// ===========================================================================33class GUINet;34class GUISUMOAbstractView;35class GUIDialog_GLObjChooser;36class GUIDialog_ChooserAbstract;373839// ===========================================================================40// class declarations41// ===========================================================================42/**43* @class GUISUMOViewParent44* @brief A single child window which contains a view of the simulation area45*46* It is made of a tool-bar containing a field to change the type of display,47* buttons that allow to choose an artifact and some other view controlling48* options.49*50* The rest of the window is a canvas that contains the display itself51*/52class GUISUMOViewParent : public GUIGlChildWindow {53// FOX-declarations54FXDECLARE(GUISUMOViewParent)5556public:57/// @brief Available view types58enum ViewType {59/// @brief plain 2D openGL view (@see GUIViewTraffic)60VIEW_2D_OPENGL,61/// @brief plain 3D OSG view (@see GUIOSGView)62VIEW_3D_OSG63};6465/** @brief Constructor66* @param[in] p The MDI-pane this window is shown within67* @param[in] mdimenu The MDI-menu for alignment68* @param[in] name The name of the window69* @param[in] parentWindow The main window70* @param[in] ic The icon of this window71* @param[in] opts Window options72* @param[in] x Initial x-position73* @param[in] y Initial x-position74* @param[in] w Initial width75* @param[in] h Initial height76*/77GUISUMOViewParent(FXMDIClient* p, FXMDIMenu* mdimenu,78const FXString& name, GUIMainWindow* parentWindow,79FXIcon* ic = NULL, FXuint opts = 0, FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0);808182/** @brief "Initialises" this window by building the contents83* @param[in] share A canvas tor get the shared context from84* @param[in] net The network to show85* @param[in] vt The view type to use86* @todo Check whether this could be done in the constructor87*/88virtual GUISUMOAbstractView* init(FXGLCanvas* share, GUINet& net, ViewType type);8990/// @brief Destructor91~GUISUMOViewParent();9293/// @brief Called if the user wants to make a snapshot (screenshot)94long onCmdMakeSnapshot(FXObject* sender, FXSelector, void*);9596/// @brief Called on a simulation step97long onSimStep(FXObject* sender, FXSelector, void*);9899/// @brief locator-callback100long onCmdLocate(FXObject*, FXSelector, void*);101102/// @brief speedFactor-callback103long onCmdSpeedFactor(FXObject*, FXSelector, void*);104long onUpdSpeedFactor(FXObject*, FXSelector, void*);105106/// @brief handle keys107long onKeyPress(FXObject* o, FXSelector sel, void* data);108long onKeyRelease(FXObject* o, FXSelector sel, void* data);109110/// @brief true if the object is selected (may include extra logic besides calling gSelected)111bool isSelected(GUIGlObject* o) const;112113/// @brief about toggled gaming status114void setToolBarVisibility(const bool value);115116/// @brief get all objects of the given type117std::vector<GUIGlID> getObjectIDs(int messageId) const;118119/// @brief erase GLObjChooser120void eraseGLObjChooser(GUIDialog_GLObjChooser* GLObjChooser);121122protected:123/// @brief fox need this124FOX_CONSTRUCTOR(GUISUMOViewParent)125126/// @brief build speed control toolbar127void buildSpeedControlToolbar();128129/// @brief toolbar shell for speed130FXToolBarShell* myToolBarDragSpeed = nullptr;131132/// @brief toolbar for speed133FXToolBar* myToolBarSpeed = nullptr;134135/// @brief slider for speedfactor136FXSlider* mySpeedFactorSlider = nullptr;137138private:139/// @brief map for existing dialogs140std::map<int, GUIDialog_ChooserAbstract*> myGLObjChooser;141};142143144