1 // VISU VISUGUI : GUI of VISU component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : VisuGUI_ScalarBarDlg.h
25 // Author : Laurent CORNABE & Hubert ROLLAND
29 #ifndef VISUGUI_SCALARBARDLG_H
30 #define VISUGUI_SCALARBARDLG_H
32 #include <qbuttongroup.h>
33 #include <qgroupbox.h>
35 #include <qradiobutton.h>
36 #include <qcheckbox.h>
37 #include <qpushbutton.h>
39 #include <qlineedit.h>
40 #include <qcombobox.h>
42 #include <qtoolbutton.h>
44 #include "QtxDblSpinBox.h"
62 #include "VISU_ScalarMap_i.hh"
64 class VisuGUI_TextPrefDlg: public QDialog
69 VisuGUI_TextPrefDlg(QWidget* parent);
70 ~VisuGUI_TextPrefDlg() {};
72 bool isBoldTitle() { return myTitBoldChk->isChecked();}
73 void setBoldTitle(bool isBold) { myTitBoldChk->setChecked(isBold);}
75 bool isItalicTitle() { return myTitItalicChk->isChecked();}
76 void setItalicTitle(bool isItalic) { myTitItalicChk->setChecked(isItalic);}
78 bool isShadowTitle() { return myTitShadowChk->isChecked();}
79 void setShadowTitle(bool isShadow) { myTitShadowChk->setChecked(isShadow);}
81 QString getTitleText() { return myTitleEdt->text();}
82 void setTitleText(QString theText) { myTitleEdt->setText(theText);}
84 QColor getTitleColor() { return myTitColor->paletteBackgroundColor();}
85 void setTitleColor(QColor theColor) { myTitColor->setPaletteBackgroundColor(theColor);}
88 void setTitleFont(int theFont);
91 bool isBoldLabel() { return myLblBoldChk->isChecked();}
92 void setBoldLabel(bool isBold) { myLblBoldChk->setChecked(isBold);}
94 bool isItalicLabel() { return myLblItalicChk->isChecked();}
95 void setItalicLabel(bool isItalic) { myLblItalicChk->setChecked(isItalic);}
97 bool isShadowLabel() { return myLblShadowChk->isChecked();}
98 void setShadowLabel(bool isShadow) { myLblShadowChk->setChecked(isShadow);}
100 QColor getLabelColor() { return myLblColor->paletteBackgroundColor();}
101 void setLabelColor(QColor theColor) { myLblColor->setPaletteBackgroundColor(theColor);}
104 void setLabelFont(int theFont);
106 void setTitleVisible(bool isVisible)
107 { (isVisible)? myTitleEdt->show() : myTitleEdt->hide();}
110 void setTitleColor();
111 void setLabelColor();
114 QLineEdit* myTitleEdt;
115 QComboBox* myTitFontCombo;
116 QCheckBox* myTitBoldChk;
117 QCheckBox* myTitItalicChk;
118 QCheckBox* myTitShadowChk;
119 QToolButton* myTitColor;
121 QComboBox* myLblFontCombo;
122 QCheckBox* myLblBoldChk;
123 QCheckBox* myLblItalicChk;
124 QCheckBox* myLblShadowChk;
125 QToolButton* myLblColor;
129 class VisuGUI_ScalarBarPane : public QVBox
134 VisuGUI_ScalarBarPane(QWidget* parent, bool SetPref);
135 ~VisuGUI_ScalarBarPane() {};
137 void setRange( double imin, double imax, /*double fmin, double fmax,*/ bool sbRange );
138 bool isIRange() {return RBIrange->isChecked();}
139 double getMin() {return MinEdit->text().toDouble();}
140 double getMax() {return MaxEdit->text().toDouble();}
141 int getOrientation();
142 void setPosAndSize( double x, double y, double w, double h, bool vert );
143 double getX() {return XSpin->value();}
144 double getY() {return YSpin->value();}
145 double getWidth() {return WidthSpin->value();}
146 double getHeight() {return HeightSpin->value();}
147 void setScalarBarData( int colors, int labels );
148 int getNbColors() {return ColorSpin->value();}
149 int getNbLabels() {return LabelSpin->value();}
150 bool isLogarithmic() {return CBLog->isChecked();}
151 void setLogarithmic( bool on ) {CBLog->setChecked( on );}
152 bool isToSave() {return CBSave ? CBSave->isChecked() : false;}
154 void initFromResources();
155 void storeToResources();
157 void initFromPrsObject(VISU::ScalarMap_i* thePrs);
158 int storeToPrsObject(VISU::ScalarMap_i* thePrs);
163 QButtonGroup* RangeGroup;
164 QRadioButton* RBFrange;
165 QRadioButton* RBIrange;
169 QRadioButton* RBhori;
170 QRadioButton* RBvert;
172 QtxDblSpinBox* XSpin;
173 QtxDblSpinBox* YSpin;
175 QtxDblSpinBox* WidthSpin;
176 QtxDblSpinBox* HeightSpin;
184 QComboBox* myModeCombo;
185 QPushButton* myTextBtn;
186 VisuGUI_TextPrefDlg* myTextDlg;
188 double Imin, Imax, /* Fmin, Fmax,*/ Rmin, Rmax;
189 double myHorX, myHorY, myHorW, myHorH;
190 double myVerX, myVerY, myVerW, myVerH;
192 bool myIsStoreTextProp;
195 void changeDefaults( int );
196 void changeRange( int );
197 void XYChanged( double );
203 class VisuGUI_ScalarBarDlg : public QDialog
208 VisuGUI_ScalarBarDlg( QWidget* parent = 0, bool SetPref = FALSE );
209 ~VisuGUI_ScalarBarDlg() {};
211 bool isToSave() {return myScalarPane->isToSave();}
213 void initFromResources() {myScalarPane->initFromResources();}
214 void storeToResources() {myScalarPane->storeToResources();}
216 void initFromPrsObject(VISU::ScalarMap_i* thePrs) {myScalarPane->initFromPrsObject(thePrs);}
217 int storeToPrsObject(VISU::ScalarMap_i* thePrs) {return myScalarPane->storeToPrsObject(thePrs);}
224 VisuGUI_ScalarBarPane* myScalarPane;
228 #endif // VISUGUI_SCALARBARDLG_H