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 "LightApp_SelectionMgr.h"
33 // //#include "SMESH_TypeFilter.hxx"
34 // #include "SUIT_SelectionFilter.h"
35 #include "SMESHGUI_SelectionOp.h"
36
37 // // QT Includes
38 // #include <qdialog.h>
39 // #include <qvaluelist.h>
40
41 class QLineEdit;
42 class QButtonGroup;
43 class QGroupBox;
44 class QListBox;
45 class QPopupMenu;
46 class QPushButton;
47 class QToolButton;
48 class QCheckBox;
49 class QWidgetStack;
50 class QtxIntSpinBox;
51 class SMESHGUI;
52 class SMESH_Actor;
53 class SMESHGUI_FilterDlg;
54 class SMESHGUI_ShapeByMeshOp;
55 class SUIT_Operation;
56 class SVTK_Selector;
57 class SVTK_ViewWindow;
58 class SMESHGUI_GroupOnShapeDlg;
59
60 //=================================================================================
61 // class    : SMESHGUI_GroupOnShapeOp
62 // purpose  : create groups on shapes of nodes and element at once, Issue 19970
63 //=================================================================================
64
65 class SMESHGUI_EXPORT SMESHGUI_GroupOnShapeOp : public SMESHGUI_SelectionOp
66 {
67     Q_OBJECT
68
69 public:
70     SMESHGUI_GroupOnShapeOp();
71     ~SMESHGUI_GroupOnShapeOp();
72
73     virtual LightApp_Dialog*    dlg() const;  
74     static QString              GetDefaultName(const QString& theOperation);
75
76 public slots:
77
78 protected:
79   
80   virtual void                  startOperation();
81   virtual void                  selectionDone();
82   virtual SUIT_SelectionFilter* createFilter( const int ) const;
83   //virtual bool                  isValid( SUIT_Operation* ) const;
84
85 private slots:
86
87     bool                        onApply();
88     void                        onButtonClick();
89
90   //void                        onSelectColor();
91
92 private:
93
94     void                        init();
95     void                        setGroupColor( const SALOMEDS::Color& );
96     SALOMEDS::Color             getGroupColor() const;
97
98     void                        setGroupQColor( const QColor& );
99     QColor                      getGroupQColor() const;
100
101     void                        setDefaultGroupColor();
102
103 private:
104
105   SMESHGUI_GroupOnShapeDlg*     myDlg;
106
107   QString                       myMeshID;
108   QStringList                   myElemGeoIDs, myNodeGeoIDs;
109   //GEOM::ListOfGO_var            myElemGObj;
110 };
111
112 class SMESHGUI_EXPORT SMESHGUI_GroupOnShapeDlg : public SMESHGUI_Dialog
113 {
114     Q_OBJECT
115     
116 public:
117     SMESHGUI_GroupOnShapeDlg();
118
119 public slots:
120
121   void                          updateButtons();
122   void                          init();
123
124 private:
125
126   //QLineEdit*                    myGrpNameLine;
127
128   QPushButton*                  myMeshBtn;
129   QLineEdit*                    myMeshLine;
130
131   QPushButton*                  myElemGeomBtn;
132   QListBox*                     myElemGeomList;
133
134   QPushButton*                  myNodeGeomBtn;
135   QListBox*                     myNodeGeomList;
136
137 //   QPushButton*                  myColorBtn;
138
139 //   bool                          myCreate, myIsBusy;
140
141 //   QString                       myHelpFileName;
142
143   friend class SMESHGUI_GroupOnShapeOp;
144 };
145
146 #endif // SMESHGUI_GroupOnShapeDlg_H_H