Salome HOME
22853: EDF 9924 GEOM: Dimension histogram
[modules/geom.git] / src / MeasureGUI / MeasureGUI_ShapeStatisticsDlg.h
1 // Copyright (C) 2015  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
31 // Qt includes
32 #include <QDialog>
33 #include <QLineEdit>
34 #include <QPointer>
35 #include <QGroupBox>
36
37 // Qtx includes
38 #include <QtxIntSpinBox.h>
39 #include <QtxComboBox.h>
40
41 class Plot2d_Histogram;
42
43 //==========================================================================
44 // class    : MeasureGUI_ShapeStatisticsDlg
45 // purpose  :
46 //==========================================================================
47
48 class MeasureGUI_ShapeStatisticsDlg : public QDialog, public GEOMBase_Helper
49 {
50   Q_OBJECT
51
52 public:
53   MeasureGUI_ShapeStatisticsDlg( QWidget*, TopoDS_Shape aShape = TopoDS_Shape(), TopAbs_ShapeEnum aSubShapeType = TopAbs_SHAPE );
54   ~MeasureGUI_ShapeStatisticsDlg();
55   
56 protected:
57   // redefined from GEOMBase_Helper
58   virtual GEOM::GEOM_IOperations_ptr  createOperation();
59   virtual bool                        isValid (QString&);
60   virtual bool                        execute (ObjectList&);
61   virtual GEOM::GEOM_Object_ptr       getFather (GEOM::GEOM_Object_ptr);
62   virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
63
64 private slots:
65   void                    onEditMainShape();
66   void                    clickOnCompute();
67   void                    clickOnPlot();
68   void                    clickOnCreateGroups();
69   void                    clickOnHelp();
70   
71 private:
72   void                    fillTypes( bool, bool, bool );
73   void                    updateTypes( QList<GEOM::GeomObjPtr> theShapes );
74   TopAbs_ShapeEnum        currentType();
75
76 private:
77   SalomeApp_Application*     myApp;
78   QLineEdit*                 myEditMainShape;
79   QtxComboBox*               myCBTypes;
80   std::list<TopoDS_Shape>    myShapes;
81   GEOM::GeomObjPtr           myMainObj;
82   QtxIntSpinBox*             myNbIntervals;
83   QGroupBox*                 myScalarRangeBox;
84   QLineEdit*                 myMin;
85   QLineEdit*                 myMax;
86   QPushButton*               myButtonPlot;
87   QPushButton*               myButtonCreateGr;
88   Plot2d_Histogram*          myHistogram;
89
90 };
91
92 #endif // MEASUREGUI_SHAPESTATISTICSDLG_H