Mon, 08/01/2011 - 12:55
Forums:
I already have a AIS_Shape which is moving a little every 100ms.I need to get the location of the changed AIS_Shape in TopoDS_Shape to do the BRepAlgoAPI_Cut() function.
So,how can I get the TopoDS_Shape from a existing AIS_Shape?
Mon, 08/01/2011 - 14:05
Please, look at this code. You need use "DownCast".
void MyDoc::ModifyFillet()
{
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();
BRepFilletAPI_MakeFillet aFillet(Sh);
}