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