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