]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Tab of preferences for Gauss Point results added
authorouv <ouv@opencascade.com>
Thu, 8 Sep 2005 07:49:29 +0000 (07:49 +0000)
committerouv <ouv@opencascade.com>
Thu, 8 Sep 2005 07:49:29 +0000 (07:49 +0000)
src/VISUGUI/VISUM_images.po
src/VISUGUI/VISUM_msg_en.po
src/VISUGUI/VisuGUI_GaussPointsDlg.cxx
src/VISUGUI/VisuGUI_GaussPointsDlg.h

index 1bde3ccc06aea8016ef9673f1698b59bdc2367a5..647fb7212abb0b492e69933cf8ef408c69db7714 100644 (file)
@@ -39,3 +39,5 @@ msgstr "Visu_vvtk_switch.png"
 msgid "ICON_VVTK_SELECTION_MODE_SWITCH"
 msgstr "Visu_points.png"
 
+msgid "ICON_LOAD_TEXTURE"
+msgstr "Visu_load_texture.png"
index 76e0e9c280e6193d3db7db350afa674a0fc2af6a..f1d7688733817a90cb688c219b4c31c626a52fa8 100644 (file)
@@ -114,5 +114,59 @@ msgstr "Selection Mode Switch"
 msgid "VVTK_ViewWindow::DSC_VVTK_SELECTION_MODE_SWITCH"
 msgstr "Selection Mode Switch"
 
+msgid "VisuGUI_GaussPointsDlg::&Cancel"
+msgstr ""
+
+msgid "VisuGUI_GaussPointsDlg::&OK"
+msgstr ""
+
+msgid "VisuGUI_GaussPointsDlg::DLG_TITLE"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_GaussPointsDlg::GAUSS_POINTS_TAB"
+msgstr "Gauss Points"
+
+msgid "VisuGUI_GaussPointsDlg::SCALAR_BAR_TAB"
+msgstr "Scalar Bar"
+
+msgid "VisuGUI_GaussPointsDlg::PRIMITIVE_TITLE"
+msgstr "Primitive"
+
+msgid "VisuGUI_GaussPointsDlg::SIZE_TITLE"
+msgstr "Size"
+
+msgid "VisuGUI_GaussPointsDlg::POINT_SPRITE"
+msgstr "Point Sprite"
+
+msgid "VisuGUI_GaussPointsDlg::OPENGL_POINT"
+msgstr "OpenGL Point"
+
+msgid "VisuGUI_GaussPointsDlg::GEOMETRICAL_SPHERE"
+msgstr "Geometrical Sphere"
+
+msgid "VisuGUI_GaussPointsDlg::MAXIMUM_SIZE"
+msgstr "Maximum Size (Clamp) : "
+
+msgid "VisuGUI_GaussPointsDlg::ALPHA_CHANNEL_THRESHOLD"
+msgstr "Alpha Channel Threshold : "
+
+msgid "VisuGUI_GaussPointsDlg::MAIN_TEXTURE"
+msgstr "Main Texture (16x16) : "
+
+msgid "VisuGUI_GaussPointsDlg::ALPHA_CHANNEL_TEXTURE"
+msgstr "Alpha Channel Texture (16x16) : "
+
+msgid "VisuGUI_GaussPointsDlg::MIN_SIZE"
+msgstr "Range values for min size (%) : "
+
+msgid "VisuGUI_GaussPointsDlg::MAX_SIZE"
+msgstr "max size (%) : "
+
+msgid "VisuGUI_GaussPointsDlg::MAGNIFICATION"
+msgstr "Magnification (%) : "
+
+msgid "VisuGUI_GaussPointsDlg::INCREMENT"
+msgstr "Increment : "
+
 msgid "VVTK_ViewWindow::LBL_TOOLBAR_LABEL"
-msgstr "GAUSS viewer tools"
\ No newline at end of file
+msgstr "GAUSS viewer tools"
index e912e22081fd8ceb2b5271997f65ea4c6287fc1e..2729f7ef1acebcc8406c2c7b8a606a475a63b49c 100644 (file)
 
 #include "SalomeApp_Module.h"
 #include "SUIT_Desktop.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
 
 #include "QtxDblSpinBox.h"
 
 #include <qlayout.h>
 #include <qtabwidget.h>
+#include <qbuttongroup.h>
+#include <qradiobutton.h>
+#include <qfiledialog.h>
 
 using namespace std;
 
@@ -54,12 +59,141 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool
   setCaption(SetPref ? tr("DLG_PREF_TITLE") : tr("DLG_PROP_TITLE"));
   setSizeGripEnabled(TRUE);
 
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+
   QVBoxLayout* TopLayout = new QVBoxLayout(this);
   TopLayout->setSpacing(6);
   TopLayout->setMargin(11);
 
