1 #include <uf.h>
2 #include <uf_ui.h>
3
4
5 static int select_filter_proc_fn(tag_t object, int type[3], void* user_data, UF_UI_selection_p_t select)
6 {
7 if (object == NULL)
8 {
9 return UF_UI_SEL_REJECT;
10 }
11 else
12 {
13 return UF_UI_SEL_ACCEPT;
14 }
15 }
16
17 static int init_proc(UF_UI_selection_p_t select, void* user_data)
18 {
19 int num_triples = 3;//可选类型的数量
20 UF_UI_mask_t mask_triples[] =
21 {UF_point_type, UF_point_subtype, UF_UI_SEL_NOT_A_FEATURE,
22 UF_line_type, UF_line_normal_subtype, UF_UI_SEL_NOT_A_FEATURE,
23 UF_solid_type, UF_solid_body_subtype, UF_UI_SEL_FEATURE_BODY
24 };//可选对象类型
25 UF_UI_set_sel_mask(select, UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC, num_triples, mask_triples);
26 if ((UF_UI_set_sel_procs(select, select_filter_proc_fn, NULL, user_data)) == 0)
27 {
28 return UF_UI_SEL_SUCCESS;
29 }
30 else
31 {
32 return UF_UI_SEL_FAILURE;
33 }
34 }
35
36
37
38
39
40
41 UF_initialize();
42
43 //单对象选择对话框
44 char sCue[] = "单对象选择对话框";
45 char sTitle[] = "单对象选择对话框";
46 int iScope = UF_UI_SEL_SCOPE_NO_CHANGE;
47 int iResponse;
48 tag_t tObject;
49 tag_t tView;
50 double adCursor[3];
51 UF_UI_select_with_single_dialog(sCue, sTitle, iScope, init_proc, NULL, &iResponse, &tObject, adCursor, &tView);
52
53 UF_terminate();
54
55 Caesar卢尚宇
56 2019年7月1日