Salome HOME
Merge from V6_5_BR 05/06/2012
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_CreatePolyhedralVolumeDlg.h
1 // Copyright (C) 2007-2012  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
23 // SMESH SMESHGUI : GUI for SMESH component
24 // File   : SMESHGUI_CreatePolyhedralVolumeDlg.h
25 // Author : Michael ZORIN, Open CASCADE S.A.S.
26 //
27 #ifndef SMESHGUI_CREATEPOLYHEDRALVOLUMEDLG_H
28 #define SMESHGUI_CREATEPOLYHEDRALVOLUMEDLG_H
29
30 // SMESH includes
31 #include "SMESH_SMESHGUI.hxx"
32
33 // Qt includes
34 #include <QDialog>
35
36 // IDL includes
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(SMESH_Mesh)
39
40 class QButtonGroup;
41 class QComboBox;
42 class QGroupBox;
43 class QListWidget;
44 class QLabel;
45 class QLineEdit;
46 class QPushButton;
47 class QRadioButton;
48 class QCheckBox;
49 class SMESHGUI;
50 class SMESH_Actor;
51 class SVTK_Selector;
52 class LightApp_SelectionMgr;
53
54 namespace SMESH
55 {
56   struct TPolySimulation;
57 }
58
59 //=================================================================================
60 // class    : SMESHGUI_CreatePolyhedralVolumeDlg
61 // purpose  :
62 //=================================================================================
63 class SMESHGUI_EXPORT SMESHGUI_CreatePolyhedralVolumeDlg : public QDialog
64
65   Q_OBJECT
66
67 public:
68   SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI* );
69   ~SMESHGUI_CreatePolyhedralVolumeDlg();
70
71 private:
72   typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
73
74   void                     Init();
75   void                     closeEvent( QCloseEvent* );
76   void                     enterEvent( QEvent* );          /* mouse enter the QWidget */
77   void                     hideEvent( QHideEvent* );       /* ESC key */
78   void                     keyPressEvent( QKeyEvent* );
79   int                      GetConstructorId();
80   void                     displaySimulation();
81     
82   bool                     isValid();
83   
84   int                      checkEditLine( bool = true ); /*! Checking for indices, return 1 if all ok, esle -1*/
85     
86   SMESHGUI*                mySMESHGUI;                   /* Current SMESHGUI object */
87   LightApp_SelectionMgr*   mySelectionMgr;               /* User shape selection */
88   SVTK_Selector*           mySelector;
89   QString                  myIDs;
90   int                      myNbOkElements;               /* to check when elements are defined */
91
92   QLineEdit*               myEditCurrentArgument;
93    
94   SMESH::SMESH_Mesh_var    myMesh;
95   SMESH_Actor*             myActor;
96   SMESH::TPolySimulation*  mySimulation;
97   QString                  myEntry;
98   GrpList                  myGroups;
99   
100   QGroupBox*               ConstructorsBox;
101   QButtonGroup*            GroupConstructors;
102   QRadioButton*            RadioButton1;
103   QRadioButton*            RadioButton2;
104   QCheckBox*               Preview;
105   QGroupBox*               GroupGroups;
106   QLabel*                  TextLabel_GroupName;
107   QComboBox*               ComboBox_GroupName;
108   QGroupBox*               GroupButtons;
109   QPushButton*             buttonOk;
110   QPushButton*             buttonCancel;
111   QPushButton*             buttonApply;
112   QPushButton*             buttonHelp;
113   QGroupBox*               GroupContent;
114   QLabel*                  TextLabelIds;
115   QPushButton*             SelectElementsButton;
116   QLineEdit*               LineEditElements;
117   QListWidget*             myFacesByNodes;
118   QLabel*                  myFacesByNodesLabel;
119   QPushButton*             AddButton;
120   QPushButton*             RemoveButton;
121
122   QString                  myHelpFileName;
123        
124 public slots:
125   void                     onAdd();
126   void                     onRemove();
127
128 private slots:
129   void                     ConstructorsClicked( int );
130   void                     ClickOnPreview( bool );
131   void                     ClickOnOk();
132   void                     ClickOnCancel();
133   void                     ClickOnApply();
134   void                     ClickOnHelp();
135   void                     SetEditCurrentArgument();
136   void                     SelectionIntoArgument();
137   void                     DeactivateActiveDialog();
138   void                     ActivateThisDialog();
139   void                     onTextChange( const QString& );
140   void                     onListSelectionChanged();
141 };
142
143 #endif // SMESHGUI_CREATEPOLYHEDRALVOLUMEDLG_H