Salome HOME
Merge commit '4823245056426a9ccf9c7965daecf11459f58af5' into V9_11_BR
[modules/geom.git] / src / RepairGUI / RepairGUI_ShapeProcessDlg.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 1c47613..395c12a
@@ -1,35 +1,36 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // GEOM GEOMGUI : GUI for Geometry component
 // File   : RepairGUI_ShapeProcessDlg.cxx
 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
-//
+
 #include "RepairGUI_ShapeProcessDlg.h"
 
-#include <DlgRef.h>
-#include <GeometryGUI.h>
-#include <GEOMBase.h>
-#include <GEOMImpl_Types.hxx>
-#include <QtxDoubleSpinBox.h>
+#include "DlgRef.h"
+#include "GeometryGUI.h"
+#include "GEOMBase.h"
+#include "GEOMImpl_Types.hxx"
+#include "RepairGUI.h"
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_DoubleSpinBox.h>
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_MessageBox.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
 #include <SALOME_ListIO.hxx>
+#include "utilities.h"
+
+#include <Basics_Utils.hxx>
+#include "utilities.h"
 
 #include <TCollection_AsciiString.hxx>
 #include <TColStd_MapOfInteger.hxx>
@@ -55,7 +59,7 @@
 //            TRUE to construct a modal dialog.
 //=================================================================================
 RepairGUI_ShapeProcessDlg::RepairGUI_ShapeProcessDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
-                                                     bool modal )
+                                                      bool modal )
   : GEOMBase_Skeleton( theGeometryGUI, parent, modal )
 {
   setHelpFileName( "shape_processing_operation_page.html" );
@@ -80,34 +84,39 @@ void RepairGUI_ShapeProcessDlg::init()
 
   initParamsValues();
   initSelection();
-       
-  setWindowTitle( tr( "GEOM_SHAPEPROCESS_TITLE" ) );
+        
+  setWindowTitle( tr( "GEOM_SHAPEPROCESS_TITLE" ));
 
   mainFrame()->GroupConstructors->hide();
   
   // select widget on the top 
   mySelectWdgt = new DlgRef_1Sel( centralWidget() );
-  mySelectWdgt->GroupBox1->setTitle( tr( "GEOM_SHAPE" ) );
-  mySelectWdgt->TextLabel1->setText( tr( "GEOM_SELECTED_OBJECTS" ) );
-  mySelectWdgt->PushButton1->setIcon( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
+  mySelectWdgt->GroupBox1->setTitle( tr( "GEOM_SHAPE" ));
+  mySelectWdgt->TextLabel1->setText( tr( "GEOM_SELECTED_OBJECTS" ));
+  mySelectWdgt->PushButton1->setIcon( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" )));
   mySelectWdgt->LineEdit1->setReadOnly( true );
 
   // layout the two group boxes in the middle, add a list of operations
   QGroupBox* anOperGr = new QGroupBox( tr( "GEOM_OPERATIONS" ), centralWidget() );
 
+  // "select all" button
+  mySelectAll = new QCheckBox( tr( "SELECT_ALL" ), anOperGr );
+  mySelectAll->setTristate( true );
+  
   // operations list widget
   myOpList = new QListWidget( anOperGr );
   myOpList->setSortingEnabled( false );
-  myOpList->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
+  myOpList->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ));
 
   QVBoxLayout* aOperLay = new QVBoxLayout( anOperGr );
   aOperLay->setMargin( 9 );
+  aOperLay->addWidget( mySelectAll );
   aOperLay->addWidget( myOpList );
 
   QGroupBox* aParamsGr = new QGroupBox( tr( "GEOM_PARAMETERS" ), centralWidget() );
 
   // add a widget stack to the parameters group box
-  QStackedLayout* aStack = new QStackedLayout( aParamsGr );
+  myStack = new QStackedLayout( aParamsGr );
 
   // continueties values..
   QStringList aContinueties = QString( "C0,G1,C1,G2,C2,C3,CN" ).split( "," );
@@ -126,8 +135,10 @@ void RepairGUI_ShapeProcessDlg::init()
       QGridLayout* aLay = new QGridLayout( w );
       aLay->setMargin( 9 ); aLay->setSpacing( 6 );
       
-      myFixShapeTol3D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
-      myFixShapeMaxTol3D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+      myFixShapeTol3D = new SalomeApp_DoubleSpinBox( w );
+      initSpinBox( myFixShapeTol3D, 0., 100., 1e-7, "len_tol_precision" );
+      myFixShapeMaxTol3D = new SalomeApp_DoubleSpinBox( w );
+      initSpinBox( myFixShapeMaxTol3D, 0., 100., 1e-7, "len_tol_precision" );      
       
       aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 );
       aLay->addWidget( myFixShapeTol3D, 0, 1 );
