1 // Copyright (C) 2014-2022 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef XGUI_INSPECTIONPANEL_H_
21 #define XGUI_INSPECTIONPANEL_H_
25 #include <ModelAPI_Feature.h>
26 #include <GeomAlgoAPI_ShapeInfo.h>
28 #include <QDockWidget>
44 class ModuleBase_PageWidget;
46 /// Internal name of property panel widget
47 MAYBE_UNUSED const static char* INSPECTION_PANEL = "inspection_panel_dock";
51 * A class which represents an inspection panel: to show content of currently selected objects
53 class XGUI_EXPORT XGUI_InspectionPanel :
54 public QDockWidget, public GeomAlgoAPI_ShapeInfo::Translator
58 /// Type of selected objects
72 /// \param theParent is a parent of the property panel
73 /// \param theMgr operation manager
74 XGUI_InspectionPanel(QWidget* theParent, XGUI_Workshop* theWorkshop);
77 virtual ~XGUI_InspectionPanel();
79 // A translator of resource strings, needed for ShapeInfo.
80 virtual std::string translate(const char* theSource) override;
84 virtual void showEvent(QShowEvent* theEvent);
87 /// A slot to react on selection changed
88 void onSelectionChanged();
91 /// Set counts of a sub-shapes
92 /// \param theId an id of sub-shape type
93 /// \param theVal a number of sub-shapes of corresponded type
94 void setSubShapeValue(SudShape theId, int theVal);
96 /// Set name of current selection
97 /// \param theName the name
98 void setName(const QString& theName);
100 /// Set content of selected shape into table
101 /// \param theShape the shape
102 void setShapeContent(const TopoDS_Shape& theShape);
104 /// Clear content of the window
107 /// Set text into parameters area
108 /// \param theText the text
109 void setParamsText(const QString& theText);
111 /// Fills Feature panel with controls specific to the given feature
112 /// \param theFeature the selected feature
113 void buildFeaturePane(const FeaturePtr& theFeature);
116 XGUI_Workshop* myWorkshop; //> selection manager
118 QLineEdit* myNameEdt; ///> Name field
119 QTableWidget* mySubShapesTab; ///> table of sub-shapes
120 QLabel* myTypeLbl; ///> label of a type
121 QTextBrowser* myTypeParams; ///> parameters area
122 QVBoxLayout* myMainLayout; ///> main layout
123 ModuleBase_PageWidget* myFeaturePane; ///> Content of feature property panel
124 QGridLayout* myFeatureLayout; ///> Layout of feature panel
125 QStackedWidget* myStackWgt; ///> base widget of the panel
127 int myFeaturePanelId;