From 13e795549b5099f8289aaed111c4cbb851addf26 Mon Sep 17 00:00:00 2001 From: asl Date: Fri, 26 Aug 2005 06:09:39 +0000 Subject: [PATCH] PAL9636 --- src/SalomeApp/SalomeApp_Study.cxx | 15 +++++++++++++++ src/SalomeApp/SalomeApp_Study.h | 3 +++ 2 files changed, 18 insertions(+) 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* ); -- 2.39.2