Salome HOME
untabify
[modules/geom.git] / src / RepairGUI / RepairGUI_RemoveExtraEdgesDlg.cxx
index 850926fe63390ac799b15212a3670efce6bce2db..16c05ad481cd0a0eac364c86413e6c30349022fb 100644 (file)
@@ -22,7 +22,7 @@
 //  GEOM RepairGUI : GUI for Geometry component
 //  File   : RepairGUI_RemoveExtraEdgesDlg.cxx
 //  Author : Michael Zorin, Open CASCADE S.A.S.
-//
+
 #include "RepairGUI_RemoveExtraEdgesDlg.h"
 
 #include <DlgRef.h>
@@ -63,12 +63,15 @@ RepairGUI_RemoveExtraEdgesDlg::RepairGUI_RemoveExtraEdgesDlg( GeometryGUI* theGe
   mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
   mainFrame()->RadioButton3->close();
 
-  GroupPoints = new DlgRef_1Sel( centralWidget() );
+  GroupPoints = new DlgRef_1Sel1Check( centralWidget() );
+
   GroupPoints->GroupBox1->setTitle( tr( "GEOM_REMOVE_EXTRA_EDGES" ) );
   GroupPoints->TextLabel1->setText( tr( "GEOM_SELECTED_SHAPE" ) );
   GroupPoints->PushButton1->setIcon( image1 );
   GroupPoints->LineEdit1->setReadOnly( true );
 
+  GroupPoints->CheckButton1->setText( tr( "GEOM_RMEE_UNION_FACES" ) );
+
   QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
   layout->setMargin( 0 ); layout->setSpacing( 6 );
   layout->addWidget( GroupPoints );
@@ -101,6 +104,8 @@ void RepairGUI_RemoveExtraEdgesDlg::Init()
   
   myOkObject = false;
 
+  GroupPoints->CheckButton1->setChecked( false );
+
   activateSelection();
   
   mainFrame()->GroupBoxPublish->show();
@@ -116,6 +121,7 @@ void RepairGUI_RemoveExtraEdgesDlg::Init()
           this, SLOT( SelectionIntoArgument() ) );
 
   initName( tr( "REMOVE_EXTRA_EDGES_NEW_OBJ_NAME" ) );
+  resize(100,100);
 }
 
 
@@ -278,11 +284,15 @@ bool RepairGUI_RemoveExtraEdgesDlg::isValid( QString& msg )
 bool RepairGUI_RemoveExtraEdgesDlg::execute( ObjectList& objects )
 {
   GEOM::GEOM_Object_var anObj;
-  
-  anObj = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->RemoveExtraEdges( myObject );
-  
-  if ( !anObj->_is_nil() )
-    objects.push_back( anObj._retn() );
+
+  int nbFacesOptimum = -1; // -1 means do not union faces
+  if (GroupPoints->CheckButton1->isChecked())
+    nbFacesOptimum = 0; // 0 means union all faces, that possible
+  GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation());
+  anObj = anOper->RemoveExtraEdges(myObject, nbFacesOptimum);
+
+  if (!anObj->_is_nil())
+    objects.push_back(anObj._retn());
 
   return true;
 }