From c43b3fb0e3a297e1284a718519ce91a4e67d5890 Mon Sep 17 00:00:00 2001 From: imn Date: Tue, 21 Apr 2015 11:08:15 +0300 Subject: [PATCH] INT PAL 0052679: Set default "Diameter" value when adding new ball element --- resources/SalomeApp.xml.in | 1 + src/SMESHGUI/SMESHGUI.cxx | 4 ++-- src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx | 5 +++-- src/SMESHGUI/SMESHGUI_PropertiesDlg.cxx | 24 ++++++++++----------- src/SMESHGUI/SMESHGUI_PropertiesDlg.h | 6 +++--- src/SMESHGUI/SMESHGUI_VTKUtils.cxx | 4 ++-- src/SMESHGUI/SMESH_msg_en.ts | 4 ++++ src/SMESHGUI/SMESH_msg_fr.ts | 4 ++++ src/SMESHGUI/SMESH_msg_ja.ts | 4 ++++ 9 files changed, 35 insertions(+), 21 deletions(-) diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index 2826241bb..94c0d894e 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -44,6 +44,7 @@ + diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 0b30830c4..d89993957 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -5146,8 +5146,8 @@ void SMESHGUI::createPreferences() LightApp_Preferences::IntSpin, "SMESH", "elem0d_size"); /* int ballSize = addPreference(tr("PREF_BALL_SIZE"), elemGroup, LightApp_Preferences::IntSpin, "SMESH", "ball_elem_size"); */ - int ballDiameter = addPreference(tr("PREF_BALL_DIAMETER"), elemGroup, - LightApp_Preferences::IntSpin, "SMESH", "ball_elem_diameter"); + double ballDiameter = addPreference(tr("PREF_BALL_DIAMETER"), elemGroup, + LightApp_Preferences::DblSpin, "SMESH", "ball_elem_diameter"); double ballScale = addPreference(tr("PREF_BALL_SCALE"), elemGroup, LightApp_Preferences::DblSpin, "SMESH", "ball_elem_scale"); int elemW = addPreference(tr("PREF_WIDTH"), elemGroup, diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx index 734ab3050..35bc44b9b 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx @@ -169,7 +169,8 @@ namespace SMESH // Preview for the balls vtkProperty* aBallProp = vtkProperty::New(); aBallProp->SetColor(ffc.red() / 255. , ffc.green() / 255. , ffc.blue() / 255.); - double aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_size",10); + //double aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_size",10); + double aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_diameter",1); aBallProp->SetPointSize(aBallElemSize); myBallPolyData = vtkPolyData::New(); @@ -427,7 +428,7 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theMo GroupC1Layout->addWidget(DiameterSpinBox, 1, 1, 1, 2); DiameterSpinBox->RangeStepAndValidator( 1e-7, 1e+9, 0.1 ); - DiameterSpinBox->SetValue( 1. ); + DiameterSpinBox->SetValue( SMESH::GetFloat("SMESH:ball_elem_diameter", 1) ); connect( DiameterSpinBox, SIGNAL( valueChanged ( double ) ), this, SLOT( onDiameterChanged( ) ) ); } /* Add to group ************************************************/ diff --git a/src/SMESHGUI/SMESHGUI_PropertiesDlg.cxx b/src/SMESHGUI/SMESHGUI_PropertiesDlg.cxx index c588a274c..d1c732faf 100644 --- a/src/SMESHGUI/SMESHGUI_PropertiesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_PropertiesDlg.cxx @@ -156,8 +156,8 @@ SMESHGUI_PropertiesDlg::SMESHGUI_PropertiesDlg( const VTK::MarkerMap& customMark myBallGrp = new QGroupBox( tr( "BALLS" ), mainFrame() ); QLabel* ballColorLab = new QLabel( tr( "COLOR" ), myBallGrp ); myBallColor = new QtxColorButton( myBallGrp ); - QLabel* ballSizeLab = new QLabel( tr( "SIZE" ), myBallGrp ); - myBallSize = new QtxIntSpinBox( myBallGrp ); + // QLabel* ballSizeLab = new QLabel( tr( "SIZE" ), myBallGrp ); + // myBallSize = new QtxIntSpinBox( myBallGrp ); QLabel* ballScaleLab = new QLabel( tr( "SCALE_FACTOR" ), myBallGrp ); myBallScale = new QtxDoubleSpinBox( 1e-2, 1e7, 0.5, myBallGrp ); hl = new QHBoxLayout( myBallGrp ); @@ -165,12 +165,12 @@ SMESHGUI_PropertiesDlg::SMESHGUI_PropertiesDlg( const VTK::MarkerMap& customMark hl->setSpacing( SPACING ); hl->addWidget( ballColorLab ); hl->addWidget( myBallColor ); - hl->addWidget( ballSizeLab ); - hl->addWidget( myBallSize ); + // hl->addWidget( ballSizeLab ); + // hl->addWidget( myBallSize ); hl->addWidget( ballScaleLab ); hl->addWidget( myBallScale ); widthLab1 = qMax( widthLab1, ballColorLab->minimumSizeHint().width() ); - widthLab2 = qMax( widthLab2, ballSizeLab->minimumSizeHint().width() ); + // widthLab2 = qMax( widthLab2, ballSizeLab->minimumSizeHint().width() ); // -- orientation vector controls myOrientationGrp = new QGroupBox( tr( "ORIENTATIONS" ), mainFrame() ); @@ -234,13 +234,13 @@ SMESHGUI_PropertiesDlg::SMESHGUI_PropertiesDlg( const VTK::MarkerMap& customMark myVolumeColor->label()->setMinimumWidth( widthLab2 ); outlineWidthLab->setMinimumWidth( widthLab2 ); elem0dSizeLab->setMinimumWidth( widthLab2 ); - ballSizeLab->setMinimumWidth( widthLab2 ); + // ballSizeLab->setMinimumWidth( widthLab2 ); orientationScaleLab->setMinimumWidth( widthLab2 ); myEdgeWidth->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); myOutlineWidth->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); myElem0dSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - myBallSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + // myBallSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); myBallScale->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); myOrientationSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); myShrinkSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); @@ -248,7 +248,7 @@ SMESHGUI_PropertiesDlg::SMESHGUI_PropertiesDlg( const VTK::MarkerMap& customMark // initialize widgets myNodeMarker->setCustomMarkers( customMarkers ); myElem0dSize->setRange( 1, 10 ); - myBallSize->setRange( 1, 10 ); + // myBallSize->setRange( 1, 10 ); myEdgeWidth->setRange( 1, 5 ); myOutlineWidth->setRange( 1, 5 ); myShrinkSize->setRange( 20, 100 ); @@ -522,19 +522,19 @@ QColor SMESHGUI_PropertiesDlg::ballColor() const \brief Set discrete elements (balls) size \param size discrete elements (balls) size */ -void SMESHGUI_PropertiesDlg::setBallSize( int size ) +/*void SMESHGUI_PropertiesDlg::setBallSize( int size ) { myBallSize->setValue( size ); -} +}*/ /*! \brief Get discrete elements (balls) size \return current discrete elements (balls) size */ -int SMESHGUI_PropertiesDlg::ballSize() const +/*int SMESHGUI_PropertiesDlg::ballSize() const { return myBallSize->value(); -} +}*/ /*! \brief Set discrete elements (balls) scale factor diff --git a/src/SMESHGUI/SMESHGUI_PropertiesDlg.h b/src/SMESHGUI/SMESHGUI_PropertiesDlg.h index 1aa46b1ad..c2f964653 100644 --- a/src/SMESHGUI/SMESHGUI_PropertiesDlg.h +++ b/src/SMESHGUI/SMESHGUI_PropertiesDlg.h @@ -82,8 +82,8 @@ public: void setBallColor( const QColor& ); QColor ballColor() const; - void setBallSize( int ); - int ballSize() const; + // void setBallSize( int ); + // int ballSize() const; void setBallScale( double ); double ballScale() const; @@ -134,7 +134,7 @@ private: QtxIntSpinBox* myElem0dSize; // - balls QtxColorButton* myBallColor; - QtxIntSpinBox* myBallSize; + // QtxIntSpinBox* myBallSize; QtxDoubleSpinBox* myBallScale; // - orientation vectors QtxColorButton* myOrientationColor; diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index bcc289cc0..ca100fce9 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -904,12 +904,12 @@ namespace SMESH aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan ); int aElem0DSize = mgr->integerValue("SMESH", "elem0d_size", 5); - int aBallSize = mgr->integerValue("SMESH", "ball_elem_size", 5); + // int aBallSize = mgr->integerValue("SMESH", "ball_elem_size", 5); int aLineWidth = mgr->integerValue("SMESH", "element_width", 1); int maxSize = aElem0DSize; if (aElem0DSize > maxSize) maxSize = aElem0DSize; if (aLineWidth > maxSize) maxSize = aLineWidth; - if (aBallSize > maxSize) maxSize = aBallSize; + // if (aBallSize > maxSize) maxSize = aBallSize; double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ), SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ), diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 59e9c9be9..28302f1b4 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -4605,6 +4605,10 @@ Please, create VTK viewer and try again PREF_BALL_COLOR Ball color + + PREF_BALL_DIAMETER + Default diameter of ball elements + PREF_BALL_SIZE Size of ball elements diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 96922a41a..388e4aeea 100755 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -4602,6 +4602,10 @@ Ouvrez une fenêtre VTK et essayez de nouveau PREF_BALL_COLOR Couleur des particulaires + + PREF_BALL_DIAMETER + Default diameter of ball elements + PREF_BALL_SIZE Taille des éléments particulaires diff --git a/src/SMESHGUI/SMESH_msg_ja.ts b/src/SMESHGUI/SMESH_msg_ja.ts index 29698eb01..d3222aeea 100644 --- a/src/SMESHGUI/SMESH_msg_ja.ts +++ b/src/SMESHGUI/SMESH_msg_ja.ts @@ -4552,6 +4552,10 @@ PREF_BALL_COLOR 粒子 + + PREF_BALL_DIAMETER + Default diameter of ball elements + PREF_BALL_SIZE 粒子状のコンポーネントのサイズ -- 2.30.2