Path: blob/main/src/netedit/frames/common/GNEInspectorFrame.h
193874 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2026 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>25#include <netedit/frames/common/GNEGroupBoxModule.h>2627// ===========================================================================28// class declaration29// ===========================================================================3031class GNEAttributesEditor;32class GNEEdgeTemplate;33class GNEElementTree;34class GNEOverlappedInspection;3536// ===========================================================================37// class definitions38// ===========================================================================3940class GNEInspectorFrame : public GNEFrame {41/// @brief FOX-declaration42FXDECLARE(GNEInspectorFrame)4344public:45// ===========================================================================46// class TemplateEditor47// ===========================================================================4849class TemplateEditor : public GNEGroupBoxModule {50/// @brief FOX-declaration51FXDECLARE(GNEInspectorFrame::TemplateEditor)5253public:54/// @brief constructor55TemplateEditor(GNEInspectorFrame* inspectorFrameParent);5657/// @brief destructor58~TemplateEditor();5960/// @brief show template editor61bool showTemplateEditor();6263/// @brief hide template editor64void hideTemplateEditor();6566/// @brief get edge template (to copy attributes from)67GNEEdgeTemplate* getEdgeTemplate() const;6869/// @brief set edge template70void setEdgeTemplate(const GNEEdge* edge);7172/// @brief update edge template73void updateEdgeTemplate();7475/// @brief set template (used by shortcut)76void setTemplate();7778/// @brief copy template (used by shortcut)79void copyTemplate();8081/// @brief clear template (used by shortcut)82void clearTemplate();8384/// @name FOX-callbacks85/// @{86/// @brief set current edge as new template87long onCmdSetTemplate(FXObject*, FXSelector, void*);8889/// @brief copy edge attributes from edge template90long onCmdCopyTemplate(FXObject*, FXSelector, void*);9192/// @brief clear current edge template93long onCmdClearTemplate(FXObject*, FXSelector, void*);94/// @}9596protected:97/// @brief FOX need this98FOX_CONSTRUCTOR(TemplateEditor)99100/// @brief update frame buttons101void updateButtons();102103private:104/// @brief current GNEInspectorFrame parent105GNEInspectorFrame* myInspectorFrameParent;106107/// @brief set template button108FXButton* mySetTemplateButton;109110/// @brief copy template button111FXButton* myCopyTemplateButton;112113/// @brief clear template button114FXButton* myClearTemplateButton;115116/// @brief edge Template117GNEEdgeTemplate* myEdgeTemplate;118};119120/**@brief Constructor121* @brief viewParent GNEViewParent in which this GNEFrame is placed122* @brief net net that uses this GNEFrame123*/124GNEInspectorFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);125126/// @brief Destructor127~GNEInspectorFrame();128129/// @brief show inspector frame130void show();131132/// @brief hide inspector frame133void hide();134135/**@brief process click over Viewnet136* @param[in] viewObjects objects under cursors137* @return true if something was sucefully done138*/139bool inspectClickedElements(GNEViewNetHelper::ViewObjectsSelector& viewObjects, const Position& clickedPosition,140const bool shiftKeyPressed);141142/// @brief Inspect a single element143void inspectElement(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousInspectedAC = nullptr);144145/// @brief Inspect the given elements146void inspectElements(const std::vector<GNEAttributeCarrier*>& ACs, GNEAttributeCarrier* previousInspectedAC = nullptr);147148/// @brief clear inspection149void clearInspection();150151/// @brief refresh current inspection152void refreshInspection();153154/// @brief get AttributesEditor155GNEAttributesEditor* getAttributesEditor() const;156157/// @brief get template editor158TemplateEditor* getTemplateEditor() const;159160/// @brief get GNEOverlappedInspection modul161GNEOverlappedInspection* getOverlappedInspection() const;162163/// @brief get GNEElementTree modul164GNEElementTree* getHierarchicalElementTree() const;165166/// @name FOX-callbacks167/// @{168169/// @brief called when user press inspet previous elemnt button170long onCmdInspectPreviousElement(FXObject*, FXSelector, void*);171/// @}172173/// @brief function called after undo/redo in the current frame (can be reimplemented in frame children)174void updateFrameAfterUndoRedo();175176/// @brief open GNEAttributesCreator extended dialog (can be reimplemented in frame children)177void selectedOverlappedElement(GNEAttributeCarrier* AC);178179protected:180/// @brief FOX need this181FOX_CONSTRUCTOR(GNEInspectorFrame)182183private:184/// @brief Overlapped Inspection185GNEOverlappedInspection* myOverlappedInspection = nullptr;186187/// @brief Attributes editor188GNEAttributesEditor* myAttributesEditor = nullptr;189190/// @brief Template editor191TemplateEditor* myTemplateEditor = nullptr;192193/// @brief Attribute Carrier Hierarchy194GNEElementTree* myHierarchicalElementTree = nullptr;195196/// @brief Back Button197FXButton* myBackButton = nullptr;198199/// @brief Pointer to previous element inspected200GNEAttributeCarrier* myPreviousInspectedAC = nullptr;201};202203204