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
20 // File : SMESHGUI_MeshPatternDlg.h
21 // Author : Sergey LITONIN, Open CASCADE S.A.S.
24 #ifndef SMESHGUI_MESHPATTERNDLG_H
25 #define SMESHGUI_MESHPATTERNDLG_H
28 #include "SMESH_SMESHGUI.hxx"
35 #include <SALOMEconfig.h>
36 #include CORBA_SERVER_HEADER(SMESH_Mesh)
37 #include CORBA_SERVER_HEADER(SMESH_Pattern)
47 class vtkUnstructuredGrid;
50 class LightApp_SelectionMgr;
52 class SMESHGUI_CreatePatternDlg;
53 class SMESHGUI_PatternWidget;
56 Class : SMESHGUI_MeshPatternDlg
57 Description : Dialog to specify filters for VTK viewer
60 class SMESHGUI_EXPORT SMESHGUI_MeshPatternDlg : public QDialog
65 enum { Type_2d, Type_3d };
68 enum { Mesh, Object, Vertex1, Vertex2, Ids };
71 SMESHGUI_MeshPatternDlg( SMESHGUI* );
72 virtual ~SMESHGUI_MeshPatternDlg();
84 void onSelectionDone();
85 void onSelInputChanged();
87 void onTypeChanged( int );
88 void onModeToggled( bool );
91 void onReverse( bool );
92 void onPreview( bool );
93 void onOkCreationDlg();
94 void onCloseCreationDlg();
95 void onTextChanged( const QString& );
96 void onNodeChanged( int );
99 QWidget* createButtonFrame( QWidget* );
100 QWidget* createMainFrame( QWidget* );
101 void displayPreview();
102 vtkUnstructuredGrid* getGrid();
104 void updateWgState();
105 bool loadFromFile( const QString& );
106 void activateSelection();
107 QStringList prepareFilters() const;
108 QString autoExtension( const QString& ) const;
109 void closeEvent( QCloseEvent* );
110 void enterEvent( QEvent* );
111 void keyPressEvent( QKeyEvent* );
112 bool isValid( const bool = true );
113 void resetSelInput();
114 bool isRefine() const;
116 bool getIds( QList<int>& ) const;
117 int getNode( bool = false ) const;
120 QPushButton* myOkBtn;
121 QPushButton* myApplyBtn;
122 QPushButton* myCloseBtn;
123 QPushButton* myHelpBtn;
125 QButtonGroup* myTypeGrp;
126 QRadioButton* mySwitch2d;
127 QRadioButton* mySwitch3d;
137 QMap<int, QPushButton*> mySelBtn;
138 QMap<int, QLineEdit*> mySelEdit;
139 QMap<int, QLabel*> mySelLbl;
142 QPushButton* myOpenBtn;
143 QPushButton* myNewBtn;
145 QCheckBox* myReverseChk;
146 QCheckBox* myCreatePolygonsChk;
147 QCheckBox* myCreatePolyedrsChk;
148 SMESHGUI_PatternWidget* myPicture2d;
151 QCheckBox* myPreviewChk;
153 SMESHGUI* mySMESHGUI;
154 SVTK_Selector* mySelector;
155 LightApp_SelectionMgr* mySelectionMgr;
159 bool myIsCreateDlgOpen;
162 SMESH::SMESH_Mesh_var myMesh;
163 GEOM::GEOM_Object_var myMeshShape;
164 QMap<int, GEOM::GEOM_Object_var> myGeomObj;
166 SMESHGUI_CreatePatternDlg* myCreationDlg;
167 SMESH::SMESH_Pattern_var myPattern;
168 SALOME_Actor* myPreviewActor;
170 QString myHelpFileName;
173 #endif // SMESHGUI_MESHPATTERNDLG_H