Salome HOME
Merge from BR_phase16 branch (09/12/09)
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GroupOnShapeDlg.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SMESH SMESHGUI : GUI for SMESH component
23 //  File   : SMESHGUI_GroupOnShapeDlg.h
24 //  Author : Edard AGAPOV
25 //  Module : SMESH
26 //
27 #ifndef SMESHGUI_GroupOnShapeDlg_H_H
28 #define SMESHGUI_GroupOnShapeDlg_H_H
29
30 #include "SMESH_SMESHGUI.hxx"
31
32 #include "SMESHGUI_SelectionOp.h"
33
34 class QLineEdit;
35 class QListWidget;
36 class QPushButton;
37 class SMESHGUI_GroupOnShapeDlg;
38
39 //=================================================================================
40 // class    : SMESHGUI_GroupOnShapeOp
41 // purpose  : create groups on shapes of nodes and element at once, Issue 19970
42 //=================================================================================
43
44 class SMESHGUI_EXPORT SMESHGUI_GroupOnShapeOp : public SMESHGUI_SelectionOp
45 {
46     Q_OBJECT
47
48 public:
49     SMESHGUI_GroupOnShapeOp();
50     ~SMESHGUI_GroupOnShapeOp();
51
52     virtual LightApp_Dialog*    dlg() const;  
53     static QString              GetDefaultName(const QString& theOperation);
54
55 public slots:
56
57 protected:
58   
59   virtual void                  startOperation();
60   virtual void                  selectionDone();
61   virtual SUIT_SelectionFilter* createFilter( const int ) const;
62   //virtual bool                  isValid( SUIT_Operation* ) const;
63
64 private slots:
65
66     bool                        onApply();
67     void                        onButtonClick();
68
69
70 //     void                        onSelectColor();
71
72
73 private:
74
75     void                        init();
76 //     void                        setGroupColor( const SALOMEDS::Color& );
77 //     SALOMEDS::Color             getGroupColor() const;
78
79 //     void                        setGroupQColor( const QColor& );
80 //     QColor                      getGroupQColor() const;
81
82 //     void                        setDefaultGroupColor();
83
84 private:
85
86   SMESHGUI_GroupOnShapeDlg*     myDlg;
87
88   QString                       myMeshID;
89   QStringList                   myElemGeoIDs, myNodeGeoIDs;
90   //GEOM::ListOfGO_var            myElemGObj;
91 };
92
93 class SMESHGUI_EXPORT SMESHGUI_GroupOnShapeDlg : public SMESHGUI_Dialog
94 {
95     Q_OBJECT
96     
97 public:
98     SMESHGUI_GroupOnShapeDlg();
99     virtual ~SMESHGUI_GroupOnShapeDlg();
100
101 public slots:
102
103   void                          updateButtons();
104   void                          init();
105
106 private:
107
108   //QLineEdit*                    myGrpNameLine;
109
110   QPushButton*                  myMeshBtn;
111   QLineEdit*                    myMeshLine;
112
113   QPushButton*                  myElemGeomBtn;
114   QListWidget*                     myElemGeomList;
115
116   QPushButton*                  myNodeGeomBtn;
117   QListWidget*                     myNodeGeomList;
118
119 //   QPushButton*                  myColorBtn;
120
121 //   bool                          myCreate, myIsBusy;
122
123 //   QString                       myHelpFileName;
124
125   friend class SMESHGUI_GroupOnShapeOp;
126 };
127
128 #endif // SMESHGUI_GroupOnShapeDlg_H_H