For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

how to get the shape in AIS_InteractiveContext

WuXuan's picture
Forums: 

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