1 // Copyright (C) 2007-2019 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 // SMESH SMESHGUI : GUI for SMESH component
24 // File : SMESHGUI_MeshDlg.h
25 // Author : Sergey LITONIN, Open CASCADE S.A.S.
27 #ifndef SMESHGUI_MESHDLG_H
28 #define SMESHGUI_MESHDLG_H
31 #include "SMESH_SMESHGUI.hxx"
33 #include "SMESHGUI_Dialog.h"
37 #include <QStringList>
40 class SMESHGUI_MeshTab;
50 * \brief Dialog for mech creation or editing
52 * This dialog is used for mech creation or editing.
54 class SMESHGUI_EXPORT SMESHGUI_MeshDlg : public SMESHGUI_Dialog
60 enum Controls { Obj, Mesh, Geom };
62 /*! Describes dimensions */
63 enum Dimensions { Dim0D = 0, Dim1D, Dim2D, Dim3D };
66 SMESHGUI_MeshDlg( const bool, const bool );
67 virtual ~SMESHGUI_MeshDlg();
69 SMESHGUI_MeshTab* tab( const int ) const;
71 void setCurrentTab( const int );
72 void setMaxHypoDim( const int );
73 void setHypoSets( const QStringList& );
74 void setGeomPopupEnabled( const bool );
75 void disableTab(const int);
76 void enableTab(const int);
77 bool isTabEnabled(const int) const;
78 int getActiveObject();
79 void setAvailableMeshType(const QStringList& );
80 int currentMeshType();
81 void setCurrentMeshType( const int );
82 void setTitile( const bool, const bool );
85 void hypoSet( const QString& );
86 void geomSelectionByMesh( bool );
87 void selectMeshType( const int, const int );
90 void onHypoSetPopup( QAction* );
91 void onGeomPopup( QAction* );
92 void onGeomSelectionButton( bool );
93 void onChangedMeshType( const int );
96 QMap<int, SMESHGUI_MeshTab*> myTabs;
98 QToolButton* myHypoSetButton;
100 QComboBox* myMeshType;
104 * \brief Tab for tab widget containing controls for definition of
105 * algorithms and hypotheses
108 class SMESHGUI_EXPORT SMESHGUI_MeshTab : public QFrame
113 /*! To differ main algorithms, hypotheses and additional ones*/
116 Algo = 0, //!< algorithms
117 MainHyp, //!< main hypothesis
118 AddHyp, //!< additional hypothesis
119 MoreAddHyp //! since several additional hypothesis are possible, the 2-nd, 3-d etc
120 // additional hypotheses are coded as being of HypType (AddHyp + 1), (AddHyp + 2) etc.
121 // Nb of HypType's after MainHyp is returned by SMESHGUI_MeshTab::nbAddHypTypes()
125 SMESHGUI_MeshTab( QWidget* );
126 virtual ~SMESHGUI_MeshTab();
128 void setAvailableHyps( const int, const QStringList& );
129 void setExistingHyps( const int, const QStringList&, bool=false);
130 void addHyp( const int, const QString& );
131 //void renameHyp( const int, const int, const QString& );
132 void setCurrentHyp( const int, const int );
133 int currentHyp( const int ) const;
134 int nbAddHypTypes() const;
138 void createHyp( const int, const int );
139 //!< Emitted when "Create hypothesis" button clicked
140 void editHyp( const int, const int );
141 //!< Emitted when "Edit hypothesis" button clicked
142 void selectAlgo( const int );
143 //!< Emitted when an algorithm is selected
154 void addItem( const QString& txt, const int type, const int index, const bool isGroup=false );
155 int getCurrentIndex( const int type, const bool curByType=false) const;
157 QMap<int, QStringList> myAvailableHypTypes;
159 QMap<int, QtxToolButton*> myHypCombo;
160 QMap<int, QToolButton*> myCreateHypBtn;
161 QMap<int, QToolButton*> myEditHypBtn;
163 QToolButton* myMoreAddHypBtn;
164 QToolButton* myLessAddHypBtn;
165 QListWidget* myAddHypList; // 2-nd, etc. additional hyps
168 #endif // SMESHGUI_MESHDLG_H