1 // Copyright (C) 2007-2013 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
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;
48 * \brief Dialog for mech creation or editing
50 * This dialog is used for mech creation or editing.
52 class SMESHGUI_EXPORT SMESHGUI_MeshDlg : public SMESHGUI_Dialog
58 enum Controls { Obj, Mesh, Geom };
60 /*! Describes dimensions */
61 enum Dimensions { Dim0D = 0, Dim1D, Dim2D, Dim3D };
64 SMESHGUI_MeshDlg( const bool, const bool );
65 virtual ~SMESHGUI_MeshDlg();
67 SMESHGUI_MeshTab* tab( const int ) const;
69 void setCurrentTab( const int );
70 void setMaxHypoDim( const int );
71 void setHypoSets( const QStringList& );
72 void setGeomPopupEnabled( const bool );
73 void disableTab(const int);
74 void enableTab(const int);
75 bool isTabEnabled(const int) const;
76 int getActiveObject();
77 void setAvailableMeshType(const QStringList& );
78 int currentMeshType();
81 void hypoSet( const QString& );
82 void geomSelectionByMesh( bool );
83 void selectMeshType( const int, const int );
86 void onHypoSetPopup( QAction* );
87 void onGeomPopup( QAction* );
88 void onGeomSelectionButton( bool );
89 void onChangedMeshType( const int );
92 QMap<int, SMESHGUI_MeshTab*> myTabs;
94 QToolButton* myHypoSetButton;
96 QComboBox* myMeshType;
100 * \brief Tab for tab widget containing controls for definition of
101 * algorithms and hypotheses
104 class SMESHGUI_EXPORT SMESHGUI_MeshTab : public QFrame
109 /*! To differ main algorithms, hypotheses and additional ones*/
112 Algo = 0, //!< algorithms
113 MainHyp, //!< main hypothesis
114 AddHyp //!< additional hypothesis
118 SMESHGUI_MeshTab( QWidget* );
119 virtual ~SMESHGUI_MeshTab();
121 void setAvailableHyps( const int, const QStringList& );
122 void setExistingHyps( const int, const QStringList&, bool=false);
123 void addHyp( const int, const QString& );
124 void renameHyp( const int, const int, const QString& );
125 void setCurrentHyp( const int, const int );
126 int currentHyp( const int ) const;
130 void createHyp( const int, const int );
131 //!< Emited when "Create hypothesis" button clicked
132 void editHyp( const int, const int );
133 //!< Emited when "Edit hypothesis" button clicked
134 void selectAlgo( const int );
135 //!< Emited when an algorithm is selected
143 QMap<int, QComboBox*> myHyp;
144 QMap<int, QToolButton*> myCreateHyp;
145 QMap<int, QToolButton*> myEditHyp;
147 QMap<int, QStringList> myAvailableHyps;
148 QMap<int, QStringList> myExistingHyps;
151 #endif // SMESHGUI_MESHDLG_H