]> SALOME platform Git repositories - modules/visu.git/blob - src/VVTK/VVTK_PickingDlg.h
Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/visu.git] / src / VVTK / VVTK_PickingDlg.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 //  File   : VVTK_PickingDlg.h
23 //  Author : Oleg Uvarov
24 //  Module : VISU
25 //
26 #ifndef VVTK_PICKINGDLG_H
27 #define VVTK_PICKINGDLG_H
28
29 #include "SVTK_DialogBase.h"
30
31 #include <vtkObject.h>
32 #include <vtkSmartPointer.h>
33
34 #include <QLineEdit>
35
36 class vtkActorCollection;
37 class vtkCallbackCommand;
38 class vtkImageData;
39
40 class QLabel;
41 class QComboBox;
42 class QCheckBox;
43 class QPushButton;
44
45 class QtxAction;
46 class QtxDoubleSpinBox;
47 class QtxIntSpinBox;
48 class QtxColorButton;
49
50 class VISU_GaussPtsAct;
51 class VISU_PickingSettings;
52
53 class SVTK_MainWindow;
54 class SVTK_RenderWindowInteractor;
55 class VVTK_ValidatedLineEdit;
56
57 //! Picking Dialog.
58 /*!
59  * Uses for set up picking preferenses and apply
60  * them to all actors in the current renderer.
61  */
62 class VVTK_PickingDlg : public SVTK_DialogBase
63 {
64   Q_OBJECT
65
66 public:
67   VVTK_PickingDlg(QtxAction* theAction,
68                   SVTK_MainWindow* theParent,
69                   const char* theName);
70
71   ~VVTK_PickingDlg();
72
73   //! Make an actor to listen the event of Update Picking Settings event.
74   void             AddActor( VISU_GaussPtsAct* );
75   void             RemoveActor( VISU_GaussPtsAct* );
76
77   //! Update dialog contents.
78   void             Update();
79
80   VISU_PickingSettings* GetPickingSettings();
81
82   void             SetInteractor( SVTK_RenderWindowInteractor* );
83
84 protected slots:
85   void             onSelectionEvent();
86   void             onClickApply();
87   void             onClickClose();
88   void             onClickHelp();
89
90   //void             onColorButtonPressed();
91   void             onSelectionValidate();
92
93 private:
94   static void      ProcessEvents(vtkObject* theObject, 
95                                  unsigned long theEvent,
96                                  void* theClientData, 
97                                  void* theCallData);
98
99   void             KeyPressed();
100   void             keyPressEvent( QKeyEvent* e );
101
102 private:
103   QtxDoubleSpinBox* myCursorSizeSpinBox;
104   QtxDoubleSpinBox* myPyramidHeightSpinBox;
105   QtxColorButton*   mySelectionColorButton;
106   QtxDoubleSpinBox* myPointToleranceSpinBox;
107   QtxIntSpinBox*    myTransparencySpinBox;
108   QComboBox*        myPositionComboBox;
109   QtxDoubleSpinBox* myZoomFactorSpinBox;
110   QtxIntSpinBox*    myStepNumberSpinBox;
111   QCheckBox*        myDisplayParentMeshCheckBox;
112
113   QtxAction*        myAction;
114   vtkSmartPointer<VISU_PickingSettings> 
115                     myPickingSettings;
116
117   VVTK_ValidatedLineEdit*      
118                     myParentElementLineEdit;
119   VVTK_ValidatedLineEdit*     
120                     myLocalPointLineEdit;
121
122   SVTK_RenderWindowInteractor* 
123                     myInteractor;
124
125   float             myPriority;
126   vtkSmartPointer<vtkCallbackCommand> 
127                     myEventCallbackCommand;
128 };
129
130 class VVTK_ValidatedLineEdit : public QLineEdit
131 {
132   Q_OBJECT;
133 public:
134   VVTK_ValidatedLineEdit( QWidget* parent );
135   
136 public slots:
137   void MarkValidated( const QString& theText );
138 };
139
140 #endif