+
+  QTabWidget* aTabBox = new QTabWidget (this);
+
+  // Gauss points pane
+  QVBox* aBox = new QVBox (this);
+  aBox->setMargin(11);
+  aBox->setSpacing(6);
+
+  // Primitive
+  QGroupBox* TopGroup = new QGroupBox ( tr( "PRIMITIVE_TITLE" ), aBox, "TopGroup" );
+  TopGroup->setColumnLayout(0, Qt::Vertical );
+  TopGroup->layout()->setSpacing( 0 );
+  TopGroup->layout()->setMargin( 0 );
+
+  QGridLayout* TopGroupLayout = new QGridLayout (TopGroup->layout());
+  TopGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+  TopGroupLayout->setSpacing(6);
+  TopGroupLayout->setMargin(11);
+
+  // Primitive Type
+  QButtonGroup* aPrimitiveTypeGroup = new QButtonGroup( 3, Qt::Horizontal, TopGroup, "PrimitiveTypeGroup" );
+  aPrimitiveTypeGroup->setRadioButtonExclusive( true );
+  aPrimitiveTypeGroup->setFrameStyle( QFrame::NoFrame );
+
+  QRadioButton* aPointSpriteButton = new QRadioButton( tr( "POINT_SPRITE" ), aPrimitiveTypeGroup );
+  aPointSpriteButton->setChecked( true );
+
+  QRadioButton* anOpenGLPointButton = new QRadioButton( tr( "OPENGL_POINT" ), aPrimitiveTypeGroup );
+  QRadioButton* aGeometricalSphereButton = new QRadioButton( tr( "GEOMETRICAL_SPHERE" ), aPrimitiveTypeGroup );
+
+  TopGroupLayout->addMultiCellWidget( aPrimitiveTypeGroup, 0, 0, 0, 2 );
+
+  // Maximum Size
+  QLabel* aMaximumSizeLabel = new QLabel( tr( "MAXIMUM_SIZE" ), TopGroup );
+  QtxDblSpinBox* aMaximumSizeSpinBox = new QtxDblSpinBox( 1.0, 512.0, 1.0, TopGroup );
+  aMaximumSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  aMaximumSizeSpinBox->setValue( 256.0 );
+
+  TopGroupLayout->addWidget( aMaximumSizeLabel, 1, 0 );
+  TopGroupLayout->addMultiCellWidget( aMaximumSizeSpinBox, 1, 1, 1, 2 );
+
+  // Main Texture
+  QLabel* aMainTextureLabel = new QLabel( tr( "MAIN_TEXTURE" ), TopGroup );
+  myMainTextureLineEdit = new QLineEdit( TopGroup );
+  QPushButton* aMainTextureButton = new QPushButton( TopGroup );
+  aMainTextureButton->setAutoDefault( false );
+  aMainTextureButton->setPixmap( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
+  connect( aMainTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseMainTexture() ) );
+
+  TopGroupLayout->addWidget( aMainTextureLabel, 2, 0 );
+  TopGroupLayout->addWidget( myMainTextureLineEdit, 2, 1 );
+  TopGroupLayout->addWidget( aMainTextureButton, 2, 2 );
+
+  // Alpha Channel Texture
+  QLabel* aAlphaChannelTextureLabel = new QLabel( tr( "ALPHA_CHANNEL_TEXTURE" ), TopGroup );
+  myAlphaChannelTextureLineEdit = new QLineEdit( TopGroup );
+  QPushButton* aAlphaChannelTextureButton = new QPushButton( TopGroup );
+  aAlphaChannelTextureButton->setAutoDefault( false );
+  aAlphaChannelTextureButton->setPixmap( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) );
+  connect( aAlphaChannelTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseAlphaChannelTexture() ) );
+
+  TopGroupLayout->addWidget( aAlphaChannelTextureLabel, 3, 0 );
+  TopGroupLayout->addWidget( myAlphaChannelTextureLineEdit, 3, 1 );
+  TopGroupLayout->addWidget( aAlphaChannelTextureButton, 3, 2 );
+
+  // Alpha Channel Threshold
+  QLabel* aAlphaChannelThresholdLabel = new QLabel( tr( "ALPHA_CHANNEL_THRESHOLD" ), TopGroup );
+  QtxDblSpinBox* aAlphaChannelThresholdSpinBox = new QtxDblSpinBox( 0.0, 1.0, 0.1, TopGroup );
+  aAlphaChannelThresholdSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  aAlphaChannelThresholdSpinBox->setValue( 0.1 );
+
+  TopGroupLayout->addWidget( aAlphaChannelThresholdLabel, 4, 0 );
+  TopGroupLayout->addMultiCellWidget( aAlphaChannelThresholdSpinBox, 4, 4, 1, 2 );
+
+
+  // Size
+  QGroupBox* BottomGroup = new QGroupBox ( tr( "SIZE_TITLE" ), aBox, "BottomGroup" );
+  BottomGroup->setColumnLayout(0, Qt::Vertical );
+  BottomGroup->layout()->setSpacing( 0 );
+  BottomGroup->layout()->setMargin( 0 );
+
+  QGridLayout* BottomGroupLayout = new QGridLayout (BottomGroup->layout());
+  BottomGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+  BottomGroupLayout->setSpacing(6);
+  BottomGroupLayout->setMargin(11);
+
+  // Min Size
+  QLabel* aMinSizeLabel = new QLabel( tr( "MIN_SIZE" ), BottomGroup );
+  QtxDblSpinBox* aMinSizeSpinBox = new QtxDblSpinBox( 0, 100, 1, BottomGroup );
+  aMinSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  aMinSizeSpinBox->setValue( 10 );
+
+  BottomGroupLayout->addWidget( aMinSizeLabel, 0, 0 );
+  BottomGroupLayout->addWidget( aMinSizeSpinBox, 0, 1 );
+
+  // Max Size
+  QLabel* aMaxSizeLabel = new QLabel( tr( "MAX_SIZE" ), BottomGroup );
+  QtxDblSpinBox* aMaxSizeSpinBox = new QtxDblSpinBox( 0, 100, 1, BottomGroup );
+  aMaxSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  aMaxSizeSpinBox->setValue( 33 );
+
+  BottomGroupLayout->addWidget( aMaxSizeLabel, 0, 2 );
+  BottomGroupLayout->addWidget( aMaxSizeSpinBox, 0, 3 );
+
+  // Magnification
+  QLabel* aMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), BottomGroup );
+  QtxDblSpinBox* aMagnificationSpinBox = new QtxDblSpinBox( 50, 200, 10, BottomGroup );
+  aMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  aMagnificationSpinBox->setValue( 100 );
+
+  BottomGroupLayout->addWidget( aMagnificationLabel, 1, 0 );
+  BottomGroupLayout->addWidget( aMagnificationSpinBox, 1, 1 );
+
+  // Increment
+  QLabel* aIncrementLabel = new QLabel( tr( "INCREMENT" ), BottomGroup );
+  QtxDblSpinBox* aIncrementSpinBox = new QtxDblSpinBox( 5, 50, 5, BottomGroup );
+  aIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  aIncrementSpinBox->setValue( 10 );
+
+  BottomGroupLayout->addWidget( aIncrementLabel, 1, 2 );
+  BottomGroupLayout->addWidget( aIncrementSpinBox, 1, 3 );
+
+
   myScalarPane = new VisuGUI_ScalarBarPane(this, SetPref);
