|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
) P- f4 S; K: P/ ^) [& W
# N" _! Q& J/ X2 S( o% o* ?
& I5 Y; Y9 L/ d" M4 Q+ d c
% a1 H6 C8 k. f; M! q这功能其实很好用,比如选择面,自动显示面的法线等等。, l' C4 T$ q+ [
- u1 r# r9 E: f2 K& d; d
static void do_UGopen_api(void)
0 v/ K3 h) K, y1 S" V/ B7 U{
0 T2 {. t1 c5 @) L+ y- W$ o1 M double pt1[3] = {0.0, 0.0, 0.0};3 V* C5 j1 e @/ X4 @4 ?" {
double pt2[3] = {2.0, 2.0, 2.0};
1 G2 U3 n* n1 i: R: m' o double pt3[3] = {-2.0,-2.0,-2.0};
6 K/ _, K& x ~ double vect1[3] = {1.0, 1.0, 1.0};
+ o6 A, j; [( R6 b* z* p UF_DISP_conehead_attrb_s attrb;
2 G3 C" q2 B0 v1 ~2 g- {( w5 _, O! ? UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,# k7 j* I9 R+ ?7 ^! A. N# X
pt1, vect1, 1);% \7 k" ]! A/ b' S* ], B/ a$ A( \
/* Example to draw the vector with the base of its staff
( z8 V0 q; \- R0 k8 i' q anchored at the origin so that the vector appears to point; k/ Y- e1 p: J$ u+ N% M
away from the origin
% s' U( ]% v+ w */
' t0 I& ?; U% ]. }2 w1 N/ e9 n9 n) D3 i UF_DISP_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
- ~* @0 W8 S0 v7 x6 P pt2, vect1, 0);
- b# X5 C3 E! B0 [ UF_DISP_labeled_conehead(UF_DISP_ALL_ACTIVE_VIEWS,
f# X0 ^1 v6 }+ n: M, A4 G pt3, vect1, 0, "Normal");
5 }" z% C' B5 a! \" D UF_DISP_get_conehead_attrb(&attrb);
9 t( p; \. n0 q% I! P /* Use color index three */( h$ [6 P; q9 z. a
attrb.color = 3;) ?' g) ~# P O- V1 T. k L/ E
/* Update the current attribute settings */- k) z S9 _. {; R, H3 ~) C% w
UF_DISP_set_conehead_attrb(&attrb);! H* a8 K4 E+ i7 N7 d1 F
printf("\nCurrent conhead display settings:\n");
9 I4 x* V& v+ V2 M$ d printf("\tLength of Staff: %g\n", attrb.staff_length);- z/ o# B: X" s: g* J/ u2 Z+ D
printf("\tTotal Length: %g\n", attrb.total_length);4 F1 ~5 p, H% c2 x0 n2 t( q T
printf("\tRadius of Cone Base: %g\n", attrb.cone_radius); J- F! g. G9 l& O0 p$ X5 o
printf("\TColor Index: %d\n", attrb.color);
1 t% ^( w$ ?/ U6 w5 D& Z printf("\tFont Index: %d\n", attrb.font);
' J; U1 Q! f! }1 Q' z$ u printf("\tDensity Index: %d\n", attrb.density);
% `1 H0 G, y% [1 I6 f7 W; P9 W0 d}
# ?' |& T$ y% G- |- b
. b+ q- x* S4 k" A/ q1 e. |7 x |
|