Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Get TopoDS_Shape from AIS_InteractiveObject

I’m very new to OPEN CASCADE.
Can someone please let me know how to get the shape from AIS_InteractiveObject which used to view the shapes.
Thanks.

There are no direct functions to get the shapes. I checked with the class discription in Open CASCADE documentation.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Let’s say you have your AIS_InteractiveObject called "interactiveObj".
You can downcast this to "AIS_Shape" first.

interactiveObj = ... ; // your interactive object
Handle(AIS_Shape) aisShape = Handle(AIS_Shape)::DownCast(interactiveObj ); // convert to AIS_Shape

Then you can get the TopoDS_Shape from the object.

TopoDS_Shape shape = aisShape->Shape();

This is the simple method.

TopoDS_Shape shape = Handle(AIS_Shape)::DownCast(interactiveObj)->Shape(); // get the TopoDS_Shape
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading