#include "VISU_GaussPoints_i.hh"
#include "VISU_GaussPointsPL.hxx"
-//#include "VISU_ScalarMap_i.hh"
#include "VISU_ScalarMapPL.hxx"
#include "VISU_Convertor.hxx"
TopLayout->setMargin(11);
+ // Presentation
+ QButtonGroup* PrsGroup = new QButtonGroup( 2, Qt::Horizontal, tr( "PRS_TITLE" ), this, "PrimitiveTypeGroup" );
+ PrsGroup->setRadioButtonExclusive( true );
+ PrsGroup->layout()->setMargin( 11 );
+ PrsGroup->layout()->setSpacing(6);
+
+ myResultsButton = new QRadioButton( tr( "RESULTS" ), PrsGroup );
+ myGeometryButton = new QRadioButton( tr( "GEOMETRY" ), PrsGroup );
+
QTabWidget* aTabBox = new QTabWidget (this);
// Gauss points pane
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 );
+ QGroupBox* PrimitiveGroup = new QGroupBox ( tr( "PRIMITIVE_TITLE" ), aBox, "PrimitiveGroup" );
+ PrimitiveGroup->setColumnLayout(0, Qt::Vertical );
+ PrimitiveGroup->layout()->setSpacing( 0 );
+ PrimitiveGroup->layout()->setMargin( 0 );
- QGridLayout* TopGroupLayout = new QGridLayout (TopGroup->layout());
- TopGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- TopGroupLayout->setSpacing(6);
- TopGroupLayout->setMargin(11);
+ QGridLayout* PrimitiveGroupLayout = new QGridLayout (PrimitiveGroup->layout());
+ PrimitiveGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ PrimitiveGroupLayout->setSpacing(6);
+ PrimitiveGroupLayout->setMargin(11);
// Primitive Type
- QButtonGroup* aPrimitiveTypeGroup = new QButtonGroup( 3, Qt::Horizontal, TopGroup, "PrimitiveTypeGroup" );
+ QButtonGroup* aPrimitiveTypeGroup = new QButtonGroup( 3, Qt::Horizontal, PrimitiveGroup, "PrimitiveTypeGroup" );
aPrimitiveTypeGroup->setRadioButtonExclusive( true );
aPrimitiveTypeGroup->setFrameStyle( QFrame::NoFrame );
aPrimitiveTypeGroup->layout()->setMargin( 0 );
QRadioButton* aGeometricalSphereButton = new QRadioButton( tr( "GEOMETRICAL_SPHERE" ), aPrimitiveTypeGroup );
aGeometricalSphereButton->setEnabled( false );
- TopGroupLayout->addMultiCellWidget( aPrimitiveTypeGroup, 0, 0, 0, 2 );
+ PrimitiveGroupLayout->addMultiCellWidget( aPrimitiveTypeGroup, 0, 0, 0, 2 );
// Clamp
- QLabel* aClampLabel = new QLabel( tr( "MAXIMUM_SIZE" ), TopGroup );
- myClampSpinBox = new QtxDblSpinBox( 1.0, 512.0, 1.0, TopGroup );
+ QLabel* aClampLabel = new QLabel( tr( "MAXIMUM_SIZE" ), PrimitiveGroup );
+ myClampSpinBox = new QtxDblSpinBox( 1.0, 512.0, 1.0, PrimitiveGroup );
myClampSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myClampSpinBox->setValue( 200.0 );
- TopGroupLayout->addWidget( aClampLabel, 1, 0 );
- TopGroupLayout->addMultiCellWidget( myClampSpinBox, 1, 1, 1, 2 );
+ PrimitiveGroupLayout->addWidget( aClampLabel, 1, 0 );
+ PrimitiveGroupLayout->addMultiCellWidget( myClampSpinBox, 1, 1, 1, 2 );
// Main Texture
- QLabel* aMainTextureLabel = new QLabel( tr( "MAIN_TEXTURE" ), TopGroup );
- myMainTextureLineEdit = new QLineEdit( TopGroup );
- QPushButton* aMainTextureButton = new QPushButton( TopGroup );
+ QLabel* aMainTextureLabel = new QLabel( tr( "MAIN_TEXTURE" ), PrimitiveGroup );
+ myMainTextureLineEdit = new QLineEdit( PrimitiveGroup );
+ QPushButton* aMainTextureButton = new QPushButton( PrimitiveGroup );
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 );
+ PrimitiveGroupLayout->addWidget( aMainTextureLabel, 2, 0 );
+ PrimitiveGroupLayout->addWidget( myMainTextureLineEdit, 2, 1 );
+ PrimitiveGroupLayout->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 );
+ QLabel* aAlphaChannelTextureLabel = new QLabel( tr( "ALPHA_CHANNEL_TEXTURE" ), PrimitiveGroup );
+ myAlphaChannelTextureLineEdit = new QLineEdit( PrimitiveGroup );
+ QPushButton* aAlphaChannelTextureButton = new QPushButton( PrimitiveGroup );
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 );
+ PrimitiveGroupLayout->addWidget( aAlphaChannelTextureLabel, 3, 0 );
+ PrimitiveGroupLayout->addWidget( myAlphaChannelTextureLineEdit, 3, 1 );
+ PrimitiveGroupLayout->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 );
+ QLabel* aAlphaChannelThresholdLabel = new QLabel( tr( "ALPHA_CHANNEL_THRESHOLD" ), PrimitiveGroup );
+ QtxDblSpinBox* aAlphaChannelThresholdSpinBox = new QtxDblSpinBox( 0.0, 1.0, 0.1, PrimitiveGroup );
aAlphaChannelThresholdSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
aAlphaChannelThresholdSpinBox->setValue( 0.1 );
- TopGroupLayout->addWidget( aAlphaChannelThresholdLabel, 4, 0 );
- TopGroupLayout->addMultiCellWidget( aAlphaChannelThresholdSpinBox, 4, 4, 1, 2 );
-
+ PrimitiveGroupLayout->addWidget( aAlphaChannelThresholdLabel, 4, 0 );
+ PrimitiveGroupLayout->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 );
+ QGroupBox* SizeGroup = new QGroupBox ( tr( "SIZE_TITLE" ), aBox, "SizeGroup" );
+ SizeGroup->setColumnLayout(0, Qt::Vertical );
+ SizeGroup->layout()->setSpacing( 0 );
+ SizeGroup->layout()->setMargin( 0 );
+
+ QGridLayout* SizeGroupLayout = new QGridLayout (SizeGroup->layout());
+ SizeGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ SizeGroupLayout->setSpacing(6);
+ SizeGroupLayout->setMargin(11);
+
+ // Geometry Size
+ mySizeLabel = new QLabel( tr( "SIZE" ), SizeGroup );
+ mySizeSpinBox = new QtxDblSpinBox( 0, 100, 1, SizeGroup );
+ mySizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ mySizeSpinBox->setValue( 10 );
- QGridLayout* BottomGroupLayout = new QGridLayout (BottomGroup->layout());
- BottomGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- BottomGroupLayout->setSpacing(6);
- BottomGroupLayout->setMargin(11);
+ SizeGroupLayout->addWidget( mySizeLabel, 0, 0 );
+ SizeGroupLayout->addWidget( mySizeSpinBox, 0, 1 );
// Min Size
- QLabel* aMinSizeLabel = new QLabel( tr( "MIN_SIZE" ), BottomGroup );
- myMinSizeSpinBox = new QtxDblSpinBox( 0, 100, 1, BottomGroup );
+ myMinSizeLabel = new QLabel( tr( "MIN_SIZE" ), SizeGroup );
+ myMinSizeSpinBox = new QtxDblSpinBox( 0, 100, 1, SizeGroup );
myMinSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myMinSizeSpinBox->setValue( 10 );
- BottomGroupLayout->addWidget( aMinSizeLabel, 0, 0 );
- BottomGroupLayout->addWidget( myMinSizeSpinBox, 0, 1 );
+ SizeGroupLayout->addWidget( myMinSizeLabel, 1, 0 );
+ SizeGroupLayout->addWidget( myMinSizeSpinBox, 1, 1 );
// Max Size
- QLabel* aMaxSizeLabel = new QLabel( tr( "MAX_SIZE" ), BottomGroup );
- myMaxSizeSpinBox = new QtxDblSpinBox( 0, 100, 1, BottomGroup );
+ myMaxSizeLabel = new QLabel( tr( "MAX_SIZE" ), SizeGroup );
+ myMaxSizeSpinBox = new QtxDblSpinBox( 0, 100, 1, SizeGroup );
myMaxSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myMaxSizeSpinBox->setValue( 33 );
- BottomGroupLayout->addWidget( aMaxSizeLabel, 0, 2 );
- BottomGroupLayout->addWidget( myMaxSizeSpinBox, 0, 3 );
+ SizeGroupLayout->addWidget( myMaxSizeLabel, 1, 2 );
+ SizeGroupLayout->addWidget( myMaxSizeSpinBox, 1, 3 );
// Magnification
- QLabel* aMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), BottomGroup );
- myMagnificationSpinBox = new QtxDblSpinBox( 50, 200, 10, BottomGroup );
+ QLabel* aMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), SizeGroup );
+ myMagnificationSpinBox = new QtxDblSpinBox( 10, 1000, 10, SizeGroup );
myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myMagnificationSpinBox->setValue( 100 );
- BottomGroupLayout->addWidget( aMagnificationLabel, 1, 0 );
- BottomGroupLayout->addWidget( myMagnificationSpinBox, 1, 1 );
+ SizeGroupLayout->addWidget( aMagnificationLabel, 2, 0 );
+ SizeGroupLayout->addWidget( myMagnificationSpinBox, 2, 1 );
// Increment
- QLabel* aIncrementLabel = new QLabel( tr( "INCREMENT" ), BottomGroup );
- myIncrementSpinBox = new QtxDblSpinBox( 5, 50, 5, BottomGroup );
+ QLabel* aIncrementLabel = new QLabel( tr( "INCREMENT" ), SizeGroup );
+ myIncrementSpinBox = new QtxDblSpinBox( 5, 50, 5, SizeGroup );
myIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myIncrementSpinBox->setValue( 10 );
- BottomGroupLayout->addWidget( aIncrementLabel, 1, 2 );
- BottomGroupLayout->addWidget( myIncrementSpinBox, 1, 3 );
+ SizeGroupLayout->addWidget( aIncrementLabel, 2, 2 );
+ SizeGroupLayout->addWidget( myIncrementSpinBox, 2, 3 );
+
+
+ // Color
+ QGroupBox* ColorGroup = new QGroupBox ( tr( "COLOR_TITLE" ), aBox, "ColorGroup" );
+ ColorGroup->setColumnLayout(0, Qt::Vertical );
+ ColorGroup->layout()->setSpacing( 0 );
+ ColorGroup->layout()->setMargin( 0 );
+
+ QGridLayout* ColorGroupLayout = new QGridLayout (ColorGroup->layout());
+ ColorGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
+ ColorGroupLayout->setSpacing(6);
+ ColorGroupLayout->setMargin(11);
+
+ QLabel* aColorLabel = new QLabel( tr( "COLOR" ), ColorGroup );
+ myColorButton = new QPushButton( ColorGroup );
+ myColorButton->setPaletteBackgroundColor( Qt::blue );
+ myColorButton->setPaletteForegroundColor( Qt::blue );
+
+ ColorGroupLayout->addWidget( aColorLabel, 0, 0 );
+ ColorGroupLayout->addWidget( myColorButton, 0, 1 );
+ connect( myColorButton, SIGNAL( clicked() ), this, SLOT( onColorButtonPressed() ) );
+
+ connect( myGeometryButton, SIGNAL( toggled( bool ) ), ColorGroup, SLOT( setEnabled( bool ) ) );
+ connect( myGeometryButton, SIGNAL( toggled( bool ) ), mySizeLabel, SLOT( setEnabled( bool ) ) );
+ connect( myGeometryButton, SIGNAL( toggled( bool ) ), mySizeSpinBox, SLOT( setEnabled( bool ) ) );
+ connect( myResultsButton, SIGNAL( toggled( bool ) ), myMinSizeLabel, SLOT( setEnabled( bool ) ) );
+ connect( myResultsButton, SIGNAL( toggled( bool ) ), myMinSizeSpinBox, SLOT( setEnabled( bool ) ) );
+ connect( myResultsButton, SIGNAL( toggled( bool ) ), myMaxSizeLabel, SLOT( setEnabled( bool ) ) );
+ connect( myResultsButton, SIGNAL( toggled( bool ) ), myMaxSizeSpinBox, SLOT( setEnabled( bool ) ) );
+
+ bool isResults = myResultsButton->isChecked();
+ ColorGroup->setEnabled( !isResults );
+ mySizeLabel->setEnabled( !isResults );
+ mySizeSpinBox->setEnabled( !isResults );
+ myMinSizeLabel->setEnabled( isResults );
+ myMinSizeSpinBox->setEnabled( isResults );
+ myMaxSizeLabel->setEnabled( isResults );
+ myMaxSizeSpinBox->setEnabled( isResults );
myScalarPane = new VisuGUI_GaussScalarBarPane(this, SetPref);
myScalarPane->setMargin(5);
buttonCancel->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
- TopLayout->addWidget(aTabBox);
+ TopLayout->addWidget( PrsGroup );
+ TopLayout->addWidget( aTabBox );
TopLayout->addWidget( GroupButtons );
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
void VisuGUI_GaussPointsDlg::initFromPrsObject( VISU::GaussPoints_i* thePrs )
{
+ bool isResults = thePrs->IsColored();
+ myResultsButton->setChecked( isResults );
+ myGeometryButton->setChecked( !isResults );
+
+ myColorButton->setPaletteBackgroundColor( thePrs->GetColor() );
+
myClampSpinBox->setMaxValue( thePrs->GetGaussPointsPL()->GetMaximumSupportedSize() );
myClampSpinBox->setValue( thePrs->GetGaussPointsPL()->GetClamp() );
+ mySizeSpinBox->setValue( thePrs->GetGaussPointsPL()->GetRelativeSize() * 100.0 );
myMinSizeSpinBox->setValue( thePrs->GetGaussPointsPL()->GetRelativeMinSize() * 100.0 );
myMaxSizeSpinBox->setValue( thePrs->GetGaussPointsPL()->GetRelativeMaxSize() * 100.0 );
{
thePrs->GetGaussPointsPL()->SetClamp( myClampSpinBox->value() );
- thePrs->GetGaussPointsPL()->SetRelativeMinSize( myMinSizeSpinBox->value() / 100.0 );
- thePrs->GetGaussPointsPL()->SetRelativeMaxSize( myMaxSizeSpinBox->value() / 100.0 );
+ bool isResults = myResultsButton->isChecked();
+ if( isResults )
+ {
+ thePrs->GetGaussPointsPL()->SetRelativeMinSize( myMinSizeSpinBox->value() / 100.0 );
+ thePrs->GetGaussPointsPL()->SetRelativeMaxSize( myMaxSizeSpinBox->value() / 100.0 );
+ }
+ else
+ {
+ thePrs->GetGaussPointsPL()->SetRelativeSize( mySizeSpinBox->value() / 100.0 );
+ thePrs->SetColor( myColorButton->paletteBackgroundColor() );
+ }
+ thePrs->ShowColored( isResults );
thePrs->GetGaussPointsPL()->SetMagnification( myMagnificationSpinBox->value() / 100.0 );
thePrs->GetGaussPointsPL()->SetMagnificationIncrement( myIncrementSpinBox->value() / 100.0 );
if( !aFileName.isNull() )
myAlphaChannelTextureLineEdit->setText( aFileName );
}
+
+void VisuGUI_GaussPointsDlg::onColorButtonPressed()
+{
+ QColor aColor = myColorButton->paletteBackgroundColor();
+ aColor = QColorDialog::getColor( aColor, this );
+ myColorButton->setPaletteBackgroundColor( aColor );
+}