1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SMESHGUI_MeshPatternDlg.h
23 // Author : Sergey LITONIN, Open CASCADE S.A.S.
25 #ifndef SMESHGUI_MESHPATTERNDLG_H
26 #define SMESHGUI_MESHPATTERNDLG_H
29 #include "SMESH_SMESHGUI.hxx"
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SMESH_Mesh)
38 #include CORBA_SERVER_HEADER(SMESH_Pattern)
47 class SalomeApp_IntSpinBox;
48 class vtkUnstructuredGrid;
51 class LightApp_SelectionMgr;
53 class SMESHGUI_CreatePatternDlg;
54 class SMESHGUI_PatternWidget;
57 Class : SMESHGUI_MeshPatternDlg
58 Description : Dialog to specify filters for VTK viewer
61 class SMESHGUI_EXPORT SMESHGUI_MeshPatternDlg : public QDialog
66 enum { Type_2d, Type_3d };
69 enum { Mesh, Object, Vertex1, Vertex2, Ids };
72 SMESHGUI_MeshPatternDlg( SMESHGUI* );
73 virtual ~SMESHGUI_MeshPatternDlg();
85 void onSelectionDone();
86 void onSelInputChanged();
88 void onTypeChanged( int );
89 void onModeToggled( bool );
92 void onReverse( bool );
93 void onPreview( bool );
94 void onOkCreationDlg();
95 void onCloseCreationDlg();
96 void onTextChanged( const QString& );
97 void onNodeChanged( int );
100 QWidget* createButtonFrame( QWidget* );
101 QWidget* createMainFrame( QWidget* );
102 void displayPreview();
103 vtkUnstructuredGrid* getGrid();
105 void updateWgState();
106 bool loadFromFile( const QString& );
107 void activateSelection();
108 QStringList prepareFilters() const;
109 QString autoExtension( const QString& ) const;
110 void closeEvent( QCloseEvent* );
111 void enterEvent( QEvent* );
112 void keyPressEvent( QKeyEvent* );
113 bool isValid( const bool = true );
114 void resetSelInput();
115 bool isRefine() const;
117 bool getIds( QList<int>& ) const;
118 int getNode( bool = false ) const;
121 QPushButton* myOkBtn;
122 QPushButton* myApplyBtn;
123 QPushButton* myCloseBtn;
124 QPushButton* myHelpBtn;
126 QButtonGroup* myTypeGrp;
127 QRadioButton* mySwitch2d;
128 QRadioButton* mySwitch3d;
133 SalomeApp_IntSpinBox* myNode1;
134 SalomeApp_IntSpinBox* myNode2;
138 QMap<int, QPushButton*> mySelBtn;
139 QMap<int, QLineEdit*> mySelEdit;
140 QMap<int, QLabel*> mySelLbl;
143 QPushButton* myOpenBtn;
144 QPushButton* myNewBtn;
146 QCheckBox* myReverseChk;
147 QCheckBox* myCreatePolygonsChk;
148 QCheckBox* myCreatePolyedrsChk;
149 SMESHGUI_PatternWidget* myPicture2d;
152 QCheckBox* myPreviewChk;
154 SMESHGUI* mySMESHGUI;
155 SVTK_Selector* mySelector;
156 LightApp_SelectionMgr* mySelectionMgr;
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;
171 QString myHelpFileName;
174 #endif // SMESHGUI_MESHPATTERNDLG_H