//
#include "OperationGUI_PartitionDlg.h"
-#include "OperationGUI_MaterialDlg.h"
#include <DlgRef.h>
#include <GeometryGUI.h>
mainFrame()->RadioButton3->close();
// Full partition (contains half-space partition)
- GroupPoints = new DlgRef_2Sel1List( centralWidget() );
+ 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->PushButton2->setIcon( image2 );
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
+ GroupPoints->LineEdit1->setEnabled(true);
+ GroupPoints->LineEdit2->setEnabled(false);
+ GroupPoints->CheckButton1->setText( tr( "GEOM_KEEP_NONLIMIT_SHAPES" ) );
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
/***************************************************************/
- setHelpFileName( "partition.htm" );
+ setHelpFileName( "partition_page.html" );
Init();
}
GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_WIRE" ) );
GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_EDGE" ) );
GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_VERTEX" ) );
+ GroupPoints->CheckButton1->setChecked( false );
+ mainFrame()->GroupBoxPublish->show();
+
/* signals and slots connections */
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( GroupPoints->ComboBox1, SIGNAL( activated( int ) ), this, SLOT( ComboTextChanged() ) );
-
- connect( myGeomGUI->getApp()->selectionMgr(),
+
+ connect( myGeomGUI->getApp()->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
initName( tr( "GEOM_PARTITION" ) );
ConstructorsClicked( 0 );
+ GroupPoints->PushButton1->click();
}
GroupPoints->TextLabel2->setText( tr( "GEOM_TOOL_OBJECT" ) );
GroupPoints->TextLabel3->show();
GroupPoints->ComboBox1->show();
-
GroupPoints->ComboBox1->setCurrentIndex( 0 );
+ GroupPoints->CheckButton1->show();
+ GroupPoints->PushButton1->setDown( true );
+ GroupPoints->PushButton2->setDown( false );
+ GroupPoints->LineEdit1->setEnabled(true);
+ GroupPoints->LineEdit2->setEnabled(false);
break;
case 1: /*Half-space partition */
GroupPoints->GroupBox1->setTitle( tr( "GEOM_PARTITION_HALFSPACE" ) );
GroupPoints->TextLabel3->hide();
GroupPoints->ComboBox1->hide();
GroupPoints->TextLabel2->setText( tr( "GEOM_PLANE" ) );
+ GroupPoints->CheckButton1->hide();
+ GroupPoints->PushButton1->setDown( true );
+ GroupPoints->LineEdit1->setEnabled(true);
break;
}
myEditCurrentArgument->setText( "" );
QString aString = "";
- int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString, true );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
if ( nbSel < 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
// One and only one plane can be selected
- if ( getConstructorId() == 1 &&
+ if ( getConstructorId() == 1 &&
myEditCurrentArgument == GroupPoints->LineEdit2 &&
nbSel != 1 ) {
myListTools.length( 0 );
}
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myListShapes, true );
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListShapes, true);
myListMaterials.length( 0 );
if ( !myListShapes.length() )
return;
}
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myListTools, true );
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListTools, true);
if ( !myListTools.length() )
return;
}
{
QPushButton* send = (QPushButton*)sender();
- if ( send == GroupPoints->PushButton1 )
+ if ( send == GroupPoints->PushButton1 ) {
myEditCurrentArgument = GroupPoints->LineEdit1;
+ GroupPoints->PushButton2->setDown(false);
+ GroupPoints->LineEdit1->setEnabled(true);
+ GroupPoints->LineEdit2->setEnabled(false);
+ }
else if ( send == GroupPoints->PushButton2 ) {
+ myGeomGUI->getApp()->selectionMgr()->clearSelected(); //clear prewious selection
myEditCurrentArgument = GroupPoints->LineEdit2;
+ GroupPoints->PushButton1->setDown(false);
+ GroupPoints->LineEdit1->setEnabled(false);
+ GroupPoints->LineEdit2->setEnabled(true);
if ( getConstructorId() == 1 )
globalSelection( GEOM_PLANE );
}
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
+ send->setDown(true);
}
int aLimit = GetLimit();
int aConstructorId = getConstructorId();
+ int aKeepNonlimitShapes = 0;
- if ( aConstructorId == 1 )
+ if ( aConstructorId == 1 ) {
aLimit = GEOM::SHAPE;
+ }
+ else {
+ if ( GroupPoints->CheckButton1->isChecked() ) {
+ aKeepNonlimitShapes = 1;
+ }
+ else {
+ aKeepNonlimitShapes = 0;
+ }
+ }
if ( isValid( msg ) ) {
- anObj = GEOM::GEOM_IBooleanOperations::_narrow(getOperation())->
- MakePartition(myListShapes, myListTools,
- myListKeepInside, myListRemoveInside,
- aLimit, false, myListMaterials);
+ anObj = GEOM::GEOM_IBooleanOperations::_narrow( getOperation() )->
+ MakePartition( myListShapes, myListTools,
+ myListKeepInside, myListRemoveInside,
+ aLimit, false, myListMaterials, aKeepNonlimitShapes );
res = true;
}
return res;
}
-
//=================================================================================
-// function : closeEvent
+// function : restoreSubShapes
// purpose :
//=================================================================================
-void OperationGUI_PartitionDlg::closeEvent( QCloseEvent* e )
+void OperationGUI_PartitionDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy,
+ SALOMEDS::SObject_ptr theSObject )
{
- GEOMBase_Skeleton::closeEvent( e );
+ 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
+ }
}
-
//=======================================================================
//function : ComboTextChanged
//purpose :
//GroupPoints->PushButton4->setEnabled(IsEnabled);
}
-
//=================================================================================
// function : GetLimit()
// purpose :