-// VISU VISUGUI : GUI of VISU component
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-//
-//
+
+// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_ScalarBarDlg.h
// Author : Laurent CORNABE & Hubert ROLLAND
// Module : VISU
// $Header$
-
+//
#ifndef VISUGUI_SCALARBARDLG_H
#define VISUGUI_SCALARBARDLG_H
-#include <qdialog.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qpushbutton.h>
-#include <qspinbox.h>
-#include <qlineedit.h>
-#include <qcombobox.h>
-#include <qvbox.h>
-#include <qtoolbutton.h>
-
-#include "QtxDblSpinBox.h"
+#include "VisuGUI_Prs3dDlg.h"
-#include "VISU_ScalarMap_i.hh"
+class QTabWidget;
-class QButtonGroup;
-class QGroupBox;
-class QLabel;
-class QRadioButton;
-class QCheckBox;
-class QPushButton;
-class QSpinBox;
-class QLineEdit;
-class QComboBox;
-class QVBox;
-class QToolButton;
-class QtxDblSpinBox;
-class SalomeApp_Module;
-class SVTK_FontWidget;
-class VISU_ScalarMapAct;
+class VisuGUI_InputPane;
-class VisuGUI_TextPrefDlg: public QDialog
+namespace VISU
{
- Q_OBJECT;
-
- public:
- VisuGUI_TextPrefDlg (QWidget* parent);
- ~VisuGUI_TextPrefDlg() {};
+ class ScalarMap_i;
+}
- QString getTitleText() { return myTitleEdt->text(); }
- void setTitleText(QString theText) { myTitleEdt->setText(theText); }
-
- void setTitleVisible (bool isVisible)
- { (isVisible)? myTitleEdt->show() : myTitleEdt->hide(); }
-
- void storeBeginValues();
-
- public:
- SVTK_FontWidget* myTitleFont;
- SVTK_FontWidget* myLabelFont;
-
- protected slots:
- void accept();
- void reject();
- void onHelp();
-
- private:
- QLineEdit* myTitleEdt;
- QString myTitle;
- QColor myColors[2];
- int myComboVals[2];
- bool myCheckVals[6];
-};
-
-
-class VisuGUI_ScalarBarPane : public QVBox
+class VisuGUI_ScalarBarDlg : public VisuGUI_ScalarBarBaseDlg
{
Q_OBJECT;
public:
- VisuGUI_ScalarBarPane(QWidget* parent, bool SetPref);
- ~VisuGUI_ScalarBarPane() {};
-
- void setRange( double imin, double imax, /*double fmin, double fmax,*/ bool sbRange );
- void setDefaultRange(double imin, double imax);
- bool isIRange() {return RBIrange->isChecked();}
- double getMin() {return MinEdit->text().toDouble();}
- double getMax() {return MaxEdit->text().toDouble();}
- int getOrientation();
- void setPosAndSize( double x, double y, double w, double h, bool vert );
- double getX() {return XSpin->value();}
- double getY() {return YSpin->value();}
- double getWidth() {return WidthSpin->value();}
- double getHeight() {return HeightSpin->value();}
- void setScalarBarData( int colors, int labels );
- int getNbColors() {return ColorSpin->value();}
- int getNbLabels() {return LabelSpin->value();}
- bool isLogarithmic() {return CBLog->isChecked();}
- void setLogarithmic( bool on ) {CBLog->setChecked( on );}
- bool isToSave() {return CBSave ? CBSave->isChecked() : false;}
-
- void initFromResources();
- void storeToResources();
+ VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule);
+ ~VisuGUI_ScalarBarDlg();
- void initFromPrsObject(VISU::ScalarMap_i* thePrs);
- int storeToPrsObject(VISU::ScalarMap_i* thePrs);
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
- bool check();
- void deletePreview();
+ virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
protected:
- QButtonGroup* RangeGroup;
- QRadioButton* RBFrange;
- QRadioButton* RBIrange;
- QLineEdit* MinEdit;
- QLineEdit* MaxEdit;
-
- QRadioButton* RBhori;
- QRadioButton* RBvert;
-
- QtxDblSpinBox* XSpin;
- QtxDblSpinBox* YSpin;
-
- QtxDblSpinBox* WidthSpin;
- QtxDblSpinBox* HeightSpin;
-
- QSpinBox* ColorSpin;
- QSpinBox* LabelSpin;
-
- QCheckBox* CBSave;
- QCheckBox* CBLog;
- QLabel* myModeLbl;
- QComboBox* myModeCombo;
- QPushButton* myTextBtn;
- VisuGUI_TextPrefDlg* myTextDlg;
-
- double Imin, Imax, /* Fmin, Fmax,*/ Rmin, Rmax;
- double myHorX, myHorY, myHorW, myHorH;
- double myVerX, myVerY, myVerW, myVerH;
- int myRangeMode;
- bool myIsStoreTextProp;
-
- private slots:
- void changeDefaults( int );
- void changeRange( int );
- void XYChanged( double );
- void changeScalarMode( int );
- void onTextPref();
- void onPreviewCheck(bool thePreview);
- void updatePreview();
-
- private:
- void createScalarBar();
- void deleteScalarBar();
-
- QCheckBox* myPreviewCheck;
- VISU_ScalarMapAct* myPreviewActor;
- VISU::ScalarMap_i* myScalarMap;
- VISU_ScalarMapPL* myScalarMapPL;
- std::string myTitle;
-
- bool myBusy;
-};
-
-
-class VisuGUI_ScalarBarDlg : public QDialog
-{
- Q_OBJECT;
-
- public:
- VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule, bool SetPref = FALSE);
- ~VisuGUI_ScalarBarDlg() {};
-
- bool isToSave() {return myScalarPane->isToSave();}
-
- void initFromResources() {myScalarPane->initFromResources();}
- void storeToResources() {myScalarPane->storeToResources();}
-
- void initFromPrsObject(VISU::ScalarMap_i* thePrs) {myScalarPane->initFromPrsObject(thePrs);}
- int storeToPrsObject(VISU::ScalarMap_i* thePrs) {return myScalarPane->storeToPrsObject(thePrs);}
-
- protected slots:
- void accept();
- void reject();
- void onHelp();
+ virtual QString GetContextHelpFilePath();
protected:
- VisuGUI_ScalarBarPane* myScalarPane;
+ VisuGUI_InputPane* myInputPane;
+ QTabWidget* myTabBox;
+
+ SALOME::GenericObjPtr<VISU::ScalarMap_i> myPrsCopy;
};
#endif // VISUGUI_SCALARBARDLG_H