Salome HOME
Copyright update 2022
[modules/geom.git] / src / MeasureGUI / MeasureGUI_ShapeStatisticsDlg.h
1 // Copyright (C) 2015-2022  CEA/DEN, EDF R&D, OPEN CASCADE
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 email : webmaster.salome@opencascade.com
18 //
19
20 // GEOM GEOMGUI : GUI for Geometry component
21 // File   : MeasureGUI_ShapeStatisticsDlg.h
22 // Author : Alexander KOVALEV, Open CASCADE (alexander.kovalev@opencascade.com)
23 //
24 #ifndef MEASUREGUI_SHAPESTATISTICSDLG_H
25 #define MEASUREGUI_SHAPESTATISTICSDLG_H
26
27 // GEOM includes
28 #include <GEOMBase_Helper.h>
29 #include "GEOM_GenericObjPtr.h"
30 #include "MeasureGUI_definitions.h"
31
32 // Qt includes
33 #include <QDialog>
34 #include <QLineEdit>
35 #include <QPointer>
36 #include <QGroupBox>
37
38 // Qtx includes
39 #include <QtxIntSpinBox.h>
40 #include <QtxComboBox.h>
41
42 class Plot2d_Histogram;
43
44 //==========================================================================
45 // class    : MeasureGUI_ShapeStatisticsDlg
46 // purpose  :
47 //==========================================================================
48
49 class MEASUREGUI_EXPORT MeasureGUI_ShapeStatisticsDlg : public QDialog, public GEOMBase_Helper
50 {
51   Q_OBJECT
52
53 public:
54   MeasureGUI_ShapeStatisticsDlg( QWidget*, TopoDS_Shape aShape = TopoDS_Shape(), TopAbs_ShapeEnum aSubShapeType = TopAbs_SHAPE );
55   ~MeasureGUI_ShapeStatisticsDlg();
56   
57 protected:
58   // redefined from GEOMBase_Helper
59   virtual GEOM::GEOM_IOperations_ptr  createOperation();
60   virtual bool                        isValid (QString&);
61   virtual bool                        execute (ObjectList&);
62   virtual GEOM::GEOM_Object_ptr       getFather (GEOM::GEOM_Object_ptr);
63   virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
64
65 private slots:
66   void                    onEditMainShape();
67   void                    clickOnCompute();
68   void                    clickOnPlot();
69   void                    clickOnCreateGroups();
70   void                    clickOnHelp();
71   
72 private:
73   void                    fillTypes( bool, bool, bool );
74   void                    updateTypes( QList<GEOM::GeomObjPtr> theShapes );
75   TopAbs_ShapeEnum        currentType();
76
77 private:
78   SalomeApp_Application*     myApp;
79   QLineEdit*                 myEditMainShape;
80   QtxComboBox*               myCBTypes;
81   std::list<TopoDS_Shape>    myShapes;
82   GEOM::GeomObjPtr           myMainObj;
83   QtxIntSpinBox*             myNbIntervals;
84   QGroupBox*                 myScalarRangeBox;
85   QLineEdit*                 myMin;
86   QLineEdit*                 myMax;
87   QPushButton*               myButtonPlot;
88   QPushButton*               myButtonCreateGr;
89   Plot2d_Histogram*          myHistogram;
90
91 };
92
93 #endif // MEASUREGUI_SHAPESTATISTICSDLG_H