#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;
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" );
buttonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
+ TopLayout->addWidget(aTabBox);
TopLayout->addWidget( GroupButtons );
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
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 );
+}