|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
' I+ w' d) t: y2 m+ }- V- C/ ]
0 x8 ~. _+ j- E; Q" j- E0 s+ t8 X
2 S) Z- S# C7 e) c' m6 F' L6 x7 ~8 }1 j% |6 `) ~) l
这功能其实很好用,比如选择面,自动显示面的法线等等。7 J. T, X: o/ V% _. k
, j" h6 G7 C- D4 P% i& b' }# m
static void do_UGopen_api(void)/ x: t% H2 a/ {( J: q [: o& |3 M
{6 j, x7 ~6 u7 v% P8 h- k
double pt1[3] = {0.0, 0.0, 0.0};5 N1 H; `* [: K, v3 n! b
double pt2[3] = {2.0, 2.0, 2.0};* m! A, n& r( i$ D
double pt3[3] = {-2.0,-2.0,-2.0};
) D% t R# | H6 T8 R. |$ V double vect1[3] = {1.0, 1.0, 1.0};6 z* M8 f8 q( h. P; t
UF_DISP_conehead_attrb_s attrb;, G2 E9 g+ @. N: o9 J, X
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
! z$ |: Y" q9 M9 d4 ] pt1, vect1, 1);
5 V' M1 z6 G/ A% `# k3 ~% ^ /* Example to draw the vector with the base of its staff6 z; [+ v0 N4 I3 m4 m0 u' X0 Q) Z& q
anchored at the origin so that the vector appears to point# d: v [! Q: i- m+ c9 i$ D. P/ R
away from the origin( b: z+ |. J! g6 G( V
*/3 @9 @2 F) }2 c" x
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,# V( i# f4 `4 X! w6 m* p( H3 j
pt2, vect1, 0);
6 f9 Q8 o" k, ^; J1 C UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
/ f5 [9 D3 w* @0 z9 B+ I pt3, vect1, 0, "Normal");6 @" H, n# K7 g9 x! |
UF_DISP_get_conehead_attrb(&attrb);
- k3 @9 E, a5 s2 V /* Use color index three */
4 S: R) K$ R: q' k& h attrb.color = 3;
* ]) N* o/ ]2 \6 @1 H. F6 v" B /* Update the current attribute settings */
5 g, T; ]2 o0 h. l; v3 n4 J0 A UF_DISP_set_conehead_attrb(&attrb);$ n8 P4 ]3 _+ B Y9 n9 r; J
printf("\nCurrent conhead display settings:\n");; Y7 z9 r* a( i) g4 F
printf("\tLength of Staff: %g\n", attrb.staff_length);6 Z$ M8 n) w; R5 o; l- I
printf("\tTotal Length: %g\n", attrb.total_length);
) V; H1 r9 g! S7 _# @# q/ U: r S printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);6 |% _. e2 [ Z) U3 O. a1 ?
printf("\TColor Index: %d\n", attrb.color);
3 W0 e# F% h2 P printf("\tFont Index: %d\n", attrb.font);
6 ^& c# [5 p$ H) r" ` printf("\tDensity Index: %d\n", attrb.density);
* O, L6 d- ?* d* y9 o+ z% d+ L}
; J9 Z r2 M8 U; J7 k
9 M1 q3 w( ^. D5 E* q) H4 A |
|