Salome HOME
93a9c0833cec6103ca57f4d763da651339614da7
[modules/geom.git] / src / EntityGUI / EntityGUI_SubShapeDlg.h
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File   : EntityGUI_SubShapeDlg.h
25 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
26
27 #ifndef ENTITYGUI_SUBSHAPEDLG_H
28 #define ENTITYGUI_SUBSHAPEDLG_H
29
30 #include <GEOMBase_Skeleton.h>
31
32 #include <TColStd_IndexedMapOfInteger.hxx>
33
34 class QCheckBox;
35 class QComboBox;
36 class QGroupBox;
37 class QPushButton;
38 class SalomeApp_DoubleSpinBox;
39 class DlgRef_1Sel1List1Check3Btn;
40
41 //=================================================================================
42 // class    : EntityGUI_SubShapeDlg
43 // purpose  :
44 //=================================================================================
45 class EntityGUI_SubShapeDlg : public GEOMBase_Skeleton
46 {
47   Q_OBJECT
48
49 public:
50   EntityGUI_SubShapeDlg (GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0);
51   ~EntityGUI_SubShapeDlg();
52
53 protected:
54   // redefined from GEOMBase_Helper
55   virtual GEOM::GEOM_IOperations_ptr  createOperation();
56   virtual bool                        isValid (QString&);
57   virtual bool                        execute (ObjectList&);
58   virtual GEOM::GEOM_Object_ptr       getFather (GEOM::GEOM_Object_ptr);
59   virtual QString                     getNewObjectName (int CurrObj = -1) const;
60   virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
61
62   void                                closeEvent (QCloseEvent*);
63
64 private slots:
65   void                                ClickOnOk();
66   bool                                ClickOnApply();
67   void                                ActivateThisDialog();
68   void                                LineEditReturnPressed();
69   void                                SelectionIntoArgument();
70   void                                SetEditCurrentArgument();
71   void                                SubShapeToggled();
72   void                                ComboTextChanged();
73
74   void                                showOnlySelected();
75   void                                ClickOnOkFilter();
76 #ifndef DISABLE_PLOT2DVIEWER
77   void                                ClickOnPlot();
78 #endif
79   void                                MeasureToggled();
80
81 private:
82   void                                Init();
83   void                                enterEvent (QEvent*);
84
85   void                                ResetStateOfDialog();
86
87   void                                activateSelection();
88   int                                 getSelectedSubshapes (TColStd_IndexedMapOfInteger& theMapIndex);
89   void                                updateButtonState();
90   bool                                isAllSubShapes() const;
91   int                                 shapeType() const;
92
93 private:
94   TopoDS_Shape                        myShape;
95   GEOM::GEOM_Object_var               myObject;
96   int                                 myDmMode;
97
98   bool                                myIsHiddenMain;
99
100   DlgRef_1Sel1List1Check3Btn*         GroupPoints;
101   QCheckBox*                          myLessFilterCheck;
102   QCheckBox*                          myGreaterFilterCheck;
103   QComboBox*                          myLessFilterCombo;
104   QComboBox*                          myGreaterFilterCombo;
105   SalomeApp_DoubleSpinBox*            myLessFilterSpin;
106   SalomeApp_DoubleSpinBox*            myGreaterFilterSpin;
107   QPushButton*                        myApplyFilterButton;
108   QPushButton*                        myPlotDistributionButton;
109   QGroupBox*                          myFilterGrp;
110 };
111
112 #endif // ENTITYGUI_SUBSHAPEDLG_H