|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
# G5 \* K. _1 b! f. r
6 Q( k/ k3 ^& O* r* l6 b
9 S" |' q* q3 _$ j5 q6 d1 p- R. @2 S: o a3 q
这功能其实很好用,比如选择面,自动显示面的法线等等。
, {: ]# o0 P0 x2 ?% X8 j5 U, j5 Y
1 i& s" E' x# h" wstatic void do_UGopen_api(void)
/ z9 @& M& Y6 H{
5 T* v# C- Z# R1 V; t double pt1[3] = {0.0, 0.0, 0.0};: l4 H+ ]3 t8 B& ^% S P
double pt2[3] = {2.0, 2.0, 2.0};
0 a# N. P) {2 o4 ^, T double pt3[3] = {-2.0,-2.0,-2.0};5 r9 y/ Q S" z
double vect1[3] = {1.0, 1.0, 1.0};$ t1 F+ ~& s5 b/ x. K" t
UF_DISP_conehead_attrb_s attrb;# C0 b: z6 q" d* \
UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,9 P; I, o3 j# s0 W" Y- X
pt1, vect1, 1);
% K% p4 [% @2 A" C5 E# w /* Example to draw the vector with the base of its staff
/ x; j/ O0 ~/ R6 R$ |" x N& V anchored at the origin so that the vector appears to point
$ g3 L" ?% p4 U [8 Y; X( Y away from the origin. ~7 e; a" N% m. b8 P2 I
*/
, G1 R% `0 `9 ^7 @6 M UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
6 r! e' A- U0 e" l pt2, vect1, 0);0 ~, m. b# s5 u4 E7 i, H3 }
UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS, s3 I/ x5 }3 M, U+ e2 _
pt3, vect1, 0, "Normal");
! n+ s2 h' t0 s) t$ K UF_DISP_get_conehead_attrb(&attrb);
2 f- H8 C# j w# k" @4 ~ /* Use color index three */
) T' Z' Y" g" L3 [8 A S0 m attrb.color = 3;
3 {, O5 A! [) I) l /* Update the current attribute settings */ K" B+ O$ ]( k7 Y c9 c
UF_DISP_set_conehead_attrb(&attrb);
* V; O& a0 y+ c F3 Q printf("\nCurrent conhead display settings:\n");+ A" r- U) d3 m5 N& m$ E
printf("\tLength of Staff: %g\n", attrb.staff_length);
+ g- V. l; M3 q5 ]; z printf("\tTotal Length: %g\n", attrb.total_length);1 s- L0 H; I) o- V+ R9 T
printf("\tRadius of Cone Base: %g\n", attrb.cone_radius);! f! `, a `& V' E
printf("\TColor Index: %d\n", attrb.color);- `4 Z8 b- Y. @# `# X
printf("\tFont Index: %d\n", attrb.font);4 S4 c$ H$ K; N
printf("\tDensity Index: %d\n", attrb.density);
% [ q" [9 `6 E7 J}0 X- S) Z4 B1 F# D+ c
- M- L5 {& b4 G3 t# F: K2 S9 [. R& ^$ n |
|