Back to index

salome-smesh  6.5.0
SMESHGUI_ShapeByMeshDlg.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_ShapeByMeshDlg.h
00024 // Author : Edward AGAPOV, Open CASCADE S.A.S.
00025 //
00026 #ifndef SMESHGUI_SHAPEBYMESHDLG_H
00027 #define SMESHGUI_SHAPEBYMESHDLG_H
00028 
00029 // SMESH includes
00030 #include "SMESH_SMESHGUI.hxx"
00031 
00032 #include "SMESHGUI_Dialog.h"
00033 #include "SMESHGUI_SelectionOp.h"
00034 
00035 // IDL includes
00036 #include <SALOMEconfig.h>
00037 #include CORBA_SERVER_HEADER(SMESH_Mesh)
00038 
00039 class QFrame;
00040 class QLineEdit;
00041 class QButtonGroup;
00042 class QGroupBox;
00043 
00049 class SMESHGUI_EXPORT SMESHGUI_ShapeByMeshDlg : public SMESHGUI_Dialog
00050 {
00051   Q_OBJECT
00052 
00053 public:
00054   SMESHGUI_ShapeByMeshDlg();
00055   virtual ~SMESHGUI_ShapeByMeshDlg();
00056 
00057 private:
00058   QFrame*                  createMainFrame( QWidget* );
00059 
00060   QGroupBox*               myElemTypeBox;
00061   QButtonGroup*            myElemTypeGroup;
00062   QLineEdit*               myElementId;
00063   QLineEdit*               myGeomName;
00064 
00065   bool                     myIsMultipleAllowed;
00066   void                     setMultipleAllowed( bool );
00067 
00068   friend class SMESHGUI_ShapeByMeshOp;
00069 };
00070 
00075 class SMESHGUI_ShapeByMeshOp: public SMESHGUI_SelectionOp
00076 {
00077   Q_OBJECT
00078 
00079 public:
00080   SMESHGUI_ShapeByMeshOp( bool = false );
00081   virtual ~SMESHGUI_ShapeByMeshOp();
00082 
00083   virtual LightApp_Dialog* dlg() const;  
00084 
00085   void                     Init();
00086   void                     SetMesh( SMESH::SMESH_Mesh_ptr );
00087   SMESH::SMESH_Mesh_ptr    GetMesh();
00088   GEOM::GEOM_Object_ptr    GetShape();
00089 
00090 protected:
00091   virtual void             commitOperation();
00092   virtual void             startOperation();
00093 
00094   void                     activateSelection();
00095   void                     setElementID( const QString& );
00096 
00097 protected slots:
00098   virtual bool             onApply();
00099 
00100 private slots:
00101   void                     onSelectionDone();
00102   void                     onTypeChanged( int );
00103   void                     onElemIdChanged( const QString& );
00104 
00105 private:
00106   SMESHGUI_ShapeByMeshDlg* myDlg;
00107   SMESH::SMESH_Mesh_var    myMesh;
00108   GEOM::GEOM_Object_var    myGeomObj;
00109 
00110   bool                     myIsManualIdEnter;
00111   bool                     myHasSolids;
00112   bool                     myIsMultipleAllowed;
00113 };
00114 
00115 #endif