]> SALOME platform Git repositories - modules/visu.git/blob - src/VISUGUI/VisuGUI_GaussPointsDlg.h
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[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.salome-platform.org/ or email : webmaster.salome@opencascade.com
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_Prs3dDlg.h"
32 #include "VISU_GaussPoints_i.hh"
33
34 #include <qvbox.h>
35
36 class QtxDblSpinBox;
37
38 class SalomeApp_Module;
39 class VVTK_PrimitiveBox;
40 class VVTK_SizeBox;
41 class VisuGUI_TextPrefDlg;
42 class VisuGUI_InputPane;
43
44
45 //! Specific Scalar Bar tab.
46 /*! Uses for set up Gauss Points Scalar Bars preferenses. */
47 class VisuGUI_GaussScalarBarPane : public QVBox
48 {
49   Q_OBJECT
50
51  public:
52   VisuGUI_GaussScalarBarPane(QWidget* parent);
53   ~VisuGUI_GaussScalarBarPane() {};
54
55   int     getOrientation();
56   void    setPosAndSize( double x, double y, double w, double h, bool vert );
57   void    setScalarBarData( int colors, int labels );
58   double  getX();
59   double  getY();
60   double  getWidth();
61   double  getHeight();
62   int     getNbColors();
63   int     getNbLabels();
64
65   void    initFromPrsObject(VISU::GaussPoints_i* thePrs, bool theInit);
66   int     storeToPrsObject(VISU::GaussPoints_i* thePrs);
67
68  protected:
69   QButtonGroup*   RangeGroup;
70   QRadioButton*   RBFieldRange;
71   QRadioButton*   RBImposedRange;
72   QLineEdit*      MinEdit;
73   QLineEdit*      MaxEdit;
74   SALOME::GenericObjPtr<VISU::GaussPoints_i> myPrsCopy;
75
76   QRadioButton*   RBhori;
77   QRadioButton*   RBvert;
78
79   QtxDblSpinBox*  XSpin;
80   QtxDblSpinBox*  YSpin;
81
82   QtxDblSpinBox*  WidthSpin;
83   QtxDblSpinBox*  HeightSpin;
84   QtxDblSpinBox*  SpacingSpin;
85
86   QRadioButton*   BicolorButton;
87   QRadioButton*   RainbowButton;
88   QLabel*         ColorLabel;
89   QSpinBox*       ColorSpin;
90   QLabel*         LabelLabel;
91   QSpinBox*       LabelSpin;
92
93   QLabel*         myModeLbl;
94   QComboBox*      myModeCombo;
95   QPushButton*    myTextBtn;
96   QPushButton*    myBarBtn;
97   VisuGUI_TextPrefDlg* myTextDlg;
98   VisuGUI_BarPrefDlg* myBarDlg;
99   QRadioButton*   myRBLocal;
100   QRadioButton*   myRBGlobal;
101   QCheckBox*      myCBDisplayed;
102
103   double          Imin,   Imax;
104   double          myHorX, myHorY, myHorW, myHorH;
105   double          myVerX, myVerY, myVerW, myVerH;
106   int             myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH;
107   int             myVerTW, myVerTH, myVerLW, myVerLH, 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   VVTK_PrimitiveBox*       myPrimitiveBox;
164   VVTK_SizeBox*            mySizeBox;
165
166   QGroupBox*               myDefShapeBox;
167   QtxDblSpinBox*           myScaleSpinBox;
168
169   SALOME::GenericObjPtr<VISU::GaussPoints_i> myPrsCopy;
170 };
171
172 #endif // VISUGUI_GAUSSPOINTSDLS_H