1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef XGUI_INSPECTIONPANEL_H_
22 #define XGUI_INSPECTIONPANEL_H_
26 #include <QDockWidget>
30 class XGUI_SelectionMgr;
50 class GeomAPI_Cylinder;
55 /// Internal name of property panel widget
56 const static char* INSPECTION_PANEL = "inspection_panel_dock";
60 * A class which represents an inspection panel: to show content of currently selected objects
62 class XGUI_EXPORT XGUI_InspectionPanel : public QDockWidget
66 /// Type of selected objects
80 /// \param theParent is a parent of the property panel
81 /// \param theMgr operation manager
82 XGUI_InspectionPanel(QWidget* theParent, XGUI_SelectionMgr* theMgr);
85 virtual ~XGUI_InspectionPanel();
89 /// A slot to react on selection changed
90 void onSelectionChanged();
93 /// Set counts of a sub-shapes
94 /// \param theId an id of sub-shape type
95 /// \param theVal a number of sub-shapes of corresponded type
96 void setSubShapeValue(SudShape theId, int theVal);
98 /// Set name of current selection
99 /// \param theName the name
100 void setName(const QString& theName);
102 /// Set content of selected shape into table
103 /// \param theShape the shape
104 void setShapeContent(const TopoDS_Shape& theShape);
106 /// Set parameters of the selected shape
107 /// \param theShape the shape
108 void setShapeParams(const TopoDS_Shape& theShape);
110 /// Clear content of the window
113 /// Show parameters of a vertex
114 /// \param theVertex the vertex
115 void fillVertex(const std::shared_ptr<GeomAPI_Vertex>& theVertex);
117 /// Show parameters of a edge
118 /// \param theEdge the edge
119 void fillEdge(const std::shared_ptr<GeomAPI_Edge>& theEdge);
121 /// Show parameters of a wire
122 /// \param theWire the wire
123 void fillWire(const std::shared_ptr<GeomAPI_Wire>& theWire);
125 /// Show parameters of a face
126 /// \param theFace the face
127 void fillFace(const std::shared_ptr<GeomAPI_Face>& theFace);
129 /// Show parameters of a shell
130 /// \param theShell the shell
131 void fillShell(const std::shared_ptr<GeomAPI_Shell>& theShell);
133 /// Show parameters of a solid
134 /// \param theSolid the solid
135 void fillSolid(const std::shared_ptr<GeomAPI_Solid>& theSolid);
137 /// Show parameters of a compound
138 /// \param theShape the compound
139 void fillContainer(const std::shared_ptr<GeomAPI_Shape>& theShape);
141 /// Show parameters of a plane
142 /// \param theTitle a title of the object
143 /// \param thePlane the plane
144 void setPlaneType(const QString& theTitle, const std::shared_ptr<GeomAPI_Pln>& thePlane);
146 /// Show parameters of a sphere
147 /// \param theTitle a title of the object
148 /// \param theSphere the sphere
149 void setSphereType(const QString& theTitle, const std::shared_ptr<GeomAPI_Sphere>& theSphere);
151 /// Show parameters of a cylinder
152 /// \param theTitle a title of the object
153 /// \param theCyl the cylinder
154 void setCylinderType(const QString& theTitle, const std::shared_ptr<GeomAPI_Cylinder>& theCyl);
156 /// Show parameters of a cone
157 /// \param theTitle a title of the object
158 /// \param theCone the cone
159 void setConeType(const QString& theTitle, const std::shared_ptr<GeomAPI_Cone>& theCone);
161 /// Show parameters of a torus
162 /// \param theTitle a title of the object
163 /// \param theTorus the torus
164 void setTorusType(const QString& theTitle, const std::shared_ptr<GeomAPI_Torus>& theTorus);
166 /// Show parameters of a box
167 /// \param theTitle a title of the object
168 /// \param theBox the box
169 void setBoxType(const QString& theTitle, const std::shared_ptr<GeomAPI_Box>& theBox);
171 /// Show parameters of a rotated box
172 /// \param theTitle a title of the object
173 /// \param theBox the box
174 void setRotatedBoxType(const QString& theTitle, const std::shared_ptr<GeomAPI_Box>& theBox);
177 /// Set text into parameters area
178 /// \param theText the text
179 void setParamsText(const QString& theText);
182 XGUI_SelectionMgr* mySelectionMgr; //> selection manager
184 QLineEdit* myNameEdt; //> Name field
185 QTableWidget* mySubShapesTab; //> table of sub-shapes
186 QLabel* myTypeLbl; //> label of a type
187 QTextBrowser* myTypeParams; //> parameters area
188 QVBoxLayout* myMainLayout; //> main layout
189 //QWidget* myMainWidget; //> main widget