
Wed, 04/05/2000 - 11:49
Forums:
Hi all,
I want to iterate through all shape objects in an AIS_InteractiveContext.
I have tried the following:
for (m_hContext->InitCurrent(); m_hContext->MoreCurrent(); m_hContext->NextCurrent()) {
ToposDS_Shape Shape = Handle(AIS_Shape)::DownCast(m_hContext->Current())->Shape(); }
This way I obviously get all selected shapes, but how do I get all shapes?
Thanx Christof
Wed, 04/05/2000 - 18:08
Like this:
AIS_ListOfInteractive Obj_List;
myAISContext->DisplayedObjects(Obj_List);
AIS_ListIteratorOfListOfInteractive it;
for (it.Initialize(Obj_List); it.More(); it.Next())
{
// Do what you want with the InteractiveObjects
// i.e. test if the current InteractiveObject has a Shape
}
with regards, Michael