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
25 * Copyright (C) 2005 CEA/DEN, EDF R&D
29 * File : SMESHGUI_MeshDlg.h
30 * Author : Sergey LITONIN
35 #ifndef SMESHGUI_MeshDlg_H
36 #define SMESHGUI_MeshDlg_H
38 #include "SMESH_SMESHGUI.hxx"
40 #include "SMESHGUI_Dialog.h"
42 #include <qstringlist.h>
45 class SMESHGUI_MeshTab;
54 * \brief Dialog for mech creation or editing
56 * This dialog is used for mech creation or editing.
58 class SMESHGUI_EXPORT SMESHGUI_MeshDlg : public SMESHGUI_Dialog
64 enum Controls { Obj, Mesh, Geom };
66 /*! Describes dimensions */
67 enum Dimensions { Dim0D = 0, Dim1D, Dim2D, Dim3D };
70 SMESHGUI_MeshDlg( const bool theToCreate, const bool theIsMesh );
71 virtual ~SMESHGUI_MeshDlg();
73 SMESHGUI_MeshTab* tab( const int ) const;
75 void setCurrentTab( const int );
76 void setMaxHypoDim( const int );
77 void setHypoSets( const QStringList& );
78 void setGeomPopupEnabled( const bool );
79 void disableTab(const int);
80 void enableTab(const int);
81 int getActiveObject();
85 void hypoSet( const QString& );
86 void geomSelectionByMesh( bool );
90 void onHypoSetPopup( int );
91 void onHypoSetButton();
92 void onGeomPopup( int );
93 void onGeomSelectionButton( bool );
97 QMap< int, SMESHGUI_MeshTab* > myTabs;
99 QPopupMenu* myHypoSetPopup;
100 QPopupMenu* myGeomPopup;
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
122 SMESHGUI_MeshTab( QWidget* );
123 virtual ~SMESHGUI_MeshTab();
125 void setAvailableHyps( const int, const QStringList& );
126 void setExistingHyps( const int, const QStringList& );
127 void addHyp( const int, const QString& );
128 void renameHyp( const int, const int, const QString& );
129 void setCurrentHyp( const int, const int );
130 int currentHyp( const int ) const;
135 void createHyp( const int theHypType, const int theIndex );
136 //!< Emited when "Create hypothesis" button clicked
137 void editHyp( const int theHypType, const int theIndex );
138 //!< Emited when "Edit hypothesis" button clicked
139 void selectAlgo( const int theIndex );
140 //!< Emited when an algorithm is selected
147 void onPopupItem( int );
151 QMap< int, QComboBox* > myHyp;
152 QMap< int, QToolButton* > myCreateHyp;
153 QMap< int, QToolButton* > myEditHyp;
155 QMap< int, QStringList > myAvailableHyps;
156 QMap< int, QStringList > myExistingHyps;