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