SHAPER  9.12.0
XGUI_InspectionPanel.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef XGUI_INSPECTIONPANEL_H_
21 #define XGUI_INSPECTIONPANEL_H_
22 
23 #include "XGUI.h"
24 
25 #include <ModelAPI_Feature.h>
26 #include <GeomAlgoAPI_ShapeInfo.h>
27 
28 #include <QDockWidget>
29 
30 #include <memory>
31 
32 class XGUI_Workshop;
33 class QLineEdit;
34 class QTableWidget;
35 class QLabel;
36 class QTextBrowser;
37 class QVBoxLayout;
38 class QResizeEvent;
39 class QStackedWidget;
40 class QGridLayout;
41 
42 class TopoDS_Shape;
43 
45 
47 MAYBE_UNUSED const static char* INSPECTION_PANEL = "inspection_panel_dock";
48 
53 class XGUI_EXPORT XGUI_InspectionPanel :
55 {
56  Q_OBJECT
57 public:
59  enum SudShape {
60  ShapeId,
61  CompoundId,
62  CompsolidId,
63  SolidId,
64  ShellId,
65  FaceId,
66  WireId,
67  EdgeId,
68  VertexId
69  };
70 
74  XGUI_InspectionPanel(QWidget* theParent, XGUI_Workshop* theWorkshop);
75 
76  // Destructor
77  virtual ~XGUI_InspectionPanel();
78 
79  // A translator of resource strings, needed for ShapeInfo.
80  virtual std::string translate(const char* theSource) override;
81 
82 
83 protected:
84  virtual void showEvent(QShowEvent* theEvent);
85 
86 private slots:
88  void onSelectionChanged();
89 
90 private:
94  void setSubShapeValue(SudShape theId, int theVal);
95 
98  void setName(const QString& theName);
99 
102  void setShapeContent(const TopoDS_Shape& theShape);
103 
105  void clearContent();
106 
109  void setParamsText(const QString& theText);
110 
113  void buildFeaturePane(const FeaturePtr& theFeature);
114 
115 private:
116  XGUI_Workshop* myWorkshop; //> selection manager
117 
118  QLineEdit* myNameEdt;
119  QTableWidget* mySubShapesTab;
120  QLabel* myTypeLbl;
121  QTextBrowser* myTypeParams;
122  QVBoxLayout* myMainLayout;
123  ModuleBase_PageWidget* myFeaturePane;
124  QGridLayout* myFeatureLayout;
125  QStackedWidget* myStackWgt;
126  int myShapePanelId;
127  int myFeaturePanelId;
128 };
129 
130 #endif
A translator to the current language is needed for HTML export.
Definition: GeomAlgoAPI_ShapeInfo.h:79
Definition: ModuleBase_PageWidget.h:37
A class which represents an inspection panel: to show content of currently selected objects.
Definition: XGUI_InspectionPanel.h:55
SudShape
Type of selected objects.
Definition: XGUI_InspectionPanel.h:59
Class which defines a configuration of the application (Workshop) and launches it.
Definition: XGUI_Workshop.h:82