-  TopLayout->addWidget(myScalarPane);
+  myScalarPane->setMargin(5);
+
+
+  aTabBox->addTab(aBox, tr("GAUSS_POINTS_TAB"));
+  aTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB"));
 
   // Common buttons ===========================================================
   QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
@@ -81,6 +215,7 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool
   buttonCancel->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
 
+  TopLayout->addWidget(aTabBox);
   TopLayout->addWidget( GroupButtons );
 
   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
@@ -100,3 +235,19 @@ int VisuGUI_GaussPointsDlg::storeToPrsObject(VISU::GaussPoints_i* thePrs)
 void VisuGUI_GaussPointsDlg::accept() {
   if (myScalarPane->check())  QDialog::accept();
 }
+
+void VisuGUI_GaussPointsDlg::onBrowseMainTexture()
+{
+  QString aFileName = QFileDialog::getOpenFileName( QString::null, "Bitmap (*.jpg *.gif *.png)", this );
+
+  if( !aFileName.isNull() )
+    myMainTextureLineEdit->setText( aFileName );
+}
+
+void VisuGUI_GaussPointsDlg::onBrowseAlphaChannelTexture()
+{
+  QString aFileName = QFileDialog::getOpenFileName( QString::null, "Bitmap (*.jpg *.gif *.png)", this );
+
+  if( !aFileName.isNull() )
+    myAlphaChannelTextureLineEdit->setText( aFileName );
+}
index 782e1b74392f9c0a64aa30dbfc7df746c120678e..d044d028a60a520de046934c5374eb180a1d351f 100644 (file)
@@ -37,6 +37,7 @@
 #include <qcheckbox.h>
 #include <qlabel.h>
 #include <qpushbutton.h>
+#include <qlineedit.h>
 
 class SalomeApp_Module;
 
@@ -59,8 +60,14 @@ public:
 protected slots:
   void accept();
 
- private:
-    VisuGUI_ScalarBarPane* myScalarPane;
+  void onBrowseMainTexture();
+  void onBrowseAlphaChannelTexture();
+
+private:
+  VisuGUI_ScalarBarPane* myScalarPane;
+
+  QLineEdit* myMainTextureLineEdit;
+  QLineEdit* myAlphaChannelTextureLineEdit;
 };
 
 #endif // VISUGUI_GAUSSPOINTSDLS_H