Salome HOME
PAL19321 Problem of Create Group for volumes
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GroupDlg.h
index af101fcff616ff15cad0dce323e0096c718ce40d..69c69485ce434676f7599c913771e1669640e478 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,6 +28,8 @@
 #ifndef DIALOGBOX_GROUP_H
 #define DIALOGBOX_GROUP_H
 
+#include "SMESH_SMESHGUI.hxx"
+
 #include "LightApp_SelectionMgr.h"
 //#include "SMESH_TypeFilter.hxx"
 #include "SUIT_SelectionFilter.h"
@@ -45,12 +47,17 @@ 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;
 
@@ -58,7 +65,7 @@ class SVTK_ViewWindow;
 // class    : SMESHGUI_GroupDlg
 // purpose  :
 //=================================================================================
-class SMESHGUI_GroupDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
 { 
     Q_OBJECT
 
@@ -69,10 +76,12 @@ public:
                       bool modal = FALSE, WFlags fl = 0 );
     SMESHGUI_GroupDlg( SMESHGUI*,
                       const char* name, 
-                      SMESH::SMESH_Group_ptr theGroup,
+                      SMESH::SMESH_GroupBase_ptr theGroup,
                       bool modal = FALSE, WFlags fl = 0 );
     ~SMESHGUI_GroupDlg();
 
+    static QString GetDefaultName(const QString& theOperation);
+
 public slots:
 
     void onAdd();
@@ -87,6 +96,7 @@ private slots:
     void onOK();
     void onClose();
     bool onApply();
+    void onHelp();
     void onDeactivate();
 
     void onListSelectionChanged();
@@ -103,21 +113,42 @@ 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(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();
+    void updateGeomPopup();
+    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 */
     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;
 
@@ -126,6 +157,7 @@ private:
     
     QButtonGroup*                 myTypeGroup;
     QLineEdit*                    myName;
+    QString                       myOldName;
 
     QButtonGroup*                 myGrpTypeGroup;
 
@@ -141,14 +173,20 @@ 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;
@@ -157,10 +195,13 @@ private:
     SUIT_SelectionFilter*         myMeshFilter;
     SUIT_SelectionFilter*         mySubMeshFilter;
     SUIT_SelectionFilter*         myGroupFilter;
+    SUIT_SelectionFilter*         myGeomFilter;
 
     SMESHGUI_FilterDlg*           myFilterDlg;
 
     bool                          myCreate, myIsBusy;
+
+    QString                       myHelpFileName;
 };
 
 #endif // DIALOGBOX_GROUP_H