Salome HOME
INT PAL 0052679: Set default "Diameter" value when adding new ball element
authorimn <imn@opencascade.com>
Tue, 21 Apr 2015 08:08:15 +0000 (11:08 +0300)
committerimn <imn@opencascade.com>
Tue, 21 Apr 2015 08:08:15 +0000 (11:08 +0300)
resources/SalomeApp.xml.in
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx
src/SMESHGUI/SMESHGUI_PropertiesDlg.cxx
src/SMESHGUI/SMESHGUI_PropertiesDlg.h
src/SMESHGUI/SMESHGUI_VTKUtils.cxx
src/SMESHGUI/SMESH_msg_en.ts
src/SMESHGUI/SMESH_msg_fr.ts
src/SMESHGUI/SMESH_msg_ja.ts

index 2826241bba2bf80f663a939b00b5202458ec912b..94c0d894eec572bfe7c4286e0aafed27c7733c4d 100644 (file)
@@ -44,6 +44,7 @@
     <parameter name="type_of_marker"               value="1"  />
     <parameter name="marker_scale"                 value="9"  />
     <parameter name="elem0d_size"                  value="5" />
     <parameter name="type_of_marker"               value="1"  />
     <parameter name="marker_scale"                 value="9"  />
     <parameter name="elem0d_size"                  value="5" />
+    <parameter name="ball_elem_diameter"           value="1" />
     <parameter name="ball_elem_size"               value="10" />
     <parameter name="ball_elem_scale"              value="1" />
     <parameter name="element_width"                value="1" />
     <parameter name="ball_elem_size"               value="10" />
     <parameter name="ball_elem_scale"              value="1" />
     <parameter name="element_width"                value="1" />
index 0b30830c43c2c024bfafb2205f9899e917616301..d89993957bc2af46550c8ef7d8bd354e9640b362 100644 (file)
@@ -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"); */
                              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,
   double ballScale = addPreference(tr("PREF_BALL_SCALE"), elemGroup,
                              LightApp_Preferences::DblSpin, "SMESH", "ball_elem_scale");
   int elemW  = addPreference(tr("PREF_WIDTH"), elemGroup,
index 734ab30502a882759807644bd90044470477faa2..35bc44b9b1d4c1fd02c4b5251c1d6c837f558693 100644 (file)
@@ -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.);
       // 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();
       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 );
     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 ************************************************/
     connect( DiameterSpinBox, SIGNAL( valueChanged ( double ) ), this, SLOT( onDiameterChanged( ) ) );
   }
   /* Add to group ************************************************/
index c588a274ce3cb0bbac00607d078a72a9e79f1dec..d1c732fafb600333d6aafb188fd3577d2d625db6 100644 (file)
@@ -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 );
   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 );
   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->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() );
   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() );
   
   // -- 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 );
   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 );
   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 );
   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 );
   // 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 );
   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
 */
   \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 );
 {
   myBallSize->setValue( size );
-}
+}*/
 
 /*!
   \brief Get discrete elements (balls) size
   \return current discrete elements (balls) 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();
 {
   return myBallSize->value();
-}
+}*/
 
 /*!
   \brief Set discrete elements (balls) scale factor
 
 /*!
   \brief Set discrete elements (balls) scale factor
index 1aa46b1ad2d0b697872588f24f817229135b718c..c2f964653351fe655f2226db5a96e04eabae0675 100644 (file)
@@ -82,8 +82,8 @@ public:
 
   void              setBallColor( const QColor& );
   QColor            ballColor() const;
 
   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;
 
   void              setBallScale( double );
   double            ballScale() const;
 
@@ -134,7 +134,7 @@ private:
   QtxIntSpinBox*          myElem0dSize;
   // - balls
   QtxColorButton*         myBallColor;
   QtxIntSpinBox*          myElem0dSize;
   // - balls
   QtxColorButton*         myBallColor;
-  QtxIntSpinBox*          myBallSize;
+  // QtxIntSpinBox*       myBallSize;
   QtxDoubleSpinBox*       myBallScale;
   // - orientation vectors
   QtxColorButton*         myOrientationColor;
   QtxDoubleSpinBox*       myBallScale;
   // - orientation vectors
   QtxColorButton*         myOrientationColor;
index bcc289cc0763792680d075b5819b539c9d7af37d..ca100fce9ad5868147cfe8eb50034e87945821e0 100644 (file)
@@ -904,12 +904,12 @@ namespace SMESH
            aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
 
     int aElem0DSize = mgr->integerValue("SMESH", "elem0d_size", 5);
            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;
     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 ),
 
     double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ),
            SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ),
index 59e9c9be989c9fb64707e975b855499770848b05..28302f1b426652f5676bdd01ce91270b82e22bd8 100644 (file)
@@ -4605,6 +4605,10 @@ Please, create VTK viewer and try again</translation>
         <source>PREF_BALL_COLOR</source>
         <translation>Ball color</translation>
     </message>
         <source>PREF_BALL_COLOR</source>
         <translation>Ball color</translation>
     </message>
+    <message>
+        <source>PREF_BALL_DIAMETER</source>
+        <translation>Default diameter of ball elements</translation>
+    </message>
     <message>
         <source>PREF_BALL_SIZE</source>
         <translation>Size of ball elements</translation>
     <message>
         <source>PREF_BALL_SIZE</source>
         <translation>Size of ball elements</translation>
index 96922a41ab1201738312adddcf6520db4ee9d862..388e4aeeabf9c418c9553f263fdc37ed6ee323f4 100755 (executable)
@@ -4602,6 +4602,10 @@ Ouvrez une fenêtre VTK et essayez de nouveau</translation>
         <source>PREF_BALL_COLOR</source>
         <translation>Couleur des particulaires</translation>
     </message>
         <source>PREF_BALL_COLOR</source>
         <translation>Couleur des particulaires</translation>
     </message>
+    <message>
+        <source>PREF_BALL_DIAMETER</source>
+        <translation type="unfinished">Default diameter of ball elements</translation>
+    </message>
     <message>
         <source>PREF_BALL_SIZE</source>
         <translation>Taille des éléments particulaires</translation>
     <message>
         <source>PREF_BALL_SIZE</source>
         <translation>Taille des éléments particulaires</translation>
index 29698eb01cd8299f31044c66cb0e4c05ea2508d1..d3222aeeaaf26be2d0a3461a208ef0778213ed06 100644 (file)
       <source>PREF_BALL_COLOR</source>
       <translation>粒子</translation>
     </message>
       <source>PREF_BALL_COLOR</source>
       <translation>粒子</translation>
     </message>
+    <message>
+      <source>PREF_BALL_DIAMETER</source>
+      <translation type="unfinished">Default diameter of ball elements</translation>
+    </message>
     <message>
       <source>PREF_BALL_SIZE</source>
       <translation>粒子状のコンポーネントのサイズ</translation>
     <message>
       <source>PREF_BALL_SIZE</source>
       <translation>粒子状のコンポーネントのサイズ</translation>