|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
6 B- W& Y3 c& Y% X. E
) a( g8 v: S$ _- y- V9 E
! e! [& s' a! A
3 j1 p x+ m E" n6 C, |这功能其实很好用,比如选择面,自动显示面的法线等等。
8 e# m0 Q8 `" Q8 Q; L2 e7 L( b, ]5 L, c9 M g* J. Q
static void do_UGopen_api(void) j4 H/ e! q: J. R! D0 h5 l n
{
7 T! d# f$ [- x; F! E double pt1[3] = {0.0, 0.0, 0.0};) z6 h6 r+ `) o( e/ O& A
double pt2[3] = {2.0, 2.0, 2.0};3 T( u4 K) r6 I
double pt3[3] = {-2.0,-2.0,-2.0};
2 A- x- {0 \3 z R( l! t% G double vect1[3] = {1.0, 1.0, 1.0};! d9 A5 G' e" X% q/ x! n
UF_DISP_conehead_attrb_s attrb;, `" J: b K7 f6 ]0 p8 i3 E
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
- R5 _! y) ~3 a+ e' ~ pt1, vect1, 1);
, F* L* D* V. y& @; B, H /* Example to draw the vector with the base of its staff5 K, l8 u; {* I2 P9 p
anchored at the origin so that the vector appears to point
$ ^& m# p- }$ h# D* ^ away from the origin& q( i7 U' B8 A! y! ~# W
*// V: w) _2 S0 v1 {7 Q; C' }* h' D
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
% z- m4 r7 M3 w& q6 {1 ?1 o( w# A pt2, vect1, 0);
: o/ B& d) b4 \4 W, y' c UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
) s' h: M, E3 T pt3, vect1, 0, "Normal");/ `+ }" Y8 \) s1 D4 F
UF_DISP_get_conehead_attrb(&attrb);; L, j) V; G4 n7 {, U7 H
/* Use color index three */1 w) `4 d/ m8 k+ I g2 @
attrb.color = 3;& ?/ [1 S0 E9 f$ |& w/ P) a
/* Update the current attribute settings */, H) k6 R. C$ P
UF_DISP_set_conehead_attrb(&attrb);1 V& y& ~! [! F- ^) R
printf("\nCurrent conhead display settings:\n");
1 U3 j9 E1 E1 F* N; C+ K3 e. { printf("\tLength of Staff: %g\n", attrb.staff_length);! V6 D9 a8 j' t0 w6 ^( M2 t
printf("\tTotal Length: %g\n", attrb.total_length);% k' H0 M; e6 w+ q, A% r4 }
printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);
9 C) K2 w, l% O% J6 \1 Q1 k printf("\TColor Index: %d\n", attrb.color);
& q1 S+ y/ ]5 M printf("\tFont Index: %d\n", attrb.font); G- P! C2 h% a( d
printf("\tDensity Index: %d\n", attrb.density);1 | \) h. _) w* A1 m3 j, u2 p& E
}
# ~: Q% x( E8 J9 Z* ~, z% i, g6 c4 k6 D* ^( J
|
|