1 // Copyright (C) 2007-2012 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
23 // File : SMESHGUI_MeshPatternDlg.h
24 // Author : Sergey LITONIN, Open CASCADE S.A.S.
26 #ifndef SMESHGUI_MESHPATTERNDLG_H
27 #define SMESHGUI_MESHPATTERNDLG_H
30 #include "SMESH_SMESHGUI.hxx"
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(SMESH_Mesh)
39 #include CORBA_SERVER_HEADER(SMESH_Pattern)
48 class SalomeApp_IntSpinBox;
49 class vtkUnstructuredGrid;
52 class LightApp_SelectionMgr;
54 class SMESHGUI_CreatePatternDlg;
55 class SMESHGUI_PatternWidget;
58 Class : SMESHGUI_MeshPatternDlg
59 Description : Dialog to specify filters for VTK viewer
62 class SMESHGUI_EXPORT SMESHGUI_MeshPatternDlg : public QDialog
67 enum { Type_2d, Type_3d };
70 enum { Mesh, Object, Vertex1, Vertex2, Ids };
73 SMESHGUI_MeshPatternDlg( SMESHGUI* );
74 virtual ~SMESHGUI_MeshPatternDlg();
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 );
101 QWidget* createButtonFrame( QWidget* );
102 QWidget* createMainFrame( QWidget* );
103 void displayPreview();
104 vtkUnstructuredGrid* getGrid();
106 void updateWgState();
107 bool loadFromFile( const QString& );
108 void activateSelection();
109 QStringList prepareFilters() const;
110 QString autoExtension( const QString& ) const;
111 void closeEvent( QCloseEvent* );
112 void enterEvent( QEvent* );
113 void keyPressEvent( QKeyEvent* );
114 bool isValid( const bool = true );
115 void resetSelInput();
116 bool isRefine() const;
118 bool getIds( QList<int>& ) const;
119 int getNode( bool = false ) const;
122 QPushButton* myOkBtn;
123 QPushButton* myApplyBtn;
124 QPushButton* myCloseBtn;
125 QPushButton* myHelpBtn;
127 QButtonGroup* myTypeGrp;
128 QRadioButton* mySwitch2d;
129 QRadioButton* mySwitch3d;
134 SalomeApp_IntSpinBox* myNode1;
135 SalomeApp_IntSpinBox* myNode2;
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;
153 QCheckBox* myPreviewChk;
155 SMESHGUI* mySMESHGUI;
156 SVTK_Selector* mySelector;
157 LightApp_SelectionMgr* mySelectionMgr;
161 bool myIsCreateDlgOpen;
164 SMESH::SMESH_Mesh_var myMesh;
165 GEOM::GEOM_Object_var myMeshShape;
166 QMap<int, GEOM::GEOM_Object_var> myGeomObj;
168 SMESHGUI_CreatePatternDlg* myCreationDlg;
169 SMESH::SMESH_Pattern_var myPattern;
170 SALOME_Actor* myPreviewActor;
172 QString myHelpFileName;
175 #endif // SMESHGUI_MESHPATTERNDLG_H