|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
+ v. ]' ]/ W, z* ^; a9 T
0 k3 ]7 X+ J2 M. j3 d: S& S( h+ b. l, h p T3 o& o/ k
b4 o2 @0 j+ J" {- ?
这功能其实很好用,比如选择面,自动显示面的法线等等。$ H E# N( C" \" @& s
; f5 J" {; @5 a; @4 T: x6 y
static void do_UGopen_api(void)
0 V0 m0 G- G- E& S! B' x% n{
* I4 N- J! }: _ m* g) A double pt1[3] = {0.0, 0.0, 0.0};$ x+ e7 I1 k- n: X
double pt2[3] = {2.0, 2.0, 2.0};
& |2 R ]$ ^1 N7 ]2 T) F double pt3[3] = {-2.0,-2.0,-2.0};2 y4 G' s9 I' r! E7 n- k
double vect1[3] = {1.0, 1.0, 1.0};3 a- a, m# }: l9 u- E6 s; ^
UF_DISP_conehead_attrb_s attrb;$ T4 @7 `% {" G
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
9 v) }: y6 o* u) }5 _# y- O pt1, vect1, 1);& a5 q; r- t/ ~
/* Example to draw the vector with the base of its staff" u; x* l' M* F0 u1 d7 t, Y( U2 I
anchored at the origin so that the vector appears to point# D, ~& u0 m8 ~5 ]+ L
away from the origin1 _' \6 f2 t T! r7 e
*/
8 D2 c1 B: q! E4 [ UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,& N& N d/ s. h0 U! f
pt2, vect1, 0);& _7 T- t7 J, |4 q
UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,7 Y6 S0 ~$ |" w
pt3, vect1, 0, "Normal");+ V$ {2 E) h# m
UF_DISP_get_conehead_attrb(&attrb);& V) ?* a3 Z: h3 V6 o7 |* P
/* Use color index three */
/ W' H3 u8 E$ F4 G O attrb.color = 3;& P: z; c3 ?- s1 ~7 t
/* Update the current attribute settings *// ?8 n9 G: @) J% G* ?) p- E
UF_DISP_set_conehead_attrb(&attrb);% _$ ~0 a3 }& [+ {( w
printf("\nCurrent conhead display settings:\n");! ?# @ v& q( z' c+ ?
printf("\tLength of Staff: %g\n", attrb.staff_length);
7 |# j5 y/ `" T Z" n printf("\tTotal Length: %g\n", attrb.total_length);; G" n. G, c4 B6 H$ y5 H
printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);1 X4 u5 J' }' n' O
printf("\TColor Index: %d\n", attrb.color);
3 m8 A# `( h6 S6 V0 L4 D* @$ y3 F9 ~3 R printf("\tFont Index: %d\n", attrb.font);
3 l5 s& U4 k) j: z! N m7 d printf("\tDensity Index: %d\n", attrb.density);
" F* f" P3 B& }' \8 b}. t5 G4 a9 D$ Q
: P1 Z( C1 U; O* u1 [ |
|