@@ -141,19 +152,47 @@ void RepairGUI_ShapeProcessDlg::init()
       QGridLayout* aLay = new QGridLayout( w );
       aLay->setMargin( 9 ); aLay->setSpacing( 6 );
       
-      myFixFaceSizeTol = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+      myFixFaceSizeTol = new SalomeApp_DoubleSpinBox( w );
+      initSpinBox( myFixFaceSizeTol, 0., 100., 1e-7, "len_tol_precision" );      
       
       aLay->addWidget( new QLabel( tr( "GEOM_TOLERANCE" ), w ), 0, 0 );
       aLay->addWidget( myFixFaceSizeTol, 0, 1 );
       aLay->setRowStretch( aLay->rowCount(), 5 );
     }
+    else if ( myOpLst[i] == "DropSmallSolids" ) {
+      // DropSmallSolids
+      w = new QWidget( aParamsGr );
+      QGridLayout* aLay = new QGridLayout( w );
+      aLay->setMargin( 9 ); aLay->setSpacing( 6 );
+
+      myDropSmallSolidsWidChk = new QCheckBox( tr("WIDTH_FACTOR_TOL"), w );
+      myDropSmallSolidsVolChk = new QCheckBox( tr("VOLUME_TOL"), w );
+      myDropSmallSolidsWidTol = new SalomeApp_DoubleSpinBox( w );
+      myDropSmallSolidsVolTol = new SalomeApp_DoubleSpinBox( w );
+      initSpinBox( myDropSmallSolidsWidTol, 0., 1e3, 1., "len_tol_precision" );
+      initSpinBox( myDropSmallSolidsVolTol, 0., 1e9, 1., "len_tol_precision" );
+      myDropSmallSolidsWidTol->setValue( 1 );
+      myDropSmallSolidsVolTol->setValue( 1e3 );
+      myDropSmallSolidsVolChk->setChecked( true );
+      myDropSmallSolidsWidTol->setEnabled( false );
+      myDropSmallSolidsMergeChk = new QCheckBox( tr("TO_MERGE_SOLIDS"), w );
+  
+      aLay->addWidget( myDropSmallSolidsWidChk, 0, 0 );
+      aLay->addWidget( myDropSmallSolidsWidTol, 0, 1 );
+      aLay->addWidget( myDropSmallSolidsVolChk, 1, 0 );
+      aLay->addWidget( myDropSmallSolidsVolTol, 1, 1 );
+      aLay->addWidget( myDropSmallSolidsMergeChk, 2, 0, 1, 2 );
+
+      aLay->setRowStretch( aLay->rowCount(), 5 );
+    }
     else if ( myOpLst[i] == "DropSmallEdges" ) {
       // DropSmallEdges
       w = new QWidget( aParamsGr );
       QGridLayout* aLay = new QGridLayout( w );
       aLay->setMargin( 9 ); aLay->setSpacing( 6 );
       
-      myDropSmallEdgesTol3D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+      myDropSmallEdgesTol3D = new SalomeApp_DoubleSpinBox( w );
+      initSpinBox( myDropSmallEdgesTol3D, 0., 100., 1e-7, "len_tol_precision" );
   
       aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 );
       aLay->addWidget( myDropSmallEdgesTol3D, 0, 1 );
@@ -165,8 +204,10 @@ void RepairGUI_ShapeProcessDlg::init()
       QGridLayout* aLay = new QGridLayout( w );
       aLay->setMargin( 9 ); aLay->setSpacing( 6 );
       
-      mySplitAngleAngle = new SalomeApp_DoubleSpinBox( 0, 360, 1, 10, 10, w );
-      mySplitAngleMaxTol = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+      mySplitAngleAngle = new SalomeApp_DoubleSpinBox( w );
+      initSpinBox( mySplitAngleAngle, 0, 360, 1, "angle_precision" );      
+      mySplitAngleMaxTol = new SalomeApp_DoubleSpinBox( w );
+      initSpinBox( mySplitAngleMaxTol, 0., 100., 1e-7, "ang_tol_precision" );      
       
       aLay->addWidget( new QLabel( tr( "GEOM_ANGLE_1" ), w ), 0, 0 );
       aLay->addWidget( mySplitAngleAngle, 0, 1 );
@@ -192,7 +233,8 @@ void RepairGUI_ShapeProcessDlg::init()
       QGridLayout* aLay = new QGridLayout( w );
       aLay->setMargin( 9 ); aLay->setSpacing( 6 );
 
-      mySplitContTol3D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+      mySplitContTol3D = new SalomeApp_DoubleSpinBox( w );
+      initSpinBox( mySplitContTol3D, 0., 100., 1e-7, "len_tol_precision" );
       mySplitContSurfCont = new QComboBox( w );
       mySplitContSurfCont->addItems( aContinueties );
       mySplitContCurvCont = new QComboBox( w );
