-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021 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
GroupPoints = new DlgRef_1SelExt( centralWidget() );
GroupPoints->GroupBox1->setTitle( tr( "GEOM_SEWING" ) );
- GroupPoints->TextLabel1->setText( tr( "GEOM_SELECTED_SHAPE" ) );
+ GroupPoints->TextLabel1->setText( tr( "GEOM_SELECTED_SHAPES" ) );
GroupPoints->PushButton1->setIcon( image1 );
GroupPoints->LineEdit1->setReadOnly( true );
/* init variables */
myEditCurrentArgument = GroupPoints->LineEdit1;
- myObject = GEOM::GEOM_Object::_nil();
+ myObjects.clear();
//myGeomGUI->SetState( 0 );
initSelection();
initName();
GroupPoints->LineEdit1->setText( "" );
- myObject = GEOM::GEOM_Object::_nil();
+ myObjects.clear();
initSelection();
{
erasePreview();
myEditCurrentArgument->setText( "" );
- myObject = GEOM::GEOM_Object::_nil();
+ myObjects.clear();
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
- SALOME_ListIO aSelList;
- aSelMgr->selectedObjects(aSelList);
+ myObjects = getSelected( TopAbs_SHAPE, -1 );
- if ( aSelList.Extent() == 1 ) {
- Handle(SALOME_InteractiveObject) anIO = aSelList.First();
- myObject = GEOMBase::ConvertIOinGEOMObject( anIO );
- if ( !CORBA::is_nil( myObject ) )
- myEditCurrentArgument->setText( GEOMBase::GetName( myObject ) );
+ if ( !myObjects.isEmpty() ) {
+ QString aName = myObjects.count() > 1 ? QString( "%1_objects").arg( myObjects.count() ) : GEOMBase::GetName( myObjects[0].get() );
+ myEditCurrentArgument->setText( aName );
}
}
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
GroupPoints->LineEdit1->setText( "" );
- myObject = GEOM::GEOM_Object::_nil();
+ myObjects.clear();
myClosed = -1;
myOpen = -1;
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_SewingDlg::createOperation()
{
- return getGeomEngine()->GetIHealingOperations( getStudyId() );
+ return getGeomEngine()->GetIHealingOperations();
}
//=================================================================================
{
myClosed = -1;
bool ok = myTolEdt->isValid( msg, !IsPreview() );
- return !myObject->_is_nil() && ( IsPreview() || myTolEdt->value() > 0. ) && ok;
+ return !myObjects.isEmpty() && ( IsPreview() || myTolEdt->value() > 0. ) && ok;
}
//=================================================================================
bool aResult = false;
GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow( getOperation() );
+ GEOM::ListOfGO_var objList = new GEOM::ListOfGO;
+ objList->length( myObjects.count() );
+ for ( int i = 0; i < myObjects.count(); ++i )
+ objList[i] = myObjects[i].copy();
+
if ( IsPreview() ) { // called from onDetect(): detect free boundary edges, highlight them (add to objects), display message dialog
GEOM::ListOfGO_var aClosed, anOpen;
- aResult = anOper->GetFreeBoundary( myObject, aClosed, anOpen );
+ aResult = anOper->GetFreeBoundary( objList, aClosed, anOpen );
if ( aResult ) {
myClosed = aClosed->length();
GEOM::GEOM_Object_var anObj;
if (myAllowNonManifoldChk->isChecked()) {
- anObj = anOper->SewAllowNonManifold( myObject, myTolEdt->value() );
+ anObj = anOper->SewAllowNonManifold( objList, myTolEdt->value() );
} else {
- anObj = anOper->Sew( myObject, myTolEdt->value() );
+ anObj = anOper->Sew( objList, myTolEdt->value() );
}
aResult = !anObj->_is_nil();
{
QStringList aParameters;
aParameters << myTolEdt->text();
- anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+ anObj->SetParameters(aParameters.join(":").toUtf8().constData());
}
objects.push_back( anObj._retn() );
}
void RepairGUI_SewingDlg::initSelection()
{
TColStd_MapOfInteger aTypes;
+ aTypes.Add( GEOM_FACE );
aTypes.Add( GEOM_SHELL );
aTypes.Add( GEOM_SOLID );
aTypes.Add( GEOM_COMPOUND );
msg = tr( "GEOM_FREE_BOUNDS_ERROR" );
SUIT_MessageBox::information( this, tr( "GEOM_FREE_BOUNDS_TLT" ), msg );
}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_SewingDlg::getSourceObjects()
+{
+ return myObjects;
+}