Salome HOME
IPAL21120 SIGSEGV on Meshing attached Compound with Automatic Hexadralization
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GroupDlg.h
index 9c19f9563396b340047379c0bf26fd8649daae31..29c943f29894b5c7ae12e813b9c9f237a44f8626 100644 (file)
@@ -1,35 +1,38 @@
-//  SMESH SMESHGUI : GUI for SMESH component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  CEA
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  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 
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  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.com
 //
+//  SMESH SMESHGUI : GUI for SMESH component
 //  File   : SMESHGUI_GroupDlg.h
 //  Author : Natalia KOPNOVA
 //  Module : SMESH
 //  $Header$
-
+//
 #ifndef DIALOGBOX_GROUP_H
 #define DIALOGBOX_GROUP_H
 
-#include "SALOME_Selection.h"
-#include "SMESH_TypeFilter.hxx"
+#include "SMESH_SMESHGUI.hxx"
+
+#include "LightApp_SelectionMgr.h"
+//#include "SMESH_TypeFilter.hxx"
+#include "SUIT_SelectionFilter.h"
 
 // QT Includes
 #include <qdialog.h>
@@ -44,29 +47,41 @@ class QLineEdit;
 class QButtonGroup;
 class QGroupBox;
 class QListBox;
+class QPopupMenu;
 class QPushButton;
+class QToolButton;
 class QCheckBox;
 class QWidgetStack;
+class QtxIntSpinBox;
 class SMESHGUI;
 class SMESH_Actor;
 class SMESHGUI_FilterDlg;
+class SMESHGUI_ShapeByMeshOp;
+class SUIT_Operation;
+class SVTK_Selector;
+class SVTK_ViewWindow;
 
 //=================================================================================
 // class    : SMESHGUI_GroupDlg
 // purpose  :
 //=================================================================================
-class SMESHGUI_GroupDlg : public QDialog
+class SMESHGUI_EXPORT 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();
 
+    static QString GetDefaultName(const QString& theOperation);
+
 public slots:
 
     void onAdd();
@@ -81,6 +96,7 @@ private slots:
     void onOK();
     void onClose();
     bool onApply();
+    void onHelp();
     void onDeactivate();
 
     void onListSelectionChanged();
@@ -97,28 +113,52 @@ private slots:
     void onNameChanged(const QString& text);
     void onFilterAccepted();
 
+    void onSelectColor();
+
+    void onGeomPopup( int );
+    void onGeomSelectionButton( bool );
+
+    void onPublishShapeByMeshDlg(SUIT_Operation*);
+    void onCloseShapeByMeshDlg(SUIT_Operation*);
+
 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 enterEvent (QEvent*);
+    void hideEvent (QHideEvent*);                          /* ESC key */
+    void keyPressEvent(QKeyEvent*);
     void setSelectionMode(int theMode);
     void updateButtons();
+    void updateGeomPopup();
+    bool SetAppropriateActor();
+    void setShowEntityMode();
+    void restoreShowEntityMode();
+
+    void                          setGroupColor( const SALOMEDS::Color& );
+    SALOMEDS::Color               getGroupColor() const;
+
+    void                          setGroupQColor( const QColor& );
+    QColor                        getGroupQColor() const;
+
+    void                          setDefaultGroupColor();
 
-    SMESHGUI*                     mySMESHGUI ;              /* Current SMESHGUI object */
-    SALOME_Selection*             mySelection ;             /* 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 */
+    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 */
+    int                           myStoredShownEntity;     /* Store ShowEntity mode of myMesh */
+    QLineEdit*                    myCurrentLineEdit;       /* Current  LineEdit */
+    SVTK_Selector*                mySelector;
 
     QPushButton*                  myMeshGroupBtn;
     QLineEdit*                    myMeshGroupLine;
     
     QButtonGroup*                 myTypeGroup;
     QLineEdit*                    myName;
+    QString                       myOldName;
 
     QButtonGroup*                 myGrpTypeGroup;
 
@@ -134,23 +174,37 @@ private:
     QPushButton*                  myGroupBtn;
     QLineEdit*                    myGroupLine;
 
+    QPushButton*                  myColorBtn;
+
     QCheckBox*                    mySelectGeomGroup;
-    QPushButton*                  myGeomGroupBtn;
+    QToolButton*                  myGeomGroupBtn;
     QLineEdit*                    myGeomGroupLine;
+    QPopupMenu*                   myGeomPopup;
+
+    SMESHGUI_ShapeByMeshOp*       myShapeByMeshOp;
 
     SMESH::SMESH_Mesh_var         myMesh;
     SMESH::SMESH_Group_var        myGroup;
+    SMESH::SMESH_GroupOnGeom_var  myGroupOnGeom;
     QValueList<int>               myIdList;
-    GEOM::GEOM_Object_var         myGeomGroup;
+    GEOM::ListOfGO_var            myGeomObjects;
 
     int                           mySelectionMode;
-    Handle(SMESH_TypeFilter)      myMeshFilter;
-    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;
+    SUIT_SelectionFilter*         myGeomFilter;
 
     SMESHGUI_FilterDlg*           myFilterDlg;
 
-    bool                          myCreate;
+    bool                          myCreate, myIsBusy;
+
+    QString                       myHelpFileName;
+
+    bool                          myNameChanged; //added by skl for IPAL19574
 };
 
 #endif // DIALOGBOX_GROUP_H