]> SALOME platform Git repositories - modules/visu.git/blob - src/VISUGUI/VisuGUI_Table3dDlg.h
Salome HOME
Porting to med 3.0.6 / Win32 compatibility / Replace dependency on libmed (fortran...
[modules/visu.git] / src / VISUGUI / VisuGUI_Table3dDlg.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_Table3dDlg.h
22 // Author : Laurent CORNABE & Hubert ROLLAND
23 //
24 #ifndef VISUGUI_TABLE3D_H
25 #define VISUGUI_TABLE3D_H
26
27 #include "VisuGUI_Prs3dDlg.h"
28
29 #include <QWidget>
30 #include <string>
31
32 class QTabWidget;
33 class QButtonGroup;
34 class QGroupBox;
35 class QComboBox;
36 class QCheckBox;
37 class QLineEdit;
38 class QRadioButton;
39 class QPushButton;
40 class SalomeApp_IntSpinBox;
41 class SalomeApp_DoubleSpinBox;
42 class VisuGUI_TextPrefDlg;
43 class VisuGUI_BarPrefDlg;
44 class SVTK_ViewWindow;
45 class SalomeApp_Module;
46
47 namespace VISU 
48 {
49   class PointMap3d_i;
50 };
51
52 class VisuGUI_Table3DPane : public QWidget
53 {
54   Q_OBJECT
55
56 public:
57   VisuGUI_Table3DPane( QWidget* );
58   ~VisuGUI_Table3DPane();
59
60   void                 initFromPrsObject( VISU::PointMap3d_i* );
61   int                  storeToPrsObject( VISU::PointMap3d_i* );
62
63   VISU::PointMap3d_i*  GetPrs();
64
65 private slots:
66   void                 onPrsType( int );
67
68 private:
69   bool                 myInitFromPrs;
70
71   SVTK_ViewWindow*     myViewWindow;
72   VISU::PointMap3d_i*  myPrs;
73
74   SalomeApp_DoubleSpinBox* ScaleSpn;
75   QGroupBox*           GBPrsTypeBox;
76   QButtonGroup*        GBPrsType;
77   SalomeApp_IntSpinBox* NbContoursSpn;
78 };
79
80 class VisuGUI_TableScalarBarPane : public QWidget
81 {
82   Q_OBJECT
83
84 public:
85   VisuGUI_TableScalarBarPane( QWidget* );
86   ~VisuGUI_TableScalarBarPane();
87
88   void                 setRange( double, double, bool );
89   void                 setDefaultRange( double, double );
90   int                  getOrientation();
91   void                 setPosAndSize( double, double, double, double, bool );
92   void                 setScalarBarData( int, int );
93   bool                 isIRange();
94   double               getMin();
95   double               getMax();
96   double               getX();
97   double               getY();
98   double               getWidth();
99   double               getHeight();
100   int                  getNbColors();
101   int                  getNbLabels();
102   bool                 isLogarithmic();
103   void                 setLogarithmic( bool on );
104   //  bool    isToSave() {return CBSave ? CBSave->isChecked() : false;}
105
106   void                 storeToResources();
107
108   void                 initFromPrsObject( VISU::PointMap3d_i* );
109   int                  storeToPrsObject( VISU::PointMap3d_i* );
110
111   bool                 check();
112
113 private slots:
114   void                 changeDefaults( int );
115   void                 changeRange( int );
116   void                 XYChanged( double );
117   void                 changeScalarMode( int );
118   void                 onTextPref();
119   void                 onBarPref();
120
121 private:
122   QGroupBox*           RangeGroup;
123   QRadioButton*        RBFrange;
124   QRadioButton*        RBIrange;
125   QLineEdit*           MinEdit;
126   QLineEdit*           MaxEdit;
127
128   QRadioButton*        RBhori;
129   QRadioButton*        RBvert;
130
131   SalomeApp_DoubleSpinBox* XSpin;
132   SalomeApp_DoubleSpinBox* YSpin;
133
134   SalomeApp_DoubleSpinBox* WidthSpin;
135   SalomeApp_DoubleSpinBox* HeightSpin;
136
137   SalomeApp_IntSpinBox* ColorSpin;
138   SalomeApp_IntSpinBox* LabelSpin;
139
140   QCheckBox*           CBSave;
141   QCheckBox*           CBLog;
142   QComboBox*           myModeCombo;
143   QPushButton*         myTextBtn;
144   QPushButton*         myBarBtn;
145   VisuGUI_TextPrefDlg* myTextDlg;
146   VisuGUI_BarPrefDlg*  myBarDlg;
147
148   double               myHorX, myHorY, myHorW, myHorH;
149   double               myVerX, myVerY, myVerW, myVerH;
150   int                  myHorTS, myHorLS, myHorBW, myHorBH;
151   int                  myVerTS, myVerLS, myVerBW, myVerBH;
152   bool                 myIsStoreTextProp;
153
154   std::string          myTitle;
155   VISU::PointMap3d_i*  myBarPrs;
156
157   bool                 myBusy;
158 };
159
160 ///////////////////////////////////////////////////////
161
162 class VisuGUI_Table3DDlg : public QDialog
163 {
164   Q_OBJECT
165
166 public:
167   VisuGUI_Table3DDlg( SalomeApp_Module* );
168   ~VisuGUI_Table3DDlg();
169
170   virtual void initFromPrsObject( VISU::PointMap3d_i* );
171   virtual int  storeToPrsObject( VISU::PointMap3d_i* );
172
173 protected slots:
174   void         accept();
175   void         onHelp();
176   void         onApply();
177
178 private:
179   QTabWidget*                    myTabBox;
180   VisuGUI_Table3DPane*           myIsoPane;
181   VisuGUI_TableScalarBarPane*    myScalarBarPane;
182
183   SALOME::GenericObjPtr<VISU::PointMap3d_i> myPrsCopy;
184 };
185
186 #endif // VISUGUI_TABLE3D_H