]> SALOME platform Git repositories - modules/smesh.git/blob - src/SMESHGUI/SMESHGUI_GroupDlg.h
Salome HOME
Roolback last changes
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GroupDlg.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_GroupDlg.h
24 //  Author : Natalia KOPNOVA
25 //  Module : SMESH
26 //  $Header$
27
28 #ifndef DIALOGBOX_GROUP_H
29 #define DIALOGBOX_GROUP_H
30
31 #include "SMESH_SMESHGUI.hxx"
32
33 #include "LightApp_SelectionMgr.h"
34 //#include "SMESH_TypeFilter.hxx"
35 #include "SUIT_SelectionFilter.h"
36
37 // QT Includes
38 #include <qdialog.h>
39 #include <qvaluelist.h>
40
41 // IDL Headers
42 #include <SALOMEconfig.h>
43 #include CORBA_SERVER_HEADER(SMESH_Mesh)
44 #include CORBA_SERVER_HEADER(SMESH_Group)
45
46 class QLineEdit;
47 class QButtonGroup;
48 class QGroupBox;
49 class QListBox;
50 class QPushButton;
51 class QCheckBox;
52 class QWidgetStack;
53 class QtxIntSpinBox;
54 class SMESHGUI;
55 class SMESH_Actor;
56 class SMESHGUI_FilterDlg;
57 class SVTK_Selector;
58 class SVTK_ViewWindow;
59
60 //=================================================================================
61 // class    : SMESHGUI_GroupDlg
62 // purpose  :
63 //=================================================================================
64 class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
65
66     Q_OBJECT
67
68 public:
69     SMESHGUI_GroupDlg( SMESHGUI*,
70                        const char* name = 0, 
71                        SMESH::SMESH_Mesh_ptr theMesh = SMESH::SMESH_Mesh::_nil(), 
72                        bool modal = FALSE, WFlags fl = 0 );
73     SMESHGUI_GroupDlg( SMESHGUI*,
74                        const char* name, 
75                        SMESH::SMESH_GroupBase_ptr theGroup,
76                        bool modal = FALSE, WFlags fl = 0 );
77     ~SMESHGUI_GroupDlg();
78
79 public slots:
80
81     void onAdd();
82     void onRemove();
83
84
85 private slots:
86
87     void onTypeChanged(int id);
88     void onGrpTypeChanged(int id);
89
90     void onOK();
91     void onClose();
92     bool onApply();
93     void onHelp();
94     void onDeactivate();
95
96     void onListSelectionChanged();
97     void onObjectSelectionChanged();
98
99     void onSelectSubMesh(bool on);
100     void onSelectGroup(bool on);
101     void onSelectGeomGroup(bool on);
102     void onSelectColorGroup(bool on);
103     void setCurrentSelection();
104
105     void setFilters();
106     void onSort();
107
108     void onNameChanged(const QString& text);
109     void onNbColorsChanged(const QString& text);
110     void onFilterAccepted();
111
112 private:
113     void initDialog(bool create);
114     void init(SMESH::SMESH_Mesh_ptr theMesh);
115     void init(SMESH::SMESH_GroupBase_ptr theGroup);
116     void closeEvent(QCloseEvent* e);
117     void enterEvent (QEvent*);
118     void hideEvent (QHideEvent*);                          /* ESC key */
119     void keyPressEvent(QKeyEvent*);
120     void setSelectionMode(int theMode);
121     void updateButtons();
122
123     SMESHGUI*                     mySMESHGUI;              /* Current SMESHGUI object */
124     LightApp_SelectionMgr*        mySelectionMgr;          /* User shape selection */
125     SMESH_Actor*                  myActor;                 /* Current mesh actor */
126     int                           myGrpTypeId; /* Current group type id : standalone or group on geometry */
127     int                           myTypeId;                /* Current type id = radio button id */
128     QLineEdit*                    myCurrentLineEdit;       /* Current  LineEdit */
129     SVTK_Selector*                mySelector;
130
131     QPushButton*                  myMeshGroupBtn;
132     QLineEdit*                    myMeshGroupLine;
133     
134     QButtonGroup*                 myTypeGroup;
135     QLineEdit*                    myName;
136
137     QButtonGroup*                 myGrpTypeGroup;
138
139     QWidgetStack*                 myWGStack;
140     QListBox*                     myElements;
141     QPushButton*                  myFilter;
142
143     QCheckBox*                    mySelectSubMesh;
144     QPushButton*                  mySubMeshBtn;
145     QLineEdit*                    mySubMeshLine;
146
147     QCheckBox*                    mySelectGroup;
148     QPushButton*                  myGroupBtn;
149     QLineEdit*                    myGroupLine;
150
151     QCheckBox*                    mySelectColorGroup;
152     QtxIntSpinBox*                myColorSpinBox;
153
154     QCheckBox*                    mySelectGeomGroup;
155     QPushButton*                  myGeomGroupBtn;
156     QLineEdit*                    myGeomGroupLine;
157
158     SMESH::SMESH_Mesh_var         myMesh;
159     SMESH::SMESH_Group_var        myGroup;
160     SMESH::SMESH_GroupOnGeom_var  myGroupOnGeom;
161     QValueList<int>               myIdList;
162     GEOM::GEOM_Object_var         myGeomGroup;
163
164     int                           mySelectionMode;
165     //Handle(SMESH_TypeFilter)      myMeshFilter;
166     //Handle(SMESH_TypeFilter)      mySubMeshFilter;
167     //Handle(SMESH_TypeFilter)      myGroupFilter;
168     SUIT_SelectionFilter*         myMeshFilter;
169     SUIT_SelectionFilter*         mySubMeshFilter;
170     SUIT_SelectionFilter*         myGroupFilter;
171
172     SMESHGUI_FilterDlg*           myFilterDlg;
173
174     bool                          myCreate, myIsBusy;
175
176     QString                       myHelpFileName;
177 };
178
179 #endif // DIALOGBOX_GROUP_H