Salome HOME
a6d52eafbb2049123c1679492fdebd8237d7c895
[modules/visu.git] / src / VISUGUI / VisuGUI_GaussPointsSelectionPane.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 //  VISU VISUGUI : GUI of VISU component
23 //  File   : VisuGUI_GaussPointsSelectionPane.h
24 //  Author : Oleg Uvarov
25 //  Module : VISU
26 //
27 #ifndef VISUGUI_GAUSSPOINTSSELECTIONPANE_H
28 #define VISUGUI_GAUSSPOINTSSELECTIONPANE_H
29
30 #include <vtkObject.h>
31 #include <vtkSmartPointer.h>
32
33 #include <QLineEdit>
34
35 class vtkActorCollection;
36 class vtkCallbackCommand;
37 class vtkImageData;
38
39 class QLabel;
40 class QComboBox;
41 class QCheckBox;
42 class QPushButton;
43
44 class QtxAction;
45
46 class VISU_GaussPtsAct;
47 class VISU_PickingSettings;
48
49 class SalomeApp_Module;
50 class SVTK_RenderWindowInteractor;
51 class VisuGUI_ValidatedLineEdit;
52
53 //! Picking Dialog.
54 /*!
55  * Uses for set up picking preferenses and apply
56  * them to all actors in the current renderer.
57  */
58 class VisuGUI_GaussPointsSelectionPane : public QWidget
59 {
60   Q_OBJECT
61
62 public:
63   VisuGUI_GaussPointsSelectionPane( const SalomeApp_Module* theModule, QWidget* theParent );
64
65   ~VisuGUI_GaussPointsSelectionPane();
66
67   //! update dialog contents.
68   void                                  update();
69
70   void                                  setIds( const int, const int );
71
72   void                                  setInteractor( SVTK_RenderWindowInteractor* );
73
74   void                                  apply();
75   //void                                  help();
76
77 protected:
78   SVTK_RenderWindowInteractor*          getInteractor();
79
80 protected slots:
81   void                                  onSelectionValidate();
82   void                                  onSelectionApply();
83
84 private slots:
85   void                                  onApplyDisplayParentMesh( bool );
86
87 private:
88   static void                           ProcessEvents(vtkObject* theObject, 
89                                                       unsigned long theEvent,
90                                                       void* theClientData, 
91                                                       void* theCallData);
92
93   void                                  KeyPressed();
94   void                                  SelectionEvent();
95   //void                                  keyPressEvent( QKeyEvent* e );
96
97   void                                  clearIDControls();
98
99 private:
100   const SalomeApp_Module*               myModule;
101
102   QCheckBox*                            myDisplayParentMeshCheckBox;
103
104   VisuGUI_ValidatedLineEdit*            myParentElementLineEdit;
105   VisuGUI_ValidatedLineEdit*            myLocalPointLineEdit;
106
107   QValidator*                           myCellIDValidator;
108   QValidator*                           myLocalPointIDValidator;
109
110   float                                 myPriority;
111   vtkSmartPointer<vtkCallbackCommand>   myEventCallbackCommand;
112 };
113
114 class VisuGUI_ValidatedLineEdit : public QLineEdit
115 {
116   Q_OBJECT;
117 public:
118   VisuGUI_ValidatedLineEdit( QWidget* parent );
119   
120 public slots:
121   void MarkValidated( const QString& theText );
122 };
123
124 #endif