Salome HOME
Merge remote branch 'origin/V8_5_asterstudy'
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Add0DElemsOnAllNodesDlg.h
1 // Copyright (C) 2007-2016  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 // SMESH SMESHGUI : GUI for SMESH component
24
25 #ifndef SMESHGUI_ADD0DELEMSONALLNODESDLG_H
26 #define SMESHGUI_ADD0DELEMSONALLNODESDLG_H
27
28 #include "SMESH_SMESHGUI.hxx"
29
30 #include "SMESHGUI_SelectionOp.h"
31 #include "SMESHGUI_Dialog.h"
32 #include "SMESHGUI_IdValidator.h"
33
34 class QButtonGroup;
35 class QCheckBox;
36 class QComboBox;
37 class QGroupBox;
38 class QLabel;
39 class QPushButton;
40 class SMESHGUI_Add0DElemsOnAllNodesOp;
41 class SMESHGUI_FilterDlg;
42
43 //---------------------------------------------------------------------------------
44 /*!
45  * \brief Dialog creating 0D elements on all nodes of given elements
46  */
47 class SMESHGUI_EXPORT SMESHGUI_Add0DElemsOnAllNodesDlg : public SMESHGUI_Dialog
48
49   Q_OBJECT
50
51  public:
52   SMESHGUI_Add0DElemsOnAllNodesDlg();
53
54   int                            getSelectionType() const;
55   bool                           isValid();
56
57 signals:
58
59   void                           selTypeChanged( int selType );
60
61
62  private slots:
63
64   void                           onGroupChecked ( bool on );
65   void                           onSelTypeChange( int selType );
66
67  private:
68
69   friend class SMESHGUI_Add0DElemsOnAllNodesOp;
70
71   QButtonGroup* mySelTypeBtnGrp;
72   QPushButton*  myFilterBtn;
73   QGroupBox*    myGroupBox;
74   QLabel*       myGroupLabel;
75   QComboBox*    myGroupListCmBox;
76   QCheckBox*    myDuplicateElemsChkBox;
77
78   SMESHGUI_IdValidator myIDValidator;
79 };
80
81 //---------------------------------------------------------------------------------
82 /*!
83  * \brief Operation creating 0D elements on all nodes of given elements
84  */
85 class SMESHGUI_EXPORT SMESHGUI_Add0DElemsOnAllNodesOp : public SMESHGUI_SelectionOp
86 {
87   Q_OBJECT
88
89  public:
90   SMESHGUI_Add0DElemsOnAllNodesOp();
91   ~SMESHGUI_Add0DElemsOnAllNodesOp();
92
93   virtual LightApp_Dialog*       dlg() const { return myDlg; }
94   
95  protected:
96   virtual void                   startOperation();
97   virtual void                   selectionDone();
98   virtual SUIT_SelectionFilter*  createFilter( const int ) const;
99
100  protected slots:
101   virtual bool                   onApply();
102   void                           onSelTypeChange(int);
103   void                           onSetFilter();
104   virtual void                   onTextChanged( int, const QStringList& );
105   void                           updateButtons();
106
107  private:
108   SMESHGUI_Add0DElemsOnAllNodesDlg* myDlg;
109   SMESHGUI_FilterDlg*               myFilterDlg;
110   Handle(SALOME_InteractiveObject)  myIO;
111 };
112
113 #endif