1 // Copyright (C) 2014-2019 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 <QDockWidget>
29 class XGUI_SelectionMgr;
49 class GeomAPI_Cylinder;
54 /// Internal name of property panel widget
55 const static char* INSPECTION_PANEL = "inspection_panel_dock";
59 * A class which represents an inspection panel: to show content of currently selected objects
61 class XGUI_EXPORT XGUI_InspectionPanel : public QDockWidget
65 /// Type of selected objects
79 /// \param theParent is a parent of the property panel
80 /// \param theMgr operation manager
81 XGUI_InspectionPanel(QWidget* theParent, XGUI_SelectionMgr* theMgr);
84 virtual ~XGUI_InspectionPanel();
88 /// A slot to react on selection changed
89 void onSelectionChanged();
92 /// Set counts of a sub-shapes
93 /// \param theId an id of sub-shape type
94 /// \param theVal a number of sub-shapes of corresponded type
95 void setSubShapeValue(SudShape theId, int theVal);
97 /// Set name of current selection
98 /// \param theName the name
99 void setName(const QString& theName);
101 /// Set content of selected shape into table
102 /// \param theShape the shape
103 void setShapeContent(const TopoDS_Shape& theShape);
105 /// Set parameters of the selected shape
106 /// \param theShape the shape
107 void setShapeParams(const TopoDS_Shape& theShape);
109 /// Clear content of the window
112 /// Show parameters of a vertex
113 /// \param theVertex the vertex
114 void fillVertex(const std::shared_ptr<GeomAPI_Vertex>& theVertex);
116 /// Show parameters of a edge
117 /// \param theEdge the edge
118 void fillEdge(const std::shared_ptr<GeomAPI_Edge>& theEdge);
120 /// Show parameters of a wire
121 /// \param theWire the wire
122 void fillWire(const std::shared_ptr<GeomAPI_Wire>& theWire);
124 /// Show parameters of a face
125 /// \param theFace the face
126 void fillFace(const std::shared_ptr<GeomAPI_Face>& theFace);
128 /// Show parameters of a shell
129 /// \param theShell the shell
130 void fillShell(const std::shared_ptr<GeomAPI_Shell>& theShell);
132 /// Show parameters of a solid
133 /// \param theSolid the solid
134 void fillSolid(const std::shared_ptr<GeomAPI_Solid>& theSolid);
136 /// Show parameters of a compound
137 /// \param theShape the compound
138 void fillContainer(const std::shared_ptr<GeomAPI_Shape>& theShape);
140 /// Show parameters of a plane
141 /// \param theTitle a title of the object
142 /// \param thePlane the plane
143 void setPlaneType(const QString& theTitle, const std::shared_ptr<GeomAPI_Pln>& thePlane);
145 /// Show parameters of a sphere
146 /// \param theTitle a title of the object
147 /// \param theSphere the sphere
148 void setSphereType(const QString& theTitle, const std::shared_ptr<GeomAPI_Sphere>& theSphere);
150 /// Show parameters of a cylinder
151 /// \param theTitle a title of the object
152 /// \param theCyl the cylinder
153 void setCylinderType(const QString& theTitle, const std::shared_ptr<GeomAPI_Cylinder>& theCyl);
155 /// Show parameters of a cone
156 /// \param theTitle a title of the object
157 /// \param theCone the cone
158 void setConeType(const QString& theTitle, const std::shared_ptr<GeomAPI_Cone>& theCone);
160 /// Show parameters of a torus
161 /// \param theTitle a title of the object
162 /// \param theTorus the torus
163 void setTorusType(const QString& theTitle, const std::shared_ptr<GeomAPI_Torus>& theTorus);
165 /// Show parameters of a box
166 /// \param theTitle a title of the object
167 /// \param theBox the box
168 void setBoxType(const QString& theTitle, const std::shared_ptr<GeomAPI_Box>& theBox);
170 /// Show parameters of a rotated box
171 /// \param theTitle a title of the object
172 /// \param theBox the box
173 void setRotatedBoxType(const QString& theTitle, const std::shared_ptr<GeomAPI_Box>& theBox);
176 /// Set text into parameters area
177 /// \param theText the text
178 void setParamsText(const QString& theText);
181 XGUI_SelectionMgr* mySelectionMgr; //> selection manager
183 QLineEdit* myNameEdt; //> Name field
184 QTableWidget* mySubShapesTab; //> table of sub-shapes
185 QLabel* myTypeLbl; //> label of a type
186 QTextBrowser* myTypeParams; //> parameters area
187 QVBoxLayout* myMainLayout; //> main layout
188 //QWidget* myMainWidget; //> main widget