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
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 LightApp_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();
89 void onSelectionDone();
90 void onSelInputChanged();
92 void onTypeChanged( int );
93 void onModeToggled( bool );
96 void onReverse( bool );
97 void onPreview( bool );
98 void onOkCreationDlg();
99 void onCloseCreationDlg();
100 void onTextChanged( const QString& );
101 void onNodeChanged( int value );
105 QFrame* createButtonFrame( QWidget* );
106 QFrame* createMainFrame ( QWidget* );
107 void displayPreview();
108 vtkUnstructuredGrid* getGrid();
110 void updateWgState();
111 bool loadFromFile( const QString& );
112 void activateSelection();
113 QStringList prepareFilters() const;
114 QString autoExtension( const QString& theFileName ) const;
115 void closeEvent( QCloseEvent* e ) ;
116 void enterEvent ( QEvent * ) ;
117 void keyPressEvent(QKeyEvent*);
118 bool isValid( const bool theMess = true );
119 void resetSelInput();
120 bool isRefine() const;
122 bool getIds( QValueList<int>& ) const;
123 int getNode( bool = false ) const;
127 QPushButton* myOkBtn;
128 QPushButton* myApplyBtn;
129 QPushButton* myCloseBtn;
130 QPushButton* myHelpBtn;
132 QButtonGroup* myTypeGrp;
133 QRadioButton* mySwitch2d;
134 QRadioButton* mySwitch3d;
143 QGroupBox* myGeomGrp;
144 QMap< int, QPushButton* > mySelBtn;
145 QMap< int, QLineEdit* > mySelEdit;
146 QMap< int, QLabel* > mySelLbl;
149 QPushButton* myOpenBtn;
150 QPushButton* myNewBtn;
152 QCheckBox* myReverseChk;
153 QCheckBox* myCreatePolygonsChk;
154 QCheckBox* myCreatePolyedrsChk;
155 SMESHGUI_PatternWidget* myPicture2d;
159 QCheckBox* myPreviewChk;
161 SMESHGUI* mySMESHGUI;
162 SVTK_Selector* mySelector;
163 LightApp_SelectionMgr* mySelectionMgr;
167 bool myIsCreateDlgOpen;
170 SMESH::SMESH_Mesh_var myMesh;
171 GEOM::GEOM_Object_var myMeshShape;
172 QMap< int, GEOM::GEOM_Object_var > myGeomObj;
174 SMESHGUI_CreatePatternDlg* myCreationDlg;
175 SMESH::SMESH_Pattern_var myPattern;
176 SALOME_Actor* myPreviewActor;
178 QString myHelpFileName;