Path: blob/main/src/netedit/frames/common/GNEInspectorFrame.h
169684 views
/****************************************************************************/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 GNEInspectorFrame.h14/// @author Jakob Erdmann15/// @author Pablo Alvarez Lopez16/// @date Mar 201117///18// The Widget for modifying network-element attributes (i.e. lane speed)19/****************************************************************************/20#pragma once21#include <config.h>2223#include <netedit/frames/GNEFrame.h>24#include <netedit/GNEViewNetHelper.h>2526// ===========================================================================27// class declaration28// ===========================================================================2930class GNEAttributesEditor;31class GNEEdgeTemplate;32class GNEElementTree;33class GNEOverlappedInspection;3435// ===========================================================================36// class definitions37// ===========================================================================3839class GNEInspectorFrame : public GNEFrame {40/// @brief FOX-declaration41FXDECLARE(GNEInspectorFrame)4243public:44// ===========================================================================45// class TemplateEditor46// ===========================================================================4748class TemplateEditor : public MFXGroupBoxModule {49/// @brief FOX-declaration50FXDECLARE(GNEInspectorFrame::TemplateEditor)5152public:53/// @brief constructor54TemplateEditor(GNEInspectorFrame* inspectorFrameParent);5556/// @brief destructor57~TemplateEditor();5859/// @brief show template editor60bool showTemplateEditor();6162/// @brief hide template editor63void hideTemplateEditor();6465/// @brief get edge template (to copy attributes from)66GNEEdgeTemplate* getEdgeTemplate() const;6768/// @brief set edge template69void setEdgeTemplate(const GNEEdge* edge);7071/// @brief update edge template72void updateEdgeTemplate();7374/// @brief set template (used by shortcut)75void setTemplate();7677/// @brief copy template (used by shortcut)78void copyTemplate();7980/// @brief clear template (used by shortcut)81void clearTemplate();8283/// @name FOX-callbacks84/// @{85/// @brief set current edge as new template86long onCmdSetTemplate(FXObject*, FXSelector, void*);8788/// @brief copy edge attributes from edge template89long onCmdCopyTemplate(FXObject*, FXSelector, void*);9091/// @brief clear current edge template92long onCmdClearTemplate(FXObject*, FXSelector, void*);93/// @}9495protected:96/// @brief FOX need this97FOX_CONSTRUCTOR(TemplateEditor)9899/// @brief update frame buttons100void updateButtons();101102private:103/// @brief current GNEInspectorFrame parent104GNEInspectorFrame* myInspectorFrameParent;105106/// @brief set template button107FXButton* mySetTemplateButton;108109/// @brief copy template button110FXButton* myCopyTemplateButton;111112/// @brief clear template button113FXButton* myClearTemplateButton;114115/// @brief edge Template116GNEEdgeTemplate* myEdgeTemplate;117};118119/**@brief Constructor120* @brief viewParent GNEViewParent in which this GNEFrame is placed121* @brief net net that uses this GNEFrame122*/123GNEInspectorFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);124125/// @brief Destructor126~GNEInspectorFrame();127128/// @brief show inspector frame129void show();130131/// @brief hide inspector frame132void hide();133134/**@brief process click over Viewnet135* @param[in] viewObjects objects under cursors136* @return true if something was sucefully done137*/138bool inspectClickedElements(GNEViewNetHelper::ViewObjectsSelector& viewObjects, const Position& clickedPosition,139const bool shiftKeyPressed);140141/// @brief Inspect a single element142void inspectElement(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousInspectedAC = nullptr);143144/// @brief Inspect the given elements145void inspectElements(const std::vector<GNEAttributeCarrier*>& ACs, GNEAttributeCarrier* previousInspectedAC = nullptr);146147/// @brief clear inspection148void clearInspection();149150/// @brief refresh current inspection151void refreshInspection();152153/// @brief get AttributesEditor154GNEAttributesEditor* getAttributesEditor() const;155156/// @brief get template editor157TemplateEditor* getTemplateEditor() const;158159/// @brief get GNEOverlappedInspection modul160GNEOverlappedInspection* getOverlappedInspection() const;161162/// @brief get GNEElementTree modul163GNEElementTree* getHierarchicalElementTree() const;164165/// @name FOX-callbacks166/// @{167168/// @brief called when user press inspet previous elemnt button169long onCmdInspectPreviousElement(FXObject*, FXSelector, void*);170/// @}171172/// @brief function called after undo/redo in the current frame (can be reimplemented in frame children)173void updateFrameAfterUndoRedo();174175/// @brief open GNEAttributesCreator extended dialog (can be reimplemented in frame children)176void selectedOverlappedElement(GNEAttributeCarrier* AC);177178protected:179/// @brief FOX need this180FOX_CONSTRUCTOR(GNEInspectorFrame)181182private:183/// @brief Overlapped Inspection184GNEOverlappedInspection* myOverlappedInspection = nullptr;185186/// @brief Attributes editor187GNEAttributesEditor* myAttributesEditor = nullptr;188189/// @brief Template editor190TemplateEditor* myTemplateEditor = nullptr;191192/// @brief Attribute Carrier Hierarchy193GNEElementTree* myHierarchicalElementTree = nullptr;194195/// @brief Back Button196FXButton* myBackButton = nullptr;197198/// @brief Pointer to previous element inspected199GNEAttributeCarrier* myPreviousInspectedAC = nullptr;200};201202203