|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
9 p5 P$ n2 B9 p9 F. T
. w9 s3 l$ o1 [1 C# Y( \( C
+ n3 W7 y }' k3 J
7 f0 r7 k+ _( ^ n F: Q这功能其实很好用,比如选择面,自动显示面的法线等等。# f8 N8 j2 N9 [; ~
6 m& a# N3 o0 g bstatic void do_UGopen_api(void)
3 h; L7 J6 O* P: q: F+ ~2 b* h" k$ H( h{
& L6 I% }( R6 Q/ Y v double pt1[3] = {0.0, 0.0, 0.0};8 a. @5 o9 |5 x1 B) ~; t8 n
double pt2[3] = {2.0, 2.0, 2.0};
* x: N6 e e% t double pt3[3] = {-2.0,-2.0,-2.0};. J$ X1 }! c) r
double vect1[3] = {1.0, 1.0, 1.0};: M+ H( R& _9 v! J, @3 H d
UF_DISP_conehead_attrb_s attrb;% L. q5 c: |2 w2 h
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,# W/ g: z k1 l* R: X& f
pt1, vect1, 1);2 E, `% h. v- Q
/* Example to draw the vector with the base of its staff4 r9 X# ?' t1 [
anchored at the origin so that the vector appears to point
2 o3 Q- M9 p( q X( J away from the origin4 y5 @) Q, _8 ?* p4 \
*/( y0 L# X: T0 m. A! c4 i. b; ~8 c
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
1 J; h# J4 }) w pt2, vect1, 0);: J; a0 y/ \2 z3 @* e
UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
+ \1 U K, A8 F* B* | pt3, vect1, 0, "Normal");
/ C# z! x1 A0 X Z1 r. e6 P UF_DISP_get_conehead_attrb(&attrb);
" I. [3 L- D) i- C9 | /* Use color index three */
8 q0 I5 v' K/ n9 O* X) X attrb.color = 3;
+ m P/ M. p7 Q: N /* Update the current attribute settings */1 `% p8 p3 k+ {$ i% c& W
UF_DISP_set_conehead_attrb(&attrb);
+ q/ q" w& X( i3 ~& Y, S! s printf("\nCurrent conhead display settings:\n");9 d- e- \8 q0 [; O* @, k& x1 G
printf("\tLength of Staff: %g\n", attrb.staff_length);
* I& ?1 G9 e8 D* k/ O5 T printf("\tTotal Length: %g\n", attrb.total_length);: o# t5 q7 `9 s! [6 {
printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);
6 X2 `0 M) |4 ] printf("\TColor Index: %d\n", attrb.color);
$ s7 P" f' X% P8 }2 D printf("\tFont Index: %d\n", attrb.font);
# Z( [9 V. T; f& e printf("\tDensity Index: %d\n", attrb.density);
6 U) |6 u7 a; G6 g8 B}1 [# `4 X4 N3 N3 m) A, Z& f
) u; q/ q7 w e8 C& O- {. ^ K9 r |
|