|
马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
各位高手:
我的目的是实现图中的两个实体的减运算,将长方体减去图中红色的实体。以下是我的程序,麻烦各位高手指点指点。还有,请各位高手指点一下 UF_OBJ_cycle_objs_in_part(part, UF_solid_type, &solid)的参数是如何传递的?谢谢了!
int ZHTWAIXING_kqfangkuai_cb ( int dialog_id,
void * client_data,
UF_STYLER_item_value_type_p_t callback_data)
{
int i=0, type, sub_type, body_type, num_result;
tag_t part, solid, tag_solid[4], *result_body;
char mess[133];
solid=NULL_TAG;
/* Make sure User Function is available. */
if ( UF_initialize() != 0)
return ( UF_UI_CB_CONTINUE_DIALOG );
/* ---- Enter your callback code here ----- */
part=UF_PART_ask_display_part();
UF_OBJ_cycle_objs_in_part(part, UF_solid_type, &solid);
do
{
UF_OBJ_ask_type_and_subtype(solid, &type, &sub_type);
if(sub_type == UF_solid_body_subtype)
{
UF_MODL_ask_body_type (solid, &body_type );
if (body_type==UF_MODL_SOLID_BODY)
{
tag_solid[i]=solid;
sprintf(mess,"%d",tag_solid[i]);
i++;
// uc1601(mess,1);
}
}
UF_OBJ_cycle_objs_in_part(part, UF_solid_type, &solid);
}while(solid != NULL_TAG);
UF_MODL_subtract_bodies( tag_solid[0], tag_solid[1], &num_result, &result_body );
UF_terminate ();
/* Callback acknowledged, do not terminate dialog */
return (UF_UI_CB_CONTINUE_DIALOG);
/* or Callback acknowledged, terminate dialog. */
/* return ( UF_UI_CB_EXIT_DIALOG ); */
} |
|