Open Cascade:如何从AIS_Shape导出TopoDS_Shape?

Open Cascade:如何从AIS_Shape导出TopoDS_Shape?

实现代码如下:

if( !myAISContext->HasOpenedContext())
{
wxMessageBox(_T("It is necessary to activate the edges selection mode\n\and select edges on an object before \nrunning this function"),_T("Error!"));
return;
}

myAISContext->InitSelected();
if (myAISContext->MoreSelected()) {
Handle(AIS_Shape) S = Handle(AIS_Shape)::DownCast(myAISContext->SelectedInteractive());

if (S.IsNull()){
wxMessageBox(_T("It is necessary to activate the edges selection mode\n\and select edges on an object before \nrunning this function"),_T("Error!"));
return;
}

TopoDS_Shape Sh=S->Shape();

参考:

HOW TO GET THE TOPODS_SHAPE FROM A EXISTING AIS_SHAPE?

 

posted @ 2019-05-29 13:50  余生以学  阅读(1254)  评论(0编辑  收藏  举报