how to get the shape in AIS_InteractiveContext

i want to get the shape when i click on the item of the treectrl. and the ais_shape will be hilight.

i try this:
AIS_ListOfInteractive aList;
myAISContext->DisplayedObjects(aList);
AIS_ListIteratorOfListOfInteractive aListIterator;
for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next())
{
myAISContext->SetSelected(aListIterator.Value());
TopoDS_Shape S =myAISContext->SelectShape(); this step will have error.
}

what shall i do?

Dmitry Kidyaev's picture

1. To highlight I use hilight metohd.
2. To get the shape which corresponds to AIS_Shape. write ((AIS_shape*)aListIterator.Value())->Shape();

WuXuan's picture

thank