英文:
Get TopoDS_Shape from AIS_InteractiveObject
问题
我对OPEN CASCADE非常不熟悉。
有人可以告诉我如何从用于查看形状的AIS_InteractiveObject中获取形状吗?
谢谢。
没有直接的函数来获取形状。我查阅了Open CASCADE文档中的类描述。
英文:
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.
答案1
得分: 1
"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 ); // 转换为 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(); // 获取 TopoDS_Shape"
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论