Salome HOME
Merge from V5_1_4_BR 07/05/2010
[modules/geom.git] / src / OperationGUI / OperationGUI_PartitionDlg.cxx
index 0b10ca3914ca74fe443b6043bceccfab5b682cb8..0b08ae59fcdf065eff571fb32c7d137609c8192a 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  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
@@ -19,6 +19,7 @@
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // GEOM GEOMGUI : GUI for Geometry component
 // File   : OperationGUI_PartitionDlg.cxx
 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
@@ -69,7 +70,7 @@ OperationGUI_PartitionDlg::OperationGUI_PartitionDlg( GeometryGUI* theGeometryGU
   GroupPoints = new DlgRef_2Sel1List1Check( centralWidget() );
   GroupPoints->GroupBox1->setTitle( tr( "GEOM_PARTITION" ) );
   GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
-  GroupPoints->TextLabel2->setText( tr( "GEOM_TOOL_OBJECT" ) );
+  GroupPoints->TextLabel2->setText( tr( "GEOM_TOOL_OBJECTS" ) );
   GroupPoints->TextLabel3->setText( tr( "GEOM_RECONSTRUCTION_LIMIT" ) );
   GroupPoints->PushButton1->setIcon( image2 );
   GroupPoints->PushButton2->setIcon( image2 );
@@ -142,7 +143,7 @@ void OperationGUI_PartitionDlg::Init()
   connect( GroupPoints->ComboBox1, SIGNAL( activated( int ) ), this, SLOT( ComboTextChanged() ) );
 
   connect( myGeomGUI->getApp()->selectionMgr(),
-          SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+           SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
   
   initName( tr( "GEOM_PARTITION" ) );
 
@@ -169,7 +170,7 @@ void OperationGUI_PartitionDlg::ConstructorsClicked( int constructorId )
   switch ( constructorId ) {
   case 0: /*Full partition */
     GroupPoints->GroupBox1->setTitle( tr( "GEOM_PARTITION" ) );
-    GroupPoints->TextLabel2->setText( tr( "GEOM_TOOL_OBJECT" ) );
+    GroupPoints->TextLabel2->setText( tr( "GEOM_TOOL_OBJECTS" ) );
     GroupPoints->TextLabel3->show();
     GroupPoints->ComboBox1->show();
     GroupPoints->ComboBox1->setCurrentIndex( 0 );
@@ -200,7 +201,7 @@ void OperationGUI_PartitionDlg::ConstructorsClicked( int constructorId )
 
   myEditCurrentArgument->setFocus();
   connect( myGeomGUI->getApp()->selectionMgr(), 
-          SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+           SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
 }
 
 
@@ -224,8 +225,10 @@ bool OperationGUI_PartitionDlg::ClickOnApply()
   if ( !onAccept() )
     return false;
   
+
   initName();
-  ConstructorsClicked( getConstructorId() );
+  //  0020854: EDF 1398 GEOM: Ergonomy of Partition GUI window 
+  //  ConstructorsClicked( getConstructorId() );
   return true;
 }
 
@@ -335,7 +338,7 @@ void OperationGUI_PartitionDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
   connect( myGeomGUI->getApp()->selectionMgr(), 
-          SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+           SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
 
   ConstructorsClicked( getConstructorId() ); 
 }
@@ -369,7 +372,7 @@ GEOM::GEOM_IOperations_ptr OperationGUI_PartitionDlg::createOperation()
 bool OperationGUI_PartitionDlg::isValid( QString& )
 {
   return ( myListShapes.length()     || myListTools.length() ||
-          myListKeepInside.length() || myListRemoveInside.length() );
+           myListKeepInside.length() || myListRemoveInside.length() );
 }
 
 
@@ -401,10 +404,10 @@ bool OperationGUI_PartitionDlg::execute( ObjectList& objects )
   }
 
   if ( isValid( msg ) ) {
-    anObj = GEOM::GEOM_IBooleanOperations::_narrow( getOperation() )->
-      MakePartition( myListShapes, myListTools,
-                    myListKeepInside, myListRemoveInside,
-                    aLimit, false, myListMaterials, aKeepNonlimitShapes );
+    GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow(getOperation());
+    anObj = anOper->MakePartition( myListShapes, myListTools,
+                                   myListKeepInside, myListRemoveInside,
+                                   aLimit, false, myListMaterials, aKeepNonlimitShapes );
     res = true;
   }
 
@@ -437,8 +440,9 @@ void OperationGUI_PartitionDlg::restoreSubShapes( SALOMEDS::Study_ptr   theStudy
   if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
     // empty list of arguments means that all arguments should be restored
     getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
-                                        /*theFindMethod=*/GEOM::FSM_GetInPlaceByHistory,
-                                        /*theInheritFirstArg=*/myListShapes.length() == 1 ); // ? false
+                                         /*theFindMethod=*/GEOM::FSM_GetInPlaceByHistory,
+                                         /*theInheritFirstArg=*/myListShapes.length() == 1,
+                                         mainFrame()->CheckBoxAddPrefix->isChecked() ); // ? false
   }
 }