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();
79 virtual void reject();
88 void onSelectionDone();
89 void onSelInputChanged();
91 void onTypeChanged( int );
92 void onModeToggled( bool );
95 void onReverse( bool );
96 void onPreview( bool );
97 void onOkCreationDlg();
98 void onCloseCreationDlg();
99 void onTextChanged( const QString& );
100 void onNodeChanged( int );
103 QWidget* createButtonFrame( QWidget* );
104 QWidget* createMainFrame( QWidget* );
105 void displayPreview();
106 vtkUnstructuredGrid* getGrid();
108 void updateWgState();
109 bool loadFromFile( const QString& );
110 void activateSelection();
111 QStringList prepareFilters() const;
112 QString autoExtension( const QString& ) const;
113 void enterEvent( QEvent* );
114 void keyPressEvent( QKeyEvent* );
115 bool isValid( const bool = true );
116 void resetSelInput();
117 bool isRefine() const;
119 bool getIds( QList<int>& ) const;
120 int getNode( bool = false ) const;
123 QPushButton* myOkBtn;
124 QPushButton* myApplyBtn;
125 QPushButton* myCloseBtn;
126 QPushButton* myHelpBtn;
128 QButtonGroup* myTypeGrp;
129 QRadioButton* mySwitch2d;
130 QRadioButton* mySwitch3d;
135 SalomeApp_IntSpinBox* myNode1;
136 SalomeApp_IntSpinBox* myNode2;
140 QMap<int, QPushButton*> mySelBtn;
141 QMap<int, QLineEdit*> mySelEdit;
142 QMap<int, QLabel*> mySelLbl;
145 QPushButton* myOpenBtn;
146 QPushButton* myNewBtn;
148 QCheckBox* myReverseChk;
149 QCheckBox* myCreatePolygonsChk;
150 QCheckBox* myCreatePolyedrsChk;
151 SMESHGUI_PatternWidget* myPicture2d;
154 QCheckBox* myPreviewChk;
156 SMESHGUI* mySMESHGUI;
157 SVTK_Selector* mySelector;
158 LightApp_SelectionMgr* mySelectionMgr;
162 bool myIsCreateDlgOpen;
165 SMESH::SMESH_Mesh_var myMesh;
166 GEOM::GEOM_Object_var myMeshShape;
167 QMap<int, GEOM::GEOM_Object_var> myGeomObj;
169 SMESHGUI_CreatePatternDlg* myCreationDlg;
170 SMESH::SMESH_Pattern_var myPattern;
171 SALOME_Actor* myPreviewActor;
173 QString myHelpFileName;
176 #endif // SMESHGUI_MESHPATTERNDLG_H