]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To implement RemoveFromStudy for ColoredPrs3dHolder
authorapo <apo@opencascade.com>
Thu, 30 Nov 2006 12:47:54 +0000 (12:47 +0000)
committerapo <apo@opencascade.com>
Thu, 30 Nov 2006 12:47:54 +0000 (12:47 +0000)
src/VISU_I/VISU_ColoredPrs3dCache_i.cc
src/VISU_I/VISU_ColoredPrs3dCache_i.hh
src/VISU_I/VISU_ColoredPrs3dHolder_i.cc

index 2b5043e7608be77a3588c8d14e71af448664eaca..ce6206b06d5f0cfd863cd5112bb218a6616f3ffc 100644 (file)
@@ -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);
+}
+
index 2f6f00559086c964074c5d68f5a3f1659a27bf5a..ae7970d4d834f035cc657969020e82cdd8ad8408 100644 (file)
@@ -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();
 
index 136a7e371e82806f521201ccd6d11ec71cd5e210..f4324ef7de77b7c57412ae6e776301e4913c0e20 100644 (file)
@@ -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