Salome HOME
Fix for Bug IPAL8945
[modules/visu.git] / src / VISUGUI / VisuGUI_GaussPointsDlg.h
1 //  VISU VISUGUI : GUI of VISU component
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
21 //
22 //
23 //
24 //  File   : VisuGUI_GaussPointsDlg.h
25 //  Author : Oleg UVAROV
26 //  Module : VISU
27
28 #ifndef VISUGUI_GAUSSPOINTSDLS_H
29 #define VISUGUI_GAUSSPOINTSDLS_H
30
31 #include "VisuGUI_ScalarBarDlg.h"
32
33 #include <qvbox.h>
34 #include <qdialog.h>
35 #include <qgroupbox.h>
36 #include <qcheckbox.h>
37 #include <qlabel.h>
38 #include <qpushbutton.h>
39 #include <qlineedit.h>
40 #include <qbuttongroup.h>
41 #include <qradiobutton.h>
42 #include <qspinbox.h>
43 #include <qcombobox.h>
44 #include <qtoolbutton.h>
45
46 class SalomeApp_Module;
47 class VVTK_PrimitiveBox;
48 class VVTK_SizeBox;
49 class VisuGUI_TextPrefDlg;
50
51 namespace VISU
52 {
53   class GaussPoints_i;
54 }
55
56 //! Specific Scalar Bar tab.
57 /*! Uses for set up Gauss Points Scalar Bars preferenses. */
58 class VisuGUI_GaussScalarBarPane : public QVBox
59 {
60   Q_OBJECT
61
62  public:
63   VisuGUI_GaussScalarBarPane(QWidget* parent, bool SetPref);
64   ~VisuGUI_GaussScalarBarPane() {};
65
66   int     getOrientation();
67   void    setPosAndSize( double x, double y, double w, double h, bool vert );
68   double  getX() {return XSpin->value();}
69   double  getY() {return YSpin->value();}
70   double  getWidth() {return WidthSpin->value();}
71   double  getHeight() {return HeightSpin->value();}
72   void    setScalarBarData( int colors, int labels );
73   int     getNbColors() {return ColorSpin->value();}
74   int     getNbLabels() {return LabelSpin->value();}
75   bool    isToSave() {return CBSave ? CBSave->isChecked() : false;}
76
77   void    initFromPrsObject(VISU::GaussPoints_i* thePrs);
78   int     storeToPrsObject(VISU::GaussPoints_i* thePrs);
79
80  protected:
81   QButtonGroup*   RangeGroup;
82
83   QRadioButton*   RBhori;
84   QRadioButton*   RBvert;
85
86   QtxDblSpinBox*  XSpin;
87   QtxDblSpinBox*  YSpin;
88
89   QtxDblSpinBox*  WidthSpin;
90   QtxDblSpinBox*  HeightSpin;
91   QtxDblSpinBox*  SpacingSpin;
92
93   QRadioButton*   BicolorButton;
94   QRadioButton*   RainbowButton;
95   QLabel*         ColorLabel;
96   QSpinBox*       ColorSpin;
97   QLabel*         LabelLabel;
98   QSpinBox*       LabelSpin;
99
100   QCheckBox*      CBSave;
101   QLabel*         myModeLbl;
102   QComboBox*      myModeCombo;
103   QPushButton*    myTextBtn;
104   VisuGUI_TextPrefDlg* myTextDlg;
105   QRadioButton*   myRBLocal;
106   QRadioButton*   myRBGlobal;
107   QCheckBox*      myCBDisplayed;
108
109   double          Imin,   Imax;
110   double          myHorX, myHorY, myHorW, myHorH;
111   double          myVerX, myVerY, myVerW, myVerH;
112   int             myRangeMode;
113   bool myIsStoreTextProp;
114
115  private slots:
116   void changeDefaults( int );
117   void changeRange( int );
118   void XYChanged( double );
119   void onTextPref();
120   void onSetDisplayGlobal();
121 };
122
123 //! Create Gauss Points Presentation Dialog.
124 /*!
125  * Uses for set up initial parameters of the Gauss Points
126  * presentation and edit them interactively.
127  */
128 class VisuGUI_GaussPointsDlg : public QDialog
129 {
130   Q_OBJECT
131
132 public:
133   VisuGUI_GaussPointsDlg (SalomeApp_Module* theModule, bool SetPref = FALSE);
134   ~VisuGUI_GaussPointsDlg() {}
135
136   //! Initializing dialog from the Gauss Points presentation.
137   void    initFromPrsObject(VISU::GaussPoints_i* thePrs);
138
139   //! Update Gauss Points presentation using parameters from the dialog.
140   int     storeToPrsObject(VISU::GaussPoints_i* thePrs);
141
142 protected slots:
143   void    onToggleDefShape( bool );
144
145   void    accept();
146
147 private:
148   VISU::GaussPoints_i*     myPrs;
149   VisuGUI_GaussScalarBarPane* myScalarPane;
150
151   QRadioButton*            myResultsButton;
152   QRadioButton*            myGeometryButton;
153   QRadioButton*            myDefShapeButton;
154
155   VVTK_PrimitiveBox*       myPrimitiveBox;
156   VVTK_SizeBox*            mySizeBox;
157
158   QGroupBox*               myDefShapeBox;
159   QtxDblSpinBox*           myScaleSpinBox;
160 };
161
162 #endif // VISUGUI_GAUSSPOINTSDLS_H