Salome HOME
60261e97f51fa806fa0e257248ae52e4055c5ead
[modules/visu.git] / src / VISUGUI / VisuGUI_FindPane.h
1 // Copyright (C) 2007-2011  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_FindPane.h
22 //  Author : Oleg Uvarov
23 //  Module : VISU
24 //
25 #ifndef VISUGUI_FINDPANE_H
26 #define VISUGUI_FINDPANE_H
27
28 #include <SVTK_Selection.h>
29
30 #include <QGroupBox>
31
32 class QComboBox;
33 class QLabel;
34 class QLineEdit;
35 class QListWidget;
36 class QToolButton;
37
38 class VISU_Actor;
39
40 typedef QPair<int,int> TFindId;
41 typedef QList<TFindId> TListFindId;
42
43 //! Find pane.
44 /*!
45  * Used for filter and highlight mesh-elements by their scalar values.
46  */
47 class VisuGUI_FindPane : public QGroupBox
48 {
49   Q_OBJECT
50
51 public:
52   VisuGUI_FindPane( QWidget* theParent );
53   ~VisuGUI_FindPane();
54
55 public:
56   void             setSelectionMode( const Selection_Mode );
57   void             setActor( VISU_Actor* );
58
59 protected slots:
60   void             onConditionChanged( int );
61   void             onApply();
62
63   void             onIdChanged();
64   void             onPrevPage();
65   void             onNextPage();
66
67 private:
68   bool             isValid() const;
69   void             clearIds();
70   void             displayIds();
71
72 signals:
73   void             idChanged( int, int );
74
75 private:
76   QComboBox*       myConditionBox;
77   QLineEdit*       myLeftValue;
78   QLabel*          myDashLabel;
79   QLineEdit*       myRightValue;
80
81   QListWidget*     myIdsListWidget;
82   QLabel*          myPageLabel;
83   QToolButton*     myPrevBtn;
84   QToolButton*     myNextBtn;
85
86   int              myCurrentPage;
87   TListFindId      myIdsList;
88
89   Selection_Mode   mySelectionMode;
90   VISU_Actor*      myActor;
91 };
92
93 #endif