|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
% N9 V% Z$ E: E" Z2 e8 k$ q/ V
: d/ S% J: {6 b# f# q" B
7 ?: L& C/ b; r+ H, x2 }4 q K1 [/ L+ O" q
这功能其实很好用,比如选择面,自动显示面的法线等等。' a' U1 h' h8 Y9 N
q: I4 L: e4 J5 N k
static void do_UGopen_api(void)
/ N/ W& O' v9 \# F{
5 s8 S0 I( E1 m double pt1[3] = {0.0, 0.0, 0.0};% _$ F9 w5 P$ j; V2 F0 D+ |7 @* O- {
double pt2[3] = {2.0, 2.0, 2.0};0 i% O `: ~! ]2 ~" |/ k8 E
double pt3[3] = {-2.0,-2.0,-2.0};- G- ?; S. {+ U" r) j1 C+ C
double vect1[3] = {1.0, 1.0, 1.0};
( i Z8 ^, v/ \6 A: Y UF_DISP_conehead_attrb_s attrb;
; Y% f, }( C, f7 q/ d4 x: V UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
5 k( a, N( I) s/ W" n* t5 a+ |& u* K pt1, vect1, 1);
* G3 F! |3 `: I5 p1 T /* Example to draw the vector with the base of its staff
$ k, l. l+ L( }3 J anchored at the origin so that the vector appears to point8 M3 r! ?4 g5 M6 k. P' E
away from the origin
5 p8 o, {2 E& b- W, x. h */ O5 ]/ n r k
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,# ~% ?; J# {/ X: p/ p
pt2, vect1, 0);/ b, n7 L+ `8 j9 H2 q$ M! ^- E5 z
UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
6 S" n4 O! _: ?) Y pt3, vect1, 0, "Normal");
{; A* y2 R3 h1 F | UF_DISP_get_conehead_attrb(&attrb);1 g7 ?. j4 ~) K2 L- c% p
/* Use color index three */& A/ u% i: D4 j) R6 C' ^
attrb.color = 3;. s# c; o* Z( f- Z) t
/* Update the current attribute settings */$ p, T4 t( f9 [) l+ t
UF_DISP_set_conehead_attrb(&attrb);
/ h2 z/ A! V+ P9 g7 w- a5 z printf("\nCurrent conhead display settings:\n");
) B! k/ Q: F, S printf("\tLength of Staff: %g\n", attrb.staff_length);! Z7 O( k" H. g2 a$ l7 B) ]
printf("\tTotal Length: %g\n", attrb.total_length);
( Y V6 r0 @. v! \1 W% W" V" _' { printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);
( i$ P; G7 }" X8 } printf("\TColor Index: %d\n", attrb.color);/ i/ r7 ~3 I$ b# p
printf("\tFont Index: %d\n", attrb.font);
/ o; j' R8 S, I, r) U' i ~ printf("\tDensity Index: %d\n", attrb.density);
( q; {; J, L" B! J5 X( Z}
6 M* Q. K2 N4 F) E5 F# N# Q1 E0 Q% f
|
|