|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
5 B+ R. t) r, i7 r6 [- z2 J
- m2 l( h0 a* d; i G: d+ E0 W; P. m
, _6 t' e) a+ n N5 `: _) _ f
# n6 b3 w% M/ R4 d( f6 a/ m4 w u! \这功能其实很好用,比如选择面,自动显示面的法线等等。/ D* A" i/ m0 Q/ a
H4 m5 h, _, y9 j' c% Astatic void do_UGopen_api(void)' V u! ^+ ]9 h; w- [5 Q6 `/ q
{$ H0 `7 F) b( x
double pt1[3] = {0.0, 0.0, 0.0};
- K' r' C i" D: ?5 w$ G double pt2[3] = {2.0, 2.0, 2.0};9 q5 P" S1 t+ F4 s- A# ]: s
double pt3[3] = {-2.0,-2.0,-2.0};3 h; ]! q o1 r
double vect1[3] = {1.0, 1.0, 1.0};' A) F1 r$ p; o( J) {0 s: z
UF_DISP_conehead_attrb_s attrb;5 I# Y' K5 } x; M$ r. K' |( q
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
7 N3 g$ w! ]4 K/ N: v# Y$ q pt1, vect1, 1);
/ m" E' R* c) f' M+ e. f k /* Example to draw the vector with the base of its staff
* O$ f5 N2 k7 v! ?8 y/ l2 }4 Z/ h% Y anchored at the origin so that the vector appears to point
6 b( M" c5 m) r; r( K4 q away from the origin
6 o) ]0 b2 [ p& J8 R; R3 U */4 X U! j: a+ c+ H4 P# T5 ^, B
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
/ ]' }5 u" |+ Y/ U4 n; g7 ^ pt2, vect1, 0);
: B) [6 D+ q9 r0 N9 Y, f UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
' |3 C# j9 H+ I pt3, vect1, 0, "Normal");1 U8 _3 ? l' z8 R6 U* H
UF_DISP_get_conehead_attrb(&attrb);+ ^! I! C. x- u. y
/* Use color index three */
* H3 u2 u. q5 W4 T; {1 b3 k: [5 [ attrb.color = 3;2 J$ |# P+ c n0 U
/* Update the current attribute settings */
, O7 f7 p% x+ A4 u! { UF_DISP_set_conehead_attrb(&attrb);
0 ~0 i2 ^0 N6 G% k printf("\nCurrent conhead display settings:\n");/ Z' Y$ N8 R+ \( L1 T, h
printf("\tLength of Staff: %g\n", attrb.staff_length);
: f7 e ~, Z3 ?: L* x9 e printf("\tTotal Length: %g\n", attrb.total_length);. a( e" \5 G6 P P
printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);
/ P# Z5 G1 q$ F* N printf("\TColor Index: %d\n", attrb.color);, p* P* `. S6 X! z5 L
printf("\tFont Index: %d\n", attrb.font);; P' e' h6 f" I7 D% p3 e* ?. T1 S
printf("\tDensity Index: %d\n", attrb.density);0 ?* e, @& K3 |2 R* s
}) f7 v2 w" F6 F4 Z) @
1 i# o9 V0 n6 G* ?, f/ [
|
|