AIS_InteractiveContext Question

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

Michael Gandyra's picture

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