@@ -216,12 +258,15 @@ void RepairGUI_ShapeProcessDlg::init()
       myBSpline3DCurveChk = new QCheckBox( tr("GEOM_3D_CURVE_MODE"), w );
       myBSpline2DCurveChk = new QCheckBox( tr("GEOM_2D_CURVE_MODE"), w );
 
-      myBSplineTol3D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+      myBSplineTol3D = new SalomeApp_DoubleSpinBox( w );
+      initSpinBox( myBSplineTol3D, 0., 100., 1e-7, "len_tol_precision" );
       
-      myBSplineTol2D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+      myBSplineTol2D = new SalomeApp_DoubleSpinBox( w );
+      initSpinBox( myBSplineTol2D, 0., 100., 1e-7, "param_tol_precision" );      
 
       myBSplineDegree = new SalomeApp_IntSpinBox( w );
       myBSplineSegments = new SalomeApp_IntSpinBox( w );
+      initSpinBox( myBSplineSegments, 1, 1000, 1);      
       myBSpline2DCont = new QComboBox( w );
       myBSpline2DCont->addItems( aContinueties );
       myBSpline3DCont = new QComboBox( w );
@@ -258,7 +303,8 @@ void RepairGUI_ShapeProcessDlg::init()
       myToBezier3DCurveChk = new QCheckBox( tr("GEOM_3D_CURVE_MODE"), w );
       myToBezier2DCurveChk = new QCheckBox( tr("GEOM_2D_CURVE_MODE"), w );
   
-      myToBezierMaxTol = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+      myToBezierMaxTol = new SalomeApp_DoubleSpinBox( w );
+      initSpinBox( myToBezierMaxTol, 0., 100., 1e-7, "len_tol_precision" );            
 
       aLay->addWidget( myToBezierSurfModeChk, 0, 0 );
       aLay->addWidget( myToBezier3DCurveChk, 1, 0 );
@@ -273,7 +319,8 @@ void RepairGUI_ShapeProcessDlg::init()
       QGridLayout* aLay = new QGridLayout( w );
       aLay->setMargin( 9 ); aLay->setSpacing( 6 );
 
-      mySameParameterTol3D = new SalomeApp_DoubleSpinBox( 0., 100., 1e-7, 10, 10, w );
+      mySameParameterTol3D = new SalomeApp_DoubleSpinBox( w );
+      initSpinBox( mySameParameterTol3D, 0., 100., 1e-7, "len_tol_precision" );            
       
       aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 );
       aLay->addWidget( mySameParameterTol3D, 0, 1 );
@@ -282,7 +329,7 @@ void RepairGUI_ShapeProcessDlg::init()
     else {
       w = new QWidget( aParamsGr ); // dumb widget
     }
-    aStack->insertWidget( i, w );
+    myStack->insertWidget( i, w );
   }
 
   QGridLayout* layout = new QGridLayout( centralWidget() );
@@ -292,25 +339,33 @@ void RepairGUI_ShapeProcessDlg::init()
   layout->addWidget( aParamsGr,    1, 1 );
 
   // signals and slots connections
-  connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( onOk() ) );
-  connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( onApply() ) );
+  connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( onOk() ));
+  connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( onApply() ));
 
-  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
-          SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ) );
+  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ))->selectionMgr(),
+           SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ));
 
-  connect( mySelectWdgt->PushButton1, SIGNAL( clicked() ),       this, SLOT( selectClicked() ) );
-  connect( mySelectWdgt->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( lineEditReturnPressed() ) );
+  connect( mySelectWdgt->PushButton1, SIGNAL( clicked() ),       this, SLOT( selectClicked() ));
+  connect( mySelectWdgt->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( lineEditReturnPressed() ));
 
-  connect( myToBezierSurfModeChk,     SIGNAL( toggled( bool ) ), this, SLOT( advOptionToggled( bool ) ) );
+  connect( myToBezierSurfModeChk,     SIGNAL( toggled( bool )), this, SLOT( advOptionToggled( bool )));
+  connect( myDropSmallSolidsWidChk,   SIGNAL( toggled( bool )), this, SLOT( advOptionToggled( bool )));
+  connect( myDropSmallSolidsVolChk,   SIGNAL( toggled( bool )), this, SLOT( advOptionToggled( bool )));
 
-  connect( myOpList, SIGNAL( currentRowChanged( int ) ), aStack, SLOT( setCurrentIndex( int ) ) );
+  connect( myOpList, SIGNAL( currentRowChanged( int )),      myStack, SLOT( setCurrentIndex( int )));
+  connect( myOpList, SIGNAL( itemChanged( QListWidgetItem* )),  this, SLOT( operatorChecked( QListWidgetItem* )));
+  connect( mySelectAll, SIGNAL( stateChanged( int ) ), this, SLOT( onSelectAll( int )));
 
   adjustSize();
   loadDefaults(); // init dialog fields with values from resource file
   //myOpList->setCurrentRow( myOpList->findItem( 0 );
   reset();
 
