Version: 9.16.0
SMESHGUI_MeshDlg.h
Go to the documentation of this file.
1// Copyright (C) 2007-2026 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// SMESH SMESHGUI : GUI for SMESH component
24// File : SMESHGUI_MeshDlg.h
25// Author : Sergey LITONIN, Open CASCADE S.A.S.
26//
27#ifndef SMESHGUI_MESHDLG_H
28#define SMESHGUI_MESHDLG_H
29
30// SMESH includes
31#include "SMESH_SMESHGUI.hxx"
32
33#include "SMESHGUI_Dialog.h"
34
35// Qt includes
36#include <QFrame>
37#include <QStringList>
38#include <QMap>
39
40class QAction;
41class QCheckBox;
42class QComboBox;
43class QListWidget;
44class QMenu;
45class QTabWidget;
46class QToolButton;
47class QtxToolButton;
49
56{
57 Q_OBJECT
58
59public:
60
61 enum Controls { Obj, Mesh, Geom };
62
64 enum Dimensions { Dim0D = 0, Dim1D, Dim2D, Dim3D };
65
66public:
67 SMESHGUI_MeshDlg( const bool, const bool );
68 virtual ~SMESHGUI_MeshDlg();
69
70 void reset();
71 void setTitile( const bool, const bool );
72 void setHypoSets( const QStringList& );
73 void setGeomPopupEnabled( const bool );
74 int getActiveObject();
75
76 SMESHGUI_MeshTab* tab( const int ) const;
77 void enableTab(const int);
78 void disableTab(const int);
79 bool isTabEnabled(const int) const;
80 void setCurrentTab( const int );
81 int currentTab() const;
82 void setMaxHypoDim( const int );
83
84 void setAvailableMeshType(const QStringList& );
85 void setCurrentMeshType( const int );
86 int currentMeshType();
87
88 bool toCreateAllGroups();
89
90signals:
91 void hypoSet( const QString& );
92 void geomSelectionByMesh( bool );
93 void selectMeshType( const int, const int );
94
95private slots:
96 void onHypoSetPopup( QAction* );
97 void onGeomPopup( QAction* );
98 void onGeomSelectionButton( bool );
99 void onChangedMeshType( const int );
100
101 private:
102 QMap<int, SMESHGUI_MeshTab*> myTabs;
103 QTabWidget* myTabWg;
104 QToolButton* myHypoSetButton;
108};
109
116{
117 Q_OBJECT
118
119 public:
122 {
123 Algo = 0,
126 MoreAddHyp
127 // additional hypotheses are coded as being of HypType (AddHyp + 1), (AddHyp + 2) etc.
128 // Nb of HypType's after MainHyp is returned by SMESHGUI_MeshTab::nbAddHypTypes()
129 };
130
131public:
133 virtual ~SMESHGUI_MeshTab();
134
135 void setAvailableHyps( const int, const QStringList& );
136 void setExistingHyps( const int, const QStringList&, bool=false);
137 void addHyp( const int, const QString& );
138 //void renameHyp( const int, const int, const QString& );
139 void setCurrentHyp( const int, const int );
140 int currentHyp( const int ) const;
141 int nbAddHypTypes() const;
142 void reset();
143
144signals:
145 void createHyp( const int, const int );
147 void editHyp( const int, const int );
149 void selectAlgo( const int );
151
152private slots:
153 void onCreateHyp();
154 void onEditHyp();
155 void onHyp( int );
156 void onMoreAddHyp();
157 void onLessAddHyp();
158
159private:
160
161 void addItem( const QString& txt, const int type, const int index, const bool isGroup=false );
162 int getCurrentIndex( const int type, const bool curByType=false) const;
163
164 QMap<int, QStringList> myAvailableHypTypes;
165
166 QMap<int, QtxToolButton*> myHypCombo;
167 QMap<int, QToolButton*> myCreateHypBtn;
168 QMap<int, QToolButton*> myEditHypBtn;
169
170 QToolButton* myMoreAddHypBtn;
171 QToolButton* myLessAddHypBtn;
172 QListWidget* myAddHypList; // 2-nd, etc. additional hyps
173};
174
175#endif // SMESHGUI_MESHDLG_H
#define SMESHGUI_EXPORT
Definition: SMESH_SMESHGUI.hxx:36
Definition: SMESHGUI_Dialog.h:44
Dialog for mech creation or editing.
Definition: SMESHGUI_MeshDlg.h:56
QComboBox * myMeshType
Definition: SMESHGUI_MeshDlg.h:106
void selectMeshType(const int, const int)
void hypoSet(const QString &)
void geomSelectionByMesh(bool)
QMap< int, SMESHGUI_MeshTab * > myTabs
Definition: SMESHGUI_MeshDlg.h:102
Controls
Definition: SMESHGUI_MeshDlg.h:61
QToolButton * myHypoSetButton
Definition: SMESHGUI_MeshDlg.h:104
QTabWidget * myTabWg
Definition: SMESHGUI_MeshDlg.h:103
Dimensions
Describes dimensions.
Definition: SMESHGUI_MeshDlg.h:64
QCheckBox * myCreateGroupsCheck
Definition: SMESHGUI_MeshDlg.h:107
QMenu * myGeomPopup
Definition: SMESHGUI_MeshDlg.h:105
Tab for tab widget containing controls for definition of algorithms and hypotheses.
Definition: SMESHGUI_MeshDlg.h:116
void editHyp(const int, const int)
Emitted when "Edit hypothesis" button clicked.
QMap< int, QStringList > myAvailableHypTypes
Definition: SMESHGUI_MeshDlg.h:164
QMap< int, QtxToolButton * > myHypCombo
Definition: SMESHGUI_MeshDlg.h:166
void createHyp(const int, const int)
Emitted when "Create hypothesis" button clicked.
QToolButton * myMoreAddHypBtn
Definition: SMESHGUI_MeshDlg.h:170
QListWidget * myAddHypList
Definition: SMESHGUI_MeshDlg.h:172
QMap< int, QToolButton * > myCreateHypBtn
Definition: SMESHGUI_MeshDlg.h:167
QMap< int, QToolButton * > myEditHypBtn
Definition: SMESHGUI_MeshDlg.h:168
HypType
To differ main algorithms, hypotheses and additional ones.
Definition: SMESHGUI_MeshDlg.h:122
@ AddHyp
additional hypothesis
Definition: SMESHGUI_MeshDlg.h:125
@ MainHyp
main hypothesis
Definition: SMESHGUI_MeshDlg.h:124
QToolButton * myLessAddHypBtn
Definition: SMESHGUI_MeshDlg.h:171
void selectAlgo(const int)
Emitted when an algorithm is selected.