Salome HOME
IPAL21120 SIGSEGV on Meshing attached Compound with Automatic Hexadralization
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_CreatePolyhedralVolumeDlg.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_CreatePolyhedralVolumeDlg.h
24 //  Author : Michael ZORIN
25 //  Module : SMESH
26 //  $Header: 
27 //
28 #ifndef DIALOGBOX_CREATEPOLYHEDRAL_H
29 #define DIALOGBOX_CREATEPOLYHEDRAL_H
30
31 #include "SMESH_SMESHGUI.hxx"
32
33 // QT Includes
34 #include <qdialog.h>
35
36 class QGridLayout; 
37 class QButtonGroup;
38 class QGroupBox;
39 class QListBox;
40 class QLabel;
41 class QLineEdit;
42 class QPushButton;
43 class QRadioButton;
44 class QCheckBox;
45 class SMESHGUI;
46 class SMESH_Actor;
47 class SVTK_Selector;
48 class SVTK_ViewWindow;
49 class LightApp_SelectionMgr;
50
51 namespace SMESH{
52   struct TPolySimulation;
53 }
54
55 // IDL Headers
56 #include <SALOMEconfig.h>
57 #include CORBA_SERVER_HEADER(SMESH_Mesh)
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*, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
69     ~SMESHGUI_CreatePolyhedralVolumeDlg();
70
71 private:
72
73     void Init() ;
74     void closeEvent( QCloseEvent* e ) ;
75     void enterEvent ( QEvent * ) ;                          /* mouse enter the QWidget */
76     void hideEvent ( QHideEvent * );                        /* ESC key */
77     void keyPressEvent( QKeyEvent* e );
78     int  GetConstructorId();
79     void displaySimulation();
80     
81     int checkEditLine(bool checkLast=true); /*! Checking for indices, return 1 if all ok, esle -1*/
82     
83     SMESHGUI*                     mySMESHGUI ;              /* Current SMESHGUI object */
84     LightApp_SelectionMgr*        mySelectionMgr ;             /* User shape selection */
85     SVTK_Selector*                mySelector;
86     QString                       myIDs;
87     int                           myNbOkElements ;            /* to check when elements are defined */
88
89     QLineEdit*                    myEditCurrentArgument;
90    
91     SMESH::SMESH_Mesh_var         myMesh;
92     SMESH_Actor*                  myActor;
93     SMESH::TPolySimulation*       mySimulation;
94     
95     QButtonGroup* GroupConstructors;
96     QRadioButton* RadioButton1;
97     QRadioButton* RadioButton2;
98     QCheckBox* Preview;
99     QGroupBox* GroupButtons;
100     QPushButton* buttonOk;
101     QPushButton* buttonCancel;
102     QPushButton* buttonApply;
103     QPushButton* buttonHelp;
104     QGroupBox* GroupContent;
105     QLabel* TextLabelIds;
106     QPushButton* SelectElementsButton;
107     QLineEdit* LineEditElements;
108     QListBox* myFacesByNodes;
109     QLabel* myFacesByNodesLabel;
110     QPushButton* AddButton;
111     QPushButton* RemoveButton;
112
113     QString myHelpFileName;
114        
115     public slots:
116
117     void onAdd();
118     void onRemove();
119
120     private slots:
121
122     void ConstructorsClicked(int constructorId);
123     void ClickOnPreview(bool theToggled);
124     void ClickOnOk();
125     void ClickOnCancel();
126     void ClickOnApply();
127     void ClickOnHelp();
128     void SetEditCurrentArgument() ;
129     void SelectionIntoArgument() ;
130     void DeactivateActiveDialog() ;
131     void ActivateThisDialog() ;
132     void onTextChange(const QString&);
133     void onListSelectionChanged();
134     
135 protected:
136     QGridLayout* SMESHGUI_CreatePolyhedralVolumeDlgLayout;
137     QGridLayout* GroupConstructorsLayout;
138     QGridLayout* GroupButtonsLayout;
139     QGridLayout* GroupContentLayout;
140 };
141
142 #endif // DIALOGBOX_CREATEPOLYHEDRAL_H