-  initName( tr( "PROCESS_SHAPE_NEW_OBJ_NAME" ) );
+  myOpList->setCurrentRow(0);
+
+  initName( tr( "PROCESS_SHAPE_NEW_OBJ_NAME" ));
+  selectionChanged();
+  updateSelectAll();
 }
 
 //=================================================================================
@@ -319,6 +374,7 @@ void RepairGUI_ShapeProcessDlg::init()
 //=================================================================================
 void RepairGUI_ShapeProcessDlg::onOk()
 {
+  setIsApplyAndClose( true );
   if ( onApply() )
     ClickOnCancel();
 }
@@ -349,24 +405,23 @@ bool RepairGUI_ShapeProcessDlg::onApply()
 void RepairGUI_ShapeProcessDlg::selectionChanged()
 {
   reset();
-       
+        
   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
   SALOME_ListIO aSelList;
   aSelMgr->selectedObjects(aSelList);
 
-  Standard_Boolean aRes = Standard_False;
   int i = 0;
   myObjects->length(aSelList.Extent());
   for (SALOME_ListIteratorOfListIO anIt (aSelList); anIt.More(); anIt.Next()) {
-    GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value(), aRes );
-    if ( !CORBA::is_nil( aSelectedObject ) && aRes )
-       myObjects[i++] = aSelectedObject;
+    GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value() );
+    if ( !CORBA::is_nil( aSelectedObject ))
+      myObjects[i++] = aSelectedObject;
   }
   myObjects->length( i );
   if ( i == 1 )
-    mySelectWdgt->LineEdit1->setText( GEOMBase::GetName( myObjects[0] ) );
+    mySelectWdgt->LineEdit1->setText( GEOMBase::GetName( myObjects[0] ));
   else if ( i > 0 )
-    mySelectWdgt->LineEdit1->setText( QString::number( i ) + "_" + tr( "GEOM_OBJECTS" ) );
+    mySelectWdgt->LineEdit1->setText( QString::number( i ) + "_" + tr( "GEOM_OBJECTS" ));
 }
 
 
@@ -399,9 +454,9 @@ void RepairGUI_ShapeProcessDlg::lineEditReturnPressed()
 void RepairGUI_ShapeProcessDlg::activate()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication( ) ))->selectionMgr(),
-          SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ) );
-       
+  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication( )))->selectionMgr(),
+           SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ));
+        
   reset();
   //myGeomGUI->SetState( 0 );
   initSelection();
@@ -426,7 +481,7 @@ void RepairGUI_ShapeProcessDlg::enterEvent( QEvent* )
 void RepairGUI_ShapeProcessDlg::reset()
 {
   myObjects = new GEOM::ListOfGO();
-  myObjects->length( 0 );      
+  myObjects->length( 0 );       
   mySelectWdgt->LineEdit1->setText( "" );
 }
 
