Salome HOME
Merge from V5_1_main 14/05/2010
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_FindElemByPointDlg.h
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef SMESHGUI_FindElemByPointDLG_H
21 #define SMESHGUI_FindElemByPointDLG_H
22
23 // SMESH includes
24 #include "SMESH_SMESHGUI.hxx"
25
26 #include "SMESHGUI_Dialog.h"
27 #include "SMESHGUI_SelectionOp.h"
28
29 #include CORBA_SERVER_HEADER(SMESH_Mesh)
30
31 class QLineEdit;
32 class QPushButton;
33 class QListWidget;
34 class QtxComboBox;
35 class SMESHGUI_SpinBox;
36 class SMESHGUI_MeshEditPreview;
37 class SMESHGUI_FindElemByPointDlg;
38
39 /*!
40  * \brief Operation to find elements by a point coordinates
41  */
42 class SMESHGUI_EXPORT SMESHGUI_FindElemByPointOp: public SMESHGUI_SelectionOp
43 {
44   Q_OBJECT
45
46 public:
47   SMESHGUI_FindElemByPointOp();
48   virtual ~SMESHGUI_FindElemByPointOp();
49
50   virtual LightApp_Dialog*       dlg() const;  
51
52 protected:
53
54   virtual void                   startOperation();
55   virtual void                   stopOperation();
56
57   virtual void                   activateSelection();
58
59 protected slots:
60
61   virtual void                   onFind();
62   virtual bool                   onApply();
63
64 private slots:
65   void                           onSelectionDone();
66   void                           onElemSelected();
67   void                           onElemTypeChange(int);
68   void                           redisplayPreview();
69
70 private:
71   SMESHGUI_FindElemByPointDlg*     myDlg;
72
73   SUIT_SelectionFilter*            myFilter;
74   SMESHGUI_MeshEditPreview*        mySimulation; // to show point coordinates
75   //SMESH_Actor*                   myMeshActor;  // to show found elements
76   SMESH::SMESH_Mesh_var            myMesh;
77   SMESH::MeshPreviewStruct_var     myPreview;
78   Handle(SALOME_InteractiveObject) myMeshIO;
79 };
80
81 /*!
82  * \brief Dialog to find elements by a point coordinates
83  */
84
85 class SMESHGUI_EXPORT SMESHGUI_FindElemByPointDlg : public SMESHGUI_Dialog
86 {
87   Q_OBJECT
88
89 public:
90   SMESHGUI_FindElemByPointDlg();
91
92 private:
93   QWidget*                      createMainFrame( QWidget* );
94
95   QLineEdit*                    myMeshName;
96   SMESHGUI_SpinBox*             myX;
97   SMESHGUI_SpinBox*             myY;
98   SMESHGUI_SpinBox*             myZ;
99   QtxComboBox*                  myElemTypeCombo;
100   QPushButton*                  myFindBtn;
101   QListWidget*                  myFoundList;
102
103   QString                       myHelpFileName;
104
105   friend class SMESHGUI_FindElemByPointOp;
106
107 private slots:
108 //void                          ButtonToggled( bool );
109 };
110
111 #endif // SMESHGUI_FindElemByPointDLG_H