|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
7 U2 \; n# N) p1 U4 p! d( L" j0 h
7 |- q* u& s/ R# m- ]- j
. T: m7 m/ ~: I( ~# g3 W) l# s1 u" j/ K U+ i
这功能其实很好用,比如选择面,自动显示面的法线等等。" z: P- W2 Q6 X" i$ h$ C) o: _
% |8 h' t4 F8 y0 Q) O j
static void do_UGopen_api(void)
V6 z9 B, N4 [/ d% u/ @: L{
: \, v# x% P0 d/ ?: Z. K( M double pt1[3] = {0.0, 0.0, 0.0};2 a- r' s0 z. W5 ]; \
double pt2[3] = {2.0, 2.0, 2.0};7 i; R! F. @8 O; o; ?& o
double pt3[3] = {-2.0,-2.0,-2.0};
: R/ e5 l1 y9 M" s* p, p double vect1[3] = {1.0, 1.0, 1.0};# \! V( v* w8 B3 b# x/ _, p
UF_DISP_conehead_attrb_s attrb;) Z% L1 v1 Y( Z7 V' k
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
9 H0 L- G' J% e! U& M7 ?, i/ d pt1, vect1, 1);
( s( W0 R' k# O) ^4 h) }0 R /* Example to draw the vector with the base of its staff
% i A9 M9 g" z9 a" ? anchored at the origin so that the vector appears to point4 {4 y- _( _; ^1 j1 {
away from the origin4 z: @8 G2 j! ~
*/. n; q! B- ]) i. R* T0 {
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
, v( L+ F# O# f4 g0 e- ]$ ^ pt2, vect1, 0);
; j3 V( p- F. A) C g1 p UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
; v3 N- B; g( `+ S+ l pt3, vect1, 0, "Normal");8 `. a) O4 G" K$ Y
UF_DISP_get_conehead_attrb(&attrb);+ _8 J/ | t+ O1 x' w
/* Use color index three */% U$ `$ [; y& R1 p/ o2 H/ g
attrb.color = 3;9 v5 }/ [% D1 G# y* F$ r& c6 H
/* Update the current attribute settings */% m, ~( k! T4 @% j P+ F
UF_DISP_set_conehead_attrb(&attrb);4 o9 J% A6 W8 ~) S6 E+ p
printf("\nCurrent conhead display settings:\n");; y1 K* V9 @& H( ~
printf("\tLength of Staff: %g\n", attrb.staff_length);. Q; f1 R, A: G5 e5 z0 o8 X
printf("\tTotal Length: %g\n", attrb.total_length);' ^7 Y. N% J9 N
printf("\tRadius of Cone Base: %g\n", attrb.cone_radius); a7 p/ Z! A u( M: R' f# L
printf("\TColor Index: %d\n", attrb.color);
; _3 i% _/ V* ?# E" y8 m& H0 c# n3 _# O printf("\tFont Index: %d\n", attrb.font);
4 s! p" r: [7 e9 W' y. c% { printf("\tDensity Index: %d\n", attrb.density);# F0 r5 r7 G, U5 n0 G$ d
}
5 e# m' O. n* d
9 K4 q4 j7 {/ U7 \& R# N# W |
|