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 SALOME_Selection;
50 class SMESHGUI_CreatePatternDlg;
51 class SMESHGUI_PatternWidget;
52 class vtkUnstructuredGrid;
56 Class : SMESHGUI_MeshPatternDlg
57 Description : Dialog to specify filters for VTK viewer
60 class SMESHGUI_MeshPatternDlg : public QDialog
65 enum { Type_2d, Type_3d };
68 enum { Mesh, Object, Vertex1, Vertex2, Ids };
71 SMESHGUI_MeshPatternDlg( QWidget*,
74 virtual ~SMESHGUI_MeshPatternDlg();
76 void Init( SALOME_Selection* );
86 void onSelectionDone();
87 void onSelInputChanged();
89 void onTypeChanged( int );
90 void onModeToggled( bool );
93 void onReverse( bool );
94 void onPreview( bool );
95 void onOkCreationDlg();
96 void onCloseCreationDlg();
97 void onTextChanged( const QString& );
98 void onNodeChanged( int value );
102 QFrame* createButtonFrame( QWidget* );
103 QFrame* createMainFrame ( QWidget* );
104 void displayPreview();
105 vtkUnstructuredGrid* getGrid();
107 void updateWgState();
108 bool loadFromFile( const QString& );
109 void activateSelection();
110 QStringList prepareFilters() const;
111 QString autoExtension( const QString& theFileName ) const;
112 void closeEvent( QCloseEvent* e ) ;
113 void enterEvent ( QEvent * ) ;
114 bool isValid( const bool theMess = true );
115 void resetSelInput();
116 bool isRefine() const;
118 bool getIds( QValueList<int>& ) const;
119 int getNode( bool = false ) const;
123 QPushButton* myOkBtn;
124 QPushButton* myApplyBtn;
125 QPushButton* myCloseBtn;
127 QButtonGroup* myTypeGrp;
128 QRadioButton* mySwitch2d;
129 QRadioButton* mySwitch3d;
138 QGroupBox* myGeomGrp;
139 QMap< int, QPushButton* > mySelBtn;
140 QMap< int, QLineEdit* > mySelEdit;
141 QMap< int, QLabel* > mySelLbl;
144 QPushButton* myOpenBtn;
145 QPushButton* myNewBtn;
147 QCheckBox* myReverseChk;
148 QCheckBox* myCreatePolygonsChk;
149 QCheckBox* myCreatePolyedrsChk;
150 SMESHGUI_PatternWidget* myPicture2d;
154 QCheckBox* myPreviewChk;
156 SALOME_Selection* mySelection;
160 bool myIsCreateDlgOpen;
163 SMESH::SMESH_Mesh_var myMesh;
164 GEOM::GEOM_Object_var myMeshShape;
165 QMap< int, GEOM::GEOM_Object_var > myGeomObj;
167 SMESHGUI_CreatePatternDlg* myCreationDlg;
168 SMESH::SMESH_Pattern_var myPattern;
169 SALOME_Actor* myPreviewActor;