Salome HOME
0019970: create groups automatically
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GroupOnShapeDlg.h
1 //  SMESH SMESHGUI : GUI for SMESH component
2 //
3 //  Copyright (C) 2003  CEA
4 // 
5 //  This library is free software; you can redistribute it and/or 
6 //  modify it under the terms of the GNU Lesser General Public 
7 //  License as published by the Free Software Foundation; either 
8 //  version 2.1 of the License. 
9 // 
10 //  This library is distributed in the hope that it will be useful, 
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
13 //  Lesser General Public License for more details. 
14 // 
15 //  You should have received a copy of the GNU Lesser General Public 
16 //  License along with this library; if not, write to the Free Software 
17 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
18 // 
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 //
21 //
22 //
23 //  File   : SMESHGUI_GroupOnShapeDlg.h
24 //  Author : Edard AGAPOV
25 //  Module : SMESH
26
27 #ifndef SMESHGUI_GroupOnShapeDlg_H_H
28 #define SMESHGUI_GroupOnShapeDlg_H_H
29
30 #include "SMESH_SMESHGUI.hxx"
31
32 #include "SMESHGUI_SelectionOp.h"
33
34 class QLineEdit;
35 class QListWidget;
36 class QPushButton;
37 class SMESHGUI_GroupOnShapeDlg;
38
39 //=================================================================================
40 // class    : SMESHGUI_GroupOnShapeOp
41 // purpose  : create groups on shapes of nodes and element at once, Issue 19970
42 //=================================================================================
43
44 class SMESHGUI_EXPORT SMESHGUI_GroupOnShapeOp : public SMESHGUI_SelectionOp
45 {
46     Q_OBJECT
47
48 public:
49     SMESHGUI_GroupOnShapeOp();
50     ~SMESHGUI_GroupOnShapeOp();
51
52     virtual LightApp_Dialog*    dlg() const;  
53     static QString              GetDefaultName(const QString& theOperation);
54
55 public slots:
56
57 protected:
58   
59   virtual void                  startOperation();
60   virtual void                  selectionDone();
61   virtual SUIT_SelectionFilter* createFilter( const int ) const;
62   //virtual bool                  isValid( SUIT_Operation* ) const;
63
64 private slots:
65
66     bool                        onApply();
67     void                        onButtonClick();
68
69
70     void                        onSelectColor();
71     void                        onAdd();
72     void                        onRemove();
73
74
75 private:
76
77     void                        init();
78 //     void                        setGroupColor( const SALOMEDS::Color& );
79 //     SALOMEDS::Color             getGroupColor() const;
80
81 //     void                        setGroupQColor( const QColor& );
82 //     QColor                      getGroupQColor() const;
83
84 //     void                        setDefaultGroupColor();
85
86 private:
87
88   SMESHGUI_GroupOnShapeDlg*     myDlg;
89
90   QString                       myMeshID;
91   QStringList                   myElemGeoIDs, myNodeGeoIDs;
92   //GEOM::ListOfGO_var            myElemGObj;
93 };
94
95 class SMESHGUI_EXPORT SMESHGUI_GroupOnShapeDlg : public SMESHGUI_Dialog
96 {
97     Q_OBJECT
98     
99 public:
100     SMESHGUI_GroupOnShapeDlg();
101     virtual ~SMESHGUI_GroupOnShapeDlg();
102
103 public slots:
104
105   void                          updateButtons();
106   void                          init();
107
108 private:
109
110   QLineEdit*                    myGrpNameLine;
111
112   QPushButton*                  myMeshBtn;
113   QLineEdit*                    myMeshLine;
114
115   QPushButton*                  myElemGeomBtn;
116   QListWidget*                     myElemGeomList;
117
118   QPushButton*                  myNodeGeomBtn;
119   QListWidget*                     myNodeGeomList;
120
121 //   QPushButton*                  myColorBtn;
122
123 //   bool                          myCreate, myIsBusy;
124
125 //   QString                       myHelpFileName;
126
127   friend class SMESHGUI_GroupOnShapeOp;
128 };
129
130 #endif // SMESHGUI_GroupOnShapeDlg_H_H