|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
4 ~' V# H2 a# I; R, V3 F
* E: g- G- E$ ]4 X G) W. ?: C8 ~4 R: b: l, n4 t* A
& i8 ^ K( J4 k ]" ?' M. k2 Q; t
这功能其实很好用,比如选择面,自动显示面的法线等等。3 P! X. b, f+ U) H
3 [% \; a0 h3 r8 t) ^6 S
static void do_UGopen_api(void)9 q9 z0 t' w* ?+ w6 c+ j- V; c j
{# h3 [7 b- q! Q% X
double pt1[3] = {0.0, 0.0, 0.0};
9 b# w2 S/ D3 F \: { double pt2[3] = {2.0, 2.0, 2.0};
2 _8 N6 w) P' e double pt3[3] = {-2.0,-2.0,-2.0};
* Q" H/ O3 E; U9 ? double vect1[3] = {1.0, 1.0, 1.0};
& }" _; ?7 K3 K. k& K$ m% c UF_DISP_conehead_attrb_s attrb;' e; {/ w& s5 L B
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
& L, S5 ?; o0 r3 X pt1, vect1, 1);
( [; O) s' y/ M8 n' J2 I /* Example to draw the vector with the base of its staff
4 k1 G- g. M$ ~0 R3 r/ w anchored at the origin so that the vector appears to point
5 h% \& f+ n# L/ d: b away from the origin
- f& ^% U$ _% k$ |8 M( \# ]& O */
. S" |. W6 b, i: |8 S' ] UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
* D& P! n" z" y# e/ A0 A$ D7 D pt2, vect1, 0);
5 k( j5 C5 @* u: S$ } UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,$ e! ?/ w9 |, i+ N1 S
pt3, vect1, 0, "Normal");/ @& f5 }6 `; x, Z" p* [: {
UF_DISP_get_conehead_attrb(&attrb);7 c- N; G' l- J$ U& I! { x6 S
/* Use color index three */: b0 x7 j3 J4 e. x8 b: |# H+ d
attrb.color = 3;
) h& D+ V/ k( D1 l3 N! W: S& @ /* Update the current attribute settings */
7 F. ?) h& W3 r UF_DISP_set_conehead_attrb(&attrb);
z, B" S4 v6 Y printf("\nCurrent conhead display settings:\n");
; \1 Y# K1 p& \0 c printf("\tLength of Staff: %g\n", attrb.staff_length);
0 b# n/ \7 ?8 \/ E printf("\tTotal Length: %g\n", attrb.total_length);
* x0 U* N& u2 I& k* v! i printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);
" H8 D- S1 q1 S printf("\TColor Index: %d\n", attrb.color);$ r& D4 g& c, o" D
printf("\tFont Index: %d\n", attrb.font);6 U" F: y- _% Y9 }& r7 S* [
printf("\tDensity Index: %d\n", attrb.density);
) s: s- W: h2 L& X}
$ I! W9 G# O. V$ s; `$ e5 I5 `! ~
Z2 D0 S5 l- r; S |
|