Salome HOME
Change translation
[modules/shaper.git] / src / XGUI / XGUI_InspectionPanel.h
index 537ae6f3bf03edb12f71c16b3c69df5eb4841429..3f980ea42071aecdc69ee4e293b909f51ef6fdae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_INSPECTIONPANEL_H_
 
 #include "XGUI.h"
 
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Solid.hxx>
-
 #include <QDockWidget>
 
+#include <memory>
+
 class XGUI_SelectionMgr;
 class QLineEdit;
 class QTableWidget;
 class QLabel;
 class QTextBrowser;
+class QVBoxLayout;
+class QResizeEvent;
+
+class TopoDS_Shape;
+
+class GeomAPI_Vertex;
+class GeomAPI_Edge;
+class GeomAPI_Wire;
+class GeomAPI_Face;
+class GeomAPI_Shell;
+class GeomAPI_Solid;
+class GeomAPI_Shape;
+
+class GeomAPI_Pln;
+class GeomAPI_Sphere;
+class GeomAPI_Cylinder;
+class GeomAPI_Cone;
+class GeomAPI_Torus;
+class GeomAPI_Box;
 
 /// Internal name of property panel widget
 const static char* INSPECTION_PANEL = "inspection_panel_dock";
 
+/**
+* \ingroup GUI
+* A class which represents an inspection panel: to show content of currently selected objects
+*/
 class XGUI_EXPORT XGUI_InspectionPanel : public QDockWidget
 {
   Q_OBJECT
 public:
+  /// Type of selected objects
   enum SudShape {
     ShapeId,
     CompoundId,
@@ -58,78 +80,112 @@ public:
   /// \param theMgr operation manager
   XGUI_InspectionPanel(QWidget* theParent, XGUI_SelectionMgr* theMgr);
 
+  // Destructor
   virtual ~XGUI_InspectionPanel();
 
+
 private slots:
+  /// A slot to react on selection changed
   void onSelectionChanged();
 
 private:
+  /// Set counts of a sub-shapes
+  /// \param theId an id of sub-shape type
+  /// \param theVal a number of sub-shapes of corresponded type
   void setSubShapeValue(SudShape theId, int theVal);
 
+  /// Set name of current selection
+  /// \param theName the name
   void setName(const QString& theName);
 
-  // Set type parameters
-  void setCylinderType(const gp_XYZ& theLoc, const gp_XYZ& theDir,
-    double theRadius, double theHeight);
-
-  void setConeType(const gp_XYZ& theLoc, const gp_XYZ& theDir,
-    double theRad1, double theRad2, double theHeight);
-
-  void setTorusType(const gp_XYZ& theLoc, const gp_XYZ& theDir,
-    double theRad1, double theRad2);
-
-  void setSphereType(const gp_XYZ& theLoc, double theRadius);
+  /// Set content of selected shape into table
+  /// \param theShape the shape
+  void setShapeContent(const TopoDS_Shape& theShape);
 
-  void setBoxType(double theX, double theY, double theZ,
-    double theXsize, double theYsize, double theZsize);
+  /// Set parameters of the selected shape
+  /// \param theShape the shape
+  void setShapeParams(const TopoDS_Shape& theShape);
 
-  void setRotatedBoxType(double theX, double theY, double theZ,
-    double theZaxisX, double theZaxisY, double theZaxisZ,
-    double theXaxisX, double theXaxisY, double theXaxisZ,
-    double theXsize, double theYsize, double theZsize);
+  /// Clear content of the window
+  void clearContent();
 
-  void setPlaneType(const gp_XYZ& theLoc, const gp_XYZ& theDir);
+  /// Show parameters of a vertex
+  /// \param theVertex the vertex
+  void fillVertex(const std::shared_ptr<GeomAPI_Vertex>& theVertex);
 
-  void setVertexType(const gp_XYZ& theLoc);
+  /// Show parameters of a edge
+  /// \param theEdge the edge
+  void fillEdge(const std::shared_ptr<GeomAPI_Edge>& theEdge);
 
-  void setCircleType(const gp_XYZ& theLoc, const gp_XYZ& theDir, double theRadius);
+  /// Show parameters of a wire
+  /// \param theWire the wire
+  void fillWire(const std::shared_ptr<GeomAPI_Wire>& theWire);
 
-  void setArcType(const gp_XYZ& theLoc, const gp_XYZ& theDir, double theRadius,
-    const gp_XYZ& theP1, const gp_XYZ& theP2);
+  /// Show parameters of a face
+  /// \param theFace the face
+  void fillFace(const std::shared_ptr<GeomAPI_Face>& theFace);
 
-  void setEllipseType(const gp_XYZ& theLoc, const gp_XYZ& theDir,
-    double theMajorRad, double theMinorRad);
+  /// Show parameters of a shell
+  /// \param theShell the shell
+  void fillShell(const std::shared_ptr<GeomAPI_Shell>& theShell);
 
-  void setEllipseArcType(const gp_XYZ& theLoc, const gp_XYZ& theDir,
-    double theMajorRad, double theMinorRad, const gp_XYZ& theP1, const gp_XYZ& theP2);
+  /// Show parameters of a solid
+  /// \param theSolid the solid
+  void fillSolid(const std::shared_ptr<GeomAPI_Solid>& theSolid);
 
-  void setLineType(const gp_XYZ& theP1, const gp_XYZ& theP2);
+  /// Show parameters of a compound
+  /// \param theShape the compound
+  void fillContainer(const std::shared_ptr<GeomAPI_Shape>& theShape);
 
-  void setShapeContent(const TopoDS_Shape& theShape);
+  /// Show parameters of a plane
+  /// \param theTitle a title of the object
+  /// \param thePlane the plane
+  void setPlaneType(const QString& theTitle, const std::shared_ptr<GeomAPI_Pln>& thePlane);
 
-  void setShapeParams(const TopoDS_Shape& theShape);
+  /// Show parameters of a sphere
+  /// \param theTitle a title of the object
+  /// \param theSphere the sphere
+  void setSphereType(const QString& theTitle, const std::shared_ptr<GeomAPI_Sphere>& theSphere);
 
-  void clearContent();
+  /// Show parameters of a cylinder
+  /// \param theTitle a title of the object
+  /// \param theCyl the cylinder
+  void setCylinderType(const QString& theTitle, const std::shared_ptr<GeomAPI_Cylinder>& theCyl);
 
-  void fillVertex(const TopoDS_Shape& theShape);
+  /// Show parameters of a cone
+  /// \param theTitle a title of the object
+  /// \param theCone the cone
+  void setConeType(const QString& theTitle, const std::shared_ptr<GeomAPI_Cone>& theCone);
 
-  void fillEdge(const TopoDS_Shape& theShape);
+  /// Show parameters of a torus
+  /// \param theTitle a title of the object
+  /// \param theTorus the torus
+  void setTorusType(const QString& theTitle, const std::shared_ptr<GeomAPI_Torus>& theTorus);
 
-  void fillFace(const TopoDS_Shape& theShape);
+  /// Show parameters of a box
+  /// \param theTitle a title of the object
+  /// \param theBox the box
+  void setBoxType(const QString& theTitle, const std::shared_ptr<GeomAPI_Box>& theBox);
 
-  void fillSolid(const TopoDS_Shape& theShape);
+  /// Show parameters of a rotated box
+  /// \param theTitle a title of the object
+  /// \param theBox the box
+  void setRotatedBoxType(const QString& theTitle, const std::shared_ptr<GeomAPI_Box>& theBox);
 
-  void fillContainer(const TopoDS_Shape& theShape);
 
-  bool processSphere(const TopoDS_Solid& theSolid);
+  /// Set text into parameters area
+  /// \param theText the text
+  void setParamsText(const QString& theText);
 
 private:
-  XGUI_SelectionMgr* mySelectionMgr;
-
-  QLineEdit* myNameEdt;
-  QTableWidget* mySubShapesTab;
-  QLabel* myTypeLbl;
-  QTextBrowser* myTypeParams;
+  XGUI_SelectionMgr* mySelectionMgr; //> selection manager
+
+  QLineEdit* myNameEdt; //> Name field
+  QTableWidget* mySubShapesTab; //> table of sub-shapes
+  QLabel* myTypeLbl; //> label of a type
+  QTextBrowser* myTypeParams; //> parameters area
+  QVBoxLayout* myMainLayout; //> main layout
+  //QWidget* myMainWidget;  //> main widget
 };
 
 #endif
\ No newline at end of file