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
26 #ifndef SMESHGUI_MeshPatternDlg_H
27 #define SMESHGUI_MeshPatternDlg_H
29 #include "SMESH_SMESHGUI.hxx"
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(GEOM_Gen)
36 #include CORBA_SERVER_HEADER(SMESH_Mesh)
37 #include CORBA_SERVER_HEADER(SMESH_Pattern)
42 class SMESHGUI_SpinBox;
44 class LightApp_SelectionMgr;
51 class SMESHGUI_CreatePatternDlg;
52 class SMESHGUI_PatternWidget;
53 class vtkUnstructuredGrid;
55 class SVTK_ViewWindow;
60 Class : SMESHGUI_MeshPatternDlg
61 Description : Dialog to specify filters for VTK viewer
64 class SMESHGUI_EXPORT SMESHGUI_MeshPatternDlg : public QDialog
69 enum { Type_2d, Type_3d };
72 enum { Mesh, Object, Vertex1, Vertex2, Ids };
75 SMESHGUI_MeshPatternDlg( SMESHGUI*,
77 virtual ~SMESHGUI_MeshPatternDlg();
90 void onSelectionDone();
91 void onSelInputChanged();
93 void onTypeChanged( int );
94 void onModeToggled( bool );
97 void onReverse( bool );
98 void onPreview( bool );
99 void onOkCreationDlg();
100 void onCloseCreationDlg();
101 void onTextChanged( const QString& );
102 void onNodeChanged( int value );
106 QFrame* createButtonFrame( QWidget* );
107 QFrame* createMainFrame ( QWidget* );
108 void displayPreview();
109 vtkUnstructuredGrid* getGrid();
111 void updateWgState();
112 bool loadFromFile( const QString& );
113 void activateSelection();
114 QStringList prepareFilters() const;
115 QString autoExtension( const QString& theFileName ) const;
116 void closeEvent( QCloseEvent* e ) ;
117 void enterEvent ( QEvent * ) ;
118 void keyPressEvent(QKeyEvent*);
119 bool isValid( const bool theMess = true );
120 void resetSelInput();
121 bool isRefine() const;
123 bool getIds( QValueList<int>& ) const;
124 int getNode( bool = false ) const;
128 QPushButton* myOkBtn;
129 QPushButton* myApplyBtn;
130 QPushButton* myCloseBtn;
131 QPushButton* myHelpBtn;
133 QButtonGroup* myTypeGrp;
134 QRadioButton* mySwitch2d;
135 QRadioButton* mySwitch3d;
144 QGroupBox* myGeomGrp;
145 QMap< int, QPushButton* > mySelBtn;
146 QMap< int, QLineEdit* > mySelEdit;
147 QMap< int, QLabel* > mySelLbl;
150 QPushButton* myOpenBtn;
151 QPushButton* myNewBtn;
153 QCheckBox* myReverseChk;
154 QCheckBox* myCreatePolygonsChk;
155 QCheckBox* myCreatePolyedrsChk;
156 SMESHGUI_PatternWidget* myPicture2d;
160 QCheckBox* myPreviewChk;
162 SMESHGUI* mySMESHGUI;
163 SVTK_Selector* mySelector;
164 LightApp_SelectionMgr* mySelectionMgr;
168 bool myIsCreateDlgOpen;
171 SMESH::SMESH_Mesh_var myMesh;
172 GEOM::GEOM_Object_var myMeshShape;
173 QMap< int, GEOM::GEOM_Object_var > myGeomObj;
175 SMESHGUI_CreatePatternDlg* myCreationDlg;
176 SMESH::SMESH_Pattern_var myPattern;
177 SALOME_Actor* myPreviewActor;
179 QString myHelpFileName;