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