Salome HOME
ca6d55db619b105a7b60734ea71b28d97874cd5b
[modules/visu.git] / src / VISUGUI / VisuGUI_GaussPointsDlg.h
1 // Copyright (C) 2007-2011  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
23 //  VISU VISUGUI : GUI of VISU component
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_Prs3dDlg.h"
32 #include "VISU_GaussPoints_i.hh"
33
34 class SalomeApp_DoubleSpinBox;
35
36 class SalomeApp_Module;
37 class SalomeApp_IntSpinBox;
38 class VisuGUI_PrimitiveBox;
39 class VisuGUI_SizeBox;
40 class VisuGUI_TextPrefDlg;
41 class VisuGUI_InputPane;
42
43
44 //! Specific Scalar Bar tab.
45 /*! Uses for set up Gauss Points Scalar Bars preferenses. */
46 class VisuGUI_GaussScalarBarPane : public QWidget//QVBox
47 {
48   Q_OBJECT
49
50  public:
51   VisuGUI_GaussScalarBarPane(QWidget* parent);
52   ~VisuGUI_GaussScalarBarPane() {};
53
54   int     getOrientation();
55   void    setPosAndSize( double x, double y, double w, double h, bool vert );
56   void    setScalarBarData( int colors, int labels );
57   double  getX();
58   double  getY();
59   double  getWidth();
60   double  getHeight();
61   int     getNbColors();
62   int     getNbLabels();
63
64   void    initFromPrsObject(VISU::GaussPoints_i* thePrs, bool theInit);
65   int     storeToPrsObject(VISU::GaussPoints_i* thePrs);
66
67  protected:
68   QButtonGroup*   RangeGroup;
69   QRadioButton*   RBFieldRange;
70   QRadioButton*   RBImposedRange;
71   QLineEdit*      MinEdit;
72   QLineEdit*      MaxEdit;
73   SALOME::GenericObjPtr<VISU::GaussPoints_i> myPrsCopy;
74
75   QRadioButton*   RBhori;
76   QRadioButton*   RBvert;
77
78   SalomeApp_DoubleSpinBox*  XSpin;
79   SalomeApp_DoubleSpinBox*  YSpin;
80
81   SalomeApp_DoubleSpinBox*  WidthSpin;
82   SalomeApp_DoubleSpinBox*  HeightSpin;
83   SalomeApp_DoubleSpinBox*  SpacingSpin;
84
85   QRadioButton*   BicolorButton;
86   QRadioButton*   RainbowButton;
87   QLabel*         ColorLabel;
88   SalomeApp_IntSpinBox* ColorSpin;
89   QLabel*         LabelLabel;
90   SalomeApp_IntSpinBox* LabelSpin;
91
92   QLabel*         myModeLbl;
93   QComboBox*      myModeCombo;
94   QPushButton*    myTextBtn;
95   QPushButton*    myBarBtn;
96   VisuGUI_TextPrefDlg* myTextDlg;
97   VisuGUI_BarPrefDlg* myBarDlg;
98   QRadioButton*   myRBLocal;
99   QRadioButton*   myRBGlobal;
100   QCheckBox*      myCBDisplayed;
101   QCheckBox*      myHideBar;
102
103   double          Imin,   Imax;
104   double          myHorX, myHorY, myHorW, myHorH;
105   double          myVerX, myVerY, myVerW, myVerH;
106   int             myHorTS, myHorLS, myHorBW, myHorBH;
107   int             myVerTS, myVerLS, myVerBW, myVerBH;
108   int             myRangeMode;
109   bool myIsStoreTextProp;
110
111   bool UseFieldRange( bool theInit = true );
112
113  private slots:
114   void onGlobalScalarBar();
115   void onLocalScalarBar();
116
117   void fieldRangeClicked();
118   void imposedRangeClicked();
119   void changeScalarMode( int );
120
121   void changeDefaults( int );
122   void XYChanged( double );
123   void onTextPref();
124   void onBarPref();
125 };
126
127 //! Create Gauss Points Presentation Dialog.
128 /*!
129  * Uses for set up initial parameters of the Gauss Points
130  * presentation and edit them interactively.
131  */
132 class VisuGUI_GaussPointsDlg : public VisuGUI_Prs3dDlg
133 {
134   Q_OBJECT
135
136 public:
137   VisuGUI_GaussPointsDlg (SalomeApp_Module* theModule);
138   ~VisuGUI_GaussPointsDlg();
139
140   //! Initializing dialog from the Gauss Points presentation.
141   virtual void    initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
142                                      bool theInit );
143
144   //! Update Gauss Points presentation using parameters from the dialog.
145   virtual int     storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
146
147 protected:
148   virtual QString GetContextHelpFilePath();
149  
150 protected slots:
151   void    onToggleDefShape( bool );
152   void    accept();
153
154 private:
155   QTabWidget*              myTabBox;
156   VisuGUI_GaussScalarBarPane* myScalarPane;
157   VisuGUI_InputPane*       myInputPane;
158
159   QRadioButton*            myResultsButton;
160   QRadioButton*            myGeometryButton;
161   QRadioButton*            myDefShapeButton;
162
163   VisuGUI_PrimitiveBox*    myPrimitiveBox;
164   VisuGUI_SizeBox*         mySizeBox;
165
166   QGroupBox*               myDefShapeBox;
167   SalomeApp_DoubleSpinBox* myScaleSpinBox;
168
169   SALOME::GenericObjPtr<VISU::GaussPoints_i> myPrsCopy;
170   SalomeApp_Module*        myModule;
171 };
172
173 #endif // VISUGUI_GAUSSPOINTSDLS_H