Back to index

salome-smesh  6.5.0
SMESHGUI_MeshDlg.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // SMESH SMESHGUI : GUI for SMESH component
00024 // File   : SMESHGUI_MeshDlg.h
00025 // Author : Sergey LITONIN, Open CASCADE S.A.S.
00026 //
00027 #ifndef SMESHGUI_MESHDLG_H
00028 #define SMESHGUI_MESHDLG_H
00029 
00030 // SMESH includes
00031 #include "SMESH_SMESHGUI.hxx"
00032 
00033 #include "SMESHGUI_Dialog.h"
00034 
00035 // Qt includes
00036 #include <QFrame>
00037 #include <QStringList>
00038 #include <QMap>
00039 
00040 class SMESHGUI_MeshTab;
00041 class QTabWidget;
00042 class QComboBox;
00043 class QToolButton;
00044 class QMenu;
00045 class QAction;
00046 
00052 class SMESHGUI_EXPORT SMESHGUI_MeshDlg : public SMESHGUI_Dialog
00053 { 
00054   Q_OBJECT       
00055       
00056 public:
00057   
00058   enum Controls { Obj, Mesh, Geom };
00059   
00061   enum Dimensions { Dim0D = 0, Dim1D, Dim2D, Dim3D };      
00062   
00063 public:
00064   SMESHGUI_MeshDlg( const bool, const bool );
00065   virtual ~SMESHGUI_MeshDlg();
00066   
00067   SMESHGUI_MeshTab*            tab( const int ) const;
00068   void                         reset();
00069   void                         setCurrentTab( const int );
00070   void                         setMaxHypoDim( const int );
00071   void                         setHypoSets( const QStringList& );
00072   void                         setGeomPopupEnabled( const bool );
00073   void                         disableTab(const int);
00074   void                         enableTab(const int);
00075   bool                         isTabEnabled(const int) const;
00076   int                          getActiveObject();
00077 
00078 signals:
00079   void                         hypoSet( const QString& );
00080   void                         geomSelectionByMesh( bool );
00081 
00082 private slots:  
00083   void                         onHypoSetPopup( QAction* );
00084   void                         onGeomPopup( QAction* );
00085   void                         onGeomSelectionButton( bool );
00086 
00087 private:
00088   QMap<int, SMESHGUI_MeshTab*> myTabs;
00089   QTabWidget*                  myTabWg;
00090   QToolButton*                 myHypoSetButton;
00091   QMenu*                       myGeomPopup;
00092 };
00093 
00099 class SMESHGUI_EXPORT SMESHGUI_MeshTab : public QFrame
00100 {
00101   Q_OBJECT
00102       
00103 public:      
00105   enum HypType
00106   { 
00107     Algo = 0, 
00108     MainHyp,  
00109     AddHyp    
00110   };            
00111       
00112 public:      
00113   SMESHGUI_MeshTab( QWidget* );
00114   virtual ~SMESHGUI_MeshTab();
00115   
00116   void                         setAvailableHyps( const int, const QStringList& );
00117   void                         setExistingHyps( const int, const QStringList& );
00118   void                         addHyp( const int, const QString& );
00119   void                         renameHyp( const int, const int, const QString& );
00120   void                         setCurrentHyp( const int, const int );
00121   int                          currentHyp( const int ) const;
00122   void                         reset();
00123 
00124 signals:  
00125   void                         createHyp( const int, const int );
00127   void                         editHyp( const int, const int );
00129   void                         selectAlgo( const int );
00131   
00132 private slots:  
00133   void                         onCreateHyp();  
00134   void                         onEditHyp();
00135   void                         onHyp( int );
00136   
00137 private:  
00138   QMap<int, QComboBox*>        myHyp;
00139   QMap<int, QToolButton*>      myCreateHyp;
00140   QMap<int, QToolButton*>      myEditHyp;
00141   
00142   QMap<int, QStringList>       myAvailableHyps;
00143   QMap<int, QStringList>       myExistingHyps;
00144 };
00145 
00146 #endif // SMESHGUI_MESHDLG_H