从AIS_InteractiveObject获取TopoDS_Shape

huangapple go评论104阅读模式
英文:

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

huangapple
  • 本文由 发表于 2023年5月22日 12:38:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76303069.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定