|
读取面的参数,在选择一遍之后,能够正常输出,但是退出之后,这个面就不能被再次选中了,什么原因?求教
int CHANGE_action_0_act_cb_ZM ( int dialog_id,
void * client_data,
UF_STYLER_item_value_type_p_t callback_data)
{
int response=5,irc;
//int *response2;
//tag_t *obj2;
tag_t obj,view;
double cursor[3]={0,0,0};
char msg[256];
char msg2[]="选择锥面:";
char title[]="选择锥面";
UF_UI_selection_options_t opts;
int scope=UF_UI_SEL_SCOPE_WORK_PART;
int type=0;
int norm_dir=0;
double point[3];
double dir[3];
double box[6];
double radius;
double rad_data;
UF_UI_mask_t mask;
opts.other_options = 0;
opts.reserved = NULL;
opts.num_mask_triples = 1;
opts.mask_triples = &mask;
opts.mask_triples->object_type = UF_face_type;
opts.mask_triples->object_subtype = 0;
opts.mask_triples->solid_type = UF_UI_SEL_FEATURE_ANY_FACE;
opts.scope = UF_UI_SEL_SCOPE_WORK_PART_AND_OCC;
/* Make sure User Function is available. */
if ( UF_initialize() != 0)
return ( UF_UI_CB_CONTINUE_DIALOG );
/* ---- Enter your callback code here ----- */
irc=UF_UI_select_single(msg2,&opts,&response,&obj,cursor,&view);
UF_MODL_ask_face_data(obj,&type,point,dir,box,&radius,&rad_data,&norm_dir);
UF_UI_open_listing_window();
sprintf(msg, "判断面类型:%d\n",type);
UF_UI_write_listing_window(msg);
sprintf(msg, "判断面内外R:%d\n",norm_dir);
UF_UI_write_listing_window(msg);
sprintf(msg, "轴中心 点:%.2f,%.2f,%.2f\n",point[0],point[1],point[2]);
UF_UI_write_listing_window(msg);
sprintf(msg, "轴方向:%.2f,%.2f,%.2f\n",dir[0],dir[1],dir[2]);
UF_UI_write_listing_window(msg);
sprintf(msg, "半径:%.2f\n",radius);
UF_UI_write_listing_window(msg);
sprintf(msg, "rad_data:%.4f\n",rad_data);
UF_UI_write_listing_window(msg);
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 ); */
UF_free(&irc);
}
|
|