|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
5 {; g7 E H, r( Q
( Z. X8 r+ H# o u5 i
2 V. t. n- D- s' `0 t$ Y! P1 Q4 Z. B+ u7 B: X% k
这功能其实很好用,比如选择面,自动显示面的法线等等。
* G/ |9 E% B& ]& o7 F" D8 j' B* t8 A0 x( D+ }
static void do_UGopen_api(void)& u. N' g3 e/ F0 X
{3 e9 {* p; [: m2 `# u/ M! p; m
double pt1[3] = {0.0, 0.0, 0.0};* X, Q- H3 M3 w/ _ s
double pt2[3] = {2.0, 2.0, 2.0};$ }8 k/ i- r. L: F% {1 ~ D) H! N
double pt3[3] = {-2.0,-2.0,-2.0};4 W D! x0 q0 {% A
double vect1[3] = {1.0, 1.0, 1.0};
! \! i5 l2 E# n UF_DISP_conehead_attrb_s attrb;& Q- Y9 f! R) G! H3 Q* ~
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
3 V( j O9 o7 _2 ]! n( B2 i4 ^ pt1, vect1, 1);
$ [+ E, K8 }$ P m! P, J3 K; J /* Example to draw the vector with the base of its staff" i& F% a- @* @+ R8 `3 C
anchored at the origin so that the vector appears to point
. {7 n& _6 r# w& U% O. o away from the origin& E1 g. y3 |* p. u/ V7 T+ `# c
*/
# k; Q7 c3 O' w UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,8 D9 W, r5 Q, i1 k
pt2, vect1, 0);5 w; Y2 M5 n2 [$ m5 V( {1 r ~
UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,# m# w" R1 w& @/ I! F3 a
pt3, vect1, 0, "Normal");
& B: U+ s( |8 W7 H UF_DISP_get_conehead_attrb(&attrb);. e% I+ K$ p* `5 x
/* Use color index three */
9 C9 F2 P$ I& e2 N attrb.color = 3;8 u* _8 g2 p! s) L P0 U. p' ]
/* Update the current attribute settings */
7 @) C' _5 T" ]6 T2 j) B# ?& v0 T UF_DISP_set_conehead_attrb(&attrb);
8 [1 `# B# y7 P3 G2 }8 R, m printf("\nCurrent conhead display settings:\n");
v+ O1 d2 G" p L) D$ {1 t; `" k printf("\tLength of Staff: %g\n", attrb.staff_length);
; K) b( c: F7 i printf("\tTotal Length: %g\n", attrb.total_length);) V# O2 o( t% k6 b# M6 r
printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);- \* I- T! F/ \# y! h7 F6 R; p5 u( M
printf("\TColor Index: %d\n", attrb.color);
% k2 D# Z7 z& B7 w/ v3 f printf("\tFont Index: %d\n", attrb.font);/ J8 X: S4 y8 x2 B! W0 ?
printf("\tDensity Index: %d\n", attrb.density);6 M* x5 v- h0 P7 \
}9 S/ ^$ O. a- S$ t" N/ F7 o/ H
" G4 y3 L7 t4 d. S3 b* B |
|