From 1c0ea5588d13252c20404ab850b89e1b213f3ab6 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 30 Nov 2006 12:47:54 +0000 Subject: [PATCH] To implement RemoveFromStudy for ColoredPrs3dHolder --- src/VISU_I/VISU_ColoredPrs3dCache_i.cc | 11 +++++++++++ src/VISU_I/VISU_ColoredPrs3dCache_i.hh | 4 ++++ src/VISU_I/VISU_ColoredPrs3dHolder_i.cc | 7 ++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc index 2b5043e7..ce6206b0 100644 --- a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc @@ -423,3 +423,14 @@ VISU::ColoredPrs3dCache_i } } } + +//---------------------------------------------------------------------------- +void +VISU::ColoredPrs3dCache_i +::RemoveHolder(VISU::ColoredPrs3dHolder_i* theHolder) +{ + TColoredPrs3dHolderMap::iterator anIter = myHolderMap.find(theHolder->GetEntry()); + if(anIter != myHolderMap.end()) + myHolderMap.erase(anIter); +} + diff --git a/src/VISU_I/VISU_ColoredPrs3dCache_i.hh b/src/VISU_I/VISU_ColoredPrs3dCache_i.hh index 2f6f0055..ae7970d4 100644 --- a/src/VISU_I/VISU_ColoredPrs3dCache_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3dCache_i.hh @@ -160,6 +160,10 @@ namespace VISU const VISU::ColoredPrs3dHolder::BasicInput& theInput, VISU::View3D_ptr theView3D); + // Unregister the holder instance from cache + void + RemoveHolder(VISU::ColoredPrs3dHolder_i* theHolder); + void ClearCache(); diff --git a/src/VISU_I/VISU_ColoredPrs3dHolder_i.cc b/src/VISU_I/VISU_ColoredPrs3dHolder_i.cc index 136a7e37..f4324ef7 100644 --- a/src/VISU_I/VISU_ColoredPrs3dHolder_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3dHolder_i.cc @@ -169,7 +169,12 @@ VISU::ColoredPrs3dHolder_i void VISU::ColoredPrs3dHolder_i ::RemoveFromStudy() -{} +{ + myCache.RemoveHolder(this); + CORBA::String_var anIOR = GetID(); + SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectIOR(anIOR.in()); + VISU::RemoveFromStudy(aSObject, false); +} //---------------------------------------------------------------------------- void -- 2.39.2