Salome HOME
Fix bug 12796: Warning missed for the bad file 'test18.med'
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GroupDlg.h
index b18abdfd1e6d43bed9e6902b4747d686afd54659..303c382235f5b8e0e7ff2bc3679ccd3ee5a8bddc 100644 (file)
@@ -16,7 +16,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.salome-platform.org or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -28,8 +28,9 @@
 #ifndef DIALOGBOX_GROUP_H
 #define DIALOGBOX_GROUP_H
 
-#include "SALOME_Selection.h"
-#include "SMESH_TypeFilter.hxx"
+#include "LightApp_SelectionMgr.h"
+//#include "SMESH_TypeFilter.hxx"
+#include "SUIT_SelectionFilter.h"
 
 // QT Includes
 #include <qdialog.h>
 
 class QLineEdit;
 class QButtonGroup;
+class QGroupBox;
 class QListBox;
 class QPushButton;
 class QCheckBox;
+class QWidgetStack;
+class QtxIntSpinBox;
 class SMESHGUI;
 class SMESH_Actor;
 class SMESHGUI_FilterDlg;
+class SVTK_Selector;
+class SVTK_ViewWindow;
 
 //=================================================================================
 // class    : SMESHGUI_GroupDlg
@@ -58,11 +64,14 @@ class SMESHGUI_GroupDlg : public QDialog
     Q_OBJECT
 
 public:
-    SMESHGUI_GroupDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* theSel = 0, 
+    SMESHGUI_GroupDlg( SMESHGUI*,
+                      const char* name = 0, 
                       SMESH::SMESH_Mesh_ptr theMesh = SMESH::SMESH_Mesh::_nil(), 
                       bool modal = FALSE, WFlags fl = 0 );
-    SMESHGUI_GroupDlg( QWidget* parent, const char* name, SALOME_Selection* theSel, 
-                      SMESH::SMESH_Group_ptr theGroup, bool modal = FALSE, WFlags fl = 0 );
+    SMESHGUI_GroupDlg( SMESHGUI*,
+                      const char* name, 
+                      SMESH::SMESH_GroupBase_ptr theGroup,
+                      bool modal = FALSE, WFlags fl = 0 );
     ~SMESHGUI_GroupDlg();
 
 public slots:
@@ -74,39 +83,58 @@ public slots:
 private slots:
 
     void onTypeChanged(int id);
+    void onGrpTypeChanged(int id);
 
     void onOK();
     void onClose();
     bool onApply();
+    void onHelp();
+    void onDeactivate();
 
     void onListSelectionChanged();
     void onObjectSelectionChanged();
 
     void onSelectSubMesh(bool on);
     void onSelectGroup(bool on);
+    void onSelectGeomGroup(bool on);
+    void onSelectColorGroup(bool on);
     void setCurrentSelection();
 
     void setFilters();
     void onSort();
 
     void onNameChanged(const QString& text);
+    void onNbColorsChanged(const QString& text);
+    void onFilterAccepted();
 
 private:
-    void initDialog(SALOME_Selection* theSel, bool create);
+    void initDialog(bool create);
     void init(SMESH::SMESH_Mesh_ptr theMesh);
-    void init(SMESH::SMESH_Group_ptr theGroup);
+    void init(SMESH::SMESH_GroupBase_ptr theGroup);
     void closeEvent(QCloseEvent* e);
+    void enterEvent (QEvent*);
+    void hideEvent (QHideEvent*);                          /* ESC key */
+    void keyPressEvent(QKeyEvent*);
     void setSelectionMode(int theMode);
     void updateButtons();
 
-    SMESHGUI*                     mySMESHGUI ;              /* Current SMESHGUI object */
-    SALOME_Selection*             mySelection ;             /* User shape selection */
-    SMESH_Actor*                  myActor;                  /* Current mesh actor */
-    int                           myTypeId ;                /* Current type id = radio button id */
-    QLineEdit*                    myCurrentLineEdit;        /* Current  LineEdit */
-
+    SMESHGUI*                     mySMESHGUI;              /* Current SMESHGUI object */
+    LightApp_SelectionMgr*        mySelectionMgr;          /* User shape selection */
+    SMESH_Actor*                  myActor;                 /* Current mesh actor */
+    int                           myGrpTypeId; /* Current group type id : standalone or group on geometry */
+    int                           myTypeId;                /* Current type id = radio button id */
+    QLineEdit*                    myCurrentLineEdit;       /* Current  LineEdit */
+    SVTK_Selector*                mySelector;
+
+    QPushButton*                  myMeshGroupBtn;
+    QLineEdit*                    myMeshGroupLine;
+    
     QButtonGroup*                 myTypeGroup;
     QLineEdit*                    myName;
+
+    QButtonGroup*                 myGrpTypeGroup;
+
+    QWidgetStack*                 myWGStack;
     QListBox*                     myElements;
     QPushButton*                  myFilter;
 
@@ -118,15 +146,32 @@ private:
     QPushButton*                  myGroupBtn;
     QLineEdit*                    myGroupLine;
 
+    QCheckBox*                    mySelectColorGroup;
+    QtxIntSpinBox*                myColorSpinBox;
+
+    QCheckBox*                    mySelectGeomGroup;
+    QPushButton*                  myGeomGroupBtn;
+    QLineEdit*                    myGeomGroupLine;
+
     SMESH::SMESH_Mesh_var         myMesh;
     SMESH::SMESH_Group_var        myGroup;
+    SMESH::SMESH_GroupOnGeom_var  myGroupOnGeom;
     QValueList<int>               myIdList;
+    GEOM::GEOM_Object_var         myGeomGroup;
 
     int                           mySelectionMode;
-    Handle(SMESH_TypeFilter)      mySubMeshFilter;
-    Handle(SMESH_TypeFilter)      myGroupFilter;
+    //Handle(SMESH_TypeFilter)      myMeshFilter;
+    //Handle(SMESH_TypeFilter)      mySubMeshFilter;
+    //Handle(SMESH_TypeFilter)      myGroupFilter;
+    SUIT_SelectionFilter*         myMeshFilter;
+    SUIT_SelectionFilter*         mySubMeshFilter;
+    SUIT_SelectionFilter*         myGroupFilter;
 
     SMESHGUI_FilterDlg*           myFilterDlg;
+
+    bool                          myCreate, myIsBusy;
+
+    QString                       myHelpFileName;
 };
 
 #endif // DIALOGBOX_GROUP_H