Salome HOME
remove images in ascii
[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 setSelectionMode(int theMode);
120     void updateButtons();
121
122     SMESHGUI*                     mySMESHGUI;              /* Current SMESHGUI object */
123     LightApp_SelectionMgr*        mySelectionMgr;          /* User shape selection */
124     SMESH_Actor*                  myActor;                 /* Current mesh actor */
125     int                           myGrpTypeId; /* Current group type id : standalone or group on geometry */
126     int                           myTypeId;                /* Current type id = radio button id */
127     QLineEdit*                    myCurrentLineEdit;       /* Current  LineEdit */
128     SVTK_Selector*                mySelector;
129
130     QPushButton*                  myMeshGroupBtn;
131     QLineEdit*                    myMeshGroupLine;
132     
133     QButtonGroup*                 myTypeGroup;
134     QLineEdit*                    myName;
135
136     QButtonGroup*                 myGrpTypeGroup;
137
138     QWidgetStack*                 myWGStack;
139     QListBox*                     myElements;
140     QPushButton*                  myFilter;
141
142     QCheckBox*                    mySelectSubMesh;
143     QPushButton*                  mySubMeshBtn;
144     QLineEdit*                    mySubMeshLine;
145
146     QCheckBox*                    mySelectGroup;
147     QPushButton*                  myGroupBtn;
148     QLineEdit*                    myGroupLine;
149
150     QCheckBox*                    mySelectColorGroup;
151     QtxIntSpinBox*                myColorSpinBox;
152
153     QCheckBox*                    mySelectGeomGroup;
154     QPushButton*                  myGeomGroupBtn;
155     QLineEdit*                    myGeomGroupLine;
156
157     SMESH::SMESH_Mesh_var         myMesh;
158     SMESH::SMESH_Group_var        myGroup;
159     SMESH::SMESH_GroupOnGeom_var  myGroupOnGeom;
160     QValueList<int>               myIdList;
161     GEOM::GEOM_Object_var         myGeomGroup;
162
163     int                           mySelectionMode;
164     //Handle(SMESH_TypeFilter)      myMeshFilter;
165     //Handle(SMESH_TypeFilter)      mySubMeshFilter;
166     //Handle(SMESH_TypeFilter)      myGroupFilter;
167     SUIT_SelectionFilter*         myMeshFilter;
168     SUIT_SelectionFilter*         mySubMeshFilter;
169     SUIT_SelectionFilter*         myGroupFilter;
170
171     SMESHGUI_FilterDlg*           myFilterDlg;
172
173     bool                          myCreate, myIsBusy;
174
175     QString                       myHelpFileName;
176 };
177
178 #endif // DIALOGBOX_GROUP_H