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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 // File : SMESHGUI_MeshPatternDlg.h
23 // Author : Sergey LITONIN
27 #ifndef SMESHGUI_MeshPatternDlg_H
28 #define SMESHGUI_MeshPatternDlg_H
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(GEOM_Gen)
35 #include CORBA_SERVER_HEADER(SMESH_Mesh)
36 #include CORBA_SERVER_HEADER(SMESH_Pattern)
41 class SMESHGUI_SpinBox;
43 class SalomeApp_SelectionMgr;
50 class SMESHGUI_CreatePatternDlg;
51 class SMESHGUI_PatternWidget;
52 class vtkUnstructuredGrid;
54 class SVTK_ViewWindow;
59 Class : SMESHGUI_MeshPatternDlg
60 Description : Dialog to specify filters for VTK viewer
63 class SMESHGUI_MeshPatternDlg : public QDialog
68 enum { Type_2d, Type_3d };
71 enum { Mesh, Object, Vertex1, Vertex2, Ids };
74 SMESHGUI_MeshPatternDlg( SMESHGUI*,
76 virtual ~SMESHGUI_MeshPatternDlg();
88 void onSelectionDone();
89 void onSelInputChanged();
91 void onTypeChanged( int );
92 void onModeToggled( bool );
95 void onReverse( bool );
96 void onPreview( bool );
97 void onOkCreationDlg();
98 void onCloseCreationDlg();
99 void onTextChanged( const QString& );
100 void onNodeChanged( int value );
104 QFrame* createButtonFrame( QWidget* );
105 QFrame* createMainFrame ( QWidget* );
106 void displayPreview();
107 vtkUnstructuredGrid* getGrid();
109 void updateWgState();
110 bool loadFromFile( const QString& );
111 void activateSelection();
112 QStringList prepareFilters() const;
113 QString autoExtension( const QString& theFileName ) const;
114 void closeEvent( QCloseEvent* e ) ;
115 void enterEvent ( QEvent * ) ;
116 bool isValid( const bool theMess = true );
117 void resetSelInput();
118 bool isRefine() const;
120 bool getIds( QValueList<int>& ) const;
121 int getNode( bool = false ) const;
125 QPushButton* myOkBtn;
126 QPushButton* myApplyBtn;
127 QPushButton* myCloseBtn;
129 QButtonGroup* myTypeGrp;
130 QRadioButton* mySwitch2d;
131 QRadioButton* mySwitch3d;
140 QGroupBox* myGeomGrp;
141 QMap< int, QPushButton* > mySelBtn;
142 QMap< int, QLineEdit* > mySelEdit;
143 QMap< int, QLabel* > mySelLbl;
146 QPushButton* myOpenBtn;
147 QPushButton* myNewBtn;
149 QCheckBox* myReverseChk;
150 QCheckBox* myCreatePolygonsChk;
151 QCheckBox* myCreatePolyedrsChk;
152 SMESHGUI_PatternWidget* myPicture2d;
156 QCheckBox* myPreviewChk;
158 SMESHGUI* mySMESHGUI;
159 SVTK_ViewWindow* myViewWindow;
160 SVTK_Selector* mySelector;
161 SalomeApp_SelectionMgr* mySelectionMgr;
165 bool myIsCreateDlgOpen;
168 SMESH::SMESH_Mesh_var myMesh;
169 GEOM::GEOM_Object_var myMeshShape;
170 QMap< int, GEOM::GEOM_Object_var > myGeomObj;
172 SMESHGUI_CreatePatternDlg* myCreationDlg;
173 SMESH::SMESH_Pattern_var myPattern;
174 SALOME_Actor* myPreviewActor;