From: asl Date: Fri, 26 Aug 2005 06:09:39 +0000 (+0000) Subject: PAL9636 X-Git-Tag: T_3_0_2a1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=13e795549b5099f8289aaed111c4cbb851addf26;p=modules%2Fgui.git PAL9636 --- diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index d01cdd9f8..e1065c9fe 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -332,3 +332,18 @@ QString SalomeApp_Study::newStudyName() const } return newName; } + +void SalomeApp_Study::deleteReferencesTo( _PTR( SObject ) obj ) +{ + _PTR(StudyBuilder) sb = studyDS()->NewBuilder(); + std::vector<_PTR(SObject)> aRefs = studyDS()->FindDependances( obj ); + for( int i=0, n=aRefs.size(); iGetFatherComponent()->ComponentDataType()==obj->GetFatherComponent()->ComponentDataType() ) + { + sb->RemoveReference( o ); + sb->RemoveObjectWithChildren( o ); + } + } +} diff --git a/src/SalomeApp/SalomeApp_Study.h b/src/SalomeApp/SalomeApp_Study.h index 5ac882766..1404446f4 100644 --- a/src/SalomeApp/SalomeApp_Study.h +++ b/src/SalomeApp/SalomeApp_Study.h @@ -35,6 +35,9 @@ public: _PTR(Study) studyDS() const; + // to delete all references to object, whose have the same component + void deleteReferencesTo( _PTR( SObject ) ); + signals: void saved( SUIT_Study* ); void opened( SUIT_Study* );