I have a list of ~1000 TopoDS_Shapes i give to an AIS_InteractiveContext at the beginning of the program.
I want to hide/show specific shapes at the user's request.
however, this code for hiding a list of shapes will not work
Handle_TopTools_HSequenceOfShape shapes; //my shapes
Handle_AIS_Shape cur_shape = new AIS_Shape(TopoDS_Shape());
for(integer i = 1; i Length(); ++i)
this->ais_context->Erase(cur_shape, Standard_False); //AIS_InteractiveContext::Erase()
I noticed that erasing shapes DOES work if Iretrieve already displayed objects via AIS_InteractiveContext::DisplayedObjects()
so i thought maybe i could compare the AIS_InteractiveObject, which i get from DisplayedObjects(), to the TopoDS_Shape.
i came up with this
//...iterate through the list
but Erase() will never be called because isSame always returns false.
what can i do? Any suggestions/mistakes in my code?