1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SMESHGUI_ShapeByMeshDlg.h
23 // Author : Edward AGAPOV
27 #ifndef SMESHGUI_ShapeByMeshDlg_H
28 #define SMESHGUI_ShapeByMeshDlg_H
30 #include "SMESH_SMESHGUI.hxx"
32 #include "SMESHGUI_Dialog.h"
33 #include "SMESHGUI_SelectionOp.h"
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(GEOM_Gen)
38 #include CORBA_SERVER_HEADER(SMESH_Mesh)
44 class LightApp_SelectionMgr;
45 class SVTK_ViewWindow;
50 * \brief Dialog to publish a sub-shape of the mesh main shape
51 * by selecting mesh elements
54 class SMESHGUI_EXPORT SMESHGUI_ShapeByMeshDlg : public SMESHGUI_Dialog
59 SMESHGUI_ShapeByMeshDlg();
60 virtual ~SMESHGUI_ShapeByMeshDlg();
64 // void closeEvent (QCloseEvent* e);
65 // void enterEvent (QEvent*);
69 //QFrame* createButtonFrame (QWidget*);
70 QFrame* createMainFrame (QWidget*);
71 //void displayPreview();
72 //void erasePreview();
75 QButtonGroup* myElemTypeGroup;
76 QLineEdit* myElementId;
77 QLineEdit* myGeomName;
80 bool myIsMultipleAllowed;
81 void setMultipleAllowed(bool isAllowed) {myIsMultipleAllowed = isAllowed;};
83 // QPushButton* myOkBtn;
84 // QPushButton* myCloseBtn;
86 // SMESHGUI* mySMESHGUI;
87 // LightApp_SelectionMgr* mySelectionMgr;
88 // SVTK_ViewWindow* myViewWindow;
90 friend class SMESHGUI_ShapeByMeshOp;
93 class SMESHGUI_ShapeByMeshOp: public SMESHGUI_SelectionOp
98 SMESHGUI_ShapeByMeshOp(bool isMultipleAllowed = false);
99 virtual ~SMESHGUI_ShapeByMeshOp();
101 virtual LightApp_Dialog* dlg() const;
104 void SetMesh (SMESH::SMESH_Mesh_ptr);
105 SMESH::SMESH_Mesh_ptr GetMesh () { return myMesh; }
106 GEOM::GEOM_Object_ptr GetShape();
110 virtual void commitOperation();
111 virtual void startOperation();
112 //virtual void selectionDone();
113 //virtual SUIT_SelectionFilter* createFilter( const int ) const;
114 //virtual bool isValid( SUIT_Operation* ) const;
116 void activateSelection();
117 void setElementID(const QString&);
121 /* void PublishShape(); */
126 virtual bool onApply() { return true; }
127 /* void onCreateHyp( const int theHypType, const int theIndex ); */
128 /* void onEditHyp( const int theHypType, const int theIndex ); */
129 /* void onHypoSet( const QString& theSetName ); */
130 /* void onGeomSelectionByMesh( bool ); */
131 /* void onPublishShapeByMeshDlg(); */
132 /* void onCloseShapeByMeshDlg(); */
139 // void onDeactivate();
141 void onSelectionDone();
142 void onTypeChanged (int);
143 void onElemIdChanged (const QString&);
147 SMESHGUI_ShapeByMeshDlg* myDlg;
148 SMESH::SMESH_Mesh_var myMesh;
149 GEOM::GEOM_Object_var myGeomObj;
151 bool myIsManualIdEnter;
153 bool myIsMultipleAllowed;