However, the code above doesn't actually hide the corresponding shape like the description for AIS_InteractiveContext::Erase describes. I've tried this with and without the custom Prs3d_Drawer objects I'm using, and I've also tried to redraw/update the viewer and context with zero success.
AIS_InteractiveContext::Erase says "The object's presentations are simply flagged as invisible and therefore excluded from redrawing.". Is it possible that the actual presentations being used aren't linked to the context fully somehow? Am I missing something in how this function is supposed to work?
Discussion
2 archived replies
Posts are displayed in their archived order.
01Commenter-1
Erase operation is pretty straight-forward, so there should be an error somewhere else in your code. It is difficult to deduce where problem may come from provided code snippet - I think that code snippet itself will work as expected being detached into dedicated sample.
If you are using an old OCCT, than problem might come from usage of Local Context (removed in up-to-date OCCT).
pload MODELING VISUALIZATION
vinit View1
box b 1 2 3
explode b F
vdisplay -dispMode 1 b
vfit
vaspects b -subShapes b_1 b_2 -setColor RED
verase b
02Author
Thanks for your reply. It did turn out to be an error in my code since I was displaying some shapes redundantly and it appeared as if AIS_InteractiveContext::Erase wasn't hiding the selected object since there were two instances of the same shape. :)