Version: 9.12.0
SMESHGUI_MeshPatternDlg.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 // File : SMESHGUI_MeshPatternDlg.h
24 // Author : Sergey LITONIN, Open CASCADE S.A.S.
25 //
26 #ifndef SMESHGUI_MESHPATTERNDLG_H
27 #define SMESHGUI_MESHPATTERNDLG_H
28 
29 // SMESH includes
30 #include "SMESH_SMESHGUI.hxx"
31 
32 // Qt includes
33 #include <QDialog>
34 #include <QMap>
35 
36 // IDL includes
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(SMESH_Mesh)
39 #include CORBA_SERVER_HEADER(SMESH_Pattern)
40 
41 class QFrame;
42 class QLineEdit;
43 class QPushButton;
44 class QRadioButton;
45 class QCheckBox;
46 class QButtonGroup;
47 class QLabel;
48 class SalomeApp_IntSpinBox;
50 class SALOME_Actor;
51 class SVTK_Selector;
52 class LightApp_SelectionMgr;
53 class SMESHGUI;
56 
57 /*
58  Class : SMESHGUI_MeshPatternDlg
59  Description : Dialog to specify filters for VTK viewer
60 */
61 
63 {
64  Q_OBJECT
65 
66  // Pattern type
67  enum { Type_2d, Type_3d };
68 
69  // selection input
70  enum { Mesh, Object, Vertex1, Vertex2, Ids };
71 
72 public:
74  virtual ~SMESHGUI_MeshPatternDlg();
75 
76  void Init();
77 
78 protected slots:
79  virtual void reject();
80 
81 private slots:
82  void onOk();
83  bool onApply();
84  void onHelp();
85 
86  void onDeactivate();
87 
88  void onSelectionDone();
89  void onSelInputChanged();
90 
91  void onTypeChanged( int );
92  void onModeToggled( bool );
93  void onOpen();
94  void onNew();
95  void onReverse( bool );
96  void onPreview( bool );
97  void onOkCreationDlg();
98  void onCloseCreationDlg();
99  void onTextChanged( const QString& );
100  void onNodeChanged( int );
101  void onOpenView();
102  void onCloseView();
103 
104 private:
105  QWidget* createButtonFrame( QWidget* );
106  QWidget* createMainFrame( QWidget* );
107  void displayPreview();
108  vtkUnstructuredGrid* getGrid();
109  void erasePreview();
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;
120 
121  bool getIds( QList<int>& ) const;
122  int getNode( bool = false ) const;
123 
124 private:
125  QPushButton* myOkBtn;
126  QPushButton* myApplyBtn;
127  QPushButton* myCloseBtn;
128  QPushButton* myHelpBtn;
129 
130  QButtonGroup* myTypeGrp;
131  QRadioButton* mySwitch2d;
132  QRadioButton* mySwitch3d;
133 
134  QCheckBox* myRefine;
135 
137  SalomeApp_IntSpinBox* myNode1;
138  SalomeApp_IntSpinBox* myNode2;
140 
142  QMap<int, QPushButton*> mySelBtn;
143  QMap<int, QLineEdit*> mySelEdit;
144  QMap<int, QLabel*> mySelLbl;
145 
147 
148  QLineEdit* myName;
149  QPushButton* myOpenBtn;
150  QPushButton* myNewBtn;
151 
152  QCheckBox* myReverseChk;
157 
158  QCheckBox* myPreviewChk;
159 
161  SVTK_Selector* mySelector;
162  LightApp_SelectionMgr* mySelectionMgr;
165  int myType;
167  bool myBusy;
168 
169  SMESH::SMESH_Mesh_var myMesh;
170  GEOM::GEOM_Object_var myMeshShape;
171  QMap<int, GEOM::GEOM_Object_var> myGeomObj;
172 
174  SMESH::SMESH_Pattern_var myPattern;
176 
177  QString myHelpFileName;
178 };
179 
180 #endif // SMESHGUI_MESHPATTERNDLG_H
#define SMESHGUI_EXPORT
Definition: SMESH_SMESHGUI.hxx:36
Class : SMESHGUI_CreatePatternDlg Description : Dialog to specify filters for VTK viewer.
Definition: SMESHGUI_CreatePatternDlg.h:57
Definition: SMESHGUI_MeshPatternDlg.h:63
SalomeApp_IntSpinBox * myNode1
Definition: SMESHGUI_MeshPatternDlg.h:137
GEOM::GEOM_Object_var myMeshShape
Definition: SMESHGUI_MeshPatternDlg.h:170
QCheckBox * myCreatePolyedrsChk
Definition: SMESHGUI_MeshPatternDlg.h:154
int myNbPoints
Definition: SMESHGUI_MeshPatternDlg.h:164
QMap< int, QLabel * > mySelLbl
Definition: SMESHGUI_MeshPatternDlg.h:144
QLabel * myNode2Lbl
Definition: SMESHGUI_MeshPatternDlg.h:139
int myType
Definition: SMESHGUI_MeshPatternDlg.h:165
SalomeApp_IntSpinBox * myNode2
Definition: SMESHGUI_MeshPatternDlg.h:138
QLineEdit * myName
Definition: SMESHGUI_MeshPatternDlg.h:148
QRadioButton * mySwitch3d
Definition: SMESHGUI_MeshPatternDlg.h:132
QCheckBox * myCreatePolygonsChk
Definition: SMESHGUI_MeshPatternDlg.h:153
QCheckBox * myReverseChk
Definition: SMESHGUI_MeshPatternDlg.h:152
QLabel * myPicture3d
Definition: SMESHGUI_MeshPatternDlg.h:156
QPushButton * myOpenBtn
Definition: SMESHGUI_MeshPatternDlg.h:149
QString myHelpFileName
Definition: SMESHGUI_MeshPatternDlg.h:177
QRadioButton * mySwitch2d
Definition: SMESHGUI_MeshPatternDlg.h:131
QPushButton * myApplyBtn
Definition: SMESHGUI_MeshPatternDlg.h:126
QMap< int, QLineEdit * > mySelEdit
Definition: SMESHGUI_MeshPatternDlg.h:143
bool myBusy
Definition: SMESHGUI_MeshPatternDlg.h:167
QPushButton * myOkBtn
Definition: SMESHGUI_MeshPatternDlg.h:125
SMESHGUI * mySMESHGUI
Definition: SMESHGUI_MeshPatternDlg.h:160
@ Type_2d
Definition: SMESHGUI_MeshPatternDlg.h:67
QButtonGroup * myTypeGrp
Definition: SMESHGUI_MeshPatternDlg.h:130
int mySelInput
Definition: SMESHGUI_MeshPatternDlg.h:163
QFrame * myGeomGrp
Definition: SMESHGUI_MeshPatternDlg.h:141
QPushButton * myCloseBtn
Definition: SMESHGUI_MeshPatternDlg.h:127
SMESH::SMESH_Pattern_var myPattern
Definition: SMESHGUI_MeshPatternDlg.h:174
SALOME_Actor * myPreviewActor
Definition: SMESHGUI_MeshPatternDlg.h:175
QPushButton * myNewBtn
Definition: SMESHGUI_MeshPatternDlg.h:150
SMESH::SMESH_Mesh_var myMesh
Definition: SMESHGUI_MeshPatternDlg.h:169
LightApp_SelectionMgr * mySelectionMgr
Definition: SMESHGUI_MeshPatternDlg.h:162
QCheckBox * myPreviewChk
Definition: SMESHGUI_MeshPatternDlg.h:158
QPushButton * myHelpBtn
Definition: SMESHGUI_MeshPatternDlg.h:128
QMap< int, QPushButton * > mySelBtn
Definition: SMESHGUI_MeshPatternDlg.h:142
SMESHGUI_PatternWidget * myPicture2d
Definition: SMESHGUI_MeshPatternDlg.h:155
bool myIsCreateDlgOpen
Definition: SMESHGUI_MeshPatternDlg.h:166
SMESHGUI_CreatePatternDlg * myCreationDlg
Definition: SMESHGUI_MeshPatternDlg.h:173
QFrame * myRefineGrp
Definition: SMESHGUI_MeshPatternDlg.h:136
SVTK_Selector * mySelector
Definition: SMESHGUI_MeshPatternDlg.h:161
QCheckBox * myRefine
Definition: SMESHGUI_MeshPatternDlg.h:134
QWidget * myMainFrame
Definition: SMESHGUI_MeshPatternDlg.h:146
QMap< int, GEOM::GEOM_Object_var > myGeomObj
Definition: SMESHGUI_MeshPatternDlg.h:171
Definition: SMESHGUI_PatternWidget.h:49
Definition: SMESHGUI.h:84