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 "QAD_SpinBoxDbl.h"
35 #include <qbuttongroup.h>
36 #include <qgroupbox.h>
38 #include <qradiobutton.h>
39 #include <qcheckbox.h>
40 #include <qpushbutton.h>
42 #include <qlineedit.h>
43 #include <qcombobox.h>
45 #include <qtoolbutton.h>
47 #include "VISU_ScalarMap_i.hh"
50 class VisuGUI_TextPrefDlg: public QDialog
55 VisuGUI_TextPrefDlg(QWidget* parent);
56 ~VisuGUI_TextPrefDlg() {};
58 bool isBoldTitle() { return myTitBoldChk->isChecked();}
59 void setBoldTitle(bool isBold) { myTitBoldChk->setChecked(isBold);}
61 bool isItalicTitle() { return myTitItalicChk->isChecked();}
62 void setItalicTitle(bool isItalic) { myTitItalicChk->setChecked(isItalic);}
64 bool isShadowTitle() { return myTitShadowChk->isChecked();}
65 void setShadowTitle(bool isShadow) { myTitShadowChk->setChecked(isShadow);}
67 QString getTitleText() { return myTitleEdt->text();}
68 void setTitleText(QString theText) { myTitleEdt->setText(theText);}
70 QColor getTitleColor() { return myTitColor->paletteBackgroundColor();}
71 void setTitleColor(QColor theColor) { myTitColor->setPaletteBackgroundColor(theColor);}
74 void setTitleFont(int theFont);
77 bool isBoldLabel() { return myLblBoldChk->isChecked();}
78 void setBoldLabel(bool isBold) { myLblBoldChk->setChecked(isBold);}
80 bool isItalicLabel() { return myLblItalicChk->isChecked();}
81 void setItalicLabel(bool isItalic) { myLblItalicChk->setChecked(isItalic);}
83 bool isShadowLabel() { return myLblShadowChk->isChecked();}
84 void setShadowLabel(bool isShadow) { myLblShadowChk->setChecked(isShadow);}
86 QColor getLabelColor() { return myLblColor->paletteBackgroundColor();}
87 void setLabelColor(QColor theColor) { myLblColor->setPaletteBackgroundColor(theColor);}
90 void setLabelFont(int theFont);
92 void setTitleVisible(bool isVisible)
93 { (isVisible)? myTitleEdt->show() : myTitleEdt->hide();}
100 QLineEdit* myTitleEdt;
101 QComboBox* myTitFontCombo;
102 QCheckBox* myTitBoldChk;
103 QCheckBox* myTitItalicChk;
104 QCheckBox* myTitShadowChk;
105 QToolButton* myTitColor;
107 QComboBox* myLblFontCombo;
108 QCheckBox* myLblBoldChk;
109 QCheckBox* myLblItalicChk;
110 QCheckBox* myLblShadowChk;
111 QToolButton* myLblColor;
115 class VisuGUI_ScalarBarPane : public QVBox
120 VisuGUI_ScalarBarPane(QWidget* parent, bool SetPref);
121 ~VisuGUI_ScalarBarPane() {};
123 void setRange( double imin, double imax, /*double fmin, double fmax,*/ bool sbRange );
124 bool isIRange() {return RBIrange->isChecked();}
125 double getMin() {return MinEdit->text().toDouble();}
126 double getMax() {return MaxEdit->text().toDouble();}
127 int getOrientation();
128 void setPosAndSize( double x, double y, double w, double h, bool vert );
129 double getX() {return XSpin->value();}
130 double getY() {return YSpin->value();}
131 double getWidth() {return WidthSpin->value();}
132 double getHeight() {return HeightSpin->value();}
133 void setScalarBarData( int colors, int labels );
134 int getNbColors() {return ColorSpin->value();}
135 int getNbLabels() {return LabelSpin->value();}
136 bool isLogarithmic() {return CBLog->isChecked();}
137 void setLogarithmic( bool on ) {CBLog->setChecked( on );}
138 bool isToSave() {return CBSave ? CBSave->isChecked() : false;}
140 void initFromResources();
141 void storeToResources();
143 void initFromPrsObject(VISU::ScalarMap_i* thePrs);
144 int storeToPrsObject(VISU::ScalarMap_i* thePrs);
149 QButtonGroup* RangeGroup;
150 QRadioButton* RBFrange;
151 QRadioButton* RBIrange;
155 QRadioButton* RBhori;
156 QRadioButton* RBvert;
158 QAD_SpinBoxDbl* XSpin;
159 QAD_SpinBoxDbl* YSpin;
161 QAD_SpinBoxDbl* WidthSpin;
162 QAD_SpinBoxDbl* HeightSpin;
170 QComboBox* myModeCombo;
171 QPushButton* myTextBtn;
172 VisuGUI_TextPrefDlg* myTextDlg;
174 double Imin, Imax, /* Fmin, Fmax,*/ Rmin, Rmax;
175 double myHorX, myHorY, myHorW, myHorH;
176 double myVerX, myVerY, myVerW, myVerH;
178 bool myIsStoreTextProp;
181 void changeDefaults( int );
182 void changeRange( int );
183 void XYChanged( double );
189 class VisuGUI_ScalarBarDlg : public QDialog
194 VisuGUI_ScalarBarDlg( bool SetPref = FALSE );
195 ~VisuGUI_ScalarBarDlg() {};
197 bool isToSave() {return myScalarPane->isToSave();}
199 void initFromResources() {myScalarPane->initFromResources();}
200 void storeToResources() {myScalarPane->storeToResources();}
202 void initFromPrsObject(VISU::ScalarMap_i* thePrs) {myScalarPane->initFromPrsObject(thePrs);}
203 int storeToPrsObject(VISU::ScalarMap_i* thePrs) {return myScalarPane->storeToPrsObject(thePrs);}
210 VisuGUI_ScalarBarPane* myScalarPane;
214 #endif // VISUGUI_SCALARBARDLG_H