Salome HOME
Update of CheckDone
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GroupOnShapeDlg.h
1 // Copyright (C) 2007-2020  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   //virtual bool                  isValid( SUIT_Operation* ) const;
62
63 private slots:
64
65     bool                        onApply();
66     void                        onButtonClick();
67
68
69 //     void                        onSelectColor();
70
71
72 private:
73
74     void                        init();
75 //     void                        setGroupColor( const SALOMEDS::Color& );
76 //     SALOMEDS::Color             getGroupColor() const;
77
78 //     void                        setGroupQColor( const QColor& );
79 //     QColor                      getGroupQColor() const;
80
81 //     void                        setDefaultGroupColor();
82
83 private:
84
85   SMESHGUI_GroupOnShapeDlg*     myDlg;
86
87   QString                       myMeshID;
88   QStringList                   myElemGeoIDs, myNodeGeoIDs;
89   //GEOM::ListOfGO_var            myElemGObj;
90 };
91
92 class SMESHGUI_EXPORT SMESHGUI_GroupOnShapeDlg : public SMESHGUI_Dialog
93 {
94     Q_OBJECT
95     
96 public:
97     SMESHGUI_GroupOnShapeDlg();
98     virtual ~SMESHGUI_GroupOnShapeDlg();
99
100 public slots:
101
102   void                          updateButtons();
103   void                          init();
104
105 private:
106
107   //QLineEdit*                    myGrpNameLine;
108
109   QPushButton*                  myMeshBtn;
110   QLineEdit*                    myMeshLine;
111
112   QPushButton*                  myElemGeomBtn;
113   QListWidget*                     myElemGeomList;
114
115   QPushButton*                  myNodeGeomBtn;
116   QListWidget*                     myNodeGeomList;
117
118 //   QPushButton*                  myColorBtn;
119
120 //   bool                          myCreate, myIsBusy;
121
122 //   QString                       myHelpFileName;
123
124   friend class SMESHGUI_GroupOnShapeOp;
125 };
126
127 #endif // SMESHGUI_GroupOnShapeDlg_H_H