|
马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
static void do_ugopen_api(void)
{
char cue[] = "cue message";
char title[] = "dialog title";
int response;
tag_t object, view;
double cursor[3];
if(!UF_CALL(UF_UI_select_with_single_dialog(cue,title,
UF_UI_SEL_SCOPE_NO_CHANGE, init_proc, NULL,
&response, &object, cursor, &view)))
{
if (response == UF_UI_OBJECT_SELECTED ||
response == UF_UI_OBJECT_SELECTED_BY_NAME)
{
printf("object tag = %d\n", object);
if (response == UF_UI_OBJECT_SELECTED)
{
printf("view = %d\n", view);
printf("cursor position = %f %f %f\n",
cursor[0], cursor[1], cursor[2]);
}
}
/* unhighlight selected object */
UF_DISP_set_highlight(object,0);
}
}
/* selection initialization procedure */
static int init_proc(
UF_UI_selection_p_t select,
void* user_data)
{
num_triples = 2;
UF_UI_mask_t mask_triples[] = {
UF_line_type, 0, 0,
UF_solid_type, 0, UF_UI_SEL_FEATURE_ANY_EDGE};
UF_UI_mask_s只有三个数据成员object_type、object_subtype、solid_type,但是这个例子里面确是6个,搞不懂怎么回事?特此请教
/* enable only lines and edges */
if((UF_CALL(UF_UI_set_sel_mask(select,
UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC,
num_triples, mask_triples))) == 0)
{
return (UF_UI_SEL_SUCCESS);
}
else
{
return (UF_UI_SEL_FAILURE);
}
}
[ 本帖最后由 zxdawn 于 2005-12-31 07:17 编辑 ] |
|