]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_InspectionPanel.h
Salome HOME
Fix for formula definition with '=' in an integer widget
[modules/shaper.git] / src / XGUI / XGUI_InspectionPanel.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef XGUI_INSPECTIONPANEL_H_
22 #define XGUI_INSPECTIONPANEL_H_
23
24 #include "XGUI.h"
25
26 #include <QDockWidget>
27
28 #include <memory>
29
30 class XGUI_SelectionMgr;
31 class QLineEdit;
32 class QTableWidget;
33 class QLabel;
34 class QTextBrowser;
35
36 class TopoDS_Shape;
37
38 class GeomAPI_Vertex;
39 class GeomAPI_Edge;
40 class GeomAPI_Wire;
41 class GeomAPI_Face;
42 class GeomAPI_Shell;
43 class GeomAPI_Solid;
44 class GeomAPI_Shape;
45
46 class GeomAPI_Pln;
47 class GeomAPI_Sphere;
48 class GeomAPI_Cylinder;
49 class GeomAPI_Cone;
50 class GeomAPI_Torus;
51 class GeomAPI_Box;
52
53 /// Internal name of property panel widget
54 const static char* INSPECTION_PANEL = "inspection_panel_dock";
55
56 class XGUI_EXPORT XGUI_InspectionPanel : public QDockWidget
57 {
58   Q_OBJECT
59 public:
60   enum SudShape {
61     ShapeId,
62     CompoundId,
63     CompsolidId,
64     SolidId,
65     ShellId,
66     FaceId,
67     WireId,
68     EdgeId,
69     VertexId
70   };
71
72   /// Constructor
73   /// \param theParent is a parent of the property panel
74   /// \param theMgr operation manager
75   XGUI_InspectionPanel(QWidget* theParent, XGUI_SelectionMgr* theMgr);
76
77   virtual ~XGUI_InspectionPanel();
78
79 private slots:
80   void onSelectionChanged();
81
82 private:
83   void setSubShapeValue(SudShape theId, int theVal);
84
85   void setName(const QString& theName);
86
87   void setShapeContent(const TopoDS_Shape& theShape);
88
89   void setShapeParams(const TopoDS_Shape& theShape);
90
91   void clearContent();
92
93
94   void fillVertex(const std::shared_ptr<GeomAPI_Vertex>& theVertex);
95
96   void fillEdge(const std::shared_ptr<GeomAPI_Edge>& theEdge);
97
98   void fillWire(const std::shared_ptr<GeomAPI_Wire>& theWire);
99
100   void fillFace(const std::shared_ptr<GeomAPI_Face>& theFace);
101
102   void fillShell(const std::shared_ptr<GeomAPI_Shell>& theShell);
103
104   void fillSolid(const std::shared_ptr<GeomAPI_Solid>& theSolid);
105
106   void fillContainer(const std::shared_ptr<GeomAPI_Shape>& theShape);
107
108
109   void setPlaneType(const QString& theTitle, const std::shared_ptr<GeomAPI_Pln>& thePlane);
110
111   void setSphereType(const QString& theTitle, const std::shared_ptr<GeomAPI_Sphere>& theSphere);
112
113   void setCylinderType(const QString& theTitle, const std::shared_ptr<GeomAPI_Cylinder>& theCyl);
114
115   void setConeType(const QString& theTitle, const std::shared_ptr<GeomAPI_Cone>& theCone);
116
117   void setTorusType(const QString& theTitle, const std::shared_ptr<GeomAPI_Torus>& theTorus);
118
119   void setBoxType(const QString& theTitle, const std::shared_ptr<GeomAPI_Box>& theBox);
120
121   void setRotatedBoxType(const QString& theTitle, const std::shared_ptr<GeomAPI_Box>& theBox);
122
123 private:
124   XGUI_SelectionMgr* mySelectionMgr;
125
126   QLineEdit* myNameEdt;
127   QTableWidget* mySubShapesTab;
128   QLabel* myTypeLbl;
129   QTextBrowser* myTypeParams;
130 };
131
132 #endif