1 // Copyright (C) 2007-2020 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, or (at your option) any later version.
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 );
105 QWidget* createButtonFrame( QWidget* );
106 QWidget* 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& ) const;
115 void enterEvent( QEvent* );
116 void keyPressEvent( QKeyEvent* );
117 bool isValid( const bool = true );
118 void resetSelInput();
119 bool isRefine() const;
121 bool getIds( QList<int>& ) const;
122 int getNode( bool = false ) const;
125 QPushButton* myOkBtn;
126 QPushButton* myApplyBtn;
127 QPushButton* myCloseBtn;
128 QPushButton* myHelpBtn;
130 QButtonGroup* myTypeGrp;
131 QRadioButton* mySwitch2d;
132 QRadioButton* mySwitch3d;
137 SalomeApp_IntSpinBox* myNode1;
138 SalomeApp_IntSpinBox* myNode2;
142 QMap<int, QPushButton*> mySelBtn;
143 QMap<int, QLineEdit*> mySelEdit;
144 QMap<int, QLabel*> mySelLbl;
146 QWidget* myMainFrame;
149 QPushButton* myOpenBtn;
150 QPushButton* myNewBtn;
152 QCheckBox* myReverseChk;
153 QCheckBox* myCreatePolygonsChk;
154 QCheckBox* myCreatePolyedrsChk;
155 SMESHGUI_PatternWidget* myPicture2d;
158 QCheckBox* myPreviewChk;
160 SMESHGUI* mySMESHGUI;
161 SVTK_Selector* mySelector;
162 LightApp_SelectionMgr* mySelectionMgr;
166 bool myIsCreateDlgOpen;
169 SMESH::SMESH_Mesh_var myMesh;
170 GEOM::GEOM_Object_var myMeshShape;
171 QMap<int, GEOM::GEOM_Object_var> myGeomObj;
173 SMESHGUI_CreatePatternDlg* myCreationDlg;
174 SMESH::SMESH_Pattern_var myPattern;
175 SALOME_Actor* myPreviewActor;
177 QString myHelpFileName;
180 #endif // SMESHGUI_MESHPATTERNDLG_H