Salome HOME
Merge branch 'V9_9_BR'
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GroupOnShapeDlg.h
1 // Copyright (C) 2007-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 //  SMESH SMESHGUI : GUI for SMESH component
21 //  File   : SMESHGUI_GroupOnShapeDlg.h
22 //  Author : Edard AGAPOV
23 //  Module : SMESH
24 //
25 #ifndef SMESHGUI_GroupOnShapeDlg_H_H
26 #define SMESHGUI_GroupOnShapeDlg_H_H
27
28 #include "SMESH_SMESHGUI.hxx"
29
30 #include "SMESHGUI_SelectionOp.h"
31
32 class QLineEdit;
33 class QListWidget;
34 class QPushButton;
35 class SMESHGUI_GroupOnShapeDlg;
36
37 //=================================================================================
38 // class    : SMESHGUI_GroupOnShapeOp
39 // purpose  : create groups on shapes of nodes and element at once, Issue 19970
40 //=================================================================================
41
42 class SMESHGUI_EXPORT SMESHGUI_GroupOnShapeOp : public SMESHGUI_SelectionOp
43 {
44     Q_OBJECT
45
46 public:
47     SMESHGUI_GroupOnShapeOp();
48     ~SMESHGUI_GroupOnShapeOp();
49
50     virtual LightApp_Dialog*    dlg() const;  
51     static QString              GetDefaultName(const QString& theOperation);
52     static SMESH::ElementType   ElementType(GEOM::GEOM_Object_var geom);
53
54 public slots:
55
56 protected:
57   
58   virtual void                  startOperation();
59   virtual void                  selectionDone();
60   virtual SUIT_SelectionFilter* createFilter( const int ) const;
61
62 private slots:
63
64     bool                        onApply();
65     void                        onButtonClick();
66
67 private:
68
69     void                        init();
70
71 private:
72
73   SMESHGUI_GroupOnShapeDlg*     myDlg;
74
75   QString                       myMeshID;
76   QStringList                   myElemGeoIDs, myNodeGeoIDs;
77 };
78
79 class SMESHGUI_EXPORT SMESHGUI_GroupOnShapeDlg : public SMESHGUI_Dialog
80 {
81     Q_OBJECT
82     
83 public:
84     SMESHGUI_GroupOnShapeDlg();
85     virtual ~SMESHGUI_GroupOnShapeDlg();
86
87 public slots:
88
89   void                          updateButtons();
90   void                          init();
91
92 private:
93
94   QPushButton*                  myMeshBtn;
95   QLineEdit*                    myMeshLine;
96
97   QPushButton*                  myElemGeomBtn;
98   QListWidget*                  myElemGeomList;
99
100   QPushButton*                  myNodeGeomBtn;
101   QListWidget*                  myNodeGeomList;
102
103   friend class SMESHGUI_GroupOnShapeOp;
104 };
105
106 #endif // SMESHGUI_GroupOnShapeDlg_H_H