1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SMESHGUI_MeshPatternDlg.h
23 // Author : Sergey LITONIN
27 #ifndef SMESHGUI_MeshPatternDlg_H
28 #define SMESHGUI_MeshPatternDlg_H
30 #include "SMESH_SMESHGUI.hxx"
35 #include <SALOMEconfig.h>
36 #include CORBA_SERVER_HEADER(GEOM_Gen)
37 #include CORBA_SERVER_HEADER(SMESH_Mesh)
38 #include CORBA_SERVER_HEADER(SMESH_Pattern)
43 class SMESHGUI_SpinBox;
45 class LightApp_SelectionMgr;
52 class SMESHGUI_CreatePatternDlg;
53 class SMESHGUI_PatternWidget;
54 class vtkUnstructuredGrid;
56 class SVTK_ViewWindow;
61 Class : SMESHGUI_MeshPatternDlg
62 Description : Dialog to specify filters for VTK viewer
65 class SMESHGUI_EXPORT SMESHGUI_MeshPatternDlg : public QDialog
70 enum { Type_2d, Type_3d };
73 enum { Mesh, Object, Vertex1, Vertex2, Ids };
76 SMESHGUI_MeshPatternDlg( SMESHGUI*,
78 virtual ~SMESHGUI_MeshPatternDlg();
91 void onSelectionDone();
92 void onSelInputChanged();
94 void onTypeChanged( int );
95 void onModeToggled( bool );
98 void onReverse( bool );
99 void onPreview( bool );
100 void onOkCreationDlg();
101 void onCloseCreationDlg();
102 void onTextChanged( const QString& );
103 void onNodeChanged( int value );
107 QFrame* createButtonFrame( QWidget* );
108 QFrame* createMainFrame ( QWidget* );
109 void displayPreview();
110 vtkUnstructuredGrid* getGrid();
112 void updateWgState();
113 bool loadFromFile( const QString& );
114 void activateSelection();
115 QStringList prepareFilters() const;
116 QString autoExtension( const QString& theFileName ) const;
117 void closeEvent( QCloseEvent* e ) ;
118 void enterEvent ( QEvent * ) ;
119 void keyPressEvent(QKeyEvent*);
120 bool isValid( const bool theMess = true );
121 void resetSelInput();
122 bool isRefine() const;
124 bool getIds( QValueList<int>& ) const;
125 int getNode( bool = false ) const;
129 QPushButton* myOkBtn;
130 QPushButton* myApplyBtn;
131 QPushButton* myCloseBtn;
132 QPushButton* myHelpBtn;
134 QButtonGroup* myTypeGrp;
135 QRadioButton* mySwitch2d;
136 QRadioButton* mySwitch3d;
145 QGroupBox* myGeomGrp;
146 QMap< int, QPushButton* > mySelBtn;
147 QMap< int, QLineEdit* > mySelEdit;
148 QMap< int, QLabel* > mySelLbl;
151 QPushButton* myOpenBtn;
152 QPushButton* myNewBtn;
154 QCheckBox* myReverseChk;
155 QCheckBox* myCreatePolygonsChk;
156 QCheckBox* myCreatePolyedrsChk;
157 SMESHGUI_PatternWidget* myPicture2d;
161 QCheckBox* myPreviewChk;
163 SMESHGUI* mySMESHGUI;
164 SVTK_Selector* mySelector;
165 LightApp_SelectionMgr* mySelectionMgr;
169 bool myIsCreateDlgOpen;
172 SMESH::SMESH_Mesh_var myMesh;
173 GEOM::GEOM_Object_var myMeshShape;
174 QMap< int, GEOM::GEOM_Object_var > myGeomObj;
176 SMESHGUI_CreatePatternDlg* myCreationDlg;
177 SMESH::SMESH_Pattern_var myPattern;
178 SALOME_Actor* myPreviewActor;
180 QString myHelpFileName;