Get TopoDS_Shape from AIS_InteractiveObject

Get TopoDS_Shape from AIS_InteractiveObject

Code snippet

Handle(AIS_InteractiveObject) aisShp = selectedAIS_Shape;
if (aisShp->IsKind("AIS_Shape"))
{
    TopoDS_Shape myShape = Handle(AIS_Shape)::DownCast(aisShp)->Shape();
    // do changes
}

More details

Check the inheritance diagram of the "AIS_InteractiveObject" class. Here you can see "AIS_Shape" is inherited from "AIS_InteractiveObject".

Inheritance diagram for AIS_Shape

In "AIS_Shape" you can see the "Shape" extracting function.

TopoDS_Shape extracting method

Any class which is inherited from "Standard_Transient" can be checked using "IsKind()" function. 
The usage of this function can be seen in the above example.

"IsKind()" function description.

Related links:





Post a Comment

Previous Post Next Post