Back to index

salome-smesh  6.5.0
SMESHGUI_MultiEditDlg.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 // File   : SMESHGUI_MultiEditDlg.h
00024 // Author : Sergey LITONIN, Open CASCADE S.A.S.
00025 //
00026 #ifndef SMESHGUI_MULTIEDITDLG_H
00027 #define SMESHGUI_MULTIEDITDLG_H
00028 
00029 // SMESH includes
00030 #include "SMESH_SMESHGUI.hxx"
00031 
00032 // Qt includes 
00033 #include <QDialog>
00034 
00035 // OCCT includes
00036 #include <TColStd_MapOfInteger.hxx>
00037 
00038 // IDL includes
00039 #include <SALOMEconfig.h>
00040 #include CORBA_SERVER_HEADER(SMESH_Mesh)
00041 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
00042 
00043 class SMESHGUI;
00044 class SMESHGUI_FilterDlg;
00045 class SMESHGUI_SpinBox;
00046 
00047 class SMESH_Actor;
00048 
00049 class LightApp_SelectionMgr;
00050 class SALOME_Actor;
00051 class SVTK_Selector;
00052 
00053 class QListWidget;
00054 class QComboBox;
00055 class QCheckBox;
00056 class QGroupBox;
00057 class QLineEdit;
00058 class QPushButton;
00059 class QButtonGroup;
00060 
00067 class SMESHGUI_EXPORT SMESHGUI_MultiEditDlg : public QDialog
00068 {
00069   Q_OBJECT
00070 
00071 public:
00072   SMESHGUI_MultiEditDlg( SMESHGUI*, const int, const bool = false );
00073   virtual ~SMESHGUI_MultiEditDlg();
00074 
00075   void                      Init();
00076 
00077   bool                      eventFilter( QObject*, QEvent* );
00078 
00079 signals:
00080   void                      ListContensChanged();
00081 
00082 protected slots:
00083   void                      onOk();
00084   virtual bool              onApply();
00085   virtual void              onClose();
00086   void                      onHelp();
00087 
00088   void                      onDeactivate();
00089   void                      onSelectionDone();
00090 
00091   void                      onFilterBtn();
00092   void                      onAddBtn();
00093   void                      onRemoveBtn();
00094   void                      onSortListBtn();
00095   void                      onListSelectionChanged();
00096   void                      onSubmeshChk();
00097   void                      onGroupChk();
00098   virtual void              onToAllChk();
00099   void                      onFilterAccepted();
00100   void                      on3d2dChanged(int);
00101 
00102   SMESH::NumericalFunctor_ptr getNumericalFunctor();
00103 
00104 protected:
00105   void                      closeEvent( QCloseEvent* );
00106   void                      enterEvent( QEvent * );
00107   void                      hideEvent( QHideEvent* );                        /* ESC key */
00108   void                      keyPressEvent( QKeyEvent* );
00109   QWidget*                  createButtonFrame( QWidget* );
00110   QWidget*                  createMainFrame( QWidget*, const bool );
00111   virtual bool              isValid( const bool );
00112   SMESH::long_array_var     getIds(SMESH::SMESH_IDSource_var& obj);
00113   void                      updateButtons();
00114   void                      setSelectionMode();
00115   virtual bool              isIdValid( const int ) const;
00116   virtual bool              process( SMESH::SMESH_MeshEditor_ptr, 
00117                                      const SMESH::long_array& ,
00118                                      SMESH::SMESH_IDSource_ptr obj) = 0;
00119   int                       entityType();
00120 
00121 protected:
00122   QPushButton*              myOkBtn;
00123   QPushButton*              myApplyBtn;
00124   QPushButton*              myCloseBtn;
00125   QPushButton*              myHelpBtn;
00126   SMESH_Actor*              myActor;
00127   SMESH::SMESH_Mesh_var     myMesh;
00128 
00129   LightApp_SelectionMgr*    mySelectionMgr;
00130   SVTK_Selector*            mySelector;
00131   SMESHGUI*                 mySMESHGUI;
00132 
00133   QGroupBox*                mySelGrp;
00134   QGroupBox*                myCriterionGrp;
00135 
00136   QWidget*                  myChoiceWidget;
00137   QButtonGroup*             myGroupChoice;
00138   QComboBox*                myComboBoxFunctor;
00139 
00140   QListWidget*              myListBox;
00141   QPushButton*              myFilterBtn;
00142   QPushButton*              myAddBtn;
00143   QPushButton*              myRemoveBtn;
00144   QPushButton*              mySortBtn;
00145 
00146   QCheckBox*                myToAllChk;
00147   QButtonGroup*             myEntityTypeGrp;
00148 
00149   QCheckBox*                mySubmeshChk;
00150   QPushButton*              mySubmeshBtn;
00151   QLineEdit*                mySubmesh;
00152 
00153   QCheckBox*                myGroupChk;
00154   QPushButton*              myGroupBtn;
00155   QLineEdit*                myGroup;
00156 
00157   SMESHGUI_FilterDlg*       myFilterDlg;
00158   TColStd_MapOfInteger      myIds;
00159   int                       myFilterType;
00160   bool                      myBusy;
00161   int                       myEntityType;
00162 
00163   QString                   myHelpFileName;
00164 };
00165 
00170 class  SMESHGUI_ChangeOrientationDlg : public SMESHGUI_MultiEditDlg
00171 {
00172   Q_OBJECT
00173 
00174 public:
00175   SMESHGUI_ChangeOrientationDlg( SMESHGUI* );
00176   virtual ~SMESHGUI_ChangeOrientationDlg();
00177 
00178 protected:
00179   virtual bool process( SMESH::SMESH_MeshEditor_ptr,
00180                         const SMESH::long_array& ,
00181                         SMESH::SMESH_IDSource_ptr obj);
00182 };
00183 
00188 class  SMESHGUI_UnionOfTrianglesDlg : public SMESHGUI_MultiEditDlg
00189 {
00190   Q_OBJECT
00191 
00192 public:
00193   SMESHGUI_UnionOfTrianglesDlg( SMESHGUI* );
00194   virtual ~SMESHGUI_UnionOfTrianglesDlg();
00195 
00196 protected:
00197   virtual bool      isValid( const bool );
00198   virtual bool      process( SMESH::SMESH_MeshEditor_ptr,
00199                              const SMESH::long_array&,
00200                              SMESH::SMESH_IDSource_ptr obj );
00201 
00202 private:
00203   SMESHGUI_SpinBox* myMaxAngleSpin;
00204 };
00205 
00206 /*
00207   Class       : SMESHGUI_CuttingOfQuadsDlg
00208   Description : Construction of quadrangles by automatic association of triangles
00209 */
00210 class  SMESHGUI_CuttingOfQuadsDlg : public SMESHGUI_MultiEditDlg
00211 {
00212   Q_OBJECT
00213 
00214 public:
00215   SMESHGUI_CuttingOfQuadsDlg( SMESHGUI* );
00216   virtual ~SMESHGUI_CuttingOfQuadsDlg();
00217 
00218 protected:
00219   virtual bool  process( SMESH::SMESH_MeshEditor_ptr,
00220                          const SMESH::long_array& ,
00221                          SMESH::SMESH_IDSource_ptr obj);
00222 
00223 protected slots:
00224   virtual void  onClose();
00225   void          onCriterionRB();
00226   void          onPreviewChk();
00227 
00228 private:
00229   void          displayPreview();
00230   void          erasePreview();
00231 
00232 private:
00233   SALOME_Actor* myPreviewActor;
00234   QCheckBox*    myPreviewChk;
00235 };
00236 
00241 class  SMESHGUI_CuttingIntoTetraDlg : public SMESHGUI_MultiEditDlg
00242 {
00243   Q_OBJECT
00244 
00245 public:
00246   SMESHGUI_CuttingIntoTetraDlg( SMESHGUI* );
00247   virtual ~SMESHGUI_CuttingIntoTetraDlg();
00248 
00249 protected:
00250   virtual bool process( SMESH::SMESH_MeshEditor_ptr,
00251                         const SMESH::long_array&,
00252                         SMESH::SMESH_IDSource_ptr obj );
00253 };
00254 
00255 #endif // SMESHGUI_MULTIEDITDLG_H