]> SALOME platform Git repositories - modules/visu.git/blob - src/VISUGUI/VisuGUI_GaussPointsDlg.h
Salome HOME
IPAL20954 problem loading help pages
[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
100   double          Imin,   Imax;
101   double          myHorX, myHorY, myHorW, myHorH;
102   double          myVerX, myVerY, myVerW, myVerH;
103   int             myHorTS, myHorLS, myHorBW, myHorBH;
104   int             myVerTS, myVerLS, myVerBW, myVerBH;
105   int             myRangeMode;
106   bool myIsStoreTextProp;
107
108   bool UseFieldRange( bool theInit = true );
109
110  private slots:
111   void onGlobalScalarBar();
112   void onLocalScalarBar();
113
114   void fieldRangeClicked();
115   void imposedRangeClicked();
116   void changeScalarMode( int );
117
118   void changeDefaults( int );
119   void XYChanged( double );
120   void onTextPref();
121   void onBarPref();
122 };
123
124 //! Create Gauss Points Presentation Dialog.
125 /*!
126  * Uses for set up initial parameters of the Gauss Points
127  * presentation and edit them interactively.
128  */
129 class VisuGUI_GaussPointsDlg : public VisuGUI_Prs3dDlg
130 {
131   Q_OBJECT
132
133 public:
134   VisuGUI_GaussPointsDlg (SalomeApp_Module* theModule);
135   ~VisuGUI_GaussPointsDlg();
136
137   //! Initializing dialog from the Gauss Points presentation.
138   virtual void    initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
139                                      bool theInit );
140
141   //! Update Gauss Points presentation using parameters from the dialog.
142   virtual int     storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
143
144 protected:
145   virtual QString GetContextHelpFilePath();
146  
147 protected slots:
148   void    onToggleDefShape( bool );
149   void    accept();
150
151 private:
152   QTabWidget*              myTabBox;
153   VisuGUI_GaussScalarBarPane* myScalarPane;
154   VisuGUI_InputPane*       myInputPane;
155
156   QRadioButton*            myResultsButton;
157   QRadioButton*            myGeometryButton;
158   QRadioButton*            myDefShapeButton;
159
160   VVTK_PrimitiveBox*       myPrimitiveBox;
161   VVTK_SizeBox*            mySizeBox;
162
163   QGroupBox*               myDefShapeBox;
164   QtxDoubleSpinBox*           myScaleSpinBox;
165
166   SALOME::GenericObjPtr<VISU::GaussPoints_i> myPrsCopy;
167   SalomeApp_Module*        myModule;
168 };
169
170 #endif // VISUGUI_GAUSSPOINTSDLS_H