mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-28 20:10:33 +05:00
PAL19266, PAL19369
This commit is contained in:
parent
d2ac54f583
commit
609e696633
@ -359,9 +359,9 @@ void GEOMToolsGUI::OnEditDelete()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// MAIN LOOP OF SELECTED OBJECTS
|
// MAIN LOOP OF SELECTED OBJECTS
|
||||||
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
|
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() )
|
||||||
|
{
|
||||||
Handle(SALOME_InteractiveObject) io = It.Value();
|
Handle(SALOME_InteractiveObject) io = It.Value();
|
||||||
if ( !io->hasEntry() )
|
if ( !io->hasEntry() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -373,21 +373,32 @@ void GEOMToolsGUI::OnEditDelete()
|
|||||||
|
|
||||||
//If the object has been used to create another one,then it can't be deleted
|
//If the object has been used to create another one,then it can't be deleted
|
||||||
_PTR(ChildIterator) it (aStudy->NewChildIterator(aGeom));
|
_PTR(ChildIterator) it (aStudy->NewChildIterator(aGeom));
|
||||||
for ( it->InitEx( true ); it->More(); it->Next() ) {
|
for ( it->InitEx( true ); it->More(); it->Next() )
|
||||||
|
{
|
||||||
_PTR(SObject) chobj (it->Value());
|
_PTR(SObject) chobj (it->Value());
|
||||||
if(CheckSubObjectInUse(chobj, obj, aStudy)) return;
|
if(CheckSubObjectInUse(chobj, obj, aStudy)) return;
|
||||||
//check subobjects
|
//check subobjects
|
||||||
for (_PTR(ChildIterator) it (aStudy->NewChildIterator(obj)); it->More(); it->Next()) {
|
_PTR(ChildIterator) it1( aStudy->NewChildIterator( obj ) );
|
||||||
_PTR(SObject) child (it->Value());
|
for( it1->InitEx( true ); it1->More(); it1->Next())
|
||||||
|
{
|
||||||
|
_PTR(SObject) child (it1->Value());
|
||||||
if(CheckSubObjectInUse( chobj, child, aStudy)) return;
|
if(CheckSubObjectInUse( chobj, child, aStudy)) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() )
|
||||||
|
{
|
||||||
|
Handle(SALOME_InteractiveObject) io = It.Value();
|
||||||
|
if ( !io->hasEntry() )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
_PTR(SObject) obj ( aStudy->FindObjectID( io->getEntry() ) );
|
||||||
|
|
||||||
RemoveObjectWithChildren(obj, aStudy, views, disp);
|
RemoveObjectWithChildren(obj, aStudy, views, disp);
|
||||||
|
|
||||||
// Remove objects from Study
|
// Remove objects from Study
|
||||||
aStudyBuilder->RemoveObjectWithChildren( obj );
|
aStudyBuilder->RemoveObjectWithChildren( obj );
|
||||||
|
|
||||||
//deleted = true;
|
//deleted = true;
|
||||||
} // MAIN LOOP of selected
|
} // MAIN LOOP of selected
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user