1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
\r
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
\r
4 // This library is free software; you can redistribute it and/or
\r
5 // modify it under the terms of the GNU Lesser General Public
\r
6 // License as published by the Free Software Foundation; either
\r
7 // version 2.1 of the License.
\r
9 // This library is distributed in the hope that it will be useful,
\r
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
12 // Lesser General Public License for more details.
\r
14 // You should have received a copy of the GNU Lesser General Public
\r
15 // License along with this library; if not, write to the Free Software
\r
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
18 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
\r
22 // File : SMESHGUI_MeshPatternDlg.h
\r
23 // Author : Sergey LITONIN
\r
27 #ifndef SMESHGUI_MeshPatternDlg_H
\r
28 #define SMESHGUI_MeshPatternDlg_H
\r
30 #include <qdialog.h>
\r
33 #include <SALOMEconfig.h>
\r
34 #include CORBA_SERVER_HEADER(GEOM_Gen)
\r
35 #include CORBA_SERVER_HEADER(SMESH_Mesh)
\r
36 #include CORBA_SERVER_HEADER(SMESH_Pattern)
\r
41 class SMESHGUI_SpinBox;
\r
43 class SALOME_Selection;
\r
48 class SMESHGUI_CreatePatternDlg;
\r
49 class SMESHGUI_PatternWidget;
\r
50 class vtkUnstructuredGrid;
\r
54 Class : SMESHGUI_MeshPatternDlg
\r
55 Description : Dialog to specify filters for VTK viewer
\r
58 class SMESHGUI_MeshPatternDlg : public QDialog
\r
63 enum { Type_2d, Type_3d };
\r
66 enum { Mesh, Object, Vertex1, Vertex2 };
\r
69 SMESHGUI_MeshPatternDlg( QWidget*,
\r
72 virtual ~SMESHGUI_MeshPatternDlg();
\r
74 void Init( SALOME_Selection* );
\r
82 void onDeactivate();
\r
84 void onSelectionDone();
\r
85 void onSelInputChanged();
\r
87 void onTypeChanged( int );
\r
90 void onReverse( bool );
\r
91 void onPreview( bool );
\r
92 void onOkCreationDlg();
\r
93 void onCloseCreationDlg();
\r
97 QFrame* createButtonFrame( QWidget* );
\r
98 QFrame* createMainFrame ( QWidget* );
\r
99 void displayPreview();
\r
100 vtkUnstructuredGrid* getGrid();
\r
101 void erasePreview();
\r
102 void updateWgState();
\r
103 bool loadFromFile( const QString& );
\r
104 void activateSelection();
\r
105 QStringList prepareFilters() const;
\r
106 QString autoExtension( const QString& theFileName ) const;
\r
107 void closeEvent( QCloseEvent* e ) ;
\r
108 void enterEvent ( QEvent * ) ;
\r
109 bool isValid( const bool theMess = true );
\r
110 void resetSelInput();
\r
114 QPushButton* myOkBtn;
\r
115 QPushButton* myApplyBtn;
\r
116 QPushButton* myCloseBtn;
\r
118 QButtonGroup* myTypeGrp;
\r
119 QRadioButton* mySwitch2d;
\r
120 QRadioButton* mySwitch3d;
\r
122 QMap< int, QPushButton* > mySelBtn;
\r
123 QMap< int, QLineEdit* > mySelEdit;
\r
124 QMap< int, QLabel* > mySelLbl;
\r
127 QPushButton* myOpenBtn;
\r
128 QPushButton* myNewBtn;
\r
130 QCheckBox* myReverseChk;
\r
131 SMESHGUI_PatternWidget* myPicture2d;
\r
132 QFrame* myPicture3d;
\r
133 QLabel* myPreview3d;
\r
135 QCheckBox* myPreviewChk;
\r
137 SALOME_Selection* mySelection;
\r
141 bool myIsCreateDlgOpen;
\r
143 SMESH::SMESH_Mesh_var myMesh;
\r
144 GEOM::GEOM_Object_var myMeshShape;
\r
145 QMap< int, GEOM::GEOM_Object_var > myGeomObj;
\r
147 SMESHGUI_CreatePatternDlg* myCreationDlg;
\r
148 SMESH::SMESH_Pattern_var myPattern;
\r
149 SALOME_Actor* myPreviewActor;
\r