From: apo Date: Thu, 30 Nov 2006 12:47:54 +0000 (+0000) Subject: To implement RemoveFromStudy for ColoredPrs3dHolder X-Git-Tag: WP1_2_3_05-12-2006_cache_system~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1c0ea5588d13252c20404ab850b89e1b213f3ab6;p=modules%2Fvisu.git To implement RemoveFromStudy for ColoredPrs3dHolder --- 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