|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
, l+ V0 r* d7 {$ n- M$ g
; p- u) V# Y) w' a0 h
$ ^; b& G7 R1 J$ ^+ x+ y
, o' V* |; j; k1 z* b这功能其实很好用,比如选择面,自动显示面的法线等等。0 A: }! S# W: Z9 H
$ @& W- j! |3 T1 [static void do_UGopen_api(void)
; z/ \6 I. ]( r) s{% q% g5 r$ G! I3 B S c2 z# E+ @
double pt1[3] = {0.0, 0.0, 0.0};
6 F% L" S$ ?* Q5 b4 T- w double pt2[3] = {2.0, 2.0, 2.0};
b1 Y' i- ?# |0 ` z double pt3[3] = {-2.0,-2.0,-2.0};
' S. @' A$ q) u" [7 w2 ]: u! } double vect1[3] = {1.0, 1.0, 1.0};
, f8 ?1 H, K$ r UF_DISP_conehead_attrb_s attrb;1 ^, i# b# ^8 m Y. }; W. x
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,7 X4 Z0 k5 ^. ^1 ~& s' P2 q ^9 ^
pt1, vect1, 1);
0 {/ U5 U- _& v' O: W# r /* Example to draw the vector with the base of its staff# M3 s( Y+ H% q; {; e# n
anchored at the origin so that the vector appears to point
/ O3 r4 T; J, `% M5 k away from the origin$ b6 I* Y0 c( W# k6 S r8 J
*/8 d% c7 b6 B- z) J% X- \
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
- F' J+ {. q/ x. m/ E* J2 U1 s pt2, vect1, 0);
# d: d- F) v6 ~& L7 z UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,0 J5 b3 e+ X6 @
pt3, vect1, 0, "Normal");4 X4 z& Z2 g- P
UF_DISP_get_conehead_attrb(&attrb);
& x/ F3 G& t8 U% J, q/ @ /* Use color index three */
4 q/ F: o- t- X, a attrb.color = 3;. q7 e# \0 k1 r7 R
/* Update the current attribute settings */
# \3 E1 N ]- q4 a UF_DISP_set_conehead_attrb(&attrb);
; l" S) Q0 ]; ^3 ?: N/ D0 i8 @ printf("\nCurrent conhead display settings:\n");
* h1 e/ j7 Y. t+ ~ printf("\tLength of Staff: %g\n", attrb.staff_length);" r2 U8 E5 x, T4 h8 }
printf("\tTotal Length: %g\n", attrb.total_length);
3 ^! G" U) }! J4 ~! a: o, U: Q printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);
8 p8 Y, V- n; X$ }9 h6 d printf("\TColor Index: %d\n", attrb.color);% N. Z( U0 Z; {) s( E' X% y
printf("\tFont Index: %d\n", attrb.font);
& S' Q& [6 E+ _( R$ F. q printf("\tDensity Index: %d\n", attrb.density);4 i! h- k; @. N0 p
}
( ]; r0 Z- v: ], z% M9 _8 f
/ `5 Y5 r; l$ S1 l2 l0 X: Y |
|