]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_InspectionPanel.h
Salome HOME
537ae6f3bf03edb12f71c16b3c69df5eb4841429
[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 <TopoDS_Shape.hxx>
27 #include <TopoDS_Solid.hxx>
28
29 #include <QDockWidget>
30
31 class XGUI_SelectionMgr;
32 class QLineEdit;
33 class QTableWidget;
34 class QLabel;
35 class QTextBrowser;
36
37 /// Internal name of property panel widget
38 const static char* INSPECTION_PANEL = "inspection_panel_dock";
39
40 class XGUI_EXPORT XGUI_InspectionPanel : public QDockWidget
41 {
42   Q_OBJECT
43 public:
44   enum SudShape {
45     ShapeId,
46     CompoundId,
47     CompsolidId,
48     SolidId,
49     ShellId,
50     FaceId,
51     WireId,
52     EdgeId,
53     VertexId
54   };
55
56   /// Constructor
57   /// \param theParent is a parent of the property panel
58   /// \param theMgr operation manager
59   XGUI_InspectionPanel(QWidget* theParent, XGUI_SelectionMgr* theMgr);
60
61   virtual ~XGUI_InspectionPanel();
62
63 private slots:
64   void onSelectionChanged();
65
66 private:
67   void setSubShapeValue(SudShape theId, int theVal);
68
69   void setName(const QString& theName);
70
71   // Set type parameters
72   void setCylinderType(const gp_XYZ& theLoc, const gp_XYZ& theDir,
73     double theRadius, double theHeight);
74
75   void setConeType(const gp_XYZ& theLoc, const gp_XYZ& theDir,
76     double theRad1, double theRad2, double theHeight);
77
78   void setTorusType(const gp_XYZ& theLoc, const gp_XYZ& theDir,
79     double theRad1, double theRad2);
80
81   void setSphereType(const gp_XYZ& theLoc, double theRadius);
82
83   void setBoxType(double theX, double theY, double theZ,
84     double theXsize, double theYsize, double theZsize);
85
86   void setRotatedBoxType(double theX, double theY, double theZ,
87     double theZaxisX, double theZaxisY, double theZaxisZ,
88     double theXaxisX, double theXaxisY, double theXaxisZ,
89     double theXsize, double theYsize, double theZsize);
90
91   void setPlaneType(const gp_XYZ& theLoc, const gp_XYZ& theDir);
92
93   void setVertexType(const gp_XYZ& theLoc);
94
95   void setCircleType(const gp_XYZ& theLoc, const gp_XYZ& theDir, double theRadius);
96
97   void setArcType(const gp_XYZ& theLoc, const gp_XYZ& theDir, double theRadius,
98     const gp_XYZ& theP1, const gp_XYZ& theP2);
99
100   void setEllipseType(const gp_XYZ& theLoc, const gp_XYZ& theDir,
101     double theMajorRad, double theMinorRad);
102
103   void setEllipseArcType(const gp_XYZ& theLoc, const gp_XYZ& theDir,
104     double theMajorRad, double theMinorRad, const gp_XYZ& theP1, const gp_XYZ& theP2);
105
106   void setLineType(const gp_XYZ& theP1, const gp_XYZ& theP2);
107
108   void setShapeContent(const TopoDS_Shape& theShape);
109
110   void setShapeParams(const TopoDS_Shape& theShape);
111
112   void clearContent();
113
114   void fillVertex(const TopoDS_Shape& theShape);
115
116   void fillEdge(const TopoDS_Shape& theShape);
117
118   void fillFace(const TopoDS_Shape& theShape);
119
120   void fillSolid(const TopoDS_Shape& theShape);
121
122   void fillContainer(const TopoDS_Shape& theShape);
123
124   bool processSphere(const TopoDS_Solid& theSolid);
125
126 private:
127   XGUI_SelectionMgr* mySelectionMgr;
128
129   QLineEdit* myNameEdt;
130   QTableWidget* mySubShapesTab;
131   QLabel* myTypeLbl;
132   QTextBrowser* myTypeParams;
133 };
134
135 #endif