@@ -437,8 +492,8 @@ void RepairGUI_ShapeProcessDlg::reset()
 //=================================================================================
 const char* get_convert( const char* theParam, const QString& theValue )
 {
-  if ( !strcmp( theParam, "SplitAngle.Angle" ) ) {
-    double doubleValue = theValue.toDouble() * PI / 180;
+  if ( !strcmp( theParam, "SplitAngle.Angle" )) {
+    double doubleValue = theValue.toDouble() * M_PI / 180.;
     return CORBA::string_dup( QString::number( doubleValue ).toLatin1().constData() );
   }
   return CORBA::string_dup( theValue.toLatin1().constData() );
@@ -448,14 +503,14 @@ const char* get_convert( const char* theParam, const QString& theValue )
 // function : set_convert
 // purpose  : conversion of angle values to degrees (non-angle values are not converted)
 //=================================================================================
-const char* set_convert( const char* theParam, const char* theValue )
+QString set_convert( const char* theParam, const char* theValue )
 {
-  if ( !strcmp( theParam, "SplitAngle.Angle" ) ) {
-    double doubleValue = atof( theValue ) * 180 / PI;
-    TCollection_AsciiString str( doubleValue );
-    return CORBA::string_dup( str.ToCString() );
+  if ( !strcmp( theParam, "SplitAngle.Angle" )) {
+    Kernel_Utils::Localizer loc;
+    double doubleValue = atof( theValue ) * 180. / M_PI;
+    return QString::number( doubleValue );
   }
-  return CORBA::string_dup( theValue );
+  return QString( theValue );
 }
 
 //=================================================================================
@@ -464,12 +519,12 @@ const char* set_convert( const char* theParam, const char* theValue )
 //=================================================================================
 void RepairGUI_ShapeProcessDlg::loadDefaults()
 {
-  GEOM::GEOM_IHealingOperations_var anOp = myGeomGUI->GetGeomGen()->GetIHealingOperations( getStudyId() );
+  GEOM::GEOM_IHealingOperations_var anOp = myGeomGUI->GetGeomGen()->GetIHealingOperations();
   GEOM::string_array_var anOperators, aParams, aValues;
   anOp->GetShapeProcessParameters( anOperators, aParams, aValues );
 
   // check the default items-operators
-  for ( int i = 0; i < anOperators->length(); i++ ) {
+  for ( int i = 0; i < (int)anOperators->length(); i++ ) {
     //MESSAGE("-->"<<(const char*)anOperators[i]);
     QList<QListWidgetItem*> items = myOpList->findItems ( (const char*)anOperators[i], Qt::MatchFixedString );
     if ( items.count() ) 
@@ -477,18 +532,18 @@ void RepairGUI_ShapeProcessDlg::loadDefaults()
   }
 
   // Retrieve default parameters for ALL operators
-  for ( int i = 0; i < myOpList->count(); i++ ) {
-    CORBA::String_var anOperator = CORBA::string_dup( myOpList->item( i )->text().toLatin1().constData() );
-    anOp->GetOperatorParameters( anOperator.in(), aParams, aValues );
+  for ( int i = 0; i < myOpList->count(); i++ )
+  {
+    QString anOperator = myOpList->item( i )->text();
+    anOp->GetOperatorParameters( anOperator.toLatin1().constData(), aParams, aValues );
 
     // set default values of parameters
     if ( aParams->length() != aValues->length() )
       continue;
 
-    for ( int j = 0; j < aParams->length(); j++ ) {
+    for ( int j = 0; j < (int)aParams->length(); j++ ) {
       QWidget* aCtrl = getControl( (const char*)aParams[j] );
-      const char* aValue = set_convert( (const char*)aParams[j], aValues[j] );
-      setValue( aCtrl, aValue );
+      setValue( aCtrl, set_convert( (const char*)aParams[j], aValues[j] ));
     }
   }
 }
@@ -500,13 +555,13 @@ void RepairGUI_ShapeProcessDlg::loadDefaults()
 void RepairGUI_ShapeProcessDlg::setValue( QWidget* theControl, const QString& theValue )
 {
   if ( theControl && !theValue.isNull() ) {
-    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ) )
+    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ))
       qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )->setValue( theValue.toDouble() );
-    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ) )
+    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ))
       qobject_cast<SalomeApp_IntSpinBox*>( theControl )->setValue( theValue.toInt() );
-    else if ( qobject_cast<QComboBox*>( theControl ) )
+    else if ( qobject_cast<QComboBox*>( theControl ))
       qobject_cast<QComboBox*>( theControl )->setEditText( theValue );
-    else if ( qobject_cast<QCheckBox*>( theControl ) )
+    else if ( qobject_cast<QCheckBox*>( theControl ))
       qobject_cast<QCheckBox*>( theControl )->setChecked( theValue.toInt() != 0 );
   }
 }
@@ -518,14 +573,23 @@ void RepairGUI_ShapeProcessDlg::setValue( QWidget* theControl, const QString& th
 QString RepairGUI_ShapeProcessDlg::getValue( QWidget* theControl ) const
 {
   if ( theControl ) {
-    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ) )
+    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )) {
+      if ( ( theControl == myDropSmallSolidsWidTol || theControl == myDropSmallSolidsVolTol ) && !theControl->isEnabled() ) {
+        // VSR: stupid workaround about ShapeProcessAPI:
+        // specific processing for optional parameters of DropSmallSolids operator
+        return QString::number( Precision::Infinite() );
+      }
       return QString::number( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )->value() );
-    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ) )
+    }
+    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl )) {
       return QString::number( qobject_cast<SalomeApp_IntSpinBox*>( theControl )->value() );
-    else if ( qobject_cast<QComboBox*>( theControl ) )
+    }
+    else if ( qobject_cast<QComboBox*>( theControl )) {
       return qobject_cast<QComboBox*>( theControl )->currentText();
-    else if ( qobject_cast<QCheckBox*>( theControl ) )
+    }
+    else if ( qobject_cast<QCheckBox*>( theControl )) {
       return qobject_cast<QCheckBox*>( theControl )->isChecked() ? "1" : "0";
+    }
   }   
   return 0;
 }
@@ -537,9 +601,9 @@ QString RepairGUI_ShapeProcessDlg::getValue( QWidget* theControl ) const
 QString RepairGUI_ShapeProcessDlg::getText( QWidget* theControl ) const
 {
   if ( theControl ) {
-    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ) )
+    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ))
       return qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )->text();
-    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ) )
+    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ))
       return qobject_cast<SalomeApp_IntSpinBox*>( theControl )->text();
   }   
   return QString::null;
@@ -551,7 +615,7 @@ QString RepairGUI_ShapeProcessDlg::getText( QWidget* theControl ) const
 //=================================================================================
 GEOM::GEOM_IOperations_ptr RepairGUI_ShapeProcessDlg::createOperation()
 {
-  return getGeomEngine()->GetIHealingOperations( getStudyId() );
+  return getGeomEngine()->GetIHealingOperations();
 }
 
 //=================================================================================
@@ -569,10 +633,11 @@ bool RepairGUI_ShapeProcessDlg::isValid( QString& msg )
     while( aListIter.hasNext() ) {
       const QString& aParam = aListIter.next();
       QWidget* aControl = getControl( aParam );
-      if ( qobject_cast<SalomeApp_DoubleSpinBox*>( aControl ) )
-       ok = qobject_cast<SalomeApp_DoubleSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
-      else if ( qobject_cast<SalomeApp_IntSpinBox*>( aControl ) )
-       ok = qobject_cast<SalomeApp_IntSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
+      if ( !aControl->isEnabled() ) continue;
+      if ( qobject_cast<SalomeApp_DoubleSpinBox*>( aControl ))
+        ok = qobject_cast<SalomeApp_DoubleSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
+      else if ( qobject_cast<SalomeApp_IntSpinBox*>( aControl ))
+        ok = qobject_cast<SalomeApp_IntSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
     }
   }
 
@@ -603,51 +668,53 @@ bool RepairGUI_ShapeProcessDlg::execute( ObjectList& objects )
 
   /*//-- check --
   int z;
-       MESSAGE("Objects : ");
-       for ( z = 0; z < myObjects->length(); z++ )
-               MESSAGE(myObjects[z]->GetName() << " ");
-       MESSAGE("\nOperators : ");
-       for ( z = 0; z < anOperators->length(); z++ )
-               MESSAGE(anOperators[z] << " ");
-       MESSAGE("\nParameters : ");
-       for ( z = 0; z < aParams->length(); z++ )
-               MESSAGE(aParams[z] << " ");
-       MESSAGE("\nValues : ");
-       for ( z = 0; z < aValues->length(); z ++ )
-               MESSAGE(aValues[z] << " ");
-       MESSAGE("\n");
+        MESSAGE("Objects : ");
+        for ( z = 0; z < myObjects->length(); z++ )
+                MESSAGE(myObjects[z]->GetName() << " ");
+        MESSAGE("\nOperators : ");
+        for ( z = 0; z < anOperators->length(); z++ )
+                MESSAGE(anOperators[z] << " ");
+        MESSAGE("\nParameters : ");
+        for ( z = 0; z < aParams->length(); z++ )
+                MESSAGE(aParams[z] << " ");
+        MESSAGE("\nValues : ");
+        for ( z = 0; z < aValues->length(); z ++ )
+                MESSAGE(aValues[z] << " ");
+        MESSAGE("\n");
   */// -----------
 
   QStringList anErrorObjNames;
-  for ( int i = 0; i < myObjects->length(); i++ ) {
+  for ( int i = 0; i < (int)myObjects->length(); i++ ) {
     GEOM::GEOM_Object_var obj = myObjects[i];
-    GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow( getOperation() )->
-      ProcessShape( obj, anOperators, aParams, aValues );
+    GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow( getOperation() );
+    GEOM::GEOM_Object_var anObj = anOper->ProcessShape( obj, anOperators, aParams, aValues );
     if ( anObj->_is_nil() )
       anErrorObjNames << GEOMBase::GetName( obj );
     else
     {
       if ( !IsPreview() )
       {
-       QStringList aParameters;
+        QStringList aParameters;
 
-       for ( int i = 0; i < anOperators->length(); i++ )
-         aParameters << QString( anOperators[i] );
+        for ( int i = 0; i < (int)anOperators->length(); i++ )
+          aParameters << QString( anOperators[i] );
 
-       for ( int i = 0; i < aParams->length(); i++ )
-         aParameters << QString( aParams[i] );
+        for ( int i = 0; i < (int)aParams->length(); i++ )
+          aParameters << QString( aParams[i] );
 
-       aParameters << getTexts( aParams );
-       anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+        aParameters << getTexts( aParams );
+        anObj->SetParameters(aParameters.join(":").toUtf8().constData());
+
+        RepairGUI::ShowStatistics( anOper, this );
       }
       objects.push_back( anObj._retn() );
     }
   }
 
   if ( !anErrorObjNames.empty() )
-    MESSAGE( "ERRORS occured while processing the following objects: " << anErrorObjNames.join( " " ).toLatin1().data() );
+    MESSAGE( "ERRORS occurred while processing the following objects: " << anErrorObjNames.join( " " ).toLatin1().data() );
     
-  return anErrorObjNames.size() < myObjects->length(); // true if at least one object was OK, false if ALL objects were nil after Healing.
+  return anErrorObjNames.size() < (int)myObjects->length(); // true if at least one object was OK, false if ALL objects were nil after Healing.
 }
 
 //=================================================================================
@@ -657,18 +724,15 @@ bool RepairGUI_ShapeProcessDlg::execute( ObjectList& objects )
 GEOM::string_array* RepairGUI_ShapeProcessDlg::getActiveOperators()
 {
   GEOM::string_array_var anOperators = new GEOM::string_array();
-  QStringList aCheckedList;
 
-  for ( int i = 0; i < myOpList->count(); i++ ) {
+  int j = 0, n = myOpList->count();
+  anOperators->length( n );
+  for ( int i = 0; i < n; i++ ) {
     if ( myOpList->item( i )->checkState() == Qt::Checked )
-      aCheckedList << myOpList->item( i )->text();
+      anOperators[j++] = myOpList->item( i )->text().toLatin1().constData();
   }
+  anOperators->length( j );
 
-  anOperators->length( aCheckedList.count() );
-
-  for ( int i = 0; i < aCheckedList.count(); i++ )
-    anOperators[i] = CORBA::string_dup( aCheckedList[i].toLatin1().constData() );
-                
   return anOperators._retn();
 }
 
@@ -683,6 +747,9 @@ QWidget* RepairGUI_ShapeProcessDlg::getControl( const QString& theParam )
   else if ( theParam == "SplitClosedFaces.NbSplitPoints" )        return mySplitClosedFacesNum;
   else if ( theParam == "FixFaceSize.Tolerance" )                 return myFixFaceSizeTol;
   else if ( theParam == "DropSmallEdges.Tolerance3d" )            return myDropSmallEdgesTol3D;
+  else if ( theParam == "DropSmallSolids.WidthFactorThreshold" )  return myDropSmallSolidsWidTol;
+  else if ( theParam == "DropSmallSolids.VolumeThreshold" )       return myDropSmallSolidsVolTol;
+  else if ( theParam == "DropSmallSolids.MergeSolids" )           return myDropSmallSolidsMergeChk;
   else if ( theParam == "BSplineRestriction.SurfaceMode" )        return myBSplineSurfModeChk;
   else if ( theParam == "BSplineRestriction.Curve3dMode" )        return myBSpline3DCurveChk;
   else if ( theParam == "BSplineRestriction.Curve2dMode" )        return myBSpline2DCurveChk;
@@ -724,6 +791,11 @@ void RepairGUI_ShapeProcessDlg::initParamsValues()
   myOpLst << "DropSmallEdges";
   myValMap["DropSmallEdges"] << "DropSmallEdges.Tolerance3d";
 
+  myOpLst << "DropSmallSolids";
+  myValMap["DropSmallSolids"] << "DropSmallSolids.WidthFactorThreshold";
+  myValMap["DropSmallSolids"] << "DropSmallSolids.VolumeThreshold";
+  myValMap["DropSmallSolids"] << "DropSmallSolids.MergeSolids";
+
   myOpLst << "SplitAngle";
   myValMap["SplitAngle"] << "SplitAngle.Angle";
   myValMap["SplitAngle"] << "SplitAngle.MaxTolerance";
@@ -767,19 +839,22 @@ GEOM::string_array* RepairGUI_ShapeProcessDlg::getParameters( const GEOM::string
   int i = 0, j = 0;
 
   // calculate the length of parameters
-  for ( i = 0, j = 0; i < theOperators.length(); i++ )
-    j += myValMap[ QString( theOperators[i] ) ].size();
+  for ( i = 0, j = 0; i < (int)theOperators.length(); i++ )
+    j += myValMap[ QString( theOperators[i].in() ) ].size();
   
-  // set the new length of paremeters
+  // set the new length of parameters
   aParams->length( j );
 
   // fill the parameters
-  for ( i = 0, j = 0; i < theOperators.length(); i++ ) {
-    QStringList aValLst = myValMap[ QString( theOperators[i] ) ];
-    for ( QStringList::Iterator it = aValLst.begin(); it != aValLst.end(); ++it )
-      aParams[j++] = CORBA::string_dup( (*it).toLatin1().constData() );
+  for ( i = 0, j = 0; i < (int)theOperators.length(); i++ ) {
+    QStringList aParamLst = myValMap[ QString( theOperators[i].in() ) ];
+    foreach ( QString aParam, aParamLst ) {
+      aParams[j++] = CORBA::string_dup( aParam.toLatin1().constData() );
+    }
   }
 
+  aParams->length( j );
+
   return aParams._retn();
 }
 
@@ -792,13 +867,13 @@ GEOM::string_array* RepairGUI_ShapeProcessDlg::getValues( const GEOM::string_arr
 {
   GEOM::string_array_var aValues = new GEOM::string_array();
   aValues->length( theParams.length() );
-    
-  for ( int i = 0; i < theParams.length(); i++ ) {
+
+  for ( int i = 0; i < (int)theParams.length(); i++ ) {
     QWidget* aCtrl = getControl( (const char*)theParams[i] );
     if ( aCtrl )
-      aValues[i] = get_convert( (const char*)theParams[i], getValue( aCtrl ) );
+      aValues[i] = get_convert( (const char*)theParams[i], getValue( aCtrl ));
   }
-    
+
   return aValues._retn();
 }
 
@@ -810,13 +885,13 @@ QStringList RepairGUI_ShapeProcessDlg::getTexts( const GEOM::string_array& thePa
 {
   QStringList aTexts;
     
-  for ( int i = 0; i < theParams.length(); i++ ) {
+  for ( int i = 0; i < (int)theParams.length(); i++ ) {
     QWidget* aCtrl = getControl( (const char*)theParams[i] );
     if ( aCtrl )
     {
       QString aText = getText( aCtrl );
       if( !aText.isNull() )
-       aTexts.append( aText );
+        aTexts.append( aText );
     }
   }
     
@@ -847,9 +922,87 @@ void RepairGUI_ShapeProcessDlg::initSelection()
 void RepairGUI_ShapeProcessDlg::advOptionToggled( bool on )
 {
   QAbstractButton* btn = (QAbstractButton*)sender();
-  if ( on && btn->isCheckable() &&
-       SUIT_MessageBox::warning( this,
-                                tr( "GEOM_WRN_WARNING" ), tr( "TIME_CONSUMING" ),
-                                SUIT_MessageBox::Yes | SUIT_MessageBox::No ) == SUIT_MessageBox::No )
-    btn->toggle();
+  if ( btn == myToBezierSurfModeChk )
+  {
+    if ( on && btn->isCheckable() &&
+         SUIT_MessageBox::warning( this,
+                                   tr( "GEOM_WRN_WARNING" ), tr( "TIME_CONSUMING" ),
+                                   SUIT_MessageBox::Yes | SUIT_MessageBox::No ) == SUIT_MessageBox::No )
+      btn->toggle();
+  }
+
+  // either myDropSmallSolidsWidChk or myDropSmallSolidsVolChk must be checked
+  if ( btn == myDropSmallSolidsWidChk )
+  {
+    myDropSmallSolidsWidTol->setEnabled( on );
+    if ( !on ) {
+      myDropSmallSolidsVolChk->setChecked( true );
+      myDropSmallSolidsVolTol->setEnabled( true );
+    }
+  }
+  if ( btn == myDropSmallSolidsVolChk )
+  {
+    myDropSmallSolidsVolTol->setEnabled( on );
+    if ( !on ) {
+      myDropSmallSolidsWidChk->setChecked( true );
+      myDropSmallSolidsWidTol->setEnabled( true );
+    }
+  }
+}
+
+//=======================================================================
+//function : operatorChecked
+//purpose  : show parameters of a selected operator
+//=======================================================================
+
+void RepairGUI_ShapeProcessDlg::operatorChecked( QListWidgetItem * item )
+{
+  if ( item && item->checkState() == Qt::Checked )
+  {
+    item->setSelected(true);
+    myStack->setCurrentIndex( myOpList->row( item ));
+  }
+  updateSelectAll();
+}
+
+void RepairGUI_ShapeProcessDlg::updateSelectAll()
+{
+  Qt::CheckState state = myOpList->count() > 0 ? myOpList->item(0)->checkState() : Qt::Unchecked;
+  for ( int i = 1; i < myOpList->count(); i++ ) {
+    if ( myOpList->item(i)->checkState() != state ) {
+      state = Qt::PartiallyChecked;
+      break;
+    }
+  }
+  mySelectAll->blockSignals( true );
+  mySelectAll->setCheckState( state );
+  mySelectAll->blockSignals( false );
+}
+
+void RepairGUI_ShapeProcessDlg::onSelectAll( int state )
+{
+  if ( state == Qt::PartiallyChecked ) { 
+    mySelectAll->setCheckState( Qt::Checked );
+    return;
+  }
+  myOpList->blockSignals( true );
+  for ( int i = 0; i < myOpList->count(); i++ ) {
+    myOpList->item(i)->setCheckState( (Qt::CheckState)state  );
+  }
+  myOpList->blockSignals( false );
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_ShapeProcessDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::ListOfGO aListPtr(myObjects);
+  for (int i = 0; i < (int)aListPtr.length(); i++) {
+    GEOM::GeomObjPtr aGeomObjPtr(aListPtr[i]);
+    res << aGeomObjPtr;
+  }
+  return res;
 }