Back to index

salome-smesh  6.5.0
SMESHGUI_Make2DFrom3DOp.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 // File   : SMESHGUI_Make2DFrom3D.h
00020 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
00021 
00022 #ifndef SMESHGUI_Make2DFrom3DOp_H
00023 #define SMESHGUI_Make2DFrom3DOp_H
00024 
00025 // SMESH includes
00026 #include "SMESH_SMESHGUI.hxx"
00027 #include "SMESHGUI_Dialog.h"
00028 #include "SMESHGUI_SelectionOp.h"
00029 #include "SMESH_TypeFilter.hxx"
00030 
00031 #include <SALOMEconfig.h>
00032 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
00033 #include CORBA_SERVER_HEADER(SMESH_Mesh)
00034 
00035 class QCheckBox;
00036 class QLineEdit;
00037 class QRadioButton;
00038 class SMESHGUI_Make2DFrom3DOp;
00039 
00044 class SMESHGUI_EXPORT SMESHGUI_Make2DFrom3DDlg :  public SMESHGUI_Dialog
00045 {
00046   Q_OBJECT
00047 
00048 public:
00049   enum { MeshOrGroups };
00050 
00051   SMESHGUI_Make2DFrom3DDlg( QWidget* );
00052   virtual ~SMESHGUI_Make2DFrom3DDlg();
00053 
00054   SMESH::Bnd_Dimension mode() const;
00055 
00056   bool                 needNewMesh() const;
00057   QString              getNewMeshName() const;
00058   void                 setNewMeshName( const QString& );
00059   void                 setNewMeshEnabled( bool );
00060   bool                 getNewMeshEnabled() const;
00061 
00062   bool                 needGroup() const;
00063   QString              getGroupName() const;
00064   void                 setGroupName( const QString& );
00065 
00066   bool                 copySource() const;
00067 
00068 private slots:
00069   void                 onTargetChanged();
00070   void                 onGroupChecked();
00071 
00072 private:
00073   QRadioButton* my2dFrom3dRB;
00074   QRadioButton* my1dFrom2dRB;
00075   QRadioButton* my1dFrom3dRB;
00076   QRadioButton* myThisMeshRB;
00077   QRadioButton* myNewMeshRB;
00078   QLineEdit*    myMeshName;
00079   QCheckBox*    myCopyCheck;
00080   QCheckBox*    myGroupCheck;
00081   QLineEdit*    myGroupName;
00082 
00083   friend class SMESHGUI_Make2DFrom3DOp;
00084 };
00085 
00090 class SMESHGUI_EXPORT SMESHGUI_Make2DFrom3DOp : public SMESHGUI_SelectionOp
00091 {
00092   Q_OBJECT
00093 
00094 public:
00095   SMESHGUI_Make2DFrom3DOp();
00096   virtual ~SMESHGUI_Make2DFrom3DOp();
00097 
00098   virtual LightApp_Dialog*           dlg() const;
00099 
00100 protected:
00101   virtual void                       startOperation();
00102   virtual void                       selectionDone();
00103   virtual SUIT_SelectionFilter*      createFilter( const int ) const;
00104   bool                               isValid( QString& ) const;
00105 
00106 protected slots:
00107   virtual bool                       onApply();
00108   void                               onModeChanged();
00109 
00110 private:
00111   bool                               compute2DMesh( QStringList& );
00112 
00113 private:
00114   SMESH::SMESH_Mesh_var              mySrcMesh;
00115   QPointer<SMESHGUI_Make2DFrom3DDlg> myDlg;
00116 
00117   SMESH_TypeFilter                   myMeshFilter;
00118   SMESH_TypeFilter                   myGroupFilter;
00119 };
00120 
00121 #endif // SMESHGUI_Make2DFrom3DOp_H