From: ouv Date: Mon, 19 Sep 2005 09:01:23 +0000 (+0000) Subject: Setting modification and increment parameters X-Git-Tag: BR-D5-38-2003_D2005-12-10~188 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=44eef61f59fba54e0f11262d0c878a1edbe15e93;p=modules%2Fvisu.git Setting modification and increment parameters --- diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx index e282d347..26a5128c 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx @@ -747,7 +747,7 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool QLabel* aClampLabel = new QLabel( tr( "MAXIMUM_SIZE" ), TopGroup ); myClampSpinBox = new QtxDblSpinBox( 1.0, 512.0, 1.0, TopGroup ); myClampSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - myClampSpinBox->setValue( 256.0 ); + myClampSpinBox->setValue( 200.0 ); TopGroupLayout->addWidget( aClampLabel, 1, 0 ); TopGroupLayout->addMultiCellWidget( myClampSpinBox, 1, 1, 1, 2 ); @@ -817,21 +817,21 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool // 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 ); + myMagnificationSpinBox = new QtxDblSpinBox( 50, 200, 10, BottomGroup ); + myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); + myMagnificationSpinBox->setValue( 100 ); BottomGroupLayout->addWidget( aMagnificationLabel, 1, 0 ); - BottomGroupLayout->addWidget( aMagnificationSpinBox, 1, 1 ); + BottomGroupLayout->addWidget( myMagnificationSpinBox, 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 ); + myIncrementSpinBox = new QtxDblSpinBox( 5, 50, 5, BottomGroup ); + myIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); + myIncrementSpinBox->setValue( 10 ); BottomGroupLayout->addWidget( aIncrementLabel, 1, 2 ); - BottomGroupLayout->addWidget( aIncrementSpinBox, 1, 3 ); + BottomGroupLayout->addWidget( myIncrementSpinBox, 1, 3 ); myScalarPane = new VisuGUI_GaussScalarBarPane(this, SetPref); @@ -870,13 +870,27 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool void VisuGUI_GaussPointsDlg::initFromPrsObject( VISU::GaussPoints_i* thePrs ) { + myClampSpinBox->setMaxValue( thePrs->GetGaussPointsPL()->GetMaximumSupportedSize() ); + myClampSpinBox->setValue( thePrs->GetGaussPointsPL()->GetClamp() ); + + myMinSizeSpinBox->setValue( thePrs->GetGaussPointsPL()->GetRelativeMinSize() * 100.0 ); + myMaxSizeSpinBox->setValue( thePrs->GetGaussPointsPL()->GetRelativeMaxSize() * 100.0 ); + + myMagnificationSpinBox->setValue( thePrs->GetGaussPointsPL()->GetMagnification() * 100.0 ); + myIncrementSpinBox->setValue( thePrs->GetGaussPointsPL()->GetMagnificationIncrement() * 100.0 ); + myScalarPane->initFromPrsObject(thePrs); } int VisuGUI_GaussPointsDlg::storeToPrsObject( VISU::GaussPoints_i* thePrs ) { - //thePrs->GetGaussPointsPL()->SetRelativeMinSize( myMinSizeSpinBox->value() / 100.0 ); - //thePrs->GetGaussPointsPL()->SetRelativeMaxSize( myMaxSizeSpinBox->value() / 100.0 ); + thePrs->GetGaussPointsPL()->SetClamp( myClampSpinBox->value() ); + + thePrs->GetGaussPointsPL()->SetRelativeMinSize( myMinSizeSpinBox->value() / 100.0 ); + thePrs->GetGaussPointsPL()->SetRelativeMaxSize( myMaxSizeSpinBox->value() / 100.0 ); + + thePrs->GetGaussPointsPL()->SetMagnification( myMagnificationSpinBox->value() / 100.0 ); + thePrs->GetGaussPointsPL()->SetMagnificationIncrement( myIncrementSpinBox->value() / 100.0 ); return myScalarPane->storeToPrsObject(thePrs); } diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.h b/src/VISUGUI/VisuGUI_GaussPointsDlg.h index 09a58540..9a9d7c4b 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.h +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.h @@ -144,6 +144,8 @@ private: QtxDblSpinBox* myMinSizeSpinBox; QtxDblSpinBox* myMaxSizeSpinBox; + QtxDblSpinBox* myMagnificationSpinBox; + QtxDblSpinBox* myIncrementSpinBox; }; #endif // VISUGUI_GAUSSPOINTSDLS_H