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