|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
4 I1 U- \3 x4 K, D2 w- o0 `
8 H0 h, N: C1 |, K; w. C% b9 X) S- d, ]6 ]
( t+ o6 R9 k3 x9 }' j7 ?这功能其实很好用,比如选择面,自动显示面的法线等等。
& O& i. M- U! p
+ X' V) {# B% `/ ~static void do_UGopen_api(void)
5 N# I4 j) j; F4 w3 X{
- D0 c4 {* J9 x5 C double pt1[3] = {0.0, 0.0, 0.0};, \6 Z0 s; [0 n- T
double pt2[3] = {2.0, 2.0, 2.0};' e+ F$ |3 L* f" Y1 _1 m& |
double pt3[3] = {-2.0,-2.0,-2.0};- K4 g2 f+ T0 g- [+ j7 ]0 l* f6 @
double vect1[3] = {1.0, 1.0, 1.0};7 T' N N2 Y) k. j2 V
UF_DISP_conehead_attrb_s attrb;
( z# b( K5 ?4 ~: l. p- l' W: z6 q UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
1 m* @" F0 G, \% _- a pt1, vect1, 1);7 }! O6 G3 [1 ]" g# J* Y
/* Example to draw the vector with the base of its staff& M2 ~* U1 _5 T' h
anchored at the origin so that the vector appears to point9 o" Z1 ?- K6 X: ?9 u/ m- N
away from the origin4 r4 H0 y" L! I) ~% n
*/
! g! V0 |2 ?; k( r2 x" T+ q* u UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
- R+ `1 ?8 \5 }+ N pt2, vect1, 0);* j1 s0 I/ n' A) y
UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
1 r% j$ w3 H" q4 t; s9 { t& c pt3, vect1, 0, "Normal");
* \' |9 D1 s, j% J- V% p2 ^% D UF_DISP_get_conehead_attrb(&attrb);
4 X8 z0 P) n: d$ q/ V' J* A; h /* Use color index three */
- g/ S+ n* D; `6 v; l" W, G' }3 x4 l3 I attrb.color = 3;
. ^8 r8 Q5 B8 i) s /* Update the current attribute settings */" v7 j S0 S# P7 D& ~
UF_DISP_set_conehead_attrb(&attrb);
, b& F' ]. x1 ^# w' t) a0 Q. D printf("\nCurrent conhead display settings:\n");7 i; b! a; n! L& w0 J
printf("\tLength of Staff: %g\n", attrb.staff_length);3 G: }0 r. Y* r, c. X
printf("\tTotal Length: %g\n", attrb.total_length);+ F n8 ^# j2 l6 O6 W( ^
printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);% s! p6 @; h' v. ?
printf("\TColor Index: %d\n", attrb.color); h2 L k' N% K& F4 l u, B$ t# m
printf("\tFont Index: %d\n", attrb.font);
: X: A9 Q4 Y/ i- `4 y' T printf("\tDensity Index: %d\n", attrb.density);# [9 @! @: G) y' ?
}
+ ~( I! h4 F& j" P5 l6 u2 n( s
|
|