/****************************************************************************/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 GNEViewParent.h14/// @author Jakob Erdmann15/// @date Feb 201116///17// A single child window which contains a view of the edited network (adapted18// from GUISUMOViewParent)19// While we don't actually need MDI for netedit it is easier to adapt existing20// structures than to write everything from scratch.21/****************************************************************************/22#pragma once23#include <config.h>2425#include <utils/foxtools/MFXButtonTooltip.h>26#include <utils/gui/windows/GUIGlChildWindow.h>272829// ===========================================================================30// class declarations31// ===========================================================================3233class GNEApplicationWindow;34class GNEACChooserDialog;35class GNEFrame;36class GNEViewNet;37class GNENet;38class GNEUndoList;39// common frames40class GNEDeleteFrame;41class GNEInspectorFrame;42class GNESelectorFrame;43class GNEMoveFrame;44// network frames45class GNEAdditionalFrame;46class GNEConnectorFrame;47class GNECreateEdgeFrame;48class GNECrossingFrame;49class GNEShapeFrame;50class GNEProhibitionFrame;51class GNEWireFrame;52class GNEDecalFrame;53class GNETAZFrame;54class GNETLSEditorFrame;55// demand frames56class GNEPersonFrame;57class GNEPersonPlanFrame;58class GNEContainerFrame;59class GNEContainerPlanFrame;60class GNERouteFrame;61class GNERouteDistributionFrame;62class GNEStopFrame;63class GNEVehicleFrame;64class GNETypeFrame;65class GNETypeDistributionFrame;66// data frames67class GNEGenericDataFrame;68class GNEEdgeDataFrame;69class GNEEdgeRelDataFrame;70class GNETAZRelDataFrame;71class GNEMeanDataFrame;727374// ===========================================================================75// class declarations76// ===========================================================================77/**78* @class GNEViewParent79* @brief A single child window which contains a view of the simulation area80*81* It is made of a tool-bar containing a field to change the type of display,82* buttons that allow to choose an artifact and some other view controlling83* options.84*85* The rest of the window is a canvas that contains the display itself86*/87class GNEViewParent : public GUIGlChildWindow {88/// @brief FOX-declaration89FXDECLARE(GNEViewParent)9091public:92/**@brief Constructor93* also builds the view and calls create()94*95* @param[in] p The MDI-pane this window is shown within96* @param[in] mdimenu The MDI-menu for alignment97* @param[in] name The name of the window98* @param[in] parentWindow The main window99* @param[in] ic The icon of this window100* @param[in] opts Window options101* @param[in] x Initial x-position102* @param[in] y Initial x-position103* @param[in] w Initial width104* @param[in] h Initial height105* @param[in] share A canvas tor get the shared context from106* @param[in] net The network to show107*/108GNEViewParent(FXMDIClient* p, FXMDIMenu* mdimenu, const FXString& name, GNEApplicationWindow* parentWindow,109FXGLCanvas* share, GNENet* net, GNEUndoList* undoList, FXIcon* ic = nullptr,110FXuint opts = 0, FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0);111112/// @brief Destructor113~GNEViewParent();114115/// @brief hide all frames116void hideAllFrames();117118/// @brief get current frame (note: it can be null)119GNEFrame* getCurrentShownFrame() const;120121/// @brief get frame for inspect elements122GNEInspectorFrame* getInspectorFrame() const;123124/// @brief get frame for delete elements125GNEDeleteFrame* getDeleteFrame() const;126127/// @brief get frame for select elements128GNESelectorFrame* getSelectorFrame() const;129130/// @brief get frame for move elements131GNEMoveFrame* getMoveFrame() const;132133/// @brief get frame for NETWORK_CONNECT134GNEConnectorFrame* getConnectorFrame() const;135136/// @brief get frame for NETWORK_TLS137GNETLSEditorFrame* getTLSEditorFrame() const;138139/// @brief get frame for NETWORK_ADDITIONAL140GNEAdditionalFrame* getAdditionalFrame() const;141142/// @brief get frame for NETWORK_CROSSING143GNECrossingFrame* getCrossingFrame() const;144145/// @brief get frame for NETWORK_TAZ146GNETAZFrame* getTAZFrame() const;147148/// @brief get frame for NETWORK_SHAPE149GNEShapeFrame* getShapeFrame() const;150151/// @brief get frame for NETWORK_PROHIBITION152GNEProhibitionFrame* getProhibitionFrame() const;153154/// @brief get frame for NETWORK_WIRE155GNEWireFrame* getWireFrame() const;156157/// @brief get frame for NETWORK_DECAL158GNEDecalFrame* getDecalFrame() const;159160/// @brief get frame for NETWORK_CREATEEDGE161GNECreateEdgeFrame* getCreateEdgeFrame() const;162163/// @brief get frame for DEMAND_ROUTE164GNERouteFrame* getRouteFrame() const;165166/// @brief get frame for DEMAND_ROUTEDISTRIBUTION167GNERouteDistributionFrame* getRouteDistributionFrame() const;168169/// @brief get frame for DEMAND_VEHICLE170GNEVehicleFrame* getVehicleFrame() const;171172/// @brief get frame for DEMAND_TYPE173GNETypeFrame* getTypeFrame() const;174175/// @brief get frame for DEMAND_TYPEDISTRIBUTION176GNETypeDistributionFrame* getTypeDistributionFrame() const;177178/// @brief get frame for DEMAND_STOP179GNEStopFrame* getStopFrame() const;180181/// @brief get frame for DEMAND_PERSON182GNEPersonFrame* getPersonFrame() const;183184/// @brief get frame for DEMAND_PERSONFRAME185GNEPersonPlanFrame* getPersonPlanFrame() const;186187/// @brief get frame for DEMAND_CONTAINER188GNEContainerFrame* getContainerFrame() const;189190/// @brief get frame for DEMAND_CONTAINERFRAME191GNEContainerPlanFrame* getContainerPlanFrame() const;192193/// @brief get frame for DATA_EDGEDATA194GNEEdgeDataFrame* getEdgeDataFrame() const;195196/// @brief get frame for DATA_EDGERELDATA197GNEEdgeRelDataFrame* getEdgeRelDataFrame() const;198199/// @brief get frame for DATA_TAZRELDATA200GNETAZRelDataFrame* getTAZRelDataFrame() const;201202/// @brief get frame for DATA_TAZRELDATA203GNEMeanDataFrame* getMeanDataFrame() const;204205/// @brief show frames area if at least a GNEFrame is showed206/// @note this function is called in GNEFrame::Show();207void showFramesArea();208209/// @brief hide frames area if all GNEFrames are hidden210/// @note this function is called in GNEFrame::Show();211void hideFramesArea();212213/// @brief get GUIMainWindow App214GUIMainWindow* getGUIMainWindow() const;215216/// @brief get GNE Application Windows217GNEApplicationWindow* getGNEAppWindows() const;218219/// @brief remove created chooser dialog220void eraseACChooserDialog(GNEACChooserDialog* chooserDialog);221222/// @brief update toolbar undo/redo buttons (called when user press Ctrl+Z/Y)223void updateUndoRedoButtons();224225/// @brief get frame area226FXVerticalFrame* getFramesArea() const;227228/// @brief get frame area width229int getFrameAreaWidth() const;230231/// @brief set frame area width232void setFrameAreaWidth(const int frameAreaWith);233234/// @name FOX-callbacks235/// @{236/// @brief Called if the user wants to make a snapshot (screenshot)237long onCmdMakeSnapshot(FXObject* sender, FXSelector, void*);238239/// @brief Called when the user hits the close button (x)240long onCmdClose(FXObject*, FXSelector, void*);241242/// @brief locator-callback243long onCmdLocate(FXObject*, FXSelector, void*);244245/// @brief Called when user press a key246long onKeyPress(FXObject* o, FXSelector sel, void* data);247248/// @brief Called when user releases a key249long onKeyRelease(FXObject* o, FXSelector sel, void* data);250251/// @brief Called when user change the splitter between FrameArea and ViewNet252long onCmdUpdateFrameAreaWidth(FXObject*, FXSelector, void*);253/// @}254255protected:256FOX_CONSTRUCTOR(GNEViewParent)257258/// @brief class for common frames259class CommonFrames {260261public:262/// @brief constructor263CommonFrames();264265/// @brief build common frames266void buildCommonFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);267268/// @brief hide common frames269void hideCommonFrames();270271/// @brief set new width in all common frames272void setCommonFramesWidth(int frameWidth);273274/// @brief return true if at least there is a common frame shown275bool isCommonFrameShown() const;276277/// @brief get current common frame show278GNEFrame* getCurrentShownFrame() const;279280/// @brief frame for inspect elements281GNEInspectorFrame* inspectorFrame = nullptr;282283/// @brief frame for delete elements284GNEDeleteFrame* deleteFrame = nullptr;285286/// @brief frame for select elements287GNESelectorFrame* selectorFrame = nullptr;288289/// @brief frame for move elements290GNEMoveFrame* moveFrame = nullptr;291};292293/// @brief class for network frames294class NetworkFrames {295296public:297/// @brief constructor298NetworkFrames();299300/// @brief build network frames301void buildNetworkFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);302303/// @brief hide network frames304void hideNetworkFrames();305306/// @brief set new width in all network frames307void setNetworkFramesWidth(int frameWidth);308309/// @brief return true if at least there is a network frame shown310bool isNetworkFrameShown() const;311312/// @brief get current network frame show313GNEFrame* getCurrentShownFrame() const;314315/// @brief frame for NETWORK_CONNECT316GNEConnectorFrame* connectorFrame = nullptr;317318/// @brief frame for NETWORK_TLS319GNETLSEditorFrame* TLSEditorFrame = nullptr;320321/// @brief frame for NETWORK_ADDITIONAL322GNEAdditionalFrame* additionalFrame = nullptr;323324/// @brief frame for NETWORK_CROSSING325GNECrossingFrame* crossingFrame = nullptr;326327/// @brief frame for NETWORK_TAZ328GNETAZFrame* TAZFrame = nullptr;329330/// @brief frame for NETWORK_SHAPE331GNEShapeFrame* polygonFrame = nullptr;332333/// @brief frame for NETWORK_PROHIBITION334GNEProhibitionFrame* prohibitionFrame = nullptr;335336/// @brief frame for NETWORK_WIRE337GNEWireFrame* wireFrame = nullptr;338339/// @brief frame for NETWORK_DECAL340GNEDecalFrame* decalFrame = nullptr;341342/// @brief frame for NETWORK_CREATEDGE343GNECreateEdgeFrame* createEdgeFrame;344};345346/// @brief class for demand frames347class DemandFrames {348349public:350/// @brief constructor351DemandFrames();352353/// @brief build demand frames354void buildDemandFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);355356/// @brief hide demand frames357void hideDemandFrames();358359/// @brief set new width in all demand frames360void setDemandFramesWidth(int frameWidth);361362/// @brief return true if at least there is a demand frame shown363bool isDemandFrameShown() const;364365/// @brief get current demand frame show366GNEFrame* getCurrentShownFrame() const;367368/// @brief frame for DEMAND_ROUTE369GNERouteFrame* routeFrame = nullptr;370371/// @brief frame for DEMAND_ROUTEDISTRIBUTION372GNERouteDistributionFrame* routeDistributionFrame = nullptr;373374/// @brief frame for DEMAND_VEHICLE375GNEVehicleFrame* vehicleFrame = nullptr;376377/// @brief frame for DEMAND_TYPE378GNETypeFrame* typeFrame = nullptr;379380/// @brief frame for DEMAND_TYPEDISTRIBUTION381GNETypeDistributionFrame* typeDistributionFrame = nullptr;382383/// @brief frame for DEMAND_STOP384GNEStopFrame* stopFrame = nullptr;385386/// @brief frame for DEMAND_PERSON387GNEPersonFrame* personFrame = nullptr;388389/// @brief frame for DEMAND_PERSONPLAN390GNEPersonPlanFrame* personPlanFrame = nullptr;391392/// @brief frame for DEMAND_CONTAINER393GNEContainerFrame* containerFrame = nullptr;394395/// @brief frame for DEMAND_CONTAINERPLAN396GNEContainerPlanFrame* containerPlanFrame = nullptr;397};398399/// @brief class for data frames400class DataFrames {401402public:403/// @brief constructor404DataFrames();405406/// @brief build data frames407void buildDataFrames(GNEViewParent* viewParent, GNEViewNet* viewNet);408409/// @brief hide data frames410void hideDataFrames();411412/// @brief set new width in all data frames413void setDataFramesWidth(int frameWidth);414415/// @brief return true if at least there is a data frame shown416bool isDataFrameShown() const;417418/// @brief get current data frame show419GNEFrame* getCurrentShownFrame() const;420421/// @brief frame for DATA_EDGEDATA422GNEEdgeDataFrame* edgeDataFrame = nullptr;423424/// @brief frame for DATA_EDGERELDATA425GNEEdgeRelDataFrame* edgeRelDataFrame = nullptr;426427/// @brief frame for DATA_TAZRELDATA428GNETAZRelDataFrame* TAZRelDataFrame = nullptr;429430/// @brief frame for DATA_MEANDATA431GNEMeanDataFrame* meanDataFrame = nullptr;432};433434/// @brief struct for ACChoosers dialog435class ACChoosers {436437public:438/// @brief constructor439ACChoosers();440441/// @brief destructor442~ACChoosers();443444/// @brief pointer to ACChooser dialog used for locate junctions445GNEACChooserDialog* ACChooserJunction = nullptr;446447/// @brief pointer to ACChooser dialog used for locate edges448GNEACChooserDialog* ACChooserEdges = nullptr;449450/// @brief pointer to ACChooser dialog used for locate walkingareas451GNEACChooserDialog* ACChooserWalkingAreas = nullptr;452453/// @brief pointer to ACChooser dialog used for locate vehicles454GNEACChooserDialog* ACChooserVehicles = nullptr;455456/// @brief pointer to ACChooser dialog used for locate persons457GNEACChooserDialog* ACChooserPersons = nullptr;458459/// @brief pointer to ACChooser dialog used for locate containers460GNEACChooserDialog* ACChooserContainers = nullptr;461462/// @brief pointer to ACChooser dialog used for locate routes463GNEACChooserDialog* ACChooserRoutes = nullptr;464465/// @brief pointer to ACChooser dialog used for locate stops466GNEACChooserDialog* ACChooserStops = nullptr;467468/// @brief pointer to ACChooser dialog used for locate TLSs469GNEACChooserDialog* ACChooserTLS = nullptr;470471/// @brief pointer to ACChooser dialog used for locate additional472GNEACChooserDialog* ACChooserAdditional = nullptr;473474/// @brief pointer to ACChooser dialog used for locate POIs475GNEACChooserDialog* ACChooserPOI = nullptr;476477/// @brief pointer to ACChooser dialog used for locate Polygons478GNEACChooserDialog* ACChooserPolygon = nullptr;479480/// @brief pointer to ACChooser dialog used for locate Prohibitions481GNEACChooserDialog* ACChooserProhibition = nullptr;482483/// @brief pointer to ACChooser dialog used for locate Wires484GNEACChooserDialog* ACChooserWire = nullptr;485};486487private:488/// @brief pointer to GNEApplicationWindow489GNEApplicationWindow* myGNEAppWindows;490491/// @brief frame to hold myView and myAttributePanel492FXHorizontalFrame* myViewArea;493494/// @brief frame to hold GNEFrames495FXVerticalFrame* myFramesArea;496497/// @brief toolbar undo button498MFXButtonTooltip* myUndoButton;499500/// @brief toolbar redo button501MFXButtonTooltip* myRedoButton;502503/// @brief compute Path manager button504MFXButtonTooltip* myComputePathManagerButton;505506/// @brief Splitter to divide ViewNet und GNEFrames507FXSplitter* myFramesSplitter;508509/// @brief struct for common frames510CommonFrames myCommonFrames;511512/// @brief struct for network frames513NetworkFrames myNetworkFrames;514515/// @brief struct for demand frames516DemandFrames myDemandFrames;517518/// @brief struct for data frames519DataFrames myDataFrames;520521/// @brief struct for ACChoosers522ACChoosers myACChoosers